summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-11-18 01:37:52 +0000
committerKarl Berry <karl@freefriends.org>2006-11-18 01:37:52 +0000
commit5c91b9f8a88e06f057a6a08b0a755a224d08e019 (patch)
tree57cfafb6bd6c146dcdfc911dbef8db622c6476bd /Master
parent983736c2ab572e9a860c74f0f781b3decd282f13 (diff)
context 17nov06 update
git-svn-id: svn://tug.org/texlive/trunk@2449 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/context/data/cont-cz-scite.properties52
-rw-r--r--Master/texmf-dist/context/data/cont-de-scite.properties79
-rw-r--r--Master/texmf-dist/context/data/cont-en-scite.properties73
-rw-r--r--Master/texmf-dist/context/data/cont-fr-scite.properties28
-rw-r--r--Master/texmf-dist/context/data/cont-it-scite.properties29
-rw-r--r--Master/texmf-dist/context/data/cont-nl-scite.properties33
-rw-r--r--Master/texmf-dist/context/data/cont-ro-scite.properties24
-rw-r--r--Master/texmf-dist/context/data/context-jedit-cz.xml1
-rw-r--r--Master/texmf-dist/context/data/context-jedit-de.xml1
-rw-r--r--Master/texmf-dist/context/data/context-jedit-en.xml1
-rw-r--r--Master/texmf-dist/context/data/context-jedit-fr.xml1
-rw-r--r--Master/texmf-dist/context/data/context-jedit-it.xml1
-rw-r--r--Master/texmf-dist/context/data/context-jedit-nl.xml1
-rw-r--r--Master/texmf-dist/context/data/context-jedit-ro.xml1
-rw-r--r--Master/texmf-dist/context/data/context.properties4
-rw-r--r--Master/texmf-dist/doc/context/bib/bibmod-doc.pdfbin271422 -> 301035 bytes
-rw-r--r--Master/texmf-dist/doc/context/bib/bibmod-doc.tex27
-rw-r--r--Master/texmf-dist/doc/context/document/general/manuals/mreadme.pdfbin0 -> 85996 bytes
-rw-r--r--Master/texmf-dist/doc/context/document/general/manuals/tiptrick.pdfbin0 -> 30607 bytes
-rw-r--r--Master/texmf-dist/doc/context/manuals/allkind/mcommon.tex199
-rw-r--r--Master/texmf-dist/doc/context/manuals/allkind/mreadme.tex361
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/context/cmin.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/context/cmit.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/context/cmitt.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/context/cmrm.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/context/cmsc.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/context/cmtt.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/dvips/jmn/hans.enc258
-rw-r--r--Master/texmf-dist/fonts/enc/pdftex/context/koeieletters.enc2
-rw-r--r--Master/texmf-dist/fonts/map/pdftex/context/ec-public-lm.map72
-rw-r--r--Master/texmf-dist/fonts/map/pdftex/context/el-public-lm.map72
-rw-r--r--Master/texmf-dist/fonts/map/pdftex/context/qx-public-lm.map72
-rw-r--r--Master/texmf-dist/fonts/map/pdftex/context/t5-public-lm.map72
-rw-r--r--Master/texmf-dist/fonts/map/pdftex/context/texnansi-public-lm.map72
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-form.mp288
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-spec.mp57
-rw-r--r--Master/texmf-dist/metapost/context/base/mp-tool.mp3
-rw-r--r--Master/texmf-dist/scripts/context/perl/mptopdf.pl4
-rw-r--r--Master/texmf-dist/scripts/context/perl/texfont.pl525
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/ctx.rb33
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/kpse.rb41
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/kpsefast.rb2
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/mp.rb4
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/tex.rb196
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/texutil.rb37
-rw-r--r--Master/texmf-dist/scripts/context/ruby/base/tool.rb36
-rw-r--r--Master/texmf-dist/scripts/context/ruby/concheck.rb56
-rw-r--r--Master/texmf-dist/scripts/context/ruby/ctxtools.rb553
-rw-r--r--Master/texmf-dist/scripts/context/ruby/pdftools.rb5
-rw-r--r--Master/texmf-dist/scripts/context/ruby/pstopdf.rb2
-rw-r--r--Master/texmf-dist/scripts/context/ruby/rlxtools.rb66
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texexec.rb87
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texmfstart.rb102
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texsync.rb5
-rw-r--r--Master/texmf-dist/scripts/context/ruby/textools.rb5
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texutil.rb5
-rw-r--r--Master/texmf-dist/scripts/context/ruby/tmftools.rb5
-rw-r--r--Master/texmf-dist/scripts/context/ruby/www/exa.rb4
-rw-r--r--Master/texmf-dist/scripts/context/ruby/www/lib.rb4
-rw-r--r--Master/texmf-dist/scripts/context/ruby/wwwclient.rb2
-rw-r--r--Master/texmf-dist/scripts/context/ruby/wwwserver.rb2
-rw-r--r--Master/texmf-dist/scripts/context/ruby/wwwwatch.rb22
-rw-r--r--Master/texmf-dist/scripts/context/ruby/xmltools.rb11
-rw-r--r--Master/texmf-dist/scripts/context/stubs/mswin/luatools.bat2
-rw-r--r--Master/texmf-dist/scripts/context/stubs/mswin/mtxtools.bat2
-rw-r--r--Master/texmf-dist/scripts/context/stubs/unix/luatools2
-rw-r--r--Master/texmf-dist/scripts/context/stubs/unix/mtxtools2
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ext.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ini.tex213
-rw-r--r--Master/texmf-dist/tex/context/base/cont-err.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/cont-fil.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/cont-log.tex21
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.mkii14
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.tex883
-rw-r--r--Master/texmf-dist/tex/context/base/cont-usr.ori4
-rw-r--r--Master/texmf-dist/tex/context/base/context.tex612
-rw-r--r--Master/texmf-dist/tex/context/base/core-blk.tex678
-rw-r--r--Master/texmf-dist/tex/context/base/core-box.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/core-buf.mkii143
-rw-r--r--Master/texmf-dist/tex/context/base/core-buf.tex1004
-rw-r--r--Master/texmf-dist/tex/context/base/core-con.mkii286
-rw-r--r--Master/texmf-dist/tex/context/base/core-con.tex332
-rw-r--r--Master/texmf-dist/tex/context/base/core-ctx.tex173
-rw-r--r--Master/texmf-dist/tex/context/base/core-dat.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/core-des.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-fig.tex2821
-rw-r--r--Master/texmf-dist/tex/context/base/core-fld.tex58
-rw-r--r--Master/texmf-dist/tex/context/base/core-fnt.tex24
-rw-r--r--Master/texmf-dist/tex/context/base/core-grd.tex62
-rw-r--r--Master/texmf-dist/tex/context/base/core-hlp.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/core-int.tex165
-rw-r--r--Master/texmf-dist/tex/context/base/core-itm.tex109
-rw-r--r--Master/texmf-dist/tex/context/base/core-job.tex109
-rw-r--r--Master/texmf-dist/tex/context/base/core-lme.tex55
-rw-r--r--Master/texmf-dist/tex/context/base/core-lnt.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-lst.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-ltb.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/core-mar.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/core-mat.tex496
-rw-r--r--Master/texmf-dist/tex/context/base/core-mis.tex497
-rw-r--r--Master/texmf-dist/tex/context/base/core-nav.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-new.tex103
-rw-r--r--Master/texmf-dist/tex/context/base/core-not.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/core-ntb.tex83
-rw-r--r--Master/texmf-dist/tex/context/base/core-num.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-obj.mkii74
-rw-r--r--Master/texmf-dist/tex/context/base/core-obj.tex94
-rw-r--r--Master/texmf-dist/tex/context/base/core-par.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/core-pgr.tex212
-rw-r--r--Master/texmf-dist/tex/context/base/core-pos.mkii184
-rw-r--r--Master/texmf-dist/tex/context/base/core-pos.tex432
-rw-r--r--Master/texmf-dist/tex/context/base/core-ref.tex617
-rw-r--r--Master/texmf-dist/tex/context/base/core-reg.tex414
-rw-r--r--Master/texmf-dist/tex/context/base/core-rul.tex1040
-rw-r--r--Master/texmf-dist/tex/context/base/core-sec.tex77
-rw-r--r--Master/texmf-dist/tex/context/base/core-spa.tex483
-rw-r--r--Master/texmf-dist/tex/context/base/core-stg.tex72
-rw-r--r--Master/texmf-dist/tex/context/base/core-syn.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/core-sys.mkii14
-rw-r--r--Master/texmf-dist/tex/context/base/core-sys.tex73
-rw-r--r--Master/texmf-dist/tex/context/base/core-tab.tex78
-rw-r--r--Master/texmf-dist/tex/context/base/core-tbl.tex22
-rw-r--r--Master/texmf-dist/tex/context/base/core-trf.tex543
-rw-r--r--Master/texmf-dist/tex/context/base/core-tsp.tex81
-rw-r--r--Master/texmf-dist/tex/context/base/core-two.mkii149
-rw-r--r--Master/texmf-dist/tex/context/base/core-two.tex102
-rw-r--r--Master/texmf-dist/tex/context/base/core-uti.mkii47
-rw-r--r--Master/texmf-dist/tex/context/base/core-uti.tex441
-rw-r--r--Master/texmf-dist/tex/context/base/core-var.tex135
-rw-r--r--Master/texmf-dist/tex/context/base/core-ver.mkii298
-rw-r--r--Master/texmf-dist/tex/context/base/core-ver.tex940
-rw-r--r--Master/texmf-dist/tex/context/base/core-vis.tex46
-rw-r--r--Master/texmf-dist/tex/context/base/enco-fde.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ffr.tex13
-rw-r--r--Master/texmf-dist/tex/context/base/enco-fpl.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/enco-fro.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ini.tex938
-rw-r--r--Master/texmf-dist/tex/context/base/enco-mis.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/enco-pfr.tex32
-rw-r--r--Master/texmf-dist/tex/context/base/enco-xtx.tex1986
-rw-r--r--Master/texmf-dist/tex/context/base/filt-ini.tex39
-rw-r--r--Master/texmf-dist/tex/context/base/font-ini.tex67
-rw-r--r--Master/texmf-dist/tex/context/base/font-run.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/hand-ini.tex24
-rw-r--r--Master/texmf-dist/tex/context/base/java-ini.tex38
-rw-r--r--Master/texmf-dist/tex/context/base/lang-frq.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ger.tex32
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ini.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/lang-lab.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/lang-mis.tex853
-rw-r--r--Master/texmf-dist/tex/context/base/lang-sla.mkii30
-rw-r--r--Master/texmf-dist/tex/context/base/lang-sla.tex43
-rw-r--r--Master/texmf-dist/tex/context/base/lang-spa.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/lang-spe.tex129
-rw-r--r--Master/texmf-dist/tex/context/base/m-arabtex.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/m-chart.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/m-cweb.tex38
-rw-r--r--Master/texmf-dist/tex/context/base/m-database.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/m-gnuplot.tex13
-rw-r--r--Master/texmf-dist/tex/context/base/m-narrowtt.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/m-r.tex44
-rw-r--r--Master/texmf-dist/tex/context/base/m-streams.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/m-tryout.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/m-visual.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/math-ams.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/math-cow.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/math-eul.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/math-ext.tex21
-rw-r--r--Master/texmf-dist/tex/context/base/math-ini.tex83
-rw-r--r--Master/texmf-dist/tex/context/base/math-pln.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-dum.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/meta-fig.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/meta-ini.tex54
-rw-r--r--Master/texmf-dist/tex/context/base/meta-mis.tex54
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pag.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdf.mkii1908
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdf.tex3123
-rw-r--r--Master/texmf-dist/tex/context/base/meta-tex.tex212
-rw-r--r--Master/texmf-dist/tex/context/base/meta-txt.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/mult-com.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/mult-con.tex31
-rw-r--r--Master/texmf-dist/tex/context/base/mult-fst.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/mult-ini.tex54
-rw-r--r--Master/texmf-dist/tex/context/base/mult-sys.tex42
-rw-r--r--Master/texmf-dist/tex/context/base/page-app.tex48
-rw-r--r--Master/texmf-dist/tex/context/base/page-bck.tex163
-rw-r--r--Master/texmf-dist/tex/context/base/page-flt.tex1202
-rw-r--r--Master/texmf-dist/tex/context/base/page-imp.tex273
-rw-r--r--Master/texmf-dist/tex/context/base/page-ini.tex196
-rw-r--r--Master/texmf-dist/tex/context/base/page-lay.tex526
-rw-r--r--Master/texmf-dist/tex/context/base/page-lin.tex92
-rw-r--r--Master/texmf-dist/tex/context/base/page-log.tex31
-rw-r--r--Master/texmf-dist/tex/context/base/page-lyr.tex117
-rw-r--r--Master/texmf-dist/tex/context/base/page-mak.tex25
-rw-r--r--Master/texmf-dist/tex/context/base/page-mar.tex147
-rw-r--r--Master/texmf-dist/tex/context/base/page-mul.tex76
-rw-r--r--Master/texmf-dist/tex/context/base/page-num.tex39
-rw-r--r--Master/texmf-dist/tex/context/base/page-plg.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/page-set.tex37
-rw-r--r--Master/texmf-dist/tex/context/base/page-sid.tex308
-rw-r--r--Master/texmf-dist/tex/context/base/page-str.tex78
-rw-r--r--Master/texmf-dist/tex/context/base/page-txt.tex123
-rw-r--r--Master/texmf-dist/tex/context/base/ppchtex.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/regi-ini.mkii153
-rw-r--r--Master/texmf-dist/tex/context/base/regi-ini.tex178
-rw-r--r--Master/texmf-dist/tex/context/base/regi-run.mkii32
-rw-r--r--Master/texmf-dist/tex/context/base/regi-utf.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/rlxtools.rlx2
-rw-r--r--Master/texmf-dist/tex/context/base/s-abr-01.tex11
-rw-r--r--Master/texmf-dist/tex/context/base/s-mag-01.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/s-mod-00.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/s-mod-01.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/sort-ini.tex16
-rw-r--r--Master/texmf-dist/tex/context/base/spec-def.mkii16
-rw-r--r--Master/texmf-dist/tex/context/base/spec-def.tex19
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dpm.tex59
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dpx.tex119
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dvi.tex15
-rw-r--r--Master/texmf-dist/tex/context/base/spec-fdf.mkii156
-rw-r--r--Master/texmf-dist/tex/context/base/spec-fdf.tex657
-rw-r--r--Master/texmf-dist/tex/context/base/spec-ini.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/spec-mis.tex65
-rw-r--r--Master/texmf-dist/tex/context/base/spec-pdf.tex20
-rw-r--r--Master/texmf-dist/tex/context/base/spec-ps.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/spec-tpd.tex322
-rw-r--r--Master/texmf-dist/tex/context/base/spec-tr.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/spec-tst.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/spec-var.tex13
-rw-r--r--Master/texmf-dist/tex/context/base/spec-xtx.tex114
-rw-r--r--Master/texmf-dist/tex/context/base/spec-yy.tex63
-rw-r--r--Master/texmf-dist/tex/context/base/supp-box.tex239
-rw-r--r--Master/texmf-dist/tex/context/base/supp-eps.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fil.mkii97
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fil.tex204
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fun.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/supp-ini.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/supp-lan.tex166
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mat.tex15
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mis.tex51
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mpe.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mps.tex410
-rw-r--r--Master/texmf-dist/tex/context/base/supp-num.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/supp-pdf.tex1088
-rw-r--r--Master/texmf-dist/tex/context/base/supp-vis.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/symb-cow.tex99
-rw-r--r--Master/texmf-dist/tex/context/base/symb-ini.tex3
-rw-r--r--Master/texmf-dist/tex/context/base/symb-mis.tex7
-rw-r--r--Master/texmf-dist/tex/context/base/symb-run.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/syst-cat.mkii61
-rw-r--r--Master/texmf-dist/tex/context/base/syst-cat.tex397
-rw-r--r--Master/texmf-dist/tex/context/base/syst-chr.tex131
-rw-r--r--Master/texmf-dist/tex/context/base/syst-con.mkii148
-rw-r--r--Master/texmf-dist/tex/context/base/syst-con.tex156
-rw-r--r--Master/texmf-dist/tex/context/base/syst-etx.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/syst-ext.tex427
-rw-r--r--Master/texmf-dist/tex/context/base/syst-fnt.tex43
-rw-r--r--Master/texmf-dist/tex/context/base/syst-gen.tex492
-rw-r--r--Master/texmf-dist/tex/context/base/syst-mtx.tex66
-rw-r--r--Master/texmf-dist/tex/context/base/syst-new.tex221
-rw-r--r--Master/texmf-dist/tex/context/base/syst-omg.tex70
-rw-r--r--Master/texmf-dist/tex/context/base/syst-pdt.tex48
-rw-r--r--Master/texmf-dist/tex/context/base/syst-pln.tex47
-rw-r--r--Master/texmf-dist/tex/context/base/syst-prm.tex79
-rw-r--r--Master/texmf-dist/tex/context/base/syst-rtp.mkii18
-rw-r--r--Master/texmf-dist/tex/context/base/syst-rtp.tex22
-rw-r--r--Master/texmf-dist/tex/context/base/syst-str.mkii119
-rw-r--r--Master/texmf-dist/tex/context/base/syst-str.tex40
-rw-r--r--Master/texmf-dist/tex/context/base/syst-tex.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/syst-var.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/syst-xtx.tex33
-rw-r--r--Master/texmf-dist/tex/context/base/thrd-tab.tex388
-rw-r--r--Master/texmf-dist/tex/context/base/type-buy.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/type-enc.tex60
-rw-r--r--Master/texmf-dist/tex/context/base/type-gyr.tex120
-rw-r--r--Master/texmf-dist/tex/context/base/type-ini.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/type-map.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/type-run.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/unic-004.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/unic-005.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/unic-ini.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/verb-ini.tex387
-rw-r--r--Master/texmf-dist/tex/context/base/verb-mp.tex177
-rw-r--r--Master/texmf-dist/tex/context/base/verb-sql.tex66
-rw-r--r--Master/texmf-dist/tex/context/base/verb-tex.tex32
-rw-r--r--Master/texmf-dist/tex/context/base/x-fig-00.tex169
-rw-r--r--Master/texmf-dist/tex/context/base/x-fig-01.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/x-newmme.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/x-newmml.tex143
-rw-r--r--Master/texmf-dist/tex/context/base/x-newmmo.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/x-om2cml.xsl29
-rw-r--r--Master/texmf-dist/tex/context/base/x-openmath.xsl4
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-01.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-04.tex109
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-08.tex44
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-12.tex53
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-20.tex231
-rw-r--r--Master/texmf-dist/tex/context/base/x-sch-00.tex62
-rw-r--r--Master/texmf-dist/tex/context/base/x-xml-11.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-cml.tex19
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-ext.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-ini.tex427
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-map.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-mml.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-mmp.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-pre.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-run.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-xsl.tex6
-rw-r--r--Master/texmf-dist/tex/context/bib/bibl-apa-de.tex8
-rw-r--r--Master/texmf-dist/tex/context/bib/t-bib.tex98
-rw-r--r--Master/texmf-dist/tex/context/config/cont-usr.tex4
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-cz.xml137
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-de.xml137
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-en.xml137
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-fr.xml139
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-it.xml137
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-nl.xml137
-rw-r--r--Master/texmf-dist/tex/context/interface/cont-ro.xml137
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-cz.xml11
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-de.xml11
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-en.xml11
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-fr.xml15
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-it.xml11
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-nl.xml11
-rw-r--r--Master/texmf-dist/tex/context/interface/keys-ro.xml11
-rw-r--r--Master/texmf-dist/tex/context/interface/t-bib.xml7
-rw-r--r--Master/texmf-dist/tex/generic/context/m-metapo.tex46
-rw-r--r--Master/texmf-dist/tex/generic/context/mptopdf.tex141
327 files changed, 26080 insertions, 19795 deletions
diff --git a/Master/texmf-dist/context/data/cont-cz-scite.properties b/Master/texmf-dist/context/data/cont-cz-scite.properties
index 1c4912372cc..b0cb8d6ff91 100644
--- a/Master/texmf-dist/context/data/cont-cz-scite.properties
+++ b/Master/texmf-dist/context/data/cont-cz-scite.properties
@@ -48,29 +48,29 @@ keywordclass.macros.context.cz=\
prizpusobivepole prizpusobvzhled program propojeneznaceni propojenydokument propojenyrejstrik \
publikace ran ref reset resetznaceni rimskecislice \
rozdelplvouciobjekt rozpojeneznaceni roztazene schovejbloky scitani sedabarva \
- settextvariable setupforms setupitemgroup setuppaper setuprule setupstrut \
- setuptextposition setuptextvariable sloupec slovovpravo spodek stanovcharakteristickuseznamu \
- stanovcislonadpisu start startbarva startcitace startfakt startinteraktivnimenu \
- startkomentar startkomponenta startmarginalnilinka startpozadi startprodukt startprojekt \
- startprostredi starttextovalinka startverze startzhustene stop stopbarva \
- stopcitace stopfakt stopinteraktivnimenu stopkomentar stopkomponenta stopmarginalnilinka \
- stoppozadi stopprodukt stopprojekt stopprostredi stoptextovalinka stopverze \
- stopzhustene strana switchtorawfont sym symbol synchronizacnilista \
- synchronizovat tab tecky tenkalinka tenkelinky tex \
- texthlavicky textovalinka textpopisku textvariable tlacitko tref \
- tvrdemezery typebuffer typstrany ukazbarvu ukazexterniobrazy ukazmrizku \
- ukaznastaveni ukazpaletu ukazpodpery ukazpole ukazpostredizakladnihofontu ukazramecek \
- ukazsadusymbolu ukazskupinubarev ukazupravu ukazvytisk ukazvzhled ukazzakladnifont \
- umistikombinovanyseznam umistilegendu umistiloga umistilokalnipoznamkypodcarou umistinadsebe umistinamrizku \
- umistipodrovnici umistipoznamkypodcarou umistirejstrik umistirovnici umistiseznam umistivedlesebe \
- umistizalozky uzijURL uzijbloky uzijexternidokument uzijexterniobraz uzijexternisoubor \
- uzijexternisoubory uzijexternizvuk uzijkodovani uzijmodul uzijodkazy uzijprikazy \
- uzijspeciality uzijsymbol verze vl vlasovalinka vlevo \
- vpravo vradku vsedniden vyberbloky vyberpapir vyberverzi \
- vyplnenytext vyplnovelinky vyplnovepole vyplnovyradek vysoky zablokujinterakcnimenu \
- zachovejbloky zadnamezera zadnebilemisto zadnedalsibloky zadnedalsisoubory zadnehorniadolniradky \
- zadneodsazovani zadnezahlaviaupati zadneznaceni zadnyseznam zadnytest zalozka \
- zapisdorejstriku zapisdoseznamu zapisdoseznamuodkazu zapismeziseznam zaramovani zarovnanonastred \
- zarovnanovlevo zarovnanovpravo zasobnikpoli zaznamovepole zhustene ziskejbuffer \
- ziskejznaceni zlomek znaceni znak znaky zpracujbloky \
- zpracujstranu zrcadlit zref
+ settextcontent settextvariable setupforms setupitemgroup setuppaper setuprule \
+ setupstrut setuptextposition setuptextvariable sloupec slovovpravo spodek \
+ stanovcharakteristickuseznamu stanovcislonadpisu start startbarva startcitace startfakt \
+ startinteraktivnimenu startkomentar startkomponenta startmarginalnilinka startpozadi startprodukt \
+ startprojekt startprostredi starttextovalinka startverze startzhustene stop \
+ stopbarva stopcitace stopfakt stopinteraktivnimenu stopkomentar stopkomponenta \
+ stopmarginalnilinka stoppozadi stopprodukt stopprojekt stopprostredi stoptextovalinka \
+ stopverze stopzhustene strana switchtorawfont sym symbol \
+ synchronizacnilista synchronizovat tab tecky tenkalinka tenkelinky \
+ tex texthlavicky textovalinka textpopisku textvariable tlacitko \
+ tref tvrdemezery typebuffer typstrany ukazbarvu ukazexterniobrazy \
+ ukazmrizku ukaznastaveni ukazpaletu ukazpodpery ukazpole ukazpostredizakladnihofontu \
+ ukazramecek ukazsadusymbolu ukazskupinubarev ukazupravu ukazvytisk ukazvzhled \
+ ukazzakladnifont umistikombinovanyseznam umistilegendu umistiloga umistilokalnipoznamkypodcarou umistinadsebe \
+ umistinamrizku umistipodrovnici umistipoznamkypodcarou umistirejstrik umistirovnici umistiseznam \
+ umistivedlesebe umistizalozky uzijURL uzijbloky uzijexternidokument uzijexterniobraz \
+ uzijexternisoubor uzijexternisoubory uzijexternizvuk uzijkodovani uzijmodul uzijodkazy \
+ uzijprikazy uzijspeciality uzijsymbol verze vl vlasovalinka \
+ vlevo vpravo vradku vsedniden vyberbloky vyberpapir \
+ vyberverzi vyplnenytext vyplnovelinky vyplnovepole vyplnovyradek vysoky \
+ zablokujinterakcnimenu zachovejbloky zadnamezera zadnebilemisto zadnedalsibloky zadnedalsisoubory \
+ zadnehorniadolniradky zadneodsazovani zadnezahlaviaupati zadneznaceni zadnyseznam zadnytest \
+ zalozka zapisdorejstriku zapisdoseznamu zapisdoseznamuodkazu zapismeziseznam zaramovani \
+ zarovnanonastred zarovnanovlevo zarovnanovpravo zasobnikpoli zaznamovepole zhustene \
+ ziskejbuffer ziskejznaceni zlomek znaceni znak znaky \
+ zpracujbloky zpracujstranu zrcadlit zref
diff --git a/Master/texmf-dist/context/data/cont-de-scite.properties b/Master/texmf-dist/context/data/cont-de-scite.properties
index 33323494c3b..ad7d38c6921 100644
--- a/Master/texmf-dist/context/data/cont-de-scite.properties
+++ b/Master/texmf-dist/context/data/cont-de-scite.properties
@@ -35,42 +35,43 @@ keywordclass.macros.context.de=\
posten programm publikation punkt ran rechteck \
rechtecke rechtsbuendig ref referenz registrierefelder roemischezahlen \
ruecksetzten ruecksetztenbeschriftung schreibezumregister schreibezurliste schreibezurreferenzliste schreibezwischenliste \
- seite seitenreferenz seitentyp settextvariable setupforms setupitemgroup \
- setuppaper setuprule setupstrut setuptextposition setuptextvariable showsymbolset \
- spalte spatium spiegeln sprache start startfarbe \
- startgeg starthintergrund startinteraktionsmenue startkleinerdurchschuss startkommentar startkomponente \
- startmarginallinie startprodukt startprojekt starttextlinie startumgebung startversion \
- startzitat stelleabsaetzeein stelleabsatznummerierungein stelleabschnittein stelleabschnittsblockein stelleanordnenein \
- stelleausgabeein stelleausrichtungein stelleausschnittein stellebeschreibungein stellebeschriftungein stellebilderunterschriftein \
- stellebildunterschriftein stellebindestrichein stelleblankoein stelleblockein stelledrehenein stelleduennerumrissein \
- stelleeinziehenein stelleeinzuegein stelleengerein stelleexterneabbildungenein stellefarbeein stellefarbenein \
- stellefeldein stellefelderin stellefliesstextein stellefliesstextumgebungein stellefussnotendefinitionein stellefussnotenein \
- stellefusszeileein stellefusszeilentextein stellegefuelltesrechteckein stellegefuelltezeileein stellegegenueberplatzierenein stellegleitobjekteein \
- stellegleitobjektein stellehintergruendeein stellehintergrundein stelleinmarginalieein stelleinteraktionein stelleinteraktionsbalkenein \
- stelleinteraktionsbildschirmein stelleknopfein stellekombinationein stellekommentarein stellekopfzahlein stellekopfzeileein \
- stellekopfzeilentextein stellelabeltextein stellelayoutein stellelegendeein stellelinienbreiteein stellelisteein \
- stellemarginalblockein stellemarginallinieein stellenobenein stellenummerierungein stellepaletteein stellepapierformatein \
- stelleplatziegeteiltegleitobjekt stellepositionierenein stellepostenein stelleprofilein stelleprogrammein stellepublikationein \
- stellepufferein stellerasterein stellerechteckein stellereferenzierenein stellereferenzlisteein stelleregisterein \
- stelleseitennummerein stelleseitennummeriernungein stelleseitenuebergangein stellesortierenein stellespaltenein stellespatiumein \
- stellespracheein stellesymbolsetein stellesynchronisationein stellesynchronisationsbalkenein stellesynonymein stellesystemein \
- stelletabein stelletabellenein stelletabulatorein stelletextein stelletextobenein stelletexttexteein \
- stelletextumrissein stelletextuntenein stelletipein stelletippenein stelletoleranzein stelleueberschriftein \
- stelleueberschriftenein stelleueberschrifttextein stelleumbruchein stelleumrahmtein stelleumrahmtetexteein stelleuntenein \
- stelleunterseitennummerein stelleunterstreichenein stelleurlein stelleversalienein stelleversionein stellezeilenabstandein \
- stellezeilenein stellezeilennumerierungein stellezitierenein stellezusammengestelltelisteein stellezwischenraumein stop \
- stopfarbe stopgeg stophintergrund stopinteraktionsmenue stopkleinerdurchschuss stopkommentar \
- stopkomponente stopmarginallinie stopprodukt stopprojekt stoptextlinie stopumgebung \
- stopversion stopzitat switchtorawfont sym symbol synchronisationsbalken \
- synchronisieren tab teilegleitobjekt tex textlinie textreferenz \
- textvariable tief tiho tip tippedatei tippen \
- tippepuffer tooltip ueber ueberschrifttext uebersetzten ueberstreichen \
- ueberstrichen umrahmt unterstreichen unterstrichen verbergebloecke vergleichefarbengruppe \
- vergleichepalette verknuepfebeschriftung verknuepfedokument verknuepfregister version verweis \
- verweisdatum verwendeURL verwendebefehl verwendebloecke verwendeexteresdokument verwendeexterneabbildung \
- verwendeexternedatei verwendeexternedateien verwendeexternestonstueck verwendemodul verwendereferenzen verwendesymbole \
- vl von waehlebloeckeaus waehlepapieraus waehleversionaus wechselezumfliesstext \
- wochentag wortrechts zeigedruck zeigeeinstellungen zeigeexterneabbildungen zeigefarbe \
- zeigefarbengruppe zeigefelder zeigefliesstext zeigefliesstextumgebung zeigegitter zeigelayout \
- zeigepalette zeigerahmen zeigestruts zeigeumbruch zentriert ziffern \
- zitat zitieren zu zurbox zusatz zwischenraum
+ seite seitenreferenz seitentyp settext settextvariable setupforms \
+ setupitemgroup setuppaper setuprule setupstrut setuptextposition setuptextvariable \
+ showsymbolset spalte spatium spiegeln sprache start \
+ startfarbe startgeg starthintergrund startinteraktionsmenue startkleinerdurchschuss startkommentar \
+ startkomponente startmarginallinie startprodukt startprojekt starttextlinie startumgebung \
+ startversion startzitat stelleabsaetzeein stelleabsatznummerierungein stelleabschnittein stelleabschnittsblockein \
+ stelleanordnenein stelleausgabeein stelleausrichtungein stelleausschnittein stellebeschreibungein stellebeschriftungein \
+ stellebilderunterschriftein stellebildunterschriftein stellebindestrichein stelleblankoein stelleblockein stelledrehenein \
+ stelleduennerumrissein stelleeinziehenein stelleeinzuegein stelleengerein stelleexterneabbildungenein stellefarbeein \
+ stellefarbenein stellefeldein stellefelderin stellefliesstextein stellefliesstextumgebungein stellefussnotendefinitionein \
+ stellefussnotenein stellefusszeileein stellefusszeilentextein stellegefuelltesrechteckein stellegefuelltezeileein stellegegenueberplatzierenein \
+ stellegleitobjekteein stellegleitobjektein stellehintergruendeein stellehintergrundein stelleinmarginalieein stelleinteraktionein \
+ stelleinteraktionsbalkenein stelleinteraktionsbildschirmein stelleknopfein stellekombinationein stellekommentarein stellekopfzahlein \
+ stellekopfzeileein stellekopfzeilentextein stellelabeltextein stellelayoutein stellelegendeein stellelinienbreiteein \
+ stellelisteein stellemarginalblockein stellemarginallinieein stellenobenein stellenummerierungein stellepaletteein \
+ stellepapierformatein stelleplatziegeteiltegleitobjekt stellepositionierenein stellepostenein stelleprofilein stelleprogrammein \
+ stellepublikationein stellepufferein stellerasterein stellerechteckein stellereferenzierenein stellereferenzlisteein \
+ stelleregisterein stelleseitennummerein stelleseitennummeriernungein stelleseitenuebergangein stellesortierenein stellespaltenein \
+ stellespatiumein stellespracheein stellesymbolsetein stellesynchronisationein stellesynchronisationsbalkenein stellesynonymein \
+ stellesystemein stelletabein stelletabellenein stelletabulatorein stelletextein stelletextobenein \
+ stelletexttexteein stelletextumrissein stelletextuntenein stelletipein stelletippenein stelletoleranzein \
+ stelleueberschriftein stelleueberschriftenein stelleueberschrifttextein stelleumbruchein stelleumrahmtein stelleumrahmtetexteein \
+ stelleuntenein stelleunterseitennummerein stelleunterstreichenein stelleurlein stelleversalienein stelleversionein \
+ stellezeilenabstandein stellezeilenein stellezeilennumerierungein stellezitierenein stellezusammengestelltelisteein stellezwischenraumein \
+ stop stopfarbe stopgeg stophintergrund stopinteraktionsmenue stopkleinerdurchschuss \
+ stopkommentar stopkomponente stopmarginallinie stopprodukt stopprojekt stoptextlinie \
+ stopumgebung stopversion stopzitat switchtorawfont sym symbol \
+ synchronisationsbalken synchronisieren tab teilegleitobjekt tex textlinie \
+ textreferenz textvariable tief tiho tip tippedatei \
+ tippen tippepuffer tooltip ueber ueberschrifttext uebersetzten \
+ ueberstreichen ueberstrichen umrahmt unterstreichen unterstrichen verbergebloecke \
+ vergleichefarbengruppe vergleichepalette verknuepfebeschriftung verknuepfedokument verknuepfregister version \
+ verweis verweisdatum verwendeURL verwendebefehl verwendebloecke verwendeexteresdokument \
+ verwendeexterneabbildung verwendeexternedatei verwendeexternedateien verwendeexternestonstueck verwendemodul verwendereferenzen \
+ verwendesymbole vl von waehlebloeckeaus waehlepapieraus waehleversionaus \
+ wechselezumfliesstext wochentag wortrechts zeigedruck zeigeeinstellungen zeigeexterneabbildungen \
+ zeigefarbe zeigefarbengruppe zeigefelder zeigefliesstext zeigefliesstextumgebung zeigegitter \
+ zeigelayout zeigepalette zeigerahmen zeigestruts zeigeumbruch zentriert \
+ ziffern zitat zitieren zu zurbox zusatz \
+ zwischenraum
diff --git a/Master/texmf-dist/context/data/cont-en-scite.properties b/Master/texmf-dist/context/data/cont-en-scite.properties
index f3dedd92c83..0421582a4bd 100644
--- a/Master/texmf-dist/context/data/cont-en-scite.properties
+++ b/Master/texmf-dist/context/data/cont-en-scite.properties
@@ -38,39 +38,40 @@ keywordclass.macros.context.en=\
processpage program publication quotation quote ran \
ref reference referral referraldate reset resetmarking \
rightaligned romannumerals rotate scale screen selectblocks \
- selectpaper selectversion settextvariable setupalign setuparranging setupbackground \
- setupbackgrounds setupblackrules setupblank setupblock setupbodyfont setupbodyfontenvironment \
- setupbottom setupbottomtexts setupbuffer setupbuttons setupcapitals setupcaption \
- setupcaptions setupclipping setupcolor setupcolors setupcolumns setupcombinations \
- setupcombinedlist setupcomment setupdescriptions setupenumerations setupexternalfigures setupfield \
- setupfields setupfillinlines setupfillinrules setupfloat setupfloats setupfloatsplitting \
- setupfooter setupfootertexts setupfootnotedefinition setupfootnotes setupforms setupframed \
- setupframedtexts setuphead setupheader setupheadertexts setupheadnumber setupheads \
- setupheadtext setuphyphenmark setupindentations setupindenting setupinmargin setupinteraction \
- setupinteractionbar setupinteractionscreen setupinterlinespace setupitemgroup setupitems setuplabeltext \
- setuplanguage setuplayout setuplegend setuplinenumbering setuplines setuplinewidth \
- setuplist setupmakeup setupmarginblocks setupmarginrules setupmarking setupnarrower \
- setupnumbering setupoppositeplacing setupoutput setuppagenumber setuppagenumbering setuppagetransitions \
- setuppalet setuppaper setuppapersize setupparagraphnumbering setupparagraphs setuppositioning \
- setupprofiles setupprograms setuppublications setupquote setupreferencelist setupreferencing \
- setupregister setuprotate setuprule setupscreens setupsection setupsectionblock \
- setupsorting setupspacing setupstrut setupsubpagenumber setupsymbolset setupsynchronization \
- setupsynchronizationbar setupsynonyms setupsystem setuptab setuptables setuptabulate \
- setuptext setuptextposition setuptextrules setuptexttexts setuptextvariable setupthinrules \
- setuptolerance setuptop setuptoptexts setuptype setuptyping setupunderbar \
- setupurl setupversions setupwhitespace showbodyfont showbodyfontenvironment showcolor \
- showcolorgroup showexternalfigures showfields showframe showgrid showlayout \
- showmakeup showpalet showprint showsetups showstruts showsymbolset \
- someline somewhere space splitfloat start startbackground \
- startcolor startcomment startcomponent startenvironment startfact startinteractionmenu \
- startmarginrule startpacked startproduct startproject startquotation starttextrule \
- startversion stop stopbackground stopcolor stopcomment stopcomponent \
- stopenvironment stopfact stopinteractionmenu stopmarginrule stoppacked stopproduct \
- stopproject stopquotation stoptextrule stopversion stretched switchtobodyfont \
- switchtorawfont sym symbol synchronizationbar synchronize tab \
- tex textreference textrule textvariable thinrule thinrules \
- tooltip translate typ type typebuffer typefile \
- underbar underbars useURL useblocks usecommands useencoding \
- useexternaldocument useexternalfigure useexternalfile useexternalfiles useexternalsoundtrack usemodule \
- usereferences usespecials usesymbols version vl weekday \
- whitespace wordright writebetweenlist writetolist writetoreferencelist writetoregister
+ selectpaper selectversion settextcontent settextvariable setupalign setuparranging \
+ setupbackground setupbackgrounds setupblackrules setupblank setupblock setupbodyfont \
+ setupbodyfontenvironment setupbottom setupbottomtexts setupbuffer setupbuttons setupcapitals \
+ setupcaption setupcaptions setupclipping setupcolor setupcolors setupcolumns \
+ setupcombinations setupcombinedlist setupcomment setupdescriptions setupenumerations setupexternalfigures \
+ setupfield setupfields setupfillinlines setupfillinrules setupfloat setupfloats \
+ setupfloatsplitting setupfooter setupfootertexts setupfootnotedefinition setupfootnotes setupforms \
+ setupframed setupframedtexts setuphead setupheader setupheadertexts setupheadnumber \
+ setupheads setupheadtext setuphyphenmark setupindentations setupindenting setupinmargin \
+ setupinteraction setupinteractionbar setupinteractionscreen setupinterlinespace setupitemgroup setupitems \
+ setuplabeltext setuplanguage setuplayout setuplegend setuplinenumbering setuplines \
+ setuplinewidth setuplist setupmakeup setupmarginblocks setupmarginrules setupmarking \
+ setupnarrower setupnumbering setupoppositeplacing setupoutput setuppagenumber setuppagenumbering \
+ setuppagetransitions setuppalet setuppaper setuppapersize setupparagraphnumbering setupparagraphs \
+ setuppositioning setupprofiles setupprograms setuppublications setupquote setupreferencelist \
+ setupreferencing setupregister setuprotate setuprule setupscreens setupsection \
+ setupsectionblock setupsorting setupspacing setupstrut setupsubpagenumber setupsymbolset \
+ setupsynchronization setupsynchronizationbar setupsynonyms setupsystem setuptab setuptables \
+ setuptabulate setuptext setuptextposition setuptextrules setuptexttexts setuptextvariable \
+ setupthinrules setuptolerance setuptop setuptoptexts setuptype setuptyping \
+ setupunderbar setupurl setupversions setupwhitespace showbodyfont showbodyfontenvironment \
+ showcolor showcolorgroup showexternalfigures showfields showframe showgrid \
+ showlayout showmakeup showpalet showprint showsetups showstruts \
+ showsymbolset someline somewhere space splitfloat start \
+ startbackground startcolor startcomment startcomponent startenvironment startfact \
+ startinteractionmenu startmarginrule startpacked startproduct startproject startquotation \
+ starttextrule startversion stop stopbackground stopcolor stopcomment \
+ stopcomponent stopenvironment stopfact stopinteractionmenu stopmarginrule stoppacked \
+ stopproduct stopproject stopquotation stoptextrule stopversion stretched \
+ switchtobodyfont switchtorawfont sym symbol synchronizationbar synchronize \
+ tab tex textreference textrule textvariable thinrule \
+ thinrules tooltip translate typ type typebuffer \
+ typefile underbar underbars useURL useblocks usecommands \
+ useencoding useexternaldocument useexternalfigure useexternalfile useexternalfiles useexternalsoundtrack \
+ usemodule usereferences usespecials usesymbols version vl \
+ weekday whitespace wordright writebetweenlist writetolist writetoreferencelist \
+ writetoregister
diff --git a/Master/texmf-dist/context/data/cont-fr-scite.properties b/Master/texmf-dist/context/data/cont-fr-scite.properties
index 581154cb032..133f91ed016 100644
--- a/Master/texmf-dist/context/data/cont-fr-scite.properties
+++ b/Master/texmf-dist/context/data/cont-fr-scite.properties
@@ -60,17 +60,17 @@ keywordclass.macros.context.fr=\
regletransitionspage regletri regletype regleurl reglevariabletexte regleversions \
remplitchamp remplitligne remplitlignesreglees remplittexte sansalinea sansespace \
sansespaceblanc sanslignesenteteetpdp sanslignessupetinf sansliste sansmarquage sanstest \
- sauteblocs selectionneblocs selectionnepapier selectionneversion separeflottant setupframedtexts \
- setupitemgroup sousligne souslignetout start startarriereplan startcitation \
- startcommentaire startcomposant startcouleur startenvironement startfait startgroupe \
- startligneregleetexte startmargereglee startmenuinteraction startproduit startprojet startversion \
- stop stoparriereplan stopcitation stopcommentaire stopcomposant stopcouleur \
- stopenvironement stopfait stopgroupe stopligneregleetexte stopmargereglee stopmenuinteraction \
- stopproduit stopprojet stopversion suggestion suivantprofil suivantversion \
- suivantversionprofil surligne surlignetout sym symbole synchronise \
- tab tapebuffer tapepage tete tex textemarge \
- textenotepdp textetete traduire traiteblocs traitepage traitfin \
- traitsfins typ uneligne utiliseURL utiliseblocs utilisecommandes \
- utilisedocumentexterne utiliseencodage utilisefichierexterne utilisefichiersexternes utilisefigureexterne utilisemodule \
- utilisepsiteaudioexterne utilisereferences utilisespecialites utilisesymboles va vaalaboite \
- vaenbas variabletexte version vide vl
+ sauteblocs selectionneblocs selectionnepapier selectionneversion separeflottant settext \
+ setupframedtexts setupitemgroup sousligne souslignetout start startarriereplan \
+ startcitation startcommentaire startcomposant startcouleur startenvironement startfait \
+ startgroupe startligneregleetexte startmargereglee startmenuinteraction startproduit startprojet \
+ startversion stop stoparriereplan stopcitation stopcommentaire stopcomposant \
+ stopcouleur stopenvironement stopfait stopgroupe stopligneregleetexte stopmargereglee \
+ stopmenuinteraction stopproduit stopprojet stopversion suggestion suivantprofil \
+ suivantversion suivantversionprofil surligne surlignetout sym symbole \
+ synchronise tab tapebuffer tapepage tete tex \
+ textemarge textenotepdp textetete traduire traiteblocs traitepage \
+ traitfin traitsfins typ uneligne utiliseURL utiliseblocs \
+ utilisecommandes utilisedocumentexterne utiliseencodage utilisefichierexterne utilisefichiersexternes utilisefigureexterne \
+ utilisemodule utilisepsiteaudioexterne utilisereferences utilisespecialites utilisesymboles va \
+ vaalaboite vaenbas variabletexte version vide vl
diff --git a/Master/texmf-dist/context/data/cont-it-scite.properties b/Master/texmf-dist/context/data/cont-it-scite.properties
index 683ba5a27c3..192a7c07e6f 100644
--- a/Master/texmf-dist/context/data/cont-it-scite.properties
+++ b/Master/texmf-dist/context/data/cont-it-scite.properties
@@ -60,17 +60,18 @@ keywordclass.macros.context.it=\
rigovuoto ruota saltablocchi sbarrati sbarrato scala \
schermo scrividentroelenco scriviinelenco scriviinlistariferimenti scriviinregistro segnalibro \
seguiprofilo seguiversione seguiversioneprofilo selezionablocchi selezionacarta selezionaversione \
- separamarcatura setupitemgroup setuppaper setvariabiletesto sfondo sim \
- simbolo sincronizza sopralinea sopralinee sottolinea sottolinee \
- spazifissi spazio spaziobianco spezzaoggettomobile spostaagriglia stackcampi \
- start startambiente startcitazione startcolore startcommento startcomponenet \
- startfatto startimpaccato startlineamargine startlineatesto startmenuinterattivo startprodotto \
- startprogetto startsfondo startversione stirato stop stopambiente \
- stopcitazione stopcolore stopcommento stopcomponenet stopfatto stopimpaccato \
- stoplineamargine stoplineatesto stopmenuinterattivo stopprodotto stopprogetto stopsfondo \
- stopversione tab testa testoetichetta testoinmargine testoinstestazioni \
- testonotapdp testoriempimento tex tieniblocchi tipopagina tooltip \
- traduci typ type typebuffer typefile usaURL \
- usablocco usacodifica usacolonnasonoraesterna usacomandi usadocumentoesterno usafiguraesterna \
- usafileesterni usafileesterno usamodulo usariferimenti usasimboli usaspecialita \
- vaia vaiabox vaigiu variabiletesto versione vl
+ separamarcatura settext setupitemgroup setuppaper setvariabiletesto sfondo \
+ sim simbolo sincronizza sopralinea sopralinee sottolinea \
+ sottolinee spazifissi spazio spaziobianco spezzaoggettomobile spostaagriglia \
+ stackcampi start startambiente startcitazione startcolore startcommento \
+ startcomponenet startfatto startimpaccato startlineamargine startlineatesto startmenuinterattivo \
+ startprodotto startprogetto startsfondo startversione stirato stop \
+ stopambiente stopcitazione stopcolore stopcommento stopcomponenet stopfatto \
+ stopimpaccato stoplineamargine stoplineatesto stopmenuinterattivo stopprodotto stopprogetto \
+ stopsfondo stopversione tab testa testoetichetta testoinmargine \
+ testoinstestazioni testonotapdp testoriempimento tex tieniblocchi tipopagina \
+ tooltip traduci typ type typebuffer typefile \
+ usaURL usablocco usacodifica usacolonnasonoraesterna usacomandi usadocumentoesterno \
+ usafiguraesterna usafileesterni usafileesterno usamodulo usariferimenti usasimboli \
+ usaspecialita vaia vaiabox vaigiu variabiletesto versione \
+ vl
diff --git a/Master/texmf-dist/context/data/cont-nl-scite.properties b/Master/texmf-dist/context/data/cont-nl-scite.properties
index 5ca7901d08b..df32e42834c 100644
--- a/Master/texmf-dist/context/data/cont-nl-scite.properties
+++ b/Master/texmf-dist/context/data/cont-nl-scite.properties
@@ -58,19 +58,20 @@ keywordclass.macros.context.nl=\
stelrefererenin stelregelnummerenin stelregelsin stelregisterin stelroterenin stelsamengesteldelijstin \
stelsectieblokin stelsectiein stelsmallerin stelsorterenin stelspatieringin stelstrutin \
stelsubpaginanummerin stelsymboolsetin stelsynchronisatiebalkin stelsynchronisatiein stelsynoniemenin stelsysteemin \
- steltaalin steltabellenin steltabin steltabulatiein steltekstin steltekstlijnenin \
- steltekstpositiein stelteksttekstenin steltekstvariabelein steltolerantiein steltypein steltypenin \
- steluitlijnenin steluitvoerin stelurlin stelveldenin stelveldin stelversiesin \
- stelvoetin stelvoetnootdefinitiein stelvoetnotenin stelvoettekstenin stelwitruimtein stop \
- stopachtergrond stopcitaat stopcommentaar stopgeg stopinteractiemenu stopkantlijn \
- stopkleur stopomgeving stoponderdeel stopopelkaar stopprodukt stopprojekt \
- stoptekstlijn stopversie suggestie switchnaarkorps switchtorawfont sym \
- symbool synchronisatiebalk synchroniseer taal tab tekstlijn \
- tekstreferentie tekstvariabele tex toevoegen toonexternefiguren toongrid \
- tooninstellingen toonkader toonkleur toonkleurgroep toonkorps toonkorpsomgeving \
- toonlayout toonopmaak toonpalet toonprint toonstruts toonsymboolset \
- toonvelden typ type typebuffer typefile uit \
- uitgerekt usecodering vastespaties veld veldstapel verbergblokken \
- vergelijkkleurgroep vergelijkpalet verplaatsopgrid versie vertaal verwerkblokken \
- verwerkpagina vl voetnoot voetnoottekst volgprofiel volgprofielversie \
- volgversie volledigregister weekdag wiskunde witruimte woordrechts
+ steltaalin steltabellenin steltabin steltabulatiein steltekstin steltekstinhoudin \
+ steltekstlijnenin steltekstpositiein stelteksttekstenin steltekstvariabelein steltolerantiein steltypein \
+ steltypenin steluitlijnenin steluitvoerin stelurlin stelveldenin stelveldin \
+ stelversiesin stelvoetin stelvoetnootdefinitiein stelvoetnotenin stelvoettekstenin stelwitruimtein \
+ stop stopachtergrond stopcitaat stopcommentaar stopgeg stopinteractiemenu \
+ stopkantlijn stopkleur stopomgeving stoponderdeel stopopelkaar stopprodukt \
+ stopprojekt stoptekstlijn stopversie suggestie switchnaarkorps switchtorawfont \
+ sym symbool synchronisatiebalk synchroniseer taal tab \
+ tekstlijn tekstreferentie tekstvariabele tex toevoegen toonexternefiguren \
+ toongrid tooninstellingen toonkader toonkleur toonkleurgroep toonkorps \
+ toonkorpsomgeving toonlayout toonopmaak toonpalet toonprint toonstruts \
+ toonsymboolset toonvelden typ type typebuffer typefile \
+ uit uitgerekt usecodering vastespaties veld veldstapel \
+ verbergblokken vergelijkkleurgroep vergelijkpalet verplaatsopgrid versie vertaal \
+ verwerkblokken verwerkpagina vl voetnoot voetnoottekst volgprofiel \
+ volgprofielversie volgversie volledigregister weekdag wiskunde witruimte \
+ woordrechts
diff --git a/Master/texmf-dist/context/data/cont-ro-scite.properties b/Master/texmf-dist/context/data/cont-ro-scite.properties
index 6aec0faca49..b5106bc3675 100644
--- a/Master/texmf-dist/context/data/cont-ro-scite.properties
+++ b/Master/texmf-dist/context/data/cont-ro-scite.properties
@@ -62,15 +62,15 @@ keywordclass.macros.context.ro=\
seteazasubsol seteazasus seteazatab seteazatabele seteazatabulatori seteazatext \
seteazatexteantet seteazatextejos seteazatextesubsol seteazatextesus seteazatextetext seteazatexteticheta \
seteazatexttitlu seteazatitlu seteazatitluri seteazatoleranta seteazatranzitiepagina seteazatype \
- seteazatyping seteazaurl seteazavariabilatext seteazaversiuni setupitemgroup setuppaper \
- setvariabilatext sim simbol sincronizeaza spatiifixate spatiu \
- spatiualb start startcitat startcomentariu startcomponenta startculoare \
- startfact startfundal startimpachetat startliniemargine startmediu startmeniuinteractiune \
- startprodus startproiect startriglatext startversiune stivacampuri stop \
- stopcitat stopcomentariu stopcomponenta stopculoare stopfact stopfundal \
- stopimpachetat stopliniemargine stopmediu stopmeniuinteractiune stopprodus stopproiect \
- stopriglatext stopversiune sublinie sublinii supralinie tab \
- tex texteticheta textmarginal texttitlu textumplere tippagina \
- titlu tooltip traduce trecilafontraw trecilafonttext typ \
- type typefile undeva urmeazaprofil urmeazaversiune urmeazaversiuneprofil \
- variabilatext versiune vl zidinsaptamana
+ seteazatyping seteazaurl seteazavariabilatext seteazaversiuni settextcontent setupitemgroup \
+ setuppaper setvariabilatext sim simbol sincronizeaza spatiifixate \
+ spatiu spatiualb start startcitat startcomentariu startcomponenta \
+ startculoare startfact startfundal startimpachetat startliniemargine startmediu \
+ startmeniuinteractiune startprodus startproiect startriglatext startversiune stivacampuri \
+ stop stopcitat stopcomentariu stopcomponenta stopculoare stopfact \
+ stopfundal stopimpachetat stopliniemargine stopmediu stopmeniuinteractiune stopprodus \
+ stopproiect stopriglatext stopversiune sublinie sublinii supralinie \
+ tab tex texteticheta textmarginal texttitlu textumplere \
+ tippagina titlu tooltip traduce trecilafontraw trecilafonttext \
+ typ type typefile undeva urmeazaprofil urmeazaversiune \
+ urmeazaversiuneprofil variabilatext versiune vl zidinsaptamana
diff --git a/Master/texmf-dist/context/data/context-jedit-cz.xml b/Master/texmf-dist/context/data/context-jedit-cz.xml
index ab6fdd8f96f..5b7b3e59d3a 100644
--- a/Master/texmf-dist/context/data/context-jedit-cz.xml
+++ b/Master/texmf-dist/context/data/context-jedit-cz.xml
@@ -299,6 +299,7 @@
<KEYWORD2>\schovejbloky</KEYWORD2>
<KEYWORD2>\scitani</KEYWORD2>
<KEYWORD2>\sedabarva</KEYWORD2>
+ <KEYWORD2>\settextcontent</KEYWORD2>
<KEYWORD2>\settextvariable</KEYWORD2>
<KEYWORD2>\setupforms</KEYWORD2>
<KEYWORD2>\setupitemgroup</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context-jedit-de.xml b/Master/texmf-dist/context/data/context-jedit-de.xml
index 0be617e78fd..820ea8fbc55 100644
--- a/Master/texmf-dist/context/data/context-jedit-de.xml
+++ b/Master/texmf-dist/context/data/context-jedit-de.xml
@@ -224,6 +224,7 @@
<KEYWORD2>\seite</KEYWORD2>
<KEYWORD2>\seitenreferenz</KEYWORD2>
<KEYWORD2>\seitentyp</KEYWORD2>
+ <KEYWORD2>\settext</KEYWORD2>
<KEYWORD2>\settextvariable</KEYWORD2>
<KEYWORD2>\setupforms</KEYWORD2>
<KEYWORD2>\setupitemgroup</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context-jedit-en.xml b/Master/texmf-dist/context/data/context-jedit-en.xml
index adc81221f2e..34359ca157d 100644
--- a/Master/texmf-dist/context/data/context-jedit-en.xml
+++ b/Master/texmf-dist/context/data/context-jedit-en.xml
@@ -241,6 +241,7 @@
<KEYWORD2>\selectblocks</KEYWORD2>
<KEYWORD2>\selectpaper</KEYWORD2>
<KEYWORD2>\selectversion</KEYWORD2>
+ <KEYWORD2>\settextcontent</KEYWORD2>
<KEYWORD2>\settextvariable</KEYWORD2>
<KEYWORD2>\setupalign</KEYWORD2>
<KEYWORD2>\setuparranging</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context-jedit-fr.xml b/Master/texmf-dist/context/data/context-jedit-fr.xml
index 68e40115fd1..0588718a424 100644
--- a/Master/texmf-dist/context/data/context-jedit-fr.xml
+++ b/Master/texmf-dist/context/data/context-jedit-fr.xml
@@ -376,6 +376,7 @@
<KEYWORD2>\selectionnepapier</KEYWORD2>
<KEYWORD2>\selectionneversion</KEYWORD2>
<KEYWORD2>\separeflottant</KEYWORD2>
+ <KEYWORD2>\settext</KEYWORD2>
<KEYWORD2>\setupframedtexts</KEYWORD2>
<KEYWORD2>\setupitemgroup</KEYWORD2>
<KEYWORD2>\sousligne</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context-jedit-it.xml b/Master/texmf-dist/context/data/context-jedit-it.xml
index d0317cd0b88..ff09d98b225 100644
--- a/Master/texmf-dist/context/data/context-jedit-it.xml
+++ b/Master/texmf-dist/context/data/context-jedit-it.xml
@@ -372,6 +372,7 @@
<KEYWORD2>\selezionacarta</KEYWORD2>
<KEYWORD2>\selezionaversione</KEYWORD2>
<KEYWORD2>\separamarcatura</KEYWORD2>
+ <KEYWORD2>\settext</KEYWORD2>
<KEYWORD2>\setupitemgroup</KEYWORD2>
<KEYWORD2>\setuppaper</KEYWORD2>
<KEYWORD2>\setvariabiletesto</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context-jedit-nl.xml b/Master/texmf-dist/context/data/context-jedit-nl.xml
index d9da1606ddb..8dee0e1061d 100644
--- a/Master/texmf-dist/context/data/context-jedit-nl.xml
+++ b/Master/texmf-dist/context/data/context-jedit-nl.xml
@@ -364,6 +364,7 @@
<KEYWORD2>\steltabin</KEYWORD2>
<KEYWORD2>\steltabulatiein</KEYWORD2>
<KEYWORD2>\steltekstin</KEYWORD2>
+ <KEYWORD2>\steltekstinhoudin</KEYWORD2>
<KEYWORD2>\steltekstlijnenin</KEYWORD2>
<KEYWORD2>\steltekstpositiein</KEYWORD2>
<KEYWORD2>\stelteksttekstenin</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context-jedit-ro.xml b/Master/texmf-dist/context/data/context-jedit-ro.xml
index 9841a035035..f1baedbfae4 100644
--- a/Master/texmf-dist/context/data/context-jedit-ro.xml
+++ b/Master/texmf-dist/context/data/context-jedit-ro.xml
@@ -387,6 +387,7 @@
<KEYWORD2>\seteazaurl</KEYWORD2>
<KEYWORD2>\seteazavariabilatext</KEYWORD2>
<KEYWORD2>\seteazaversiuni</KEYWORD2>
+ <KEYWORD2>\settextcontent</KEYWORD2>
<KEYWORD2>\setupitemgroup</KEYWORD2>
<KEYWORD2>\setuppaper</KEYWORD2>
<KEYWORD2>\setvariabilatext</KEYWORD2>
diff --git a/Master/texmf-dist/context/data/context.properties b/Master/texmf-dist/context/data/context.properties
index 6875277180d..7668e1320da 100644
--- a/Master/texmf-dist/context/data/context.properties
+++ b/Master/texmf-dist/context/data/context.properties
@@ -31,7 +31,7 @@
file.patterns.tex=
file.patterns.latex=
-file.patterns.context=*.tex;*.tui;*.tuo;*.sty;
+file.patterns.context=*.tex;*.tui;*.tuo;*.sty;*.mkii;*.mkiv
# ConTeXt : keywords (if not yet loaded already)
@@ -47,7 +47,7 @@ import latex-scite
# Example : patterns
file.patterns.xml=
-file.patterns.example=*.xml;*.xsl;*.xsd;*.fo;*.exa;*.rlb;*.rlg;*.rlv;*.rng;*.xfdf;*.xslt;*.dtd
+file.patterns.example=*.xml;*.xsl;*.xsd;*.fo;*.exa;*.rlb;*.rlg;*.rlv;*.rng;*.xfdf;*.xslt;*.dtd;*.lmx
filter.example=eXaMpLe|$(file.patterns.example)|
diff --git a/Master/texmf-dist/doc/context/bib/bibmod-doc.pdf b/Master/texmf-dist/doc/context/bib/bibmod-doc.pdf
index abf6359c179..1f74aca0964 100644
--- a/Master/texmf-dist/doc/context/bib/bibmod-doc.pdf
+++ b/Master/texmf-dist/doc/context/bib/bibmod-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/bib/bibmod-doc.tex b/Master/texmf-dist/doc/context/bib/bibmod-doc.tex
index 6d25650dd0a..b64fd018c3a 100644
--- a/Master/texmf-dist/doc/context/bib/bibmod-doc.tex
+++ b/Master/texmf-dist/doc/context/bib/bibmod-doc.tex
@@ -46,7 +46,7 @@
\module
[ file=bibmod-doc,
- version=2006.03.13,
+ version=2006.11.04,
title=Module Documentation,
subtitle=Bibliographies,
author={Taco Hoekwater},
@@ -60,7 +60,7 @@
The bibliographic module (\type{t-bib.tex}) takes care of references
to publications and the typesetting of publication lists, as well as
providing an interface between \BIBTEX and \CONTEXT. This manual
-documents version 2006.08.08.
+documents version 2006.09.15.
The bibliographic subsystem consists of the main module
\type{t-bib.tex}; four \BIBTEX\ styles (\type{cont-xx.bst}); and a set
@@ -182,6 +182,14 @@ heading for \type{\completepublications}
\NC title\NC The sectioning command.\NC\NR
\stoptabulate
+A fourth option can be used to nullify the printing of `year suffixes'
+in cases where the author(s) has written multiple works within a
+single year.
+
+\starttabulate[|l|p|]
+\NC maybeyear\NC either \type{on} or \type{off}. Default is \type{on}\NC\NR
+\stoptabulate
+
The other extra options are needed to control micro||typesetting
of things that are buried deep within macros. There is a separate
command to handle the larger layout options
@@ -335,6 +343,10 @@ and select the parts that are needed for the current article.
\setup{setupbibtex}
\starttabulate[|l|p|]
+\NC bibtex\NC The name (with possibly a pathname or even some option settings)
+ of the bibtex executable. This is passed on to texexec. The default value
+ is simply `bibtex'\NC\NR
+
\NC database\NC List of bibtex database file names to be
used. The module will write a very short \type{.aux} file instructing
\BIBTEX\ to create a (possibly very large) \type{\jobname.bbl} file,
@@ -490,6 +502,15 @@ the default one, you most likely want to call
\placepublications[criterium=all]
\stoptyping
+If you use a numeric list style combined with multiple , each
+\type{\placepublications} or \type{\completepublications} commands,
+by default each one restarts the displayed number. If you do not
+like that, you can add an option argument like so:
+\starttyping
+\placepublications[option=continue]
+\stoptyping
+
+
The module uses the following defaults for the generated head:
\starttyping
\setupheadtext[en][pubs=References]
@@ -569,7 +590,7 @@ and the meanings are as follows:
\NC \type{firstnames} \NC individual (given) name(s)\NC\NR
\NC \type{inits} \NC abbreviated form(s) of \type{firstnames}.\NC\NR
\NC \type{von} \NC any bits of the family name that are normally disregarded in sorting\NC\NR
-\NC \type{surname} \NC reaminder of the family (last) name\NC\NR
+\NC \type{surname} \NC remainder of the family (last) name\NC\NR
\stoptabulate
diff --git a/Master/texmf-dist/doc/context/document/general/manuals/mreadme.pdf b/Master/texmf-dist/doc/context/document/general/manuals/mreadme.pdf
new file mode 100644
index 00000000000..33800801520
--- /dev/null
+++ b/Master/texmf-dist/doc/context/document/general/manuals/mreadme.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/document/general/manuals/tiptrick.pdf b/Master/texmf-dist/doc/context/document/general/manuals/tiptrick.pdf
new file mode 100644
index 00000000000..3ced360e14a
--- /dev/null
+++ b/Master/texmf-dist/doc/context/document/general/manuals/tiptrick.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/context/manuals/allkind/mcommon.tex b/Master/texmf-dist/doc/context/manuals/allkind/mcommon.tex
new file mode 100644
index 00000000000..f0c22cff42e
--- /dev/null
+++ b/Master/texmf-dist/doc/context/manuals/allkind/mcommon.tex
@@ -0,0 +1,199 @@
+% content=tex
+%
+% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa
+
+\startenvironment mcommon
+
+% modules
+
+\usemodule[abr-02]
+
+% layout
+
+\startmode[screen]
+ \setuppapersize[S6][S6]
+ \setupinteraction[state=start]
+ \setupinteractionscreen[options=max]
+\stopmode
+
+\setuplayout
+ [footer=0cm,
+ width=middle,
+ height=middle]
+
+% fonts
+
+\startmode[atpragma]
+
+ \startMPenvironment[global]
+ \usetypescriptfile[type-buy]
+ \usetypescript[lucida][texnansi]
+ \setupbodyfont[lucida,10pt]
+ \stopMPenvironment
+
+ \setupbodyfont[11pt]
+
+\stopmode
+
+\startnotmode[atpragma]
+
+ \startMPenvironment[global]
+ \usetypescript[palatino][ec]
+ \setupbodyfont[palatino,10pt]
+ \stopMPenvironment
+
+ \setupbodyfont[11pt]
+
+\stopnotmode
+
+\definefont [BigFont] [SansBold at 60pt]
+\definefont [MedFont] [SansBold at 30pt]
+
+% colors
+
+\setupcolors
+ [state=start]
+
+\definecolor [NopColor] [r=.6,g=.4,b=.5]
+\definecolor [AltColor] [r=.4,g=.6,b=.5]
+\definecolor [TheColor] [r=.4,g=.5,b=.6]
+\definecolor [TmpColor] [r=.6,g=.5,b=.4]
+
+\definecolor [red] [NopColor]
+\definecolor [green] [AltColor]
+\definecolor [blue] [TheColor]
+\definecolor [yellow][TmpColor]
+
+% spacing
+
+\setupwhitespace
+ [big]
+
+\setuptolerance
+ [verytolerant,stretch]
+
+% verbatim
+
+\setuptype
+ [color=AltColor]
+
+\setuptyping
+ [color=AltColor]
+
+% structure
+
+\setupitemize
+ [each]
+ [color=TheColor]
+
+\definedescription
+ [switch]
+ [headstyle=type,
+ headcolor=TheColor,
+ location=serried,
+ width=broad]
+
+\defineenumeration
+ [topic]
+ [location=serried,
+ width=broad,
+ headstyle=,
+ headcolor=TheColor,
+ text=,
+ left={[},
+ right={]}]
+
+\setuphead
+ [section]
+ [style=\ss\bfb,
+ color=TheColor]
+
+\setuplist
+ [section]
+ [alternative=c,
+ color=TheColor,
+ textcolor=black,
+ pagecolor=black]
+
+% whatever
+
+\setupsystem
+ [random=medium]
+
+\setupfloats
+ [ntop=100]
+
+\setupinteraction
+ [style=,
+ color=NopColor,
+ contrastcolor=NopColor]
+
+% tables and frames
+
+\setuptabulate
+ [rulethickness=.5pt,
+ rulecolor=AltColor]
+
+\setuptables
+ [rulethickness=.5pt,
+ rulecolor=AltColor]
+
+\setupframedtexts
+ [rulethickness=.5pt,
+ framecolor=TheColor,
+ width=\textwidth]
+
+% quick reference things
+
+\usemodule[set-11] \loadsetups
+
+\setupframedtexts
+ [setuptext]
+ [rulethickness=.5pt,
+ framecolor=AltColor]
+
+% basic titlepage and colofon, a bit old fashioned approach, but let's not
+% modernize everything now
+
+\def\TitlePage#1#2#3#4#5% number/name angle title author screen
+ {\doifnumberelse{#1}
+ {\ifcase#1
+ \defineoverlay
+ [logo]
+ [\useMPgraphic{titlepage}{width=\overlaywidth,height=\overlayheight}]
+ \else
+ \startMPrun
+ logo_type := #1 ; mpgraph := #1 ; input mp-cont ;
+ \stopMPrun
+ \defineoverlay
+ [logo]
+ [{\externalfigure
+ [\MPrunfile{#1}]
+ [width=\overlaywidth,height=\overlayheight]}]
+ \fi}
+ {\defineoverlay
+ [logo]
+ [\useMPgraphic{#1}{width=\overlaywidth,height=\overlayheight}]}
+ \setupbackgrounds
+ [page]
+ [background=logo]
+ \definecolor[Gray][s=#5]
+ \startstandardmakeup
+ \dontcomplain
+ \BigFont \setupinterlinespace \vfill \setupalign[left] \let\\=\par
+ \ifcase#2\relax
+ \noindent\color[Gray]{#3}\par
+ \else
+ \noindent\rotate[rotation=#2]{\color[Gray]{#3}}\par
+ \fi
+ \stopstandardmakeup
+ \setupbackgrounds
+ [page]
+ [background=]}
+
+\def\ColofonPage
+ {\startstandardmakeup
+ \vfill \setups [pragma-colofon]
+ \stopstandardmakeup}
+
+\stopenvironment
diff --git a/Master/texmf-dist/doc/context/manuals/allkind/mreadme.tex b/Master/texmf-dist/doc/context/manuals/allkind/mreadme.tex
new file mode 100644
index 00000000000..22af40afe7f
--- /dev/null
+++ b/Master/texmf-dist/doc/context/manuals/allkind/mreadme.tex
@@ -0,0 +1,361 @@
+% interface=en output=pdftex language=uk
+%
+% copyright=pragma-ade readme=readme.pdf licence=cc-by-nc-sa
+
+\environment mcommon
+
+\useurl[gpl-simple] [http://creativecommons.org/licenses/GPL/2.0/]
+\useurl[gpl-legal] [http://creativecommons.org/licenses/GPL/2.0/legalcode]
+\useurl[byncsa-simple][http://creativecommons.org/licenses/by-nc-sa/2.5/]
+\useurl[byncsa-legal] [http://creativecommons.org/licenses/by-nc-sa/2.5/legalcode]
+
+\useurl[garden] [http://contextgarden.net]
+\useurl[contextlist] [http://www.ntg.nl/mailman/listinfo/ntg-context]
+\useurl[development] [http://www.ntg.nl/mailman/listinfo/dev-context]
+\useurl[announce] [http://www.ntg.nl/mailman/listinfo/ann-context]
+\useurl[collector] [http://context.literatesolutions.com]
+\useurl[pragma] [http://www.pragma-ade.com]
+\useurl[mirror] [http://context.aanhet.net]
+
+\setupinteraction[state=start]
+
+% copied from cont-log: readme_logo
+
+\startuseMPgraphic{titlepage}{width,height}
+ numeric width ; width = \MPvar{width} ;
+ numeric height ; height = \MPvar{height} ;
+ numeric delta ; delta := width/10 ;
+ numeric circle ; circle := 2.5delta ;
+ color c ; c := (.2,.4,.6) ;
+ path p, q, r ;
+ p := unitsquare xscaled width yscaled height ;
+ z1 = (delta,height-2delta) ;
+ z2 = (width-delta,height-delta) ;
+ z3 = (width/2-delta,2delta+circle) ;
+ z4 = (x3,delta+circle/2) ;
+ q := z1 { dir -15 } .. z2 &
+ z2 { dir -105 } .. z3 &
+ z3 { dir 135 } .. z1 &
+ cycle ;
+ r := fullcircle xscaled circle yscaled (.85circle) rotated 15 shifted z4 ;
+ pickup pencircle scaled (delta/1.5) ;
+ fill p withcolor .50c ;
+ fill q withcolor .75c ;
+ fill r withcolor .75c ;
+ draw p withcolor c ;
+ draw q withcolor c ;
+ pickup pencircle scaled (delta/2) ;
+ draw r withcolor c ;
+ setbounds currentpicture to p ;
+\stopuseMPgraphic
+
+\starttext
+
+\TitlePage{titlepage}{90}{Read Me First}{}{1}
+
+\subject {Introduction}
+
+What licence suits best for a \TEX\ like system is a matter of
+taste. Personally we dislike any licence that needs more than a few
+pages of dense legal code to get the message accross. A \TEX\
+related system like \CONTEXT\ is a hybrid of programs, scripts
+and|/|or macro code as well as documentation and sample code,
+including graphics. \TEX\ related systems also have a long
+standing tradition of providing support structures for users. In
+order to make support feasable, a \TEX\ based system like
+\CONTEXT\ assumes a certain logic and structure in the way the
+related files are named and organized in a tree structure. Even a
+small change in one of the elements may let such a system behave
+differently than manuals suggest. Swap a font, change some style
+defaults, leave out some pieces, and users may end up in
+confusion. A licence does not give a user any guarantees!
+
+In order to satisfy those responsible for distributing \CONTEXT,
+we need to choose a licence that makes them feel comfortable.
+Unfortunately we don't feel that comfortable with a licence that does
+not provide the guarantees that a system will not be adapted in
+such ways that the advertised behaviour changes. On the
+other hand, it is the responsibility of those distributing and
+extending the system to make sure that this does not happen.
+However, users should not automatically assume that what they get
+shipped is the same as the original, which is why we stress that
+support (from our side) will only be given on unaltered systems.
+
+First of all, what is \CONTEXT ? It's just a bunch of macros,
+written in \TEX\ and \METAPOST, meant for typesetting documents.
+The macros are accompanied by some scripts, written in \PERL\ (mainly
+the older scripts) \RUBY\ (the official ones) and \LUA\ (for
+embedded usage). The \CONTEXT\ distribution comes with a few fonts,
+files that help manage resources (e.g.\ map files), as well as
+patterns (based on official ones, so this is a derived work).
+
+The \CONTEXT\ distribution is packaged in a zip file organized in
+the \TDS\ structure.
+
+\starttabulate
+\NC \type {cont-tmf.zip} \NC The main distribution. \NC \NR
+\NC \type {cont-img.zip} \NC A few extra resources. \NC \NR
+\NC \type {cont-ext.zip} \NC Third party modules. \NC \NR
+\stoptabulate
+
+When we talk about \CONTEXT\ we also mean its graphical companion
+\METAFUN\ and \FOXET, an \XML\ related product. All these are
+included in the main distribution archive.
+
+The documentation can be downloaded from our website, one of its
+mirrors, the \TEX\ collection as distributed by \TEX\ user groups.
+For some manuals, source code is available in a subversion
+repository. The archives are also kept on \CTAN.
+
+That said, what licence does apply? We need to distinguish between
+things that resemble a program on the one hand and documentation
+on the other hand. We (currently) use a different licence for
+either of them.
+
+\subject {The Code}
+
+The program code (i.e. anything not under the \type {/doc}
+subtree) is distributed under the
+
+\startnarrower
+\goto{Creative Commons GNU GPL}[url(gpl-simple)]
+\stopnarrower
+
+For practical purposes distributers may also choose the \LATEX\
+project licence, which is considered to be a bit more \TEX\
+friendly. (BSD alike licences, the Ruby Licence and the Apache
+are all licences that apply well for \CONTEXT.)
+
+In practice, users may forget about the legal part, if only
+because I haven't even read (and understood) it completely myself,
+so let's stick to what Creative Commons makes of it:
+
+\startcolor[blue]
+The GNU General Public License is a Free Software license. Like
+any Free Software license, it grants to you the four following
+freedoms:
+
+\startitemize
+\item The freedom to run the program for any purpose.
+\item The freedom to study how the program works and adapt it to
+ your needs.
+\item The freedom to redistribute copies so you can help your neighbour.
+\item The freedom to improve the program and release your improvements
+ to the public, so that the whole community benefits.
+\stopitemize
+
+You may exercise the freedoms specified here provided that you
+comply with the express conditions of this license. The principal
+conditions are:
+
+You must conspicuously and appropriately publish on each copy
+distributed an appropriate copyright notice and disclaimer of
+warranty and keep intact all the notices that refer to this
+License and to the absence of any warranty; and give any other
+recipients of the Program a copy of the GNU General Public License
+along with the Program. Any translation of the GNU General Public
+License must be accompanied by the GNU General Public License.
+
+If you modify your copy or copies of the program or any portion of
+it, or develop a program based upon it, you may distribute the
+resulting work provided you do so under the GNU General Public
+License. Any translation of the GNU General Public License must be
+accompanied by the GNU General Public License.
+
+If you copy or distribute the program, you must accompany it with
+the complete corresponding machine-readable source code or with a
+written offer, valid for at least three years, to furnish the
+complete corresponding machine-readable source code.
+
+Any of these conditions can be waived if you get permission from
+the copyright holder.
+
+Your fair use and other rights are in no way affected by the above.
+\stopcolor
+
+\subject {Recommendations}
+
+Here are a few recommendations in case you want to distribute,
+extend of embed \CONTEXT\ in applications:
+
+\startitemize
+
+\item You can best leave the code base untouched. Most of
+\CONTEXT\ provides hooks and it's relatively easy to overload
+code. Leave the lower level system code untouched: changes may
+backfire when you update. Asking for more hooks is the best way to
+go.
+
+\item Put your own code in the right subpaths, i.e.\ modules
+approved by the development team under \type {.../third}, and
+styles and whatever else under \type {.../user}. This way your
+code will not interfere with existing code and updating will give
+less problems. Keep in mind that \TEX\ systems have their own way
+and order in locating files, and the load order often matters.
+
+\item Don't copy styles and change a few lines, but load the base one
+and built|/|patch on top of that. In the end you may benefit from
+improvements to the base style.
+
+\item Be original. The whole idea behind \CONTEXT\ is that you can
+write your own styles. On the \CONTEXT\ mailing list as well as on
+the Wiki there are enough advanced users to help you make a start.
+
+\item Don't hesitate to submit bugs reports and ask for
+extensions. It may even be that what you want is already present
+but yet undocumented.
+
+\item If things don't work as expected, check to what extend your
+system matches the (more or less) standard. We provide so called
+minimal \CONTEXT\ trees that can serve as a reference. Because
+\CONTEXT\ evolves, make sure your system is up to date.
+
+\item The scripts can best be called using \type {texmfstart}. This
+lessens dependencies on the location in the tree and ensures upward
+compatibility. It also prevents clashes with similary named scripts.
+
+\item Some scripts depend on each other. Don't mess around with the
+existing functionality and names of the scripts and then feed them
+back into the standard distributions.
+
+\stopitemize
+
+\subject {Documents}
+
+The documentation is provided under another Creative Commons licence
+
+\startnarrower
+\goto{Attribution NonCommercial ShareAlike}[url(byncsa-simple)]
+\stopnarrower
+
+This one says:
+
+\startcolor[blue]
+You are free:
+
+\startitemize
+\item to copy, distribute, display, and perform the work
+\item to make derivative works
+\stopitemize
+
+{\sc Attribution:} You must attribute the work in the manner
+specified by the author or licensor.
+
+{\sc NonCommercial:} You may not use this work for commercial
+purposes.
+
+{\sc Share Alike:} If you alter, transform, or build upon this
+work, you may distribute the resulting work only under a license
+identical to this one.
+
+\startitemize
+\item For any reuse or distribution, you must make clear to others
+ the license terms of this work.
+\item Any of these conditions can be waived if you get permission from
+ the copyright holder.
+\stopitemize
+
+Your fair use and other rights are in no way affected by the above.
+\stopcolor
+
+The non||commercial part is mostly a safeguard. We don't mind if
+user groups distribute printed copies, publish (parts of) manuals
+and|/|or if authors use example code in manuals and books about
+\CONTEXT.
+
+If you distribute \CONTEXT\ and related software on electronic media
+as part of \TEX\ distributions (either or not for money), you may
+also distribute the manuals and their sources in electronic form,
+preferable as provided by the maintainers of \CONTEXT.
+
+Keep in mind that logos and cover designs are not meant to be
+copied. We provide the source code for some manuals, but we don't
+always provide all graphics and other resources. For instance, in
+some manuals we use commercial fonts and you have to buy those
+yourself.
+
+We provide the typeset manuals at our website. Those are the official
+ones. We appreciate it if you do not to distribute manuals compiled
+on your own system as substitutes. The manuals are a showcase for what
+\CONTEXT\ provides. Help us to assure the quality.
+
+\subject {More information}
+
+We're not going to fill \mathematics{n}~pages with legal stuff, so if
+you want to know more, you have to consult the web for the legalities
+mentioned. Here are a few starting points:
+
+\startlines
+\goto{\url[gpl-simple]}[url(gpl-simple)]
+\goto{\url[gpl-legal]}[url(gpl-legal)]
+\stoplines
+
+\startlines
+\goto{\url[byncsa-simple]}[url(byncsa-simple)]
+\goto{\url[byncsa-legal]}[url(byncsa-legal)]
+\stoplines
+
+\CONTEXT\ itself can be fetched from the main site or its primary mirror:
+
+\startlines
+\goto{\url[pragma]}[url(pragma)]
+\goto{\url[mirror]}[url(mirror)]
+\stoplines
+
+A starting point for support can be found at:
+
+\startlines
+\goto{\url[contextlist]}[url(contextlist)]
+\goto{\url[garden]}[url(garden)]
+\stoplines
+
+Bugs and feature requests can be registered at the collector:
+
+\startlines
+\goto{\url[collector]}[url(collector)]
+\stoplines
+
+Releases are announced at:
+
+\startlines
+\goto{\url[announce]}[url(announce)]
+\stoplines
+
+The developers can be met at:
+
+\startlines
+\goto{\url[development]}[url(development)]
+\stoplines
+
+\subject {Disclaimer}
+
+To play safe we include a disclaimer here, taken from the BSD style
+licence. For some reason such a text is in capitals, so \unknown
+
+\start \sc \blue
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR \quotation {AS IS} AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+\stop
+
+\unknown\ and don't bother discussing licence issues and related things
+with us for the mere sake of discussing licence stuff.
+
+\blank[2*big]
+
+\startlines
+Hans Hagen
+PRAGMA ADE
+Hasselt NL
+\stoplines
+
+\ColofonPage
+
+\stoptext
diff --git a/Master/texmf-dist/fonts/enc/dvips/context/cmin.enc b/Master/texmf-dist/fonts/enc/dvips/context/cmin.enc
new file mode 100644
index 00000000000..dc2b063a615
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/context/cmin.enc
@@ -0,0 +1,258 @@
+/enccmin[
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/space
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/zero
+/one
+/two
+/three
+/four
+/five
+/six
+/seven
+/eight
+/nine
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/dvips/context/cmit.enc b/Master/texmf-dist/fonts/enc/dvips/context/cmit.enc
new file mode 100644
index 00000000000..40fd82f77ce
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/context/cmit.enc
@@ -0,0 +1,258 @@
+/enccmit[
+/Gamma
+/Delta
+/Theta
+/Lambda
+/Xi
+/Pi
+/Sigma
+/Upsilon
+/Phi
+/Psi
+/Omega
+/ff
+/fi
+/fl
+/ffi
+/ffl
+/dotlessi
+/dotlessj
+/grave
+/acute
+/caron
+/breve
+/macron
+/ring
+/cedilla
+/germandbls
+/ae
+/oe
+/oslash
+/AE
+/OE
+/Oslash
+/suppress
+/exclam
+/quotedblright
+/numbersign
+/sterling
+/percent
+/ampersand
+/quoteright
+/parenleft
+/parenright
+/asterisk
+/plus
+/comma
+/hyphen
+/period
+/slash
+/zero
+/one
+/two
+/three
+/four
+/five
+/six
+/seven
+/eight
+/nine
+/colon
+/semicolon
+/exclamdown
+/equal
+/questiondown
+/question
+/at
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/bracketleft
+/quotedblleft
+/bracketright
+/circumflex
+/dotaccent
+/quoteleft
+/a
+/b
+/c
+/d
+/e
+/f
+/g
+/h
+/i
+/j
+/k
+/l
+/m
+/n
+/o
+/p
+/q
+/r
+/s
+/t
+/u
+/v
+/w
+/x
+/y
+/z
+/endash
+/emdash
+/hungarumlaut
+/tilde
+/dieresis
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/dvips/context/cmitt.enc b/Master/texmf-dist/fonts/enc/dvips/context/cmitt.enc
new file mode 100644
index 00000000000..971187c32da
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/context/cmitt.enc
@@ -0,0 +1,258 @@
+/enccmitt[
+/Gamma
+/Delta
+/Theta
+/Lambda
+/Xi
+/Pi
+/Sigma
+/Upsilon
+/Phi
+/Psi
+/Omega
+/arrowup
+/arrowdown
+/quotesingle
+/exclamdown
+/questiondown
+/dotlessi
+/dotlessj
+/grave
+/acute
+/caron
+/breve
+/macron
+/ring
+/cedilla
+/germandbls
+/ae
+/oe
+/oslash
+/AE
+/OE
+/Oslash
+/visiblespace
+/exclam
+/quotedbl
+/numbersign
+/sterling
+/percent
+/ampersand
+/quoteright
+/parenleft
+/parenright
+/asterisk
+/plus
+/comma
+/hyphen
+/period
+/slash
+/zero
+/one
+/two
+/three
+/four
+/five
+/six
+/seven
+/eight
+/nine
+/colon
+/semicolon
+/less
+/equal
+/greater
+/question
+/at
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/bracketleft
+/backslash
+/bracketright
+/asciicircum
+/underscore
+/quoteleft
+/a
+/b
+/c
+/d
+/e
+/f
+/g
+/h
+/i
+/j
+/k
+/l
+/m
+/n
+/o
+/p
+/q
+/r
+/s
+/t
+/u
+/v
+/w
+/x
+/y
+/z
+/braceleft
+/bar
+/braceright
+/asciitilde
+/dieresis
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/dvips/context/cmrm.enc b/Master/texmf-dist/fonts/enc/dvips/context/cmrm.enc
new file mode 100644
index 00000000000..3a1ab23ddd9
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/context/cmrm.enc
@@ -0,0 +1,258 @@
+/enccmrm[
+/Gamma
+/Delta
+/Theta
+/Lambda
+/Xi
+/Pi
+/Sigma
+/Upsilon
+/Phi
+/Psi
+/Omega
+/ff
+/fi
+/fl
+/ffi
+/ffl
+/dotlessi
+/dotlessj
+/grave
+/acute
+/caron
+/breve
+/macron
+/ring
+/cedilla
+/germandbls
+/ae
+/oe
+/oslash
+/AE
+/OE
+/Oslash
+/suppress
+/exclam
+/quotedblright
+/numbersign
+/dollar
+/percent
+/ampersand
+/quoteright
+/parenleft
+/parenright
+/asterisk
+/plus
+/comma
+/hyphen
+/period
+/slash
+/zero
+/one
+/two
+/three
+/four
+/five
+/six
+/seven
+/eight
+/nine
+/colon
+/semicolon
+/exclamdown
+/equal
+/questiondown
+/question
+/at
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/bracketleft
+/quotedblleft
+/bracketright
+/circumflex
+/dotaccent
+/quoteleft
+/a
+/b
+/c
+/d
+/e
+/f
+/g
+/h
+/i
+/j
+/k
+/l
+/m
+/n
+/o
+/p
+/q
+/r
+/s
+/t
+/u
+/v
+/w
+/x
+/y
+/z
+/endash
+/emdash
+/hungarumlaut
+/tilde
+/dieresis
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/dvips/context/cmsc.enc b/Master/texmf-dist/fonts/enc/dvips/context/cmsc.enc
new file mode 100644
index 00000000000..b8ab09121a0
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/context/cmsc.enc
@@ -0,0 +1,258 @@
+/enccmsc[
+/Gamma
+/Delta
+/Theta
+/Lambda
+/Xi
+/Pi
+/Sigma
+/Upsilon
+/Phi
+/Psi
+/Omega
+/arrowup
+/arrowdown
+/quotesingle
+/exclamdown
+/questiondown
+/dotlessi
+/dotlessj
+/grave
+/acute
+/caron
+/breve
+/macron
+/ring
+/cedilla
+/germandbls
+/ae
+/oe
+/oslash
+/AE
+/OE
+/Oslash
+/suppress
+/exclam
+/quotedblright
+/numbersign
+/dollar
+/percent
+/ampersand
+/quoteright
+/parenleft
+/parenright
+/asterisk
+/plus
+/comma
+/hyphen
+/period
+/slash
+/zero
+/one
+/two
+/three
+/four
+/five
+/six
+/seven
+/eight
+/nine
+/colon
+/semicolon
+/less
+/equal
+/greater
+/question
+/at
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/bracketleft
+/quotedblleft
+/bracketright
+/circumflex
+/dotaccent
+/quoteleft
+/a
+/b
+/c
+/d
+/e
+/f
+/g
+/h
+/i
+/j
+/k
+/l
+/m
+/n
+/o
+/p
+/q
+/r
+/s
+/t
+/u
+/v
+/w
+/x
+/y
+/z
+/endash
+/emdash
+/hungarumlaut
+/tilde
+/dieresis
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/dvips/context/cmtt.enc b/Master/texmf-dist/fonts/enc/dvips/context/cmtt.enc
new file mode 100644
index 00000000000..3c3a9f74b3a
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/context/cmtt.enc
@@ -0,0 +1,258 @@
+/enccmtt[
+/Gamma
+/Delta
+/Theta
+/Lambda
+/Xi
+/Pi
+/Sigma
+/Upsilon
+/Phi
+/Psi
+/Omega
+/arrowup
+/arrowdown
+/quotesingle
+/exclamdown
+/questiondown
+/dotlessi
+/dotlessj
+/grave
+/acute
+/caron
+/breve
+/macron
+/ring
+/cedilla
+/germandbls
+/ae
+/oe
+/oslash
+/AE
+/OE
+/Oslash
+/visiblespace
+/exclam
+/quotedbl
+/numbersign
+/dollar
+/percent
+/ampersand
+/quoteright
+/parenleft
+/parenright
+/asterisk
+/plus
+/comma
+/hyphen
+/period
+/slash
+/zero
+/one
+/two
+/three
+/four
+/five
+/six
+/seven
+/eight
+/nine
+/colon
+/semicolon
+/less
+/equal
+/greater
+/question
+/at
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/bracketleft
+/backslash
+/bracketright
+/asciicircum
+/underscore
+/quoteleft
+/a
+/b
+/c
+/d
+/e
+/f
+/g
+/h
+/i
+/j
+/k
+/l
+/m
+/n
+/o
+/p
+/q
+/r
+/s
+/t
+/u
+/v
+/w
+/x
+/y
+/z
+/braceleft
+/bar
+/braceright
+/asciitilde
+/dieresis
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/dvips/jmn/hans.enc b/Master/texmf-dist/fonts/enc/dvips/jmn/hans.enc
new file mode 100644
index 00000000000..9c7b78a8665
--- /dev/null
+++ b/Master/texmf-dist/fonts/enc/dvips/jmn/hans.enc
@@ -0,0 +1,258 @@
+/enchans[
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/space
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/at
+/A
+/B
+/C
+/D
+/E
+/F
+/G
+/H
+/I
+/J
+/K
+/L
+/M
+/N
+/O
+/P
+/Q
+/R
+/S
+/T
+/U
+/V
+/W
+/X
+/Y
+/Z
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/a
+/b
+/c
+/d
+/e
+/f
+/g
+/h
+/i
+/j
+/k
+/l
+/m
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/AA
+/AAA
+/BB
+/BBB
+/CC
+/CCC
+/DD
+/DDD
+/EE
+/EEE
+/FF
+/FFF
+/GG
+/GGG
+/HH
+/HHH
+/II
+/III
+/JJ
+/JJJ
+/KK
+/KKK
+/LL
+/LLL
+/MM
+/MMM
+/NN
+/NNN
+/OO
+/OOO
+/PP
+/PPP
+/QQ
+/QQQ
+/RR
+/RRR
+/SS
+/SSS
+/TT
+/TTT
+/UU
+/UUU
+/VV
+/VVV
+/WW
+/WWW
+/XX
+/XXX
+/YY
+/YYY
+/ZZ
+/ZZZ
+/aa
+/aaa
+/bb
+/bbb
+/cc
+/ccc
+/dd
+/ddd
+/ee
+/eee
+/ff
+/fff
+/gg
+/ggg
+/hh
+/hhh
+/ii
+/iii
+/jj
+/jjj
+/kk
+/kkk
+/ll
+/lll
+/A.alt
+/B.alt
+/C.alt
+/D.alt
+/E.alt
+/F.alt
+/G.alt
+/H.alt
+/I.alt
+/J.alt
+/K.alt
+/L.alt
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+/.notdef
+] def
diff --git a/Master/texmf-dist/fonts/enc/pdftex/context/koeieletters.enc b/Master/texmf-dist/fonts/enc/pdftex/context/koeieletters.enc
index 072fc8a507c..e6b0405ea73 100644
--- a/Master/texmf-dist/fonts/enc/pdftex/context/koeieletters.enc
+++ b/Master/texmf-dist/fonts/enc/pdftex/context/koeieletters.enc
@@ -19,7 +19,7 @@
/dotlessj
/grave
/acute
- /hacek
+ /caron
/breve
/hungarumlaut
/macron
diff --git a/Master/texmf-dist/fonts/map/pdftex/context/ec-public-lm.map b/Master/texmf-dist/fonts/map/pdftex/context/ec-public-lm.map
index d4640394fa4..9f21b710707 100644
--- a/Master/texmf-dist/fonts/map/pdftex/context/ec-public-lm.map
+++ b/Master/texmf-dist/fonts/map/pdftex/context/ec-public-lm.map
@@ -1,69 +1,3 @@
-ec-lmb10 LMRoman10-Demi "enclmec ReEncodeFont" <lm-ec.enc <lmb10.pfb
-ec-lmbo10 LMRoman10-DemiOblique "enclmec ReEncodeFont" <lm-ec.enc <lmbo10.pfb
-ec-lmbx10 LMRoman10-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx10.pfb
-ec-lmbx12 LMRoman12-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx12.pfb
-ec-lmbx5 LMRoman5-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx5.pfb
-ec-lmbx6 LMRoman6-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx6.pfb
-ec-lmbx7 LMRoman7-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx7.pfb
-ec-lmbx8 LMRoman8-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx8.pfb
-ec-lmbx9 LMRoman9-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmbx9.pfb
-ec-lmbxi10 LMRoman10-BoldItalic "enclmec ReEncodeFont" <lm-ec.enc <lmbxi10.pfb
-ec-lmbxo10 LMRoman10-BoldOblique "enclmec ReEncodeFont" <lm-ec.enc <lmbxo10.pfb
-ec-lmcsc10 LMRoman10-CapsRegular "enclmec ReEncodeFont" <lm-ec.enc <lmcsc10.pfb
-ec-lmcsco10 LMRoman10-CapsOblique "enclmec ReEncodeFont" <lm-ec.enc <lmcsco10.pfb
-ec-lmr10 LMRoman10-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr10.pfb
-ec-lmr12 LMRoman12-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr12.pfb
-ec-lmr17 LMRoman17-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr17.pfb
-ec-lmr5 LMRoman5-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr5.pfb
-ec-lmr6 LMRoman6-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr6.pfb
-ec-lmr7 LMRoman7-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr7.pfb
-ec-lmr8 LMRoman8-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr8.pfb
-ec-lmr9 LMRoman9-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmr9.pfb
-ec-lmri10 LMRoman10-Italic "enclmec ReEncodeFont" <lm-ec.enc <lmri10.pfb
-ec-lmri12 LMRoman12-Italic "enclmec ReEncodeFont" <lm-ec.enc <lmri12.pfb
-ec-lmri7 LMRoman7-Italic "enclmec ReEncodeFont" <lm-ec.enc <lmri7.pfb
-ec-lmri8 LMRoman8-Italic "enclmec ReEncodeFont" <lm-ec.enc <lmri8.pfb
-ec-lmri9 LMRoman9-Italic "enclmec ReEncodeFont" <lm-ec.enc <lmri9.pfb
-ec-lmro10 LMRoman10-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmro10.pfb
-ec-lmro12 LMRoman12-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmro12.pfb
-ec-lmro17 LMRoman17-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmro17.pfb
-ec-lmro8 LMRoman8-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmro8.pfb
-ec-lmro9 LMRoman9-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmro9.pfb
-ec-lmss10 LMSans10-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss10.pfb
-ec-lmss12 LMSans12-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss12.pfb
-ec-lmss17 LMSans17-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss17.pfb
-ec-lmss8 LMSans8-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss8.pfb
-ec-lmss9 LMSans9-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss9.pfb
-ec-lmssbo10 LMSans10-BoldOblique "enclmec ReEncodeFont" <lm-ec.enc <lmssbo10.pfb
-ec-lmssbx10 LMSans10-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmssbx10.pfb
-ec-lmssdc10 LMSans10-DemiCondensed "enclmec ReEncodeFont" <lm-ec.enc <lmssdc10.pfb
-ec-lmssdo10 LMSans10-DemiCondensedOblique "enclmec ReEncodeFont" <lm-ec.enc <lmssdo10.pfb
-ec-lmsso10 LMSans10-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmsso10.pfb
-ec-lmsso12 LMSans12-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmsso12.pfb
-ec-lmsso17 LMSans17-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmsso17.pfb
-ec-lmsso8 LMSans8-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmsso8.pfb
-ec-lmsso9 LMSans9-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmsso9.pfb
-ec-lmssq8 LMSansQuotation8-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmssq8.pfb
-ec-lmssqbo8 LMSansQuotation8-BoldOblique "enclmec ReEncodeFont" <lm-ec.enc <lmssqbo8.pfb
-ec-lmssqbx8 LMSansQuotation8-Bold "enclmec ReEncodeFont" <lm-ec.enc <lmssqbx8.pfb
-ec-lmssqo8 LMSansQuotation8-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmssqo8.pfb
-ec-lmtcsc10 LMTypewriter10-CapsRegular "enclmec ReEncodeFont" <lm-ec.enc <lmtcsc10.pfb
-ec-lmtcso10 LMTypewriter10-CapsOblique "enclmec ReEncodeFont" <lm-ec.enc <lmtcso10.pfb
-ec-lmtl10 LMTypewriter10-Light "enclmec ReEncodeFont" <lm-ec.enc <lmtl10.pfb
-ec-lmtlo10 LMTypewriter10-LightOblique "enclmec ReEncodeFont" <lm-ec.enc <lmtlo10.pfb
-ec-lmtlc10 LMTypewriter10-LightCondensed "enclmec ReEncodeFont" <lm-ec.enc <lmtlc10.pfb
-ec-lmtlco10 LMTypewriter10-LightCondensedOblique "enclmec ReEncodeFont" <lm-ec.enc <lmtlco10.pfb
-ec-lmtk10 LMTypewriter10-Dark "enclmec ReEncodeFont" <lm-ec.enc <lmtk10.pfb
-ec-lmtko10 LMTypewriter10-DarkOblique "enclmec ReEncodeFont" <lm-ec.enc <lmtko10.pfb
-ec-lmtt10 LMTypewriter10-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmtt10.pfb
-ec-lmtt12 LMTypewriter12-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmtt12.pfb
-ec-lmtt8 LMTypewriter8-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmtt8.pfb
-ec-lmtt9 LMTypewriter9-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmtt9.pfb
-ec-lmtti10 LMTypewriter10-Italic "enclmec ReEncodeFont" <lm-ec.enc <lmtti10.pfb
-ec-lmtto10 LMTypewriter10-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmtto10.pfb
-ec-lmvtt10 LMTypewriterVarWd10-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmvtt10.pfb
-ec-lmvtto10 LMTypewriterVarWd10-Oblique "enclmec ReEncodeFont" <lm-ec.enc <lmvtto10.pfb
-ec-lmvtl10 LMTypewriterVarWd10-Light "enclmec ReEncodeFont" <lm-ec.enc <lmvtl10.pfb
-ec-lmvtlo10 LMTypewriterVarWd10-LightOblique "enclmec ReEncodeFont" <lm-ec.enc <lmvtlo10.pfb
-ec-lmvtk10 LMTypewriterVarWd10-Dark "enclmec ReEncodeFont" <lm-ec.enc <lmvtk10.pfb
-ec-lmvtko10 LMTypewriterVarWd10-DarkOblique "enclmec ReEncodeFont" <lm-ec.enc <lmvtko10.pfb
+% Being an early adopter, we used this name for the map file. The first
+% latin modern font sets had *-lm.map which unfortunately was changed to
+% lm-*.map names.
diff --git a/Master/texmf-dist/fonts/map/pdftex/context/el-public-lm.map b/Master/texmf-dist/fonts/map/pdftex/context/el-public-lm.map
index f8b605afb43..9f21b710707 100644
--- a/Master/texmf-dist/fonts/map/pdftex/context/el-public-lm.map
+++ b/Master/texmf-dist/fonts/map/pdftex/context/el-public-lm.map
@@ -1,69 +1,3 @@
-el-lmb10 LMRoman10-Demi "enclmel ReEncodeFont" <lm-el.enc <lmb10.pfb
-el-lmbo10 LMRoman10-DemiOblique "enclmel ReEncodeFont" <lm-el.enc <lmbo10.pfb
-el-lmbx10 LMRoman10-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx10.pfb
-el-lmbx12 LMRoman12-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx12.pfb
-el-lmbx5 LMRoman5-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx5.pfb
-el-lmbx6 LMRoman6-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx6.pfb
-el-lmbx7 LMRoman7-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx7.pfb
-el-lmbx8 LMRoman8-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx8.pfb
-el-lmbx9 LMRoman9-Bold "enclmel ReEncodeFont" <lm-el.enc <lmbx9.pfb
-el-lmbxi10 LMRoman10-BoldItalic "enclmel ReEncodeFont" <lm-el.enc <lmbxi10.pfb
-el-lmbxo10 LMRoman10-BoldOblique "enclmel ReEncodeFont" <lm-el.enc <lmbxo10.pfb
-el-lmcsc10 LMRoman10-CapsRegular "enclmel ReEncodeFont" <lm-el.enc <lmcsc10.pfb
-el-lmcsco10 LMRoman10-CapsOblique "enclmel ReEncodeFont" <lm-el.enc <lmcsco10.pfb
-el-lmr10 LMRoman10-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr10.pfb
-el-lmr12 LMRoman12-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr12.pfb
-el-lmr17 LMRoman17-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr17.pfb
-el-lmr5 LMRoman5-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr5.pfb
-el-lmr6 LMRoman6-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr6.pfb
-el-lmr7 LMRoman7-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr7.pfb
-el-lmr8 LMRoman8-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr8.pfb
-el-lmr9 LMRoman9-Regular "enclmel ReEncodeFont" <lm-el.enc <lmr9.pfb
-el-lmri10 LMRoman10-Italic "enclmel ReEncodeFont" <lm-el.enc <lmri10.pfb
-el-lmri12 LMRoman12-Italic "enclmel ReEncodeFont" <lm-el.enc <lmri12.pfb
-el-lmri7 LMRoman7-Italic "enclmel ReEncodeFont" <lm-el.enc <lmri7.pfb
-el-lmri8 LMRoman8-Italic "enclmel ReEncodeFont" <lm-el.enc <lmri8.pfb
-el-lmri9 LMRoman9-Italic "enclmel ReEncodeFont" <lm-el.enc <lmri9.pfb
-el-lmro10 LMRoman10-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmro10.pfb
-el-lmro12 LMRoman12-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmro12.pfb
-el-lmro17 LMRoman17-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmro17.pfb
-el-lmro8 LMRoman8-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmro8.pfb
-el-lmro9 LMRoman9-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmro9.pfb
-el-lmss10 LMSans10-Regular "enclmel ReEncodeFont" <lm-el.enc <lmss10.pfb
-el-lmss12 LMSans12-Regular "enclmel ReEncodeFont" <lm-el.enc <lmss12.pfb
-el-lmss17 LMSans17-Regular "enclmel ReEncodeFont" <lm-el.enc <lmss17.pfb
-el-lmss8 LMSans8-Regular "enclmel ReEncodeFont" <lm-el.enc <lmss8.pfb
-el-lmss9 LMSans9-Regular "enclmel ReEncodeFont" <lm-el.enc <lmss9.pfb
-el-lmssbo10 LMSans10-BoldOblique "enclmel ReEncodeFont" <lm-el.enc <lmssbo10.pfb
-el-lmssbx10 LMSans10-Bold "enclmel ReEncodeFont" <lm-el.enc <lmssbx10.pfb
-el-lmssdc10 LMSans10-DemiCondensed "enclmel ReEncodeFont" <lm-el.enc <lmssdc10.pfb
-el-lmssdo10 LMSans10-DemiCondensedOblique "enclmel ReEncodeFont" <lm-el.enc <lmssdo10.pfb
-el-lmsso10 LMSans10-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmsso10.pfb
-el-lmsso12 LMSans12-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmsso12.pfb
-el-lmsso17 LMSans17-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmsso17.pfb
-el-lmsso8 LMSans8-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmsso8.pfb
-el-lmsso9 LMSans9-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmsso9.pfb
-el-lmssq8 LMSansQuotation8-Regular "enclmel ReEncodeFont" <lm-el.enc <lmssq8.pfb
-el-lmssqbo8 LMSansQuotation8-BoldOblique "enclmel ReEncodeFont" <lm-el.enc <lmssqbo8.pfb
-el-lmssqbx8 LMSansQuotation8-Bold "enclmel ReEncodeFont" <lm-el.enc <lmssqbx8.pfb
-el-lmssqo8 LMSansQuotation8-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmssqo8.pfb
-el-lmtcsc10 LMTypewriter10-CapsRegular "enclmel ReEncodeFont" <lm-el.enc <lmtcsc10.pfb
-el-lmtcso10 LMTypewriter10-CapsOblique "enclmel ReEncodeFont" <lm-el.enc <lmtcso10.pfb
-el-lmtl10 LMTypewriter10-Light "enclmel ReEncodeFont" <lm-el.enc <lmtl10.pfb
-el-lmtlo10 LMTypewriter10-LightOblique "enclmel ReEncodeFont" <lm-el.enc <lmtlo10.pfb
-el-lmtlc10 LMTypewriter10-LightCondensed "enclmel ReEncodeFont" <lm-el.enc <lmtlc10.pfb
-el-lmtlco10 LMTypewriter10-LightCondensedOblique "enclmel ReEncodeFont" <lm-el.enc <lmtlco10.pfb
-el-lmtk10 LMTypewriter10-Dark "enclmel ReEncodeFont" <lm-el.enc <lmtk10.pfb
-el-lmtko10 LMTypewriter10-DarkOblique "enclmel ReEncodeFont" <lm-el.enc <lmtko10.pfb
-el-lmtt10 LMTypewriter10-Regular "enclmel ReEncodeFont" <lm-el.enc <lmtt10.pfb
-el-lmtt12 LMTypewriter12-Regular "enclmel ReEncodeFont" <lm-el.enc <lmtt12.pfb
-el-lmtt8 LMTypewriter8-Regular "enclmel ReEncodeFont" <lm-el.enc <lmtt8.pfb
-el-lmtt9 LMTypewriter9-Regular "enclmel ReEncodeFont" <lm-el.enc <lmtt9.pfb
-el-lmtti10 LMTypewriter10-Italic "enclmel ReEncodeFont" <lm-el.enc <lmtti10.pfb
-el-lmtto10 LMTypewriter10-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmtto10.pfb
-el-lmvtt10 LMTypewriterVarWd10-Regular "enclmel ReEncodeFont" <lm-el.enc <lmvtt10.pfb
-el-lmvtto10 LMTypewriterVarWd10-Oblique "enclmel ReEncodeFont" <lm-el.enc <lmvtto10.pfb
-el-lmvtl10 LMTypewriterVarWd10-Light "enclmel ReEncodeFont" <lm-el.enc <lmvtl10.pfb
-el-lmvtlo10 LMTypewriterVarWd10-LightOblique "enclmel ReEncodeFont" <lm-el.enc <lmvtlo10.pfb
-el-lmvtk10 LMTypewriterVarWd10-Dark "enclmel ReEncodeFont" <lm-el.enc <lmvtk10.pfb
-el-lmvtko10 LMTypewriterVarWd10-DarkOblique "enclmel ReEncodeFont" <lm-el.enc <lmvtko10.pfb
+% Being an early adopter, we used this name for the map file. The first
+% latin modern font sets had *-lm.map which unfortunately was changed to
+% lm-*.map names.
diff --git a/Master/texmf-dist/fonts/map/pdftex/context/qx-public-lm.map b/Master/texmf-dist/fonts/map/pdftex/context/qx-public-lm.map
index d69d50d936c..9f21b710707 100644
--- a/Master/texmf-dist/fonts/map/pdftex/context/qx-public-lm.map
+++ b/Master/texmf-dist/fonts/map/pdftex/context/qx-public-lm.map
@@ -1,69 +1,3 @@
-qx-lmb10 LMRoman10-Demi "enclmqx ReEncodeFont" <lm-qx.enc <lmb10.pfb
-qx-lmbo10 LMRoman10-DemiOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmbo10.pfb
-qx-lmbx10 LMRoman10-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx10.pfb
-qx-lmbx12 LMRoman12-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx12.pfb
-qx-lmbx5 LMRoman5-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx5.pfb
-qx-lmbx6 LMRoman6-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx6.pfb
-qx-lmbx7 LMRoman7-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx7.pfb
-qx-lmbx8 LMRoman8-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx8.pfb
-qx-lmbx9 LMRoman9-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmbx9.pfb
-qx-lmbxi10 LMRoman10-BoldItalic "enclmqx ReEncodeFont" <lm-qx.enc <lmbxi10.pfb
-qx-lmbxo10 LMRoman10-BoldOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmbxo10.pfb
-qx-lmcsc10 LMRoman10-CapsRegular "enclmqx ReEncodeFont" <lm-qx.enc <lmcsc10.pfb
-qx-lmcsco10 LMRoman10-CapsOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmcsco10.pfb
-qx-lmr10 LMRoman10-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr10.pfb
-qx-lmr12 LMRoman12-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr12.pfb
-qx-lmr17 LMRoman17-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr17.pfb
-qx-lmr5 LMRoman5-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr5.pfb
-qx-lmr6 LMRoman6-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr6.pfb
-qx-lmr7 LMRoman7-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr7.pfb
-qx-lmr8 LMRoman8-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr8.pfb
-qx-lmr9 LMRoman9-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmr9.pfb
-qx-lmri10 LMRoman10-Italic "enclmqx ReEncodeFont" <lm-qx.enc <lmri10.pfb
-qx-lmri12 LMRoman12-Italic "enclmqx ReEncodeFont" <lm-qx.enc <lmri12.pfb
-qx-lmri7 LMRoman7-Italic "enclmqx ReEncodeFont" <lm-qx.enc <lmri7.pfb
-qx-lmri8 LMRoman8-Italic "enclmqx ReEncodeFont" <lm-qx.enc <lmri8.pfb
-qx-lmri9 LMRoman9-Italic "enclmqx ReEncodeFont" <lm-qx.enc <lmri9.pfb
-qx-lmro10 LMRoman10-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmro10.pfb
-qx-lmro12 LMRoman12-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmro12.pfb
-qx-lmro17 LMRoman17-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmro17.pfb
-qx-lmro8 LMRoman8-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmro8.pfb
-qx-lmro9 LMRoman9-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmro9.pfb
-qx-lmss10 LMSans10-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmss10.pfb
-qx-lmss12 LMSans12-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmss12.pfb
-qx-lmss17 LMSans17-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmss17.pfb
-qx-lmss8 LMSans8-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmss8.pfb
-qx-lmss9 LMSans9-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmss9.pfb
-qx-lmssbo10 LMSans10-BoldOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmssbo10.pfb
-qx-lmssbx10 LMSans10-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmssbx10.pfb
-qx-lmssdc10 LMSans10-DemiCondensed "enclmqx ReEncodeFont" <lm-qx.enc <lmssdc10.pfb
-qx-lmssdo10 LMSans10-DemiCondensedOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmssdo10.pfb
-qx-lmsso10 LMSans10-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmsso10.pfb
-qx-lmsso12 LMSans12-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmsso12.pfb
-qx-lmsso17 LMSans17-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmsso17.pfb
-qx-lmsso8 LMSans8-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmsso8.pfb
-qx-lmsso9 LMSans9-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmsso9.pfb
-qx-lmssq8 LMSansQuotation8-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmssq8.pfb
-qx-lmssqbo8 LMSansQuotation8-BoldOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmssqbo8.pfb
-qx-lmssqbx8 LMSansQuotation8-Bold "enclmqx ReEncodeFont" <lm-qx.enc <lmssqbx8.pfb
-qx-lmssqo8 LMSansQuotation8-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmssqo8.pfb
-qx-lmtcsc10 LMTypewriter10-CapsRegular "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtcsc10.pfb
-qx-lmtcso10 LMTypewriter10-CapsOblique "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtcso10.pfb
-qx-lmtl10 LMTypewriter10-Light "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtl10.pfb
-qx-lmtlo10 LMTypewriter10-LightOblique "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtlo10.pfb
-qx-lmtlc10 LMTypewriter10-LightCondensed "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtlc10.pfb
-qx-lmtlco10 LMTypewriter10-LightCondensedOblique "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtlco10.pfb
-qx-lmtk10 LMTypewriter10-Dark "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtk10.pfb
-qx-lmtko10 LMTypewriter10-DarkOblique "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtko10.pfb
-qx-lmtt10 LMTypewriter10-Regular "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtt10.pfb
-qx-lmtt12 LMTypewriter12-Regular "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtt12.pfb
-qx-lmtt8 LMTypewriter8-Regular "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtt8.pfb
-qx-lmtt9 LMTypewriter9-Regular "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtt9.pfb
-qx-lmtti10 LMTypewriter10-Italic "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtti10.pfb
-qx-lmtto10 LMTypewriter10-Oblique "enclmqxtt ReEncodeFont" <lm-qxtt.enc <lmtto10.pfb
-qx-lmvtt10 LMTypewriterVarWd10-Regular "enclmqx ReEncodeFont" <lm-qx.enc <lmvtt10.pfb
-qx-lmvtto10 LMTypewriterVarWd10-Oblique "enclmqx ReEncodeFont" <lm-qx.enc <lmvtto10.pfb
-qx-lmvtl10 LMTypewriterVarWd10-Light "enclmqx ReEncodeFont" <lm-qx.enc <lmvtl10.pfb
-qx-lmvtlo10 LMTypewriterVarWd10-LightOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmvtlo10.pfb
-qx-lmvtk10 LMTypewriterVarWd10-Dark "enclmqx ReEncodeFont" <lm-qx.enc <lmvtk10.pfb
-qx-lmvtko10 LMTypewriterVarWd10-DarkOblique "enclmqx ReEncodeFont" <lm-qx.enc <lmvtko10.pfb
+% Being an early adopter, we used this name for the map file. The first
+% latin modern font sets had *-lm.map which unfortunately was changed to
+% lm-*.map names.
diff --git a/Master/texmf-dist/fonts/map/pdftex/context/t5-public-lm.map b/Master/texmf-dist/fonts/map/pdftex/context/t5-public-lm.map
index 0e626d7e424..9f21b710707 100644
--- a/Master/texmf-dist/fonts/map/pdftex/context/t5-public-lm.map
+++ b/Master/texmf-dist/fonts/map/pdftex/context/t5-public-lm.map
@@ -1,69 +1,3 @@
-t5-lmb10 LMRoman10-Demi "enclmt5 ReEncodeFont" <lm-t5.enc <lmb10.pfb
-t5-lmbo10 LMRoman10-DemiOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmbo10.pfb
-t5-lmbx10 LMRoman10-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx10.pfb
-t5-lmbx12 LMRoman12-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx12.pfb
-t5-lmbx5 LMRoman5-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx5.pfb
-t5-lmbx6 LMRoman6-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx6.pfb
-t5-lmbx7 LMRoman7-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx7.pfb
-t5-lmbx8 LMRoman8-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx8.pfb
-t5-lmbx9 LMRoman9-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmbx9.pfb
-t5-lmbxi10 LMRoman10-BoldItalic "enclmt5 ReEncodeFont" <lm-t5.enc <lmbxi10.pfb
-t5-lmbxo10 LMRoman10-BoldOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmbxo10.pfb
-t5-lmcsc10 LMRoman10-CapsRegular "enclmt5 ReEncodeFont" <lm-t5.enc <lmcsc10.pfb
-t5-lmcsco10 LMRoman10-CapsOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmcsco10.pfb
-t5-lmr10 LMRoman10-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr10.pfb
-t5-lmr12 LMRoman12-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr12.pfb
-t5-lmr17 LMRoman17-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr17.pfb
-t5-lmr5 LMRoman5-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr5.pfb
-t5-lmr6 LMRoman6-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr6.pfb
-t5-lmr7 LMRoman7-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr7.pfb
-t5-lmr8 LMRoman8-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr8.pfb
-t5-lmr9 LMRoman9-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmr9.pfb
-t5-lmri10 LMRoman10-Italic "enclmt5 ReEncodeFont" <lm-t5.enc <lmri10.pfb
-t5-lmri12 LMRoman12-Italic "enclmt5 ReEncodeFont" <lm-t5.enc <lmri12.pfb
-t5-lmri7 LMRoman7-Italic "enclmt5 ReEncodeFont" <lm-t5.enc <lmri7.pfb
-t5-lmri8 LMRoman8-Italic "enclmt5 ReEncodeFont" <lm-t5.enc <lmri8.pfb
-t5-lmri9 LMRoman9-Italic "enclmt5 ReEncodeFont" <lm-t5.enc <lmri9.pfb
-t5-lmro10 LMRoman10-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmro10.pfb
-t5-lmro12 LMRoman12-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmro12.pfb
-t5-lmro17 LMRoman17-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmro17.pfb
-t5-lmro8 LMRoman8-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmro8.pfb
-t5-lmro9 LMRoman9-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmro9.pfb
-t5-lmss10 LMSans10-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmss10.pfb
-t5-lmss12 LMSans12-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmss12.pfb
-t5-lmss17 LMSans17-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmss17.pfb
-t5-lmss8 LMSans8-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmss8.pfb
-t5-lmss9 LMSans9-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmss9.pfb
-t5-lmssbo10 LMSans10-BoldOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmssbo10.pfb
-t5-lmssbx10 LMSans10-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmssbx10.pfb
-t5-lmssdc10 LMSans10-DemiCondensed "enclmt5 ReEncodeFont" <lm-t5.enc <lmssdc10.pfb
-t5-lmssdo10 LMSans10-DemiCondensedOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmssdo10.pfb
-t5-lmsso10 LMSans10-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmsso10.pfb
-t5-lmsso12 LMSans12-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmsso12.pfb
-t5-lmsso17 LMSans17-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmsso17.pfb
-t5-lmsso8 LMSans8-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmsso8.pfb
-t5-lmsso9 LMSans9-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmsso9.pfb
-t5-lmssq8 LMSansQuotation8-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmssq8.pfb
-t5-lmssqbo8 LMSansQuotation8-BoldOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmssqbo8.pfb
-t5-lmssqbx8 LMSansQuotation8-Bold "enclmt5 ReEncodeFont" <lm-t5.enc <lmssqbx8.pfb
-t5-lmssqo8 LMSansQuotation8-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmssqo8.pfb
-t5-lmtcsc10 LMTypewriter10-CapsRegular "enclmt5 ReEncodeFont" <lm-t5.enc <lmtcsc10.pfb
-t5-lmtcso10 LMTypewriter10-CapsOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmtcso10.pfb
-t5-lmtl10 LMTypewriter10-Light "enclmt5 ReEncodeFont" <lm-t5.enc <lmtl10.pfb
-t5-lmtlo10 LMTypewriter10-LightOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmtlo10.pfb
-t5-lmtlc10 LMTypewriter10-LightCondensed "enclmt5 ReEncodeFont" <lm-t5.enc <lmtlc10.pfb
-t5-lmtlco10 LMTypewriter10-LightCondensedOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmtlco10.pfb
-t5-lmtk10 LMTypewriter10-Dark "enclmt5 ReEncodeFont" <lm-t5.enc <lmtk10.pfb
-t5-lmtko10 LMTypewriter10-DarkOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmtko10.pfb
-t5-lmtt10 LMTypewriter10-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmtt10.pfb
-t5-lmtt12 LMTypewriter12-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmtt12.pfb
-t5-lmtt8 LMTypewriter8-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmtt8.pfb
-t5-lmtt9 LMTypewriter9-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmtt9.pfb
-t5-lmtti10 LMTypewriter10-Italic "enclmt5 ReEncodeFont" <lm-t5.enc <lmtti10.pfb
-t5-lmtto10 LMTypewriter10-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmtto10.pfb
-t5-lmvtt10 LMTypewriterVarWd10-Regular "enclmt5 ReEncodeFont" <lm-t5.enc <lmvtt10.pfb
-t5-lmvtto10 LMTypewriterVarWd10-Oblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmvtto10.pfb
-t5-lmvtl10 LMTypewriterVarWd10-Light "enclmt5 ReEncodeFont" <lm-t5.enc <lmvtl10.pfb
-t5-lmvtlo10 LMTypewriterVarWd10-LightOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmvtlo10.pfb
-t5-lmvtk10 LMTypewriterVarWd10-Dark "enclmt5 ReEncodeFont" <lm-t5.enc <lmvtk10.pfb
-t5-lmvtko10 LMTypewriterVarWd10-DarkOblique "enclmt5 ReEncodeFont" <lm-t5.enc <lmvtko10.pfb
+% Being an early adopter, we used this name for the map file. The first
+% latin modern font sets had *-lm.map which unfortunately was changed to
+% lm-*.map names.
diff --git a/Master/texmf-dist/fonts/map/pdftex/context/texnansi-public-lm.map b/Master/texmf-dist/fonts/map/pdftex/context/texnansi-public-lm.map
index af810611512..9f21b710707 100644
--- a/Master/texmf-dist/fonts/map/pdftex/context/texnansi-public-lm.map
+++ b/Master/texmf-dist/fonts/map/pdftex/context/texnansi-public-lm.map
@@ -1,69 +1,3 @@
-texnansi-lmb10 LMRoman10-Demi "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmb10.pfb
-texnansi-lmbo10 LMRoman10-DemiOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbo10.pfb
-texnansi-lmbx10 LMRoman10-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx10.pfb
-texnansi-lmbx12 LMRoman12-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx12.pfb
-texnansi-lmbx5 LMRoman5-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx5.pfb
-texnansi-lmbx6 LMRoman6-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx6.pfb
-texnansi-lmbx7 LMRoman7-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx7.pfb
-texnansi-lmbx8 LMRoman8-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx8.pfb
-texnansi-lmbx9 LMRoman9-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbx9.pfb
-texnansi-lmbxi10 LMRoman10-BoldItalic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbxi10.pfb
-texnansi-lmbxo10 LMRoman10-BoldOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmbxo10.pfb
-texnansi-lmcsc10 LMRoman10-CapsRegular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmcsc10.pfb
-texnansi-lmcsco10 LMRoman10-CapsOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmcsco10.pfb
-texnansi-lmr10 LMRoman10-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr10.pfb
-texnansi-lmr12 LMRoman12-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr12.pfb
-texnansi-lmr17 LMRoman17-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr17.pfb
-texnansi-lmr5 LMRoman5-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr5.pfb
-texnansi-lmr6 LMRoman6-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr6.pfb
-texnansi-lmr7 LMRoman7-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr7.pfb
-texnansi-lmr8 LMRoman8-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr8.pfb
-texnansi-lmr9 LMRoman9-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmr9.pfb
-texnansi-lmri10 LMRoman10-Italic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmri10.pfb
-texnansi-lmri12 LMRoman12-Italic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmri12.pfb
-texnansi-lmri7 LMRoman7-Italic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmri7.pfb
-texnansi-lmri8 LMRoman8-Italic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmri8.pfb
-texnansi-lmri9 LMRoman9-Italic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmri9.pfb
-texnansi-lmro10 LMRoman10-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmro10.pfb
-texnansi-lmro12 LMRoman12-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmro12.pfb
-texnansi-lmro17 LMRoman17-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmro17.pfb
-texnansi-lmro8 LMRoman8-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmro8.pfb
-texnansi-lmro9 LMRoman9-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmro9.pfb
-texnansi-lmss10 LMSans10-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmss10.pfb
-texnansi-lmss12 LMSans12-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmss12.pfb
-texnansi-lmss17 LMSans17-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmss17.pfb
-texnansi-lmss8 LMSans8-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmss8.pfb
-texnansi-lmss9 LMSans9-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmss9.pfb
-texnansi-lmssbo10 LMSans10-BoldOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssbo10.pfb
-texnansi-lmssbx10 LMSans10-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssbx10.pfb
-texnansi-lmssdc10 LMSans10-DemiCondensed "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssdc10.pfb
-texnansi-lmssdo10 LMSans10-DemiCondensedOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssdo10.pfb
-texnansi-lmsso10 LMSans10-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmsso10.pfb
-texnansi-lmsso12 LMSans12-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmsso12.pfb
-texnansi-lmsso17 LMSans17-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmsso17.pfb
-texnansi-lmsso8 LMSans8-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmsso8.pfb
-texnansi-lmsso9 LMSans9-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmsso9.pfb
-texnansi-lmssq8 LMSansQuotation8-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssq8.pfb
-texnansi-lmssqbo8 LMSansQuotation8-BoldOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssqbo8.pfb
-texnansi-lmssqbx8 LMSansQuotation8-Bold "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssqbx8.pfb
-texnansi-lmssqo8 LMSansQuotation8-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmssqo8.pfb
-texnansi-lmtcsc10 LMTypewriter10-CapsRegular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtcsc10.pfb
-texnansi-lmtcso10 LMTypewriter10-CapsOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtcso10.pfb
-texnansi-lmtl10 LMTypewriter10-Light "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtl10.pfb
-texnansi-lmtlo10 LMTypewriter10-LightOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtlo10.pfb
-texnansi-lmtlc10 LMTypewriter10-LightCondensed "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtlc10.pfb
-texnansi-lmtlco10 LMTypewriter10-LightCondensedOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtlco10.pfb
-texnansi-lmtk10 LMTypewriter10-Dark "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtk10.pfb
-texnansi-lmtko10 LMTypewriter10-DarkOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtko10.pfb
-texnansi-lmtt10 LMTypewriter10-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtt10.pfb
-texnansi-lmtt12 LMTypewriter12-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtt12.pfb
-texnansi-lmtt8 LMTypewriter8-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtt8.pfb
-texnansi-lmtt9 LMTypewriter9-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtt9.pfb
-texnansi-lmtti10 LMTypewriter10-Italic "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtti10.pfb
-texnansi-lmtto10 LMTypewriter10-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmtto10.pfb
-texnansi-lmvtt10 LMTypewriterVarWd10-Regular "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmvtt10.pfb
-texnansi-lmvtto10 LMTypewriterVarWd10-Oblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmvtto10.pfb
-texnansi-lmvtl10 LMTypewriterVarWd10-Light "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmvtl10.pfb
-texnansi-lmvtlo10 LMTypewriterVarWd10-LightOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmvtlo10.pfb
-texnansi-lmvtk10 LMTypewriterVarWd10-Dark "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmvtk10.pfb
-texnansi-lmvtko10 LMTypewriterVarWd10-DarkOblique "enclmtexnansi ReEncodeFont" <lm-texnansi.enc <lmvtko10.pfb
+% Being an early adopter, we used this name for the map file. The first
+% latin modern font sets had *-lm.map which unfortunately was changed to
+% lm-*.map names.
diff --git a/Master/texmf-dist/metapost/context/base/mp-form.mp b/Master/texmf-dist/metapost/context/base/mp-form.mp
index bad87651c17..a65ab6d7374 100644
--- a/Master/texmf-dist/metapost/context/base/mp-form.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-form.mp
@@ -1,58 +1,58 @@
-% Hans Hagen / October 2000
+% Hans Hagen / October 2000
%
-% This file is mostly a copy from the file format.mp, that
-% comes with MetaPost and is written by John Hobby. This file
-% is meant to be compatible, but has a few more features,
-% controlled by the variables:
+% This file is mostly a copy from the file format.mp, that
+% comes with MetaPost and is written by John Hobby. This file
+% is meant to be compatible, but has a few more features,
+% controlled by the variables:
%
% fmt_initialize when false, initialization is skipped
% fmt_precision the default accuracy (default=3)
% fmt_separator the pattern separator (default=%)
-% fmt_zerocheck activate extra sci notation zero check
+% fmt_zerocheck activate extra sci notation zero check
%
% instead of a picture, one can format a number in a for TeX
% acceptable input string
-boolean mant_font ; mant_font := true ; % signals graph not to load form
+boolean mant_font ; mant_font := true ; % signals graph not to load form
-if known fmt_loaded : expandafter endinput fi ;
+if known fmt_loaded : expandafter endinput fi ;
boolean fmt_loaded ; fmt_loaded := true ;
-if unknown fmt_precision :
- numeric fmt_precision ; fmt_precision := 3 ;
+if unknown fmt_precision :
+ numeric fmt_precision ; fmt_precision := 3 ;
fi ;
-if unknown fmt_initialize :
- boolean fmt_initialize ; fmt_initialize := true ;
-fi ;
+if unknown fmt_initialize :
+ boolean fmt_initialize ; fmt_initialize := true ;
+fi ;
-if unknown fmt_separator :
- string fmt_separator ; fmt_separator := "%" ;
-fi ;
+if unknown fmt_separator :
+ string fmt_separator ; fmt_separator := "%" ;
+fi ;
-if unknown fmt_zerocheck :
- boolean fmt_zerocheck ; fmt_zerocheck := false ;
-fi ;
+if unknown fmt_zerocheck :
+ boolean fmt_zerocheck ; fmt_zerocheck := false ;
+fi ;
-boolean fmt_metapost ; fmt_metapost := true ; % == use old method
+boolean fmt_metapost ; fmt_metapost := true ; % == use old method
-% As said, all clever code is from John, the more stupid
-% extensions are mine. The following string variables are
-% responsible for the TeX formatting.
+% As said, all clever code is from John, the more stupid
+% extensions are mine. The following string variables are
+% responsible for the TeX formatting.
-% TeX specs when using TeX instead of pseudo TeX.
+% TeX specs when using TeX instead of pseudo TeX.
-string sFebraise_ ; sFebraise_ := "{" ;
-string sFeeraise_ ; sFeeraise_ := "}" ;
-string sFebmath_ ; sFebmath_ := "$" ;
-string sFeemath_ ; sFeemath_ := "$" ;
+string sFebraise_ ; sFebraise_ := "{" ;
+string sFeeraise_ ; sFeeraise_ := "}" ;
+string sFebmath_ ; sFebmath_ := "$" ;
+string sFeemath_ ; sFeemath_ := "$" ;
-string sFmneg_ ; sFmneg_ := "-" ;
-string sFemarker_ ; sFemarker_ := "{\times}10^" ;
-string sFeneg_ ; sFeneg_ := "-" ;
-string sFe_plus ; sFe_plus := "" ; % "+"
+string sFmneg_ ; sFmneg_ := "-" ;
+string sFemarker_ ; sFemarker_ := "{\times}10^" ;
+string sFeneg_ ; sFeneg_ := "-" ;
+string sFe_plus ; sFe_plus := "" ; % "+"
-def sFe_base = Fline_up_("1", sFemarker_) enddef ;
+def sFe_base = Fline_up_("1", sFemarker_) enddef ;
% Macros for generating typeset pictures of computed numbers
%
@@ -64,19 +64,19 @@ def sFe_base = Fline_up_("1", sFemarker_) enddef ;
% Fe_plus plus sign if any for typesetting positive exponents
% Ten_to[] powers of ten for indices 0,1,2,3,4
%
-% New are:
+% New are:
%
% formatstr(f,x) TeX string representing x using format f
% Mformatstr(f,x) like Mformatstr, but x is in Mlog form
% Other than the above-documented user interface, all
-% externally visible names start with F and end with _.
+% externally visible names start with F and end with _.
% Allow big numbers in token lists
-begingroup interim warningcheck := 0 ;
+begingroup interim warningcheck := 0 ;
-%%% Load auxiliary macros.
+%%% Load auxiliary macros.
input string
input marith
@@ -87,24 +87,24 @@ picture Fmneg_, Femarker_, Feneg_, Fe_base, Fe_plus ;
string Fmfont_, Fefont_ ;
numeric Fmscale_, Fescale_, Feraise_ ;
-% Argument
+% Argument
%
% s is a leading minus sign
% m is a 1-digit mantissa
-% x is whatever follows the mantissa
-% sn is a leading minus for the exponent, and
-% e is a 1-digit exponent.
-%
+% x is whatever follows the mantissa
+% sn is a leading minus for the exponent, and
+% e is a 1-digit exponent.
+%
% Numbers in scientific notation are constructed by placing
% these pieces side-by-side; decimal numbers use only m
% and/or s. To get exponents with leading plus signs, assign
% to Fe_plus after calling init_numbers. To do something
% special with a unit mantissa followed by x, assign to
-% Fe_base after calling init_numbers.
+% Fe_base after calling init_numbers.
-vardef init_numbers(expr s, m, x, sn, e) =
+vardef init_numbers(expr s, m, x, sn, e) =
Fmneg_ := s ;
- for p within m :
+ for p within m :
Fmfont_ := fontpart p ;
Fmscale_ := xxpart p ;
exitif true ;
@@ -117,34 +117,34 @@ vardef init_numbers(expr s, m, x, sn, e) =
Feraise_ := ypart llcorner p ;
exitif true ;
endfor
- if fmt_metapost :
+ if fmt_metapost :
Fe_base := Fline_up_("1" infont Fmfont_ scaled Fmscale_, Femarker_) ;
- % else :
+ % else :
% sFe_base := Fline_up_("1", sFemarker_) ;
- fi ;
+ fi ;
Fe_plus := nullpicture ;
enddef ;
%%% Low-Level Typesetting %%%
vardef Fmant_(expr x) = %%% adapted by HH %%%
- if fmt_metapost :
+ if fmt_metapost :
(decimal abs x infont Fmfont_ scaled Fmscale_)
- else :
- (decimal abs x)
- fi
+ else :
+ (decimal abs x)
+ fi
enddef ;
vardef Fexp_(expr x) = %%% adapted by HH %%%
- if fmt_metapost :
+ if fmt_metapost :
(decimal x infont Fefont_ scaled Fescale_ shifted (0,Feraise_))
- else :
- (decimal x)
- fi
+ else :
+ (decimal x)
+ fi
enddef ;
vardef Fline_up_(text t_) = %%% adapted by HH %%%
- if fmt_metapost :
+ if fmt_metapost :
save p_, c_ ;
picture p_ ; p_ = nullpicture ;
pair c_ ; c_ = (0,0) ;
@@ -154,63 +154,69 @@ vardef Fline_up_(text t_) = %%% adapted by HH %%%
c_ := (xpart lrcorner p_, 0) ;
endfor
p_
- else :
- "" for q_ = t_ : & q_ endfor
- fi
+ else :
+ "" for q_ = t_ : & q_ endfor
+ fi
enddef ;
vardef Fdec_o_(expr x) = %%% adapted by HH %%%
- if x<0 :
+ if x<0 :
Fline_up_(if fmt_metapost : Fmneg_ else : sFmneg_ fi, Fmant_(x))
- else :
+ else :
Fmant_(x)
fi
enddef ;
vardef Fsci_o_(expr x, e) = %%% adapted by HH %%%
- if fmt_metapost :
+ if fmt_metapost :
Fline_up_
(if x < 0 : Fmneg_,fi
if abs x = 1 : Fe_base else : Fmant_(x), Femarker_ fi,
if e < 0 : Feneg_ else : Fe_plus fi,
- Fexp_(abs e))
- else :
+ Fexp_(abs e))
+ else :
Fline_up_
(if x < 0 : sFmneg_, fi
if abs x = 1 : sFe_base else : Fmant_(x), sFemarker_ fi,
- sFebraise_,
+ sFebraise_,
if e < 0 : sFeneg_ else : sFe_plus fi,
- Fexp_(abs e),
+ Fexp_(abs e),
sFeeraise_)
- fi
+ fi
enddef ;
% Assume prologues=1 implies troff mode. TeX users who want
% prologues on should use some other positive value. The mpx
-% file mechanism requires separate input files here.
+% file mechanism requires separate input files here.
+%
+% if fmt_initialize : %%% adapted by HH
+% if prologues = 1 : input troffnum else : input texnum fi
+% fi ;
+%
+% wrong assumption, so we need:
-if fmt_initialize : %%% adapted by HH
- if prologues = 1 : input troffnum else : input texnum fi
+if fmt_initialize :
+ input texnum ;
fi ;
%%% Scaling and Rounding %%%
% Find a pair p where x = xpart p*10**ypart p and either p =
% (0,0) or xpart p is between 1000 and 9999.99999. This is
-% the `exponent form' of x.
+% the `exponent form' of x.
-vardef Feform_(expr x) =
+vardef Feform_(expr x) =
interim warningcheck := 0 ;
if string x :
Meform(Mlog_str x)
else :
save b, e ;
b = x ; e = 0 ;
- if abs b >= 10000 :
+ if abs b >= 10000 :
(b/10, 1)
- elseif b = 0 :
+ elseif b = 0 :
origin
- else :
+ else :
forever :
exitif abs b >= 1000 ;
b := b*10 ; e := e-1 ;
@@ -223,16 +229,16 @@ enddef ;
% The marith.mp macros include a similar macro Meform that
% converts from `Mlog form' to exponent form. In case
% rounding has made the xpart of an exponent form number too
-% large, fix it.
+% large, fix it.
-vardef Feadj_(expr x, y) =
+vardef Feadj_(expr x, y) =
if abs x >= 10000 : (x/10, y+1) else : (x,y) fi
enddef ;
% Round x to d places right of the decimal point. When d<0,
-% round to the nearest multiple of 10 to the -d.
+% round to the nearest multiple of 10 to the -d.
-vardef roundd(expr x, d) =
+vardef roundd(expr x, d) =
if abs d > 4 :
if d > 0 : x else : 0 fi
elseif d > 0 :
@@ -243,23 +249,23 @@ vardef roundd(expr x, d) =
fi
enddef ;
-Ten_to0 = 1 ;
-Ten_to1 = 10 ;
-Ten_to2 = 100 ;
-Ten_to3 = 1000 ;
+Ten_to0 = 1 ;
+Ten_to1 = 10 ;
+Ten_to2 = 100 ;
+Ten_to3 = 1000 ;
Ten_to4 = 10000 ;
-% Round an exponent form number p to k significant figures.
+% Round an exponent form number p to k significant figures.
-primarydef p Fprec_ k =
- Feadj_(roundd(xpart p,k-4), ypart p)
+primarydef p Fprec_ k =
+ Feadj_(roundd(xpart p,k-4), ypart p)
enddef ;
% Round an exponent form number p to k digits right of the
-% decimal point.
+% decimal point.
-primarydef p Fdigs_ k =
- Feadj_(roundd(xpart p,k+ypart p), ypart p)
+primarydef p Fdigs_ k =
+ Feadj_(roundd(xpart p,k+ypart p), ypart p)
enddef ;
%%% High-Level Routines %%%
@@ -267,30 +273,30 @@ enddef ;
% The following operators convert z from exponent form and
% produce typeset output: Formsci_ generates scientific
% notation; Formdec_ generates decimal notation; and
-% Formgen_ generates whatever is likely to be most compact.
+% Formgen_ generates whatever is likely to be most compact.
vardef Formsci_(expr z) = %%% adapted by HH %%%
- if fmt_zerocheck and (z = origin) :
- Fsci_o_(0,0)
- else :
- Fsci_o_(xpart z/1000, ypart z + 3)
- fi
+ if fmt_zerocheck and (z = origin) :
+ Fsci_o_(0,0)
+ else :
+ Fsci_o_(xpart z/1000, ypart z + 3)
+ fi
enddef ;
-vardef Formdec_(expr z) =
- if ypart z > 0 :
+vardef Formdec_(expr z) =
+ if ypart z > 0 :
Formsci_(z)
else :
Fdec_o_
- (xpart z if ypart z >= -4 :
+ (xpart z if ypart z >= -4 :
/Ten_to[-ypart z]
- else :
- for i = ypart z upto -5 : /(10) endfor /10000
+ else :
+ for i = ypart z upto -5 : /(10) endfor /10000
fi)
fi
enddef ;
-vardef Formgen_(expr q) =
+vardef Formgen_(expr q) =
clearxy ; (x,y) = q ;
if x = 0 : Formdec_
elseif y >= -6 : Formdec_
@@ -299,17 +305,17 @@ vardef Formgen_(expr q) =
enddef ;
def Fset_item_(expr s) = %%% adapted by HH %%%
- if s <> "" :
+ if s <> "" :
if fmt_metapost :
s infont defaultfont scaled defaultscale,
- else :
- s,
- fi
- fi
+ else :
+ s,
+ fi
+ fi
enddef ;
% For each format letter, the table below tells how to
-% round and typeset a quantity z in exponent form.
+% round and typeset a quantity z in exponent form.
%
% e scientific, p significant figures
% p decimal, p digits right of the point
@@ -318,80 +324,80 @@ enddef ;
string fmt_[] ;
-fmt_[ASCII "e"] = "Formsci_(z Fprec_ p)" ;
+fmt_[ASCII "e"] = "Formsci_(z Fprec_ p)" ;
fmt_[ASCII "f"] = "Formdec_(z Fdigs_ p)" ;
-fmt_[ASCII "g"] = "Formgen_(z Fprec_ p)" ;
-fmt_[ASCII "G"] = "Formgen_(z Fdigs_ p)" ;
+fmt_[ASCII "g"] = "Formgen_(z Fprec_ p)" ;
+fmt_[ASCII "G"] = "Formgen_(z Fdigs_ p)" ;
% The format and Mformat macros take a format string f and
% generate typeset output for a numeric quantity x. String f
% should contain a `%' followed by an optional number and one
% of the format letters defined above. The number should be
-% an integer giving the precision (default 3).
+% an integer giving the precision (default 3).
vardef isfmtseparator primary c = %%% added by HH %%%
- ((c <> fmt_separator) and (c <> "%"))
-enddef ;
+ ((c <> fmt_separator) and (c <> "%"))
+enddef ;
-def initialize_form_numbers =
+def initialize_form_numbers =
initialize_numbers ; % in context: do_initialize_numbers ;
enddef ;
vardef dofmt_@#(expr f, x) = %%% adapted by HH %%%
- initialize_form_numbers ;
- if f = "" :
- if fmt_metapost : nullpicture else : "" fi
+ initialize_form_numbers ;
+ if f = "" :
+ if fmt_metapost : nullpicture else : "" fi
else :
interim warningcheck := 0 ;
save k, l, s, p, z ;
pair z ; z = @#(x) ;
- % the next adaption is okay
+ % the next adaption is okay
% k = 1 + cspan(f, fmt_separator <> ) ;
- % but best is to support both % and fmt_separator
+ % but best is to support both % and fmt_separator
k = 1 + cspan(f, isfmtseparator) ;
- %
+ %
l-k = cspan(substring(k,infinity) of f, isdigit) ;
- p = if l > k :
- scantokens substring(k,l) of f
- else :
- fmt_precision
+ p = if l > k :
+ scantokens substring(k,l) of f
+ else :
+ fmt_precision
fi ;
string s ; s = fmt_[ASCII substring (l,l+1) of f] ;
if unknown s :
- if k <= length f :
- errmessage("No valid format letter found in "&f) ;
+ if k <= length f :
+ errmessage("No valid format letter found in "&f) ;
fi
s = if fmt_metapost : "nullpicture" else : "" fi ;
fi
Fline_up_
(Fset_item_(substring (0,k-1) of f)
- if not fmt_metapost : sFebmath_, fi
+ if not fmt_metapost : sFebmath_, fi
scantokens s,
- if not fmt_metapost : sFeemath_, fi
+ if not fmt_metapost : sFeemath_, fi
Fset_item_(substring (l+1,infinity) of f)
- if fmt_metapost : nullpicture else : "" fi)
+ if fmt_metapost : nullpicture else : "" fi)
fi
- hide (fmt_metapost := true)
+ hide (fmt_metapost := true)
enddef ;
-%%% so far %%%
+%%% so far %%%
-vardef format (expr f, x) =
- fmt_metapost := true ; dofmt_.Feform_(f,x)
+vardef format (expr f, x) =
+ fmt_metapost := true ; dofmt_.Feform_(f,x)
enddef ;
-vardef Mformat(expr f, x) =
- fmt_metapost := true ; dofmt_.Meform (f,x)
+vardef Mformat(expr f, x) =
+ fmt_metapost := true ; dofmt_.Meform (f,x)
enddef ;
-vardef formatstr (expr f, x) =
- fmt_metapost := false ; dofmt_.Feform_(f,x)
+vardef formatstr (expr f, x) =
+ fmt_metapost := false ; dofmt_.Feform_(f,x)
enddef ;
-vardef Mformatstr(expr f, x) =
- fmt_metapost := false ; dofmt_.Meform (f,x)
+vardef Mformatstr(expr f, x) =
+ fmt_metapost := false ; dofmt_.Meform (f,x)
enddef ;
% Restore warningcheck to previous value.
-endgroup ;
+endgroup ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-spec.mp b/Master/texmf-dist/metapost/context/base/mp-spec.mp
index a46b09e92dd..6c5a557b475 100644
--- a/Master/texmf-dist/metapost/context/base/mp-spec.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-spec.mp
@@ -185,17 +185,60 @@ newinternal shadefactor ; shadefactor := 1 ;
pair shadeoffset ; shadeoffset := origin ;
+% vardef define_linear_shade (expr a, b, ca, cb) =
+% flush_special(30, 15, "0 1 " & decimal shadefactor & " " &
+% dddecimal ca & " " & ddecimal (a shifted shadeoffset) & " " &
+% dddecimal cb & " " & ddecimal (b shifted shadeoffset) ) ;
+% _special_counter_
+% enddef ;
+
+% vardef define_circular_shade (expr a, b, ra, rb, ca, cb) =
+% flush_special(31, 17, "0 1 " & decimal shadefactor & " " &
+% dddecimal ca & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
+% dddecimal cb & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb ) ;
+% _special_counter_
+% enddef ;
+
+vardef _is_cmyk_(expr c) =
+ (redpart c = _special_signal_/_special_div_) and (greenpart c = 1/_special_div_)
+enddef ;
+vardef _is_spot_(expr c) =
+ (redpart c = _special_signal_/_special_div_) and (greenpart c = 2/_special_div_)
+enddef ;
+
+numeric mp_shade_version ; mp_shade_version := 2 ; % more colors, needs new backend
+
vardef define_linear_shade (expr a, b, ca, cb) =
- flush_special(30, 15, "0 1 " & decimal shadefactor & " " &
- dddecimal ca & " " & ddecimal (a shifted shadeoffset) & " " &
- dddecimal cb & " " & ddecimal (b shifted shadeoffset) ) ;
- _special_counter_
+ if (mp_shade_version > 1) and _is_cmyk_(ca) and _is_cmyk_(cb) :
+ flush_special(32, 17, "0 1 " & decimal shadefactor & " " &
+ cmykcolorpattern[bluepart ca] & " " & ddecimal (a shifted shadeoffset) & " " &
+ cmykcolorpattern[bluepart cb] & " " & ddecimal (b shifted shadeoffset) ) ;
+ elseif (mp_shade_version > 1) and _is_spot_(ca) and _is_spot_(cb) :
+ flush_special(34, 17, "0 1 " & decimal shadefactor & " " &
+ spotcolorpattern[bluepart ca] & " " & ddecimal (a shifted shadeoffset) & " " &
+ cmykcolorpattern[bluepart cb] & " " & ddecimal (b shifted shadeoffset) ) ;
+ else :
+ flush_special(30, 15, "0 1 " & decimal shadefactor & " " &
+ dddecimal ca & " " & ddecimal (a shifted shadeoffset) & " " &
+ dddecimal cb & " " & ddecimal (b shifted shadeoffset) ) ;
+ fi ;
+ _special_counter_
enddef ;
vardef define_circular_shade (expr a, b, ra, rb, ca, cb) =
- flush_special(31, 17, "0 1 " & decimal shadefactor & " " &
- dddecimal ca & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
- dddecimal cb & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb ) ;
+ if (mp_shade_version > 1) and _is_cmyk_(ca) and _is_cmyk_(cb) :
+ flush_special(33, 19, "0 1 " & decimal shadefactor & " " &
+ cmykcolorpattern[bluepart ca] & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
+ cmykcolorpattern[bluepart cb] & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb ) ;
+ elseif (mp_shade_version > 1) and _is_spot_(ca) and _is_spot_(cb) :
+ flush_special(35, 19, "0 1 " & decimal shadefactor & " " &
+ spotcolorpattern[bluepart ca] & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
+ spotcolorpattern[bluepart cb] & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb ) ;
+ else :
+ flush_special(31, 17, "0 1 " & decimal shadefactor & " " &
+ dddecimal ca & " " & ddecimal (a shifted shadeoffset) & " " & decimal ra & " " &
+ dddecimal cb & " " & ddecimal (b shifted shadeoffset) & " " & decimal rb ) ;
+ fi ;
_special_counter_
enddef ;
diff --git a/Master/texmf-dist/metapost/context/base/mp-tool.mp b/Master/texmf-dist/metapost/context/base/mp-tool.mp
index 3b52b9d5d47..fca61cb346a 100644
--- a/Master/texmf-dist/metapost/context/base/mp-tool.mp
+++ b/Master/texmf-dist/metapost/context/base/mp-tool.mp
@@ -58,8 +58,9 @@ vardef mpversiongt (expr s) = mpversioncmp(s, ">") enddef ;
%D We always want \EPS\ conforming output, so we say:
-prologues := 2 ; % 1 = troff, 2 = tex
+prologues := 1 ;
warningcheck := 0 ;
+mpprocset := 1 ;
%D Namespace handling:
diff --git a/Master/texmf-dist/scripts/context/perl/mptopdf.pl b/Master/texmf-dist/scripts/context/perl/mptopdf.pl
index f85c36891b9..b1589a9d39e 100644
--- a/Master/texmf-dist/scripts/context/perl/mptopdf.pl
+++ b/Master/texmf-dist/scripts/context/perl/mptopdf.pl
@@ -120,9 +120,9 @@ foreach my $file (@files) {
$_ = $file ;
if (s/\.(\d+|mps)$// && -e $file) {
if ($miktex) {
- $command = "pdfetex -undump=mptopdf" ;
+ $command = "pdftex -undump=mptopdf" ;
} else {
- $command = "pdfetex -fmt=mptopdf -progname=context" ;
+ $command = "pdftex -fmt=mptopdf -progname=context" ;
}
if ($dosish) {
$command = "$command \\relax $file" ;
diff --git a/Master/texmf-dist/scripts/context/perl/texfont.pl b/Master/texmf-dist/scripts/context/perl/texfont.pl
index 425417374de..ec875e5b472 100644
--- a/Master/texmf-dist/scripts/context/perl/texfont.pl
+++ b/Master/texmf-dist/scripts/context/perl/texfont.pl
@@ -42,6 +42,7 @@ use Config ;
use FindBin ;
use File::Copy ;
use Getopt::Long ;
+use Data::Dumper;
$Getopt::Long::passthrough = 1 ; # no error message
$Getopt::Long::autoabbrev = 1 ; # partial switch accepted
@@ -146,6 +147,7 @@ my $trace = 0 ;
my $afmpl = 0 ;
my $trees = 'TEXMFFONTS,TEXMFLOCAL,TEXMFEXTRA,TEXMFMAIN,TEXMFDIST' ;
my $pattern = '' ;
+my $uselmencodings = 0 ;
my $fontsuffix = "" ;
my $namesuffix = "" ;
@@ -198,6 +200,7 @@ my @cleanup = () ; # atl: build list of generated files to delete
"expert" => \$expert,
"afmpl" => \$afmpl,
"afm2pl" => \$afmpl,
+ "lm" => \$uselmencodings,
"rootlist=s" => \$trees,
"pattern=s" => \$pattern,
"trace" => \$trace, # --verbose conflicts with --ve
@@ -549,7 +552,6 @@ if ($sourcepath eq "auto") # todo uppercase root
foreach my $sub ("tfm","vf")
{ foreach my $typ ("","-raw")
{ my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$varlabel$typ-$file.$sub" ;
- # { my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$varlabel$typ-$file$fontsuffix.$sub" ;
if (-s $nam)
{ report ("removing : $encoding$varlabel$typ-$file.$sub") ;
unlink $nam } } } }
@@ -558,11 +560,12 @@ if ($sourcepath eq "auto") # todo uppercase root
{ report ("removing : $nam") ;
unlink "$nam" }
my $mapfile = "$encoding$varlabel-$vendor-$collection" ;
- my $maproot = "$fontroot/fonts/map/pdftex/context";
- if (-e "$maproot$mapfile.map")
- { report ("renaming : $mapfile.map -> $mapfile.bak") ;
- unlink "$maproot$mapfile.bak" ;
- rename "$maproot$mapfile.map", "$maproot$mapfile.bak" }
+ foreach my $map ("pdftex","dvips", "dvipdfm")
+ { my $maproot = "$fontroot/fonts/map/$map/context/";
+ if (-e "$maproot$mapfile.map")
+ { report ("renaming : $mapfile.map -> $mapfile.bak") ;
+ unlink "$maproot$mapfile.bak" ;
+ rename "$maproot$mapfile.map", "$maproot$mapfile.bak" } }
exit }
else
{ last } } } }
@@ -576,9 +579,13 @@ my $tfmpath = "$fontroot/fonts/tfm/$vendor/$collection" ;
my $vfpath = "$fontroot/fonts/vf/$vendor/$collection" ;
my $pfbpath = "$fontroot/fonts/type1/$vendor/$collection" ;
my $ttfpath = "$fontroot/fonts/truetype/$vendor/$collection" ;
-my $mappath = "$fontroot/fonts/map/pdftex/context" ;
+my $otfpath = "$fontroot/fonts/opentype/$vendor/$collection" ;
my $encpath = "$fontroot/fonts/enc/dvips/context" ;
+sub mappath
+ { my $str = shift ;
+ return "$fontroot/fonts/map/$str/context" }
+
# are not on local path ! ! ! !
foreach my $path ($afmpath, $pfbpath)
@@ -597,20 +604,19 @@ if (($fontroot =~ /texmf\-fonts/o) || (-e "$fontroot/ls-R") || (-e "$fontroot/ls
sub do_make_path
{ my $str = shift ;
if ($str =~ /^(.*)\/.*?$/)
- { do_make_path($1) }
+ { do_make_path($1); }
mkdir $str, 0755 unless -d $str }
sub make_path
{ my $str = shift ;
- do_make_path("$fontroot/fonts") ;
- do_make_path("$fontroot/fonts/$str") ;
- do_make_path("$fontroot/fonts/$str/$vendor") ;
do_make_path("$fontroot/fonts/$str/$vendor/$collection") }
if ($makepath&&$install)
{ make_path ("afm") ; make_path ("type1") }
-do_make_path($mappath) ;
+do_make_path(mappath("pdftex")) ;
+do_make_path(mappath("dvips")) ;
+do_make_path(mappath("dvipdfm")) ;
do_make_path($encpath) ;
# now fonts/map and fonts/enc
@@ -624,21 +630,23 @@ if ($install)
error ("unknown tfm path $tfmpath") unless -d $tfmpath ;
error ("unknown vf path $vfpath" ) unless -d $vfpath ;
-error ("unknown map path $mappath") unless -d $mappath ;
+error ("unknown map path " . mappath("pdftex")) unless -d mappath("pdftex");
+error ("unknown map path " . mappath("dvips")) unless -d mappath("dvips");
+error ("unknown map path " . mappath("dvipdfm")) unless -d mappath("dvipdfm");
my $mapfile = "$identifier.map" ;
my $bakfile = "$identifier.bak" ;
my $texfile = "$identifier.tex" ;
- report "encoding vector : $encoding" ;
+ report "encoding vector : $encoding" ;
if ($variant) { report "encoding variant : $variant" }
report "vendor name : $vendor" ;
report " source path : $sourcepath" ;
report "font collection : $collection" ;
report "texmf font root : $lcfontroot" ;
- report "pdftex map file : $mapfile" ;
+ report " map file name : $mapfile" ;
-if ($install) { report "source path : $sourcepath" }
+if ($install) { report "source path : $sourcepath" }
my $fntlist = "" ;
@@ -736,45 +744,74 @@ if ($install)
copy_files("ttf",$sourcepath,$ttfpath) }
if ($extension eq "otf")
{ make_path("truetype") ;
- copy_files("otf",$sourcepath,$ttfpath) } }
+ copy_files("otf",$sourcepath,$ttfpath) } }
error ("no afm files found") unless @files ;
-my $map = my $tex = 0 ; my $mapdata = my $texdata = "" ;
-
-copy ("$mappath/$mapfile","$mappath/$bakfile") ;
-
-if (open (MAP,"<$mappath/$mapfile"))
- { report ("extending map file : $mappath/$mapfile") ;
- while (<MAP>) { unless (/^\%/o) { $mapdata .= $_ } }
- close (MAP) }
-else
- { report ("no map file at : $mappath/$mapfile") }
+sub open_mapfile
+ { my $type = shift;
+ my $mappath = mappath($type);
+ my $mapdata = "";
+ my $mapptr = undef;
+ my $fullmapfile = $mapfile;
+ $fullmapfile = "$type-$fullmapfile" unless $type eq "pdftex";
+ if ($install)
+ { copy ("$mappath/$mapfile","$mappath/$bakfile") ; }
+ if (open ($mapptr,"<$mappath/$mapfile"))
+ { report ("extending map file : $mappath/$mapfile") ;
+ while (<$mapptr>) { unless (/^\%/o) { $mapdata .= $_ } }
+ close ($mapptr) }
+ else
+ { report ("no map file at : $mappath/$mapfile") }
+ #~ unless (open ($mapptr,">$fullmapfile") )
+do_make_path($mappath) ;
+ unless (open ($mapptr,">$mappath/$fullmapfile") )
+ { report "warning : can't open $fullmapfile" }
+ else
+ { if ($type eq "pdftex")
+ { print $mapptr "% This file is generated by the TeXFont Perl script.\n";
+ print $mapptr "%\n" ;
+ print $mapptr "% You need to add the following line to your file:\n" ;
+ print $mapptr "%\n" ;
+ print $mapptr "% \\pdfmapfile{+$mapfile}\n" ;
+ print $mapptr "%\n" ;
+ print $mapptr "% In ConTeXt you can best use:\n" ;
+ print $mapptr "%\n" ;
+ print $mapptr "% \\loadmapfile\[$mapfile\]\n\n" } }
+ return ($mapptr,$mapdata) ; }
+
+sub finish_mapfile
+ { my ($type, $mapptr, $mapdata ) = @_;
+ my $fullmapfile = $mapfile;
+ $fullmapfile = "$type-$fullmapfile" unless $type eq "pdftex";
+ if (defined $mapptr)
+ { report ("updating map file : $mapfile (for $type)") ;
+ while ($mapdata =~ s/\n\n+/\n/mois) {} ;
+ $mapdata =~ s/^\s*//gmois ;
+ print $mapptr $mapdata ;
+ close ($mapptr) ;
+ if ($install)
+ { copy ("$fullmapfile", mappath($type) . "/$mapfile") ; } } }
+
+
+my ($PDFTEXMAP,$pdftexmapdata) = open_mapfile("pdftex");
+my ($DVIPSMAP,$dvipsmapdata) = open_mapfile("dvips");
+my ($DVIPDFMMAP,$dvipdfmmapdata) = open_mapfile("dvipdfm");
+
+my $tex = 0 ;
+my $texdata = "" ;
if (open (TEX,"<$texfile"))
{ while (<TEX>) { unless (/stoptext/o) { $texdata .= $_ } }
close (TEX) }
-$map = open (MAP,">$mapfile") ;
$tex = open (TEX,">$texfile") ;
-unless ($map) { report "warning : can't open $mapfile" }
unless ($tex) { report "warning : can't open $texfile" }
-if ($map)
- { print MAP "% This file is generated by the TeXFont Perl script.\n" ;
- print MAP "%\n" ;
- print MAP "% You need to add the following line to your file:\n" ;
- print MAP "%\n" ;
- print MAP "% \\pdfmapfile{+$mapfile}\n" ;
- print MAP "%\n" ;
- print MAP "% In ConTeXt you can best use:\n" ;
- print MAP "%\n" ;
- print MAP "% \\loadmapfile\[$mapfile\]\n\n" }
-
if ($tex)
{ if ($texdata eq "")
- { print TEX "% output=pdftex interface=en\n" ;
+ { print TEX "% interface=en\n" ;
print TEX "\n" ;
print TEX "\\usemodule[fnt-01]\n" ;
print TEX "\n" ;
@@ -811,6 +848,227 @@ if ($encoding ne "") # evt -progname=context
{ $encfil = `kpsewhich -progname=pdftex $encoding$varlabel.enc` ;
chomp $encfil ; if ($encfil eq "") { $encfil = "$encoding$varlabel.enc" } }
+sub build_pdftex_mapline
+ { my ($option, $usename, $fontname, $rawname, $cleanfont, $encoding, $varlabel, $strange) = @_;
+ my $cleanname = $fontname;
+ $cleanname =~ s/\_//gio ;
+ $option =~ s/^\s+(.*)/$1/o ;
+ $option =~ s/(.*)\s+$/$1/o ;
+ $option =~ s/ / /g ;
+ if ($option ne "")
+ { $option = "\"$option\" 4" }
+ else
+ { $option = "4" }
+ # adding cleanfont is kind of dangerous
+ my $thename = "";
+ my $str = "";
+ my $theencoding = "" ;
+ if ($strange ne "")
+ { $thename = $cleanname ; $theencoding = "" ; }
+ elsif ($lcdf)
+ { $thename = $usename ; $theencoding = " $encoding$varlabel-$cleanname.enc" }
+ elsif ($afmpl)
+ { $thename = $usename ; $theencoding = " $encoding$varlabel.enc" }
+ elsif ($virtual)
+ { $thename = $rawname ; $theencoding = " $encoding$varlabel.enc" }
+ else
+ { $thename = $usename ; $theencoding = " $encoding$varlabel.enc" }
+if ($uselmencodings) {
+ $theencoding =~ s/^(ec)\.enc/lm\-$1.enc/ ;
+}
+ # quit rest if no type 1 file
+ my $pfb_sourcepath = $sourcepath ;
+ $pfb_sourcepath =~ s@/afm/@/type1/@ ;
+ unless ((-e "$pfbpath/$fontname.$extension")||
+ (-e "$pfb_sourcepath/$fontname.$extension")||
+ (-e "$sourcepath/$fontname.$extension")||
+ (-e "$ttfpath/$fontname.$extension"))
+ { if ($tex) { $report .= "missing file: \\type \{$fontname.pfb\}\n" }
+ report ("missing pfb file : $fontname.pfb") }
+ # now add entry to map
+ if ($strange eq "") {
+ if ($extension eq "otf") {
+ if ($lcdf) {
+ my $mapline = "" ;
+ if (open(ALTMAP,"texfont.map")) {
+ while (<ALTMAP>) {
+ chomp ;
+ # atl: we assume this b/c we always force otftotfm --no-type1
+ if (/<<(.*)\.otf$/oi) {
+ $mapline = $_ ; last ;
+ }
+ }
+ close(ALTMAP) ;
+ } else {
+ report("no mapfile from otftotfm : texfont.map") ;
+ }
+ if ($preproc) {
+ $mapline =~ s/<\[/</;
+ $mapline =~ s/<<(\S+)\.otf$/<$1\.pfb/ ;
+ } else {
+ $mapline =~ s/<<(\S+)\.otf$/<< $ttfpath\/$fontname.$extension/ ;
+ }
+ $str = "$mapline\n" ;
+ } else {
+ if ($preproc) {
+ $str = "$thename $cleanfont $option < $fontname.pfb$theencoding\n" ;
+ } else {
+ # PdfTeX can't subset OTF files, so we have to include the whole thing
+ # It looks like we also need to be explicit on where to find the file
+ $str = "$thename $cleanfont $option << $ttfpath/$fontname.$extension <$theencoding\n" ;
+ }
+ }
+ } else {
+ $str = "$thename $cleanfont $option < $fontname.$extension$theencoding\n" ;
+ }
+ } else {
+ $str = "$thename $cleanfont < $fontname.$extension\n" ;
+ }
+ return ($str, $thename); }
+
+sub build_dvips_mapline
+ { my ($option, $usename, $fontname, $rawname, $cleanfont, $encoding, $varlabel, $strange) = @_;
+ my $cleanname = $fontname;
+ $cleanname =~ s/\_//gio ;
+ $option =~ s/^\s+(.*)/$1/o ;
+ $option =~ s/(.*)\s+$/$1/o ;
+ $option =~ s/ / /g ;
+ # adding cleanfont is kind of dangerous
+ my $thename = "";
+ my $str = "";
+ my $optionencoding = "" ;
+ my $encname = "";
+ my $theencoding = "" ;
+ if ($encoding ne "") # evt -progname=context
+ { $encfil = `kpsewhich -progname=dvips $encoding$varlabel.enc` ;
+ chomp $encfil ;
+ if ($encfil eq "")
+ { $encfil = "$encoding$varlabel.enc" ; }
+ if (open(ENC,"<$encfil"))
+ { while (<ENC>)
+ { if (/^\/([^ ]+)\s*\[/)
+ { $encname = $1;
+ last; } }
+ close ENC; } }
+ if ($strange ne "")
+ { $thename = $cleanname ;
+ $optionencoding = "\"$option\"" if length($option)>1; }
+ elsif ($lcdf)
+ { $thename = $usename ;
+ $optionencoding = "\"$option $encname ReEncodeFont\" <$encoding$varlabel-$cleanname.enc" }
+ elsif ($afmpl)
+ { $thename = $usename ;
+ $optionencoding = "\"$option $encname ReEncodeFont\" <$encoding$varlabel.enc" }
+ elsif ($virtual)
+ { $thename = $rawname ;
+ $optionencoding = "\"$option $encname ReEncodeFont\" <$encoding$varlabel.enc" }
+ else
+ { $thename = $usename ;
+ $optionencoding = "\"$option $encname ReEncodeFont\" <$encoding$varlabel.enc" }
+if ($uselmencodings) {
+ $theencoding =~ s/^(ec)\.enc/lm\-$1.enc/ ;
+}
+ # quit rest if no type 1 file
+ my $pfb_sourcepath = $sourcepath ;
+ $pfb_sourcepath =~ s@/afm/@/type1/@ ;
+ unless ((-e "$pfbpath/$fontname.$extension")||
+ (-e "$pfb_sourcepath/$fontname.$extension")||
+ (-e "$sourcepath/$fontname.$extension")||
+ (-e "$ttfpath/$fontname.$extension"))
+ { if ($tex) { $report .= "missing file: \\type \{$fontname.pfb\}\n" }
+ report ("missing pfb file : $fontname.pfb") }
+ # now add entry to map
+ if ($strange eq "") {
+ if ($extension eq "otf") {
+ if ($lcdf) {
+ my $mapline = "" ;
+ if (open(ALTMAP,"texfont.map")) {
+ while (<ALTMAP>) {
+ chomp ;
+ # atl: we assume this b/c we always force otftotfm --no-type1
+ if (/<<(.*)\.otf$/oi) {
+ $mapline = $_ ; last ;
+ }
+ }
+ close(ALTMAP) ;
+ } else {
+ report("no mapfile from otftotfm : texfont.map") ;
+ }
+ if ($preproc) {
+ $mapline =~ s/<\[/</;
+ $mapline =~ s/<<(\S+)\.otf$/<$1\.pfb/ ;
+ } else {
+ $mapline =~ s/<<(\S+)\.otf$/<< $ttfpath\/$fontname.$extension/ ;
+ }
+ $str = "$mapline\n" ;
+ } else {
+ if ($preproc) {
+ $str = "$thename $cleanfont $optionencoding <$fontname.pfb\n" ;
+ } else {
+ # dvips can't subset OTF files, so we have to include the whole thing
+ # It looks like we also need to be explicit on where to find the file
+ $str = "$thename $cleanfont $optionencoding << $ttfpath/$fontname.$extension \n" ;
+ }
+ }
+ } else {
+ $str = "$thename $cleanfont $optionencoding <$fontname.$extension\n" ;
+ }
+ } else {
+ $str = "$thename $cleanfont $optionencoding <$fontname.$extension\n" ;
+ }
+ return ($str, $thename); }
+# return $str; }
+
+
+sub build_dvipdfm_mapline
+ { my ($option, $usename, $fontname, $rawname, $cleanfont, $encoding, $varlabel, $strange) = @_;
+ my $cleanname = $fontname;
+ $cleanname =~ s/\_//gio ;
+ $option =~ s/([\d\.]+)\s+SlantFont/ -s $1 /;
+ $option =~ s/([\d\.]+)\s+ExtendFont/ -e $1 /;
+ $option =~ s/^\s+(.*)/$1/o ;
+ $option =~ s/(.*)\s+$/$1/o ;
+ $option =~ s/ / /g ;
+ # adding cleanfont is kind of dangerous
+ my $thename = "";
+ my $str = "";
+ my $theencoding = "" ;
+ if ($strange ne "")
+ { $thename = $cleanname ; $theencoding = "" ; }
+ elsif ($lcdf)
+ { $thename = $usename ; $theencoding = " $encoding$varlabel-$cleanname" }
+ elsif ($afmpl)
+ { $thename = $usename ; $theencoding = " $encoding$varlabel" }
+ elsif ($virtual)
+ { $thename = $rawname ; $theencoding = " $encoding$varlabel" }
+ else
+ { $thename = $usename ; $theencoding = " $encoding$varlabel" }
+if ($uselmencodings) {
+ $theencoding =~ s/^(ec)\.enc/lm\-$1.enc/ ;
+}
+ # quit rest if no type 1 file
+ my $pfb_sourcepath = $sourcepath ;
+ $pfb_sourcepath =~ s@/afm/@/type1/@ ;
+ unless ((-e "$pfbpath/$fontname.$extension")||
+ (-e "$pfb_sourcepath/$fontname.$extension")||
+ (-e "$sourcepath/$fontname.$extension")||
+ (-e "$ttfpath/$fontname.$extension"))
+ { if ($tex) { $report .= "missing file: \\type \{$fontname.pfb\}\n" }
+ report ("missing pfb file : $fontname.pfb") }
+ # now add entry to map
+ if ($strange eq "") {
+ if ($extension eq "otf") {
+ #TH: todo
+ } else {
+ $str = "$thename $theencoding $fontname $option\n" ;
+ }
+ } else {
+ $str = "$thename $fontname $option\n" ;
+ }
+ return ($str, $thename); }
+# return $str; }
+
+
sub preprocess_font
{ my ($infont,$pfbfont) = @_ ;
if ($infont ne "")
@@ -850,20 +1108,20 @@ foreach my $file (@files)
if ($encoding ne "")
{ $encstr = " -T $encfil" }
if ($caps ne "")
- { $vfstr = " -V $raw$cleanname$fontsuffix" }
+ { $vfstr = " -V $use$cleanname$fontsuffix" }
else # if ($virtual)
- { $vfstr = " -v $raw$cleanname$fontsuffix" }
+ { $vfstr = " -v $use$cleanname$fontsuffix" }
my $font = "";
# let's see what we have here (we force texnansi.enc to avoid error messages)
if ($lcdf)
{ my $command = "otfinfo -p $file" ;
- print "$command\n" if $trace ;
+ print "$command\n" if $trace;
$font = `$command` ;
chomp $font ;
$cleanname = $cleanfont = $font }
else
{ my $command = "afm2tfm \"$file\" -p texnansi.enc texfont.tfm" ;
- print "$command\n" if $trace ;
+ print "$command (for testing)\n" if $trace ;
$font = `$command` ;
UnLink "texfont.tfm" ;
($rawfont,$cleanfont,$restfont) = split(/\s/,$font) }
@@ -912,6 +1170,9 @@ foreach my $file (@files)
if ($afmpl)
{ report " generating pl : $cleanname$fontsuffix (from $cleanname)" ;
$encstr = " -p $encfil" ;
+if ($uselmencodings) {
+ $encstr =~ s/(ec)\.enc$/lm\-$1\.enc/ ;
+}
my $command = "afm2pl -f afm2tfm $shape $passon $encstr $file $cleanname$fontsuffix.vpl" ;
print "$command\n" if $trace ;
my $ok = `$command` ;
@@ -924,28 +1185,28 @@ foreach my $file (@files)
my $command = "afm2tfm $file $shape $passon $encstr $vfstr $raw$cleanname$fontsuffix" ;
print "$command\n" if $trace ;
$font = `$command` }
- # generate vf file if needed
- chomp $font ;
- if ($font =~ /.*?([\d\.]+)\s*ExtendFont/io) { $extend = $1 }
- if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
- if ($extend ne "") { $option .= " $1 ExtendFont " }
- if ($slant ne "") { $option .= " $1 SlantFont " }
- if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
- if ($afmpl)
- { report "generating new tfm : $use$cleanname$fontsuffix" ;
- my $command = "pltotf $cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
- print "$command\n" if $trace ;
- my $ok = `$command` }
- elsif ($virtual)
- { report "generating new vf : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
- my $command = "vptovf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm" ;
- print "$command\n" if $trace ;
- my $ok = `$command` }
- else
- { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
- my $command = "pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
- print "$command\n" if $trace ;
- my $ok = `$command` } } }
+ # generate vf file if needed
+ chomp $font ;
+ if ($font =~ /.*?([\d\.]+)\s*ExtendFont/io) { $extend = $1 }
+ if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
+ if ($extend ne "") { $option .= " $extend ExtendFont " }
+ if ($slant ne "") { $option .= " $slant SlantFont " }
+ if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
+ if ($afmpl)
+ { report "generating new tfm : $use$cleanname$fontsuffix" ;
+ my $command = "pltotf $cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` }
+ elsif ($virtual)
+ { report "generating new vf : $use$cleanname$fontsuffix (from $use$cleanname)" ;
+ my $command = "vptovf $use$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` }
+ else
+ { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
+ my $command = "pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` } } }
elsif (-e "$sourcepath/$cleanname.tfm" )
{ report "using existing tfm : $cleanname.tfm" }
elsif (($strange eq "expert")&&($expert))
@@ -993,85 +1254,43 @@ foreach my $file (@files)
{ UnLink ("$rawname.$suf", "$usename.$suf") ;
UnLink ("$cleanname.$suf", "$fontname.$suf") ;
UnLink ("$cleanname$fontsuffix.$suf", "$fontname$fontsuffix.$suf") }
- # add line to maps file
- $option =~ s/^\s+(.*)/$1/o ;
- $option =~ s/(.*)\s+$/$1/o ;
- $option =~ s/ / /o ;
- if ($option ne "")
- { $option = "\"$option\" 4" }
- else
- { $option = "4" }
- # adding cleanfont is kind of dangerous
- my $thename = my $str = my $theencoding = "" ;
- if ($strange ne "")
- { $thename = $cleanname ; $theencoding = "" ; }
- elsif ($lcdf)
- { $thename = $usename ; $theencoding = " $encoding$varlabel-$cleanname.enc" }
- elsif ($afmpl)
- { $thename = $usename ; $theencoding = " $encoding$varlabel.enc" }
- elsif ($virtual)
- { $thename = $rawname ; $theencoding = " $encoding$varlabel.enc" }
- else
- { $thename = $usename ; $theencoding = " $encoding$varlabel.enc" }
- # quit rest if no type 1 file
- my $pfb_sourcepath = $sourcepath ;
- $pfb_sourcepath =~ s@/afm/@/type1/@ ;
- unless ((-e "$pfbpath/$fontname.$extension")||
- (-e "$pfb_sourcepath/$fontname.$extension")||
- (-e "$sourcepath/$fontname.$extension")||
- (-e "$ttfpath/$fontname.$extension"))
- { if ($tex) { $report .= "missing file: \\type \{$fontname.pfb\}\n" }
- report ("missing pfb file : $fontname.pfb") }
- # now add entry to map
- if ($strange eq "") {
- if ($extension eq "otf") {
- if ($lcdf) {
- my $mapline = "" ;
- if (open(ALTMAP,"texfont.map")) {
- while (<ALTMAP>) {
- chomp ;
- # atl: we assume this b/c we always force otftotfm --no-type1
- if (/<<(.*)\.otf$/oi) {
- $mapline = $_ ; last ;
- }
- }
- close(ALTMAP) ;
- } else {
- report("no mapfile from otftotfm : texfont.map") ;
- }
- if ($preproc) {
- $mapline =~ s/<\[/</;
- $mapline =~ s/<<(\S+)\.otf$/<$1\.pfb/ ;
- } else {
- $mapline =~ s/<<(\S+)\.otf$/<< $ttfpath\/$fontname.$extension/ ;
- }
- $str = "$mapline\n" ;
- } else {
- if ($preproc) {
- $str = "$thename $cleanfont $option < $fontname.pfb$theencoding\n" ;
- } else {
- # PdfTeX can't subset OTF files, so we have to include the whole thing
- # It looks like we also need to be explicit on where to find the file
- $str = "$thename $cleanfont $option << $ttfpath/$fontname.$extension <[$theencoding\n" ;
- }
- }
- } else {
- $str = "$thename $cleanfont $option < $fontname.$extension$theencoding\n" ;
- }
- } else {
- $str = "$thename $cleanfont < $fontname.$extension\n" ;
+ # add line to map files
+ my $str = my $thename = "";
+ ($str, $thename) = build_pdftex_mapline($option, $usename, $fontname, $rawname, $cleanfont, $encoding, $varlabel, $strange);
+ # check for redundant entries
+ if (defined $PDFTEXMAP) {
+ $pdftexmapdata =~ s/^$thename\s.*?$//gmis ;
+ if ($afmpl) {
+ if ($pdftexmapdata =~ s/^$rawname\s.*?$//gmis) {
+ report ("removing raw file : $rawname") ;
+ }
+ }
+ $maplist .= $str ;
+ $pdftexmapdata .= $str ;
}
- # check for redundant entries
- if ($map) {
- $mapdata =~ s/^$thename\s.*?$//gmis ;
- if ($afmpl) {
- if ($mapdata =~ s/^$rawname\s.*?$//gmis) {
- report ("removing raw file : $rawname") ;
- }
- }
- $maplist .= $str ;
- $mapdata .= $str ;
+ ($str, $thename) = build_dvips_mapline($option, $usename, $fontname, $rawname, $cleanfont, $encoding, $varlabel, $strange);
+ # check for redundant entries
+ if (defined $DVIPSMAP) {
+ $dvipsmapdata =~ s/^$thename\s.*?$//gmis ;
+ if ($afmpl) {
+ if ($dvipsmapdata =~ s/^$rawname\s.*?$//gmis) {
+ report ("removing raw file : $rawname") ;
+ }
+ }
+ $dvipsmapdata .= $str ;
}
+ ($str, $thename) = build_dvipdfm_mapline($option, $usename, $fontname, $rawname, $cleanfont, $encoding, $varlabel, $strange);
+ # check for redundant entries
+ if (defined $DVIPDFMMAP) {
+ $dvipdfmmapdata =~ s/^$thename\s.*?$//gmis ;
+ if ($afmpl) {
+ if ($dvipdfmmapdata =~ s/^$rawname\s.*?$//gmis) {
+ report ("removing raw file : $rawname") ;
+ }
+ }
+ $dvipdfmmapdata .= $str ;
+ }
+
# write lines to tex file
if (($strange eq "expert")&&($expert)) {
$fntlist .= "\\definefontsynonym[$cleanfont$namesuffix][$cleanname] \% expert\n" ;
@@ -1090,14 +1309,13 @@ foreach my $file (@files)
}
}
-if ($map)
- { report ("updating map file : $mapfile") ;
- while ($mapdata =~ s/\n\n+/\n/mois) {} ;
- $mapdata =~ s/^\s*//gmois ;
- print MAP $mapdata }
+finish_mapfile("pdftex", $PDFTEXMAP, $pdftexmapdata);
+finish_mapfile("dvipdfm", $DVIPDFMMAP, $dvipdfmmapdata);
+finish_mapfile("dvips", $DVIPSMAP, $dvipsmapdata);
if ($tex)
- { $mappath =~ s/\\/\//go ;
+ { my $mappath = mappath("pdftex");
+ $mappath =~ s/\\/\//go ;
$savedoptions =~ s/^\s+//gmois ; $savedoptions =~ s/\s+$//gmois ;
$fntlist =~ s/^\s+//gmois ; $fntlist =~ s/\s+$//gmois ;
$maplist =~ s/^\s+//gmois ; $maplist =~ s/\s+$//gmois ;
@@ -1127,11 +1345,8 @@ if ($tex)
print TEX "\n" ;
print TEX "\\stoptext\n" }
-if ($map) { close (MAP) }
if ($tex) { close (TEX) }
-copy ($mapfile,"$mappath/$mapfile") ;
-
# atl: global cleanup with generated files (afm & ttf don't mix)
UnLink(@cleanup) ;
@@ -1146,9 +1361,9 @@ print "\n" ; system ("mktexlsr $fontroot") ; print "\n" ;
if ($show) { system ("texexec --once --silent $texfile") }
-@files = validglob("$identifier.*") ;
+@files = validglob("$identifier.* *-$identifier.map") ;
foreach my $file (@files)
- { unless ($file =~ /(tex|pdf|log|mp|tmp)$/io) { unlink $file } }
+ { unless ($file =~ /(tex|pdf|log|mp|tmp)$/io) { UnLink ($file) } }
exit ;
diff --git a/Master/texmf-dist/scripts/context/ruby/base/ctx.rb b/Master/texmf-dist/scripts/context/ruby/base/ctx.rb
index 0baf5a88b1b..dff9570d837 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/ctx.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/ctx.rb
@@ -84,7 +84,7 @@ class CtxRunner
end
if ! done && defaultname && FileTest.file?(defaultname) then
report("using default ctxfile #{defaultname}")
- @ctxname = defaultname
+ @ctxname, done = defaultname, true
end
if not done then
report('no ctx file found')
@@ -115,23 +115,34 @@ class CtxRunner
if @jobname then
variables['job'] = @jobname
end
- REXML::XPath.each(@xmldata.root,"//ctx:value[@name='job']") do |val|
+ root = @xmldata.root
+ begin
+ REXML::XPath.each(root,"//ctx:block") do |blk|
+ if @jobname && blk.attributes['pattern'] then
+ root.delete(blk) unless @jobname =~ /#{blk.attributes['pattern']}/
+ else
+ root.delete(blk)
+ end
+ end
+ rescue
+ end
+ REXML::XPath.each(root,"//ctx:value[@name='job']") do |val|
substititute(val,variables['job'])
end
- REXML::XPath.each(@xmldata.root,"/ctx:job/ctx:message") do |mes|
+ REXML::XPath.each(root,"/ctx:job//ctx:message") do |mes|
report("preprocessing: #{justtext(mes)}")
end
- REXML::XPath.each(@xmldata.root,"/ctx:job/ctx:process/ctx:resources/ctx:environment") do |sty|
+ REXML::XPath.each(root,"/ctx:job//ctx:process/ctx:resources/ctx:environment") do |sty|
@environments << justtext(sty)
end
- REXML::XPath.each(@xmldata.root,"/ctx:job/ctx:process/ctx:resources/ctx:module") do |mod|
+ REXML::XPath.each(root,"/ctx:job//ctx:process/ctx:resources/ctx:module") do |mod|
@modules << justtext(mod)
end
- REXML::XPath.each(@xmldata.root,"/ctx:job/ctx:process/ctx:resources/ctx:filter") do |fil|
+ REXML::XPath.each(root,"/ctx:job//ctx:process/ctx:resources/ctx:filter") do |fil|
@filters << justtext(fil)
end
commands = Hash.new
- REXML::XPath.each(@xmldata.root,"/ctx:job/ctx:preprocess/ctx:processors/ctx:processor") do |pre|
+ REXML::XPath.each(root,"/ctx:job//ctx:preprocess/ctx:processors/ctx:processor") do |pre|
begin
commands[pre.attributes['name']] = pre
rescue
@@ -139,13 +150,13 @@ class CtxRunner
end
suffix = @@suffix
begin
- suffix = REXML::XPath.match(@xmldata.root,"/ctx:job/ctx:preprocess/@suffix").to_s
+ suffix = REXML::XPath.match(root,"/ctx:job//ctx:preprocess/@suffix").to_s
rescue
suffix = @@suffix
else
if suffix && suffix.empty? then suffix = @@suffix end
end
- REXML::XPath.each(@xmldata.root,"/ctx:job/ctx:preprocess/ctx:files") do |files|
+ REXML::XPath.each(root,"/ctx:job//ctx:preprocess/ctx:files") do |files|
REXML::XPath.each(files,"ctx:file") do |pattern|
preprocessor = pattern.attributes['processor']
if preprocessor and not preprocessor.empty? then
@@ -267,7 +278,7 @@ class CtxRunner
if f = File.open(fullname,'r') and i = REXML::Document.new(f) then
report("including ctx file #{name}")
REXML::XPath.each(i.root,"*") do |ii|
- xmldata.root.insert_after(e,ii)
+ xmldata.root.insert_before(e,ii)
more = true
end
end
@@ -275,8 +286,8 @@ class CtxRunner
end
rescue
end
+ break if done
end
- break if done
end
report("no valid ctx inclusion file #{name}") unless done
rescue Exception
diff --git a/Master/texmf-dist/scripts/context/ruby/base/kpse.rb b/Master/texmf-dist/scripts/context/ruby/base/kpse.rb
index b0321672fc1..bff3cc1fae7 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/kpse.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/kpse.rb
@@ -28,6 +28,10 @@ class String
end
end
+ def sane_path
+ self.gsub(/\\/,'/')
+ end
+
end
class Array
@@ -36,6 +40,12 @@ class Array
self.join(File::PATH_SEPARATOR)
end
+ def non_empty
+ self.delete_if do |i|
+ (i == nil || i.empty?) rescue false
+ end
+ end
+
end
module Kpse
@@ -96,42 +106,57 @@ module Kpse
@@scripts.keys.sort.each do |k| puts("scripts : #{k} -> #{@@scripts[k]}\n") end
end
+ def Kpse.used_path(varname)
+ begin
+ if @@mswindows then
+ path = run("--expand-path=\$#{varname}") rescue ''
+ else
+ path = run("--expand-path='$#{varname}'") rescue ''
+ end
+ rescue
+ path = ''
+ end
+ return path.sane_path
+ end
+
def Kpse.found(filename, progname=nil, format=nil)
begin
tag = Kpse.key(filename) # all
if @@located.key?(tag) then
- return @@located[tag]
+ return @@located[tag].sane_path
elsif FileTest.file?(filename) then
setvariable(tag,filename)
return filename
elsif FileTest.file?(File.join(@@ownpath,filename)) then
setvariable(tag,File.join(@@ownpath,filename))
- return @@located[tag]
+ return @@located[tag].sane_path
else
[progname,@@progname].flatten.compact.uniq.each do |prg|
[format,@@formats].flatten.compact.uniq.each do |fmt|
begin
tag = Kpse.key(filename,prg,fmt)
if @@located.key?(tag) then
- return @@located[tag]
+ return @@located[tag].sane_path
elsif p = Kpse.kpsewhich(filename,prg,fmt) then
setvariable(tag,p.chomp)
- return @@located[tag]
+ return @@located[tag].sane_path
end
rescue
end
end
end
setvariable(tag,filename)
- return filename
+ return filename.sane_path
end
rescue
- filename
+ filename.sane_path
end
end
def Kpse.kpsewhich(filename,progname,format)
- Kpse.run("-progname=#{progname} -format=\"#{format}\" #{filename}")
+ p = if progname && ! progname.empty? then "-progname=#{progname}" else '' end
+ f = if format && ! format.empty? then "-format=\"#{format}\"" else '' end
+ Kpse.run("#{p} #{f} #{filename}")
end
def Kpse.which
@@ -160,7 +185,7 @@ module Kpse
# maybe we should check for writeability
unless @@paths.key?('formatpaths') then
begin
- setpath('formatpaths',run("--show-path=fmt").gsub(/\\/,'/').split_path)
+ setpath('formatpaths',run("--show-path=fmt").sane_path.split_path)
rescue
setpath('formatpaths',[])
end
diff --git a/Master/texmf-dist/scripts/context/ruby/base/kpsefast.rb b/Master/texmf-dist/scripts/context/ruby/base/kpsefast.rb
index 20c07c70a4e..24ff1a0fa7c 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/kpsefast.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/kpsefast.rb
@@ -9,6 +9,8 @@
# www : www.pragma-ade.com
# todo: multiple cnf files
+#
+# todo: cleanup, string or table store (as in lua variant)
class String
diff --git a/Master/texmf-dist/scripts/context/ruby/base/mp.rb b/Master/texmf-dist/scripts/context/ruby/base/mp.rb
index b30be111091..5dd2948cffc 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/mp.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/mp.rb
@@ -91,8 +91,8 @@ EOT
f.puts("")
f.puts(@@start[method])
end
- data.gsub!(/[^\\]%.*?$/mo) do
- ''
+ data.gsub!(/([^\\])%.*?$/mo) do
+ $1
end
data.scan(/(verbatim|b)tex\s*(.*?)\s*etex/mo) do
tag, text = $1, $2
diff --git a/Master/texmf-dist/scripts/context/ruby/base/tex.rb b/Master/texmf-dist/scripts/context/ruby/base/tex.rb
index a6403dcde2b..f6f3dc4ed83 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/tex.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/tex.rb
@@ -85,6 +85,9 @@ class TEX
@@pdftex = 'pdftex' # new default, pdfetex is gone
+ @@luafiles = "luafiles.tmp"
+ @@luatarget = "lua/context"
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |p|
if System.unix? then
pp, pe = "#{p}/pdftex" , "#{p}/pdfetex"
@@ -113,7 +116,7 @@ class TEX
['pdfetex','pdftex','pdf','pdftex','standard'] .each do |b| @@backends[b] = 'pdftex' end
['dvipdfmx','dvipdfm','dpx','dpm'] .each do |b| @@backends[b] = 'dvipdfmx' end
['xetex','xtx'] .each do |b| @@backends[b] = 'xetex' end
- ['dvips','ps'] .each do |b| @@backends[b] = 'dvips' end
+ ['dvips','ps','dvi'] .each do |b| @@backends[b] = 'dvips' end
['dvipsone'] .each do |b| @@backends[b] = 'dvipsone' end
['acrobat','adobe','distiller'] .each do |b| @@backends[b] = 'acrobat' end
['xdv','xdv2pdf'] .each do |b| @@backends[b] = 'xdv2pdf' end
@@ -164,7 +167,7 @@ class TEX
@@runoptions['xetex'] = ['--8bit -no-pdf'] # from now on we assume (x)dvipdfmx to be used
@@runoptions['pdfetex'] = ['--8bit ']
@@runoptions['pdftex'] = ['--8bit '] # pdftex is now pdfetex
- @@runoptions['luatex'] = ['--8bit ']
+ @@runoptions['luatex'] = ['']
@@runoptions['aleph'] = ['--8bit ']
@@booleanvars = [
@@ -225,6 +228,29 @@ class TEX
@@extrabooleanvars << vars
end
+ # def jobvariables(names=nil)
+ # if [names ||[]].flatten.size == 0 then
+ # names = [allbooleanvars,allstringvars].flatten
+ # end
+ # data = Hash.new
+ # names.each do |name|
+ # if allbooleanvars.include?(name) then
+ # data[name] = if getvariable(name) then "yes" else "no" end
+ # else
+ # data[name] = getvariable(name)
+ # end
+ # end
+ # data
+ # end
+
+ # def setjobvariables(names=nil)
+ # assignments = Array.new
+ # jobvariables(names).each do |k,v|
+ # assignments << "#{k}=\{#{v}\}"
+ # end
+ # "\setvariables[exe][#{assignments.join(", ")}]"
+ # end
+
@@temprunfile = 'texexec'
@@temptexfile = 'texexec.tex'
@@ -524,6 +550,41 @@ class TEX
return version
end
+ def cleanupluafiles
+ File.delete(@@luafiles) rescue false
+ end
+
+ def compileluafiles
+ begin
+ Dir.glob("lua/context/*.luc").each do |luc|
+ File.delete(luc) rescue false
+ end
+ rescue
+ end
+ if data = (IO.readlines(@@luafiles) rescue nil) then
+ report("compiling lua files (using #{File.expand_path(@@luafiles)})")
+ begin
+ Dir.makedirs(@@luatarget) rescue false
+ data.each do |line|
+ luafile = line.chomp
+ lucfile = File.basename(luafile).gsub(/\..*?$/,'') + ".luc"
+ if runcommand(["luac","-s","-o",quoted(File.join(Dir.getwd,@@luatarget,lucfile)),quoted(luafile)]) then
+ report("#{File.basename(luafile)} converted to #{File.basename(lucfile)}")
+ else
+ report("#{File.basename(luafile)} not converted to #{File.basename(lucfile)}")
+ end
+ end
+ rescue
+ report("fatal error in compilation")
+ end
+ else
+ report("no lua compilations needed")
+ end
+ File.delete(@@luafiles) rescue false
+ end
+
+ # we need engine methods
+
def makeformats
checktestversion
@@ -561,9 +622,18 @@ class TEX
makeuserfile
makeresponsefile
end
- texformats.each do |texformat|
- report("generating tex format #{texformat}")
- runcommand([quoted(texengine),prognameflag(progname),iniflag,tcxflag,prefixed(texformat,texengine),texmakeextras(texformat)])
+ if texengine == 'luatex' then
+ cleanupluafiles
+ texformats.each do |texformat|
+ report("generating tex format #{texformat}")
+run_luatools("--ini --compile #{texformat}")
+ end
+ compileluafiles
+ else
+ texformats.each do |texformat|
+ report("generating tex format #{texformat}")
+ runcommand([quoted(texengine),prognameflag(progname),iniflag,tcxflag,prefixed(texformat,texengine),texmakeextras(texformat)])
+ end
end
else
report("unable to make format due to lack of permissions")
@@ -592,8 +662,10 @@ class TEX
mpsformatpath = ''
end
# check for problems
+ report("")
report("tex engine path: #{texformatpath}") unless texformatpath.empty?
report("mps engine path: #{mpsformatpath}") unless mpsformatpath.empty?
+ report("")
[['fmt','tex'],['mem','mps']].each do |f|
[[texformatpath,'global'],[mpsformatpath,'global'],[savedpath,'current']].each do |p|
begin
@@ -601,11 +673,20 @@ class TEX
rescue
else
Dir.glob("*.#{f[0]}").each do |file|
- report("#{f[1]}format: #{filestate(file)} > #{File.expand_path(file)}")
+ report("#{f[1]}: #{filestate(file)} > #{File.expand_path(file)} (#{File.size(file)})")
end
end
end
end
+ begin
+ lucdir = File.join(texformatpath,@@luatarget)
+ Dir.chdir(lucdir)
+ rescue
+ else
+ Dir.glob("*.luc").each do |file|
+ report("luc: #{filestate(file)} > #{File.expand_path(file)} (#{File.size(file)})")
+ end
+ end
# to be sure, go back to current path
begin
Dir.chdir(savedpath)
@@ -613,6 +694,7 @@ class TEX
end
# finalize
cleanup
+ report("")
reportruntime
end
@@ -853,10 +935,10 @@ class TEX
rname = File.unsuffixed(resultname)
if ! rname.empty? && (rname != fname) then
report("outputfile #{rname}")
- ['tuo','log','dvi','pdf'].each do |s|
+ ['tuo','tuc','log','dvi','pdf'].each do |s|
File.silentrename(File.suffixed(fname,s),File.suffixed('texexec',s))
end
- ['tuo'].each do |s|
+ ['tuo','tuc'].each do |s|
File.silentrename(File.suffixed(rname,s),File.suffixed(fname,s)) if FileTest.file?(File.suffixed(rname,s))
end
end
@@ -867,12 +949,12 @@ class TEX
rname = File.unsuffixed(resultname)
if ! rname.empty? && (rname != fname) then
report("renaming #{fname} to #{rname}")
- ['tuo','log','dvi','pdf'].each do |s|
+ ['tuo','tuc','log','dvi','pdf'].each do |s|
File.silentrename(File.suffixed(fname,s),File.suffixed(rname,s))
end
report("restoring #{fname}")
unless $fname == 'texexec' then
- ['tuo','log','dvi','pdf'].each do |s|
+ ['tuo','tuc','log','dvi','pdf'].each do |s|
File.silentrename(File.suffixed('texexec',s),File.suffixed(fname,s))
end
end
@@ -1034,6 +1116,20 @@ class TEX
public
+ def run_luatools(args)
+ # dirty trick: we know that the lua path is relative to the ruby path; of course this
+ # will not work well when stubs are used
+ [(ENV["_CTX_K_S_texexec_"] or ENV["_CTX_K_S_THREAD_"] or ENV["TEXMFSTART.THREAD"]), File.dirname($0)].each do |path|
+ if path then
+ script = "#{path}/../lua/luatools.lua"
+ if FileTest.file?(script) then
+ return runcommand("lua #{script} #{args}")
+ end
+ end
+ end
+ return runcommand("texmfstart luatools #{args}")
+ end
+
def processmpgraphic
getarrayvariable('files').each do |filename|
setvariable('filename',filename)
@@ -1126,6 +1222,38 @@ class TEX
reportruntime
end
+ def processmpstatic
+ if filename = getvariable('filename') then
+ filename += ".mp" unless filename =~ /\..+?$/
+ if FileTest.file?(filename) then
+ begin
+ data = IO.read(filename)
+ File.open("texexec.tex",'w') do |f|
+ f << "\\setupoutput[pdftex]\n"
+ f << "\\setupcolors[state=start]\n"
+ data.sub!(/^%mpenvironment\:\s*(.*?)$/mois) do
+ f << $1
+ "\n"
+ end
+ f << "\\starttext\n"
+ f << "\\startMPpage\n"
+ f << data.gsub(/end\.*\s*$/m, '') # a bit of a hack
+ f << "\\stopMPpage\n"
+ f << "\\stoptext\n"
+ end
+ report("converting static '#{filename}'")
+ runtex("texexec.tex")
+ pdffile = File.suffixed(filename,'pdf')
+ File.silentrename("texexec.pdf",pdffile)
+ report ("#{filename} converted to #{pdffile}")
+ rescue
+ report("error in converting #{filename} (#{$!}")
+ end
+ end
+ end
+ reportruntime
+ end
+
def processmpxtex
getarrayvariable('files').each do |filename|
setvariable('filename',filename)
@@ -1372,7 +1500,11 @@ class TEX
report("progname: #{progname}")
if texengine && texformat && progname then
fixbackendvars(@@mappaths[texengine])
+if texengine == "luatex" then
+ run_luatools("--fmt=#{texformat} #{filename}")
+else
runcommand([quoted(texengine),prognameflag(progname),formatflag(texengine,texformat),tcxflag,runoptions(texengine),filename,texprocextras(texformat)])
+end
# true
else
false
@@ -1451,7 +1583,25 @@ class TEX
end
end
- # 1=tex 2=mptex 3=mpxtex 4=mpgraphic
+ def runluacheck(jobname)
+ if false then
+ # test-pos.tex / 6 meg tua file: 18.6 runtime
+ old, new = File.suffixed(jobname,'tua'), File.suffixed(jobname,'tuc')
+ if FileTest.file?(old) then
+ report("converting #{old} into #{new}")
+ system("luac -s -o #{new} #{old}")
+ end
+ else
+ # test-pos.tex / 6 meg tua file: 17.5 runtime
+ old, new = File.suffixed(jobname,'tua'), File.suffixed(jobname,'tuc')
+ if FileTest.file?(old) then
+ report("renaming #{old} into #{new}")
+ File.rename(old,new) rescue false
+ end
+ end
+ end
+
+ # 1=tex 2=mptex 3=mpxtex 4=mpgraphic 5=mpstatic
def runtexexec(filename=[], options=[], mode=nil)
begin
@@ -1470,6 +1620,7 @@ class TEX
when 2 then job.processmptex
when 3 then job.processmpxtex
when 4 then job.processmpgraphic
+ when 5 then job.processmpstatic
end
job.inspect && Kpse.inspect if getvariable('verbose')
return true
@@ -1658,6 +1809,7 @@ class TEX
ok = runtex(if dummyfile || forcexml then rawbase else rawname end)
if ok then
ok = runtexutil(rawbase) if getvariable('texutil') || getvariable('forcetexutil')
+ runluacheck(rawbase)
runbackend(rawbase)
popresult(rawbase,result)
end
@@ -1667,10 +1819,11 @@ class TEX
end
end
else
+# goto tmp/jobname when present
mprundone, ok, stoprunning = false, true, false
texruns, nofruns = 0, getvariable('runs').to_i
state = FileState.new
- ['tub','tuo'].each do |s|
+ ['tub','tuo','tuc'].each do |s|
state.register(File.suffixed(rawbase,s))
end
if getvariable('automprun') then # check this
@@ -1690,13 +1843,16 @@ class TEX
makeoptionfile(rawbase,jobname,orisuffix,false,false,2,texruns) # unknown
end
end
+# goto .
ok = runtex(File.suffixed(if dummyfile || forcexml then rawbase else rawname end,jobsuffix))
+# goto tmp/jobname when present
if ok && (nofruns > 1) then
unless getvariable('nompmode') then
mprundone = runtexmpjob(rawbase, "mpgraph")
mprundone = runtexmpjob(rawbase, "mprun")
end
ok = runtexutil(rawbase)
+ runluacheck(rawbase)
state.update
stoprunning = state.stable?
end
@@ -1704,11 +1860,16 @@ class TEX
if not ok then
setvariable('error','error in tex file')
end
- ok = runtexutil(rawbase) if (nofruns == 1) && getvariable('texutil')
+ if (nofruns == 1) && getvariable('texutil') then
+ ok = runtexutil(rawbase)
+ runluacheck(rawbase)
+ end
if ok && finalrun && (nofruns > 1) then
makeoptionfile(rawbase,jobname,orisuffix,true,finalrun,4,texruns) unless getvariable('nooptionfile')
report("final TeX run #{texruns}")
+# goto .
ok = runtex(File.suffixed(if dummyfile || forcexml then rawbase else rawname end,jobsuffix))
+# goto tmp/jobname when present
end
if getvariable('keep') then
['top','log','run'].each do |suffix|
@@ -1721,8 +1882,11 @@ class TEX
# File.silentdelete(File.suffixed(rawbase,s))
# end
if ok then
+# goto .
runbackend(rawbase)
popresult(rawbase,result)
+# goto tmp/jobname when present
+# skip next
end
if true then # autopurge
begin
@@ -1755,14 +1919,14 @@ class TEX
end
end
rescue
- report("fatal error #{$!}")
+ # report("fatal error #{$!}")
end
end
end
Kpse.runscript('ctxtools',rawbase,'--purge') if getvariable('purge')
Kpse.runscript('ctxtools',rawbase,'--purge --all') if getvariable('purgeall')
-
+# till here
when 'latex' then
ok = runtex(rawname)
@@ -1913,7 +2077,7 @@ class TEX
def purge_mpx_files(mpname)
unless getvariable('keep') then
- ['tex', 'log', 'tui', 'tuo', 'top'].each do |suffix|
+ ['tex', 'log', 'tui', 'tuo', 'tuc', 'top'].each do |suffix|
File.silentdelete(File.suffixed(mpname,'temp',suffix))
end
end
diff --git a/Master/texmf-dist/scripts/context/ruby/base/texutil.rb b/Master/texmf-dist/scripts/context/ruby/base/texutil.rb
index 2bca831675e..7c402b98f85 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/texutil.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/texutil.rb
@@ -235,7 +235,11 @@ class TeXUtil
end
def tokenize(str)
- str.gsub(/\\strchr\{(.*?)\}/o) do "\\#{$1}" end
+ if str then
+ str.gsub(/\\strchr\{(.*?)\}/o) do "\\#{$1}" end
+ else
+ ""
+ end
end
def remap(str)
@@ -461,7 +465,6 @@ class TeXUtil
class Synonym
@@debug = false
- @@debug = true
def initialize(t, c, k, d)
@type, @command, @key, @sortkey, @data = t, c, k, k, d
@@ -559,7 +562,6 @@ class TeXUtil
@@specialbanner = "" # \\relax"
@@debug = false
- @@debug = true
@@howto = /^(.*?)\:\:(.*)$/o
@@split = ' && '
@@ -598,7 +600,8 @@ class TeXUtil
# end
end
else
- @entry, @key = cleanupsplit(@entry), cleanupsplit(@key)
+ # @entry, @key = cleanupsplit(@entry), cleanupsplit(@key)
+@entry, @key = cleanupsplit(@entry), xcleanupsplit(@key)
end
@sortkey = sorter.simplify(@key)
# special = @sortkey =~ /^([^a-zA-Z\\])/o
@@ -613,7 +616,7 @@ class TeXUtil
@entry,
@texthowto.ljust(10,' '),
# @state, # no, messes up things
- (@realpage ||'').rjust(6,' ').gsub(/0/,' '),
+ (@realpage.to_s || '').rjust(6,' ').gsub(/0/,' '),
# (@realpage ||'').rjust(6,' '),
@pagehowto
].join(@@split)
@@ -628,6 +631,23 @@ class TeXUtil
end
end
+def xcleanupsplit(target) # +a+b+c &a&b&c a+b+c a&b&c
+ t = Array.new
+ case target[0,1]
+ when '&' then
+ t = target.sub(/^./o,'').split(/([^\\])\&/o)
+ when '+' then
+ t = target.sub(/^./o,'').split(/([^\\])\+/o)
+ else
+ # t = target.split(/([^\\])[\&\+]/o)
+ # t = target.split(/[\&\+]/o)
+ t = target.split(/(?!\\)[\&\+]/o) # lookahead
+ end
+ if not t[1] then t[1] = " " end # we need some entry else we get subentries first
+ if not t[2] then t[2] = " " end # we need some entry else we get subentries first
+ return t.join(@@split)
+end
+
def <=> (other)
@sortkey <=> other.sortkey
end
@@ -659,11 +679,13 @@ class TeXUtil
alphaclass, alpha = '', ''
@@savedhowto, @@savedfrom, @@savedto, @@savedentry = '', '', '', ''
if @@debug then
+ # if true then
list.each do |entry|
handle << "% [#{entry.sortkey.gsub(/#{@@split}/o,'] [')}]\n"
end
end
list.each do |entry|
+# puts(entry.sortkey.gsub(/\s+/,""))
if entry.sortkey =~ /^(\S+)/o then
if sorter.division?($1) then
testalpha = sorter.getdivision($1)
@@ -738,6 +760,7 @@ class TeXUtil
elsif @@savedhowto != entry.pagehowto and ! entry.pagehowto.empty? then
@@savedhowto = entry.pagehowto
end
+ # beware, we keep multiple page entries per realpage because of possible prefix usage
if copied || ! ((lastpage == entry.page) && (lastrealpage == entry.realpage)) then
nextentry = "{#{entry.type}}{#{previous[0]}}{#{previous[1]}}{#{previous[2]}}{#{entry.pagehowto},#{entry.texthowto}}"
savedline = "{#{entry.type}}{#{@@savedhowto},#{entry.texthowto}}{#{entry.location}}{#{entry.page}}{#{entry.realpage}}"
@@ -791,7 +814,8 @@ class TeXUtil
@@registers[data[1]].push(Register.new(3,data[1],data[2],data[3],data[4],nil,data[5],data[6]))
when 's' then
@@registers[data[1]] = Array.new unless @@registers.key?(data[1])
- @@registers[data[1]].push(Register.new(4,data[1],data[2],data[3],data[4],data[5],data[6],nil))
+ # was this but wrong sort order (4,data[1],data[2],data[3],data[4],data[5],data[6],nil))
+ @@registers[data[1]].push(Register.new(4,data[1],data[2],data[3],data[4],data[5],data[6],0))
when 'l' then
@@languages[data[1]] = data[2] || ''
end
@@ -820,6 +844,7 @@ class TeXUtil
@@registers[s].each_index do |i|
@@registers[s][i].build(@@sorter[s])
end
+ # @@registers[s].uniq!
@@registers[s] = @@registers[s].sort
end
end
diff --git a/Master/texmf-dist/scripts/context/ruby/base/tool.rb b/Master/texmf-dist/scripts/context/ruby/base/tool.rb
index 9f120ca117a..77ad947fe1e 100644
--- a/Master/texmf-dist/scripts/context/ruby/base/tool.rb
+++ b/Master/texmf-dist/scripts/context/ruby/base/tool.rb
@@ -129,7 +129,7 @@ module Tool
def Tool.simplefilename(old)
- return old unless test(?f,old)
+ return old if not FileTest.file?(old)
new = old.downcase
new.gsub!(/[^A-Za-z0-9\_\-\.\\\/]/o) do # funny chars
@@ -141,9 +141,10 @@ module Tool
$1 + ':'
end
end
- new.gsub!(/(.+?)\.(.+?)(\..+)$/o) do # duplicate .
- $1 + '-' + $2 + $3
- end
+ # fragile for a.b.c.d.bla-bla.e.eps
+ # new.gsub!(/(.+?)\.(.+?)(\..+)$/o) do # duplicate .
+ # $1 + '-' + $2 + $3
+ # end
new.gsub!(/\-+/o) do # duplicate -
'-'
end
@@ -244,7 +245,7 @@ module Tool
new.sub!(/\.ai$/io) do
'.eps'
end
- new.sub!(/\.ai(.*?)$/io) do
+ new.sub!(/\.ai([a-z0-9]*)$/io) do
'-' + $1 + '.eps'
end
new
@@ -253,7 +254,7 @@ module Tool
def Tool.cleanfilename(old,logging=nil)
- return old unless test(?f,old)
+ return old if not FileTest.file?(old)
new = checksuffix(simplefilename(old))
unless new == old
@@ -269,29 +270,6 @@ module Tool
end
- def Tool.preventduplicates(old,logging=nil)
-
- return false unless test(?f,old)
-
- if old =~ /\.(tif|jpg|png|tiff)$/io
- suffix = $1
- new = old
- newn, news = new.split('.')
- if test(?e,'newn.eps')
- new = newn + '-' + suffix + '.' + suffix
- begin
- File.rename(old,new)
- logging.report("renaming duplicate #{old} to #{new}") unless logging
- return true
- rescue
- logging.report("unable to rename duplicate #{old} to #{new}") unless logging
- end
- end
- end
- return false
-
- end
-
def Tool.servername
host = Socket::gethostname
begin
diff --git a/Master/texmf-dist/scripts/context/ruby/concheck.rb b/Master/texmf-dist/scripts/context/ruby/concheck.rb
index bf09bbdc8da..6c7512bff8f 100644
--- a/Master/texmf-dist/scripts/context/ruby/concheck.rb
+++ b/Master/texmf-dist/scripts/context/ruby/concheck.rb
@@ -223,6 +223,7 @@ def some_chr_error(data, filename, left, right)
levels = Array.new
for line in 0..data.length-1 do
str = data[line]
+ # str = data[line].gsub(/\\[\#{left}\#{right}]/,'')
column = 0
while column<str.length do
case str[column].chr
@@ -365,6 +366,7 @@ end
# todo : language dependent
def check_file_tex (filename)
+ error = false
if data = load_file(filename) then
message("checking tex file", filename)
interface = guess_interface(data)
@@ -372,42 +374,49 @@ def check_file_tex (filename)
data = cleanup_data(data,interface)
# data.each do |d| print d end
$valid[interface].each do |v|
- return false if some_wrd_error(data, filename, v[0], v[1] ,$valid_tex)
+ if some_wrd_error(data, filename, v[0], v[1] ,$valid_tex) then
+ error = true
+ break
+ end
end
# return false if some_wrd_error(data, filename, '\\\\start' , '\\\\stop' , $valid_tex)
# return false if some_wrd_error(data, filename, '\\\\Start' , '\\\\Stop' , $valid_tex)
# return false if some_wrd_error(data, filename, '\\\\beginvan', '\\\\eindvan', $valid_tex)
# return false if some_wrd_error(data, filename, '\\\\begin' , '\\\\end|\\\\eind', $valid_tex)
- return false if some_sym_error(data, filename, '$', false)
- return false if some_sym_error(data, filename, '|', true)
- return false if some_chr_error(data, filename, '{', '}')
- return false if some_chr_error(data, filename, '[', ']')
- return false if some_chr_error(data, filename, '(', ')')
- return false if some_key_error(data, filename, valid)
- message("no errors in tex code", filename)
- return true
+ error = true if some_sym_error(data, filename, '$', false)
+ error = true if some_sym_error(data, filename, '|', true)
+ error = true if some_chr_error(data, filename, '{', '}')
+ error = true if some_chr_error(data, filename, '[', ']')
+ error = true if some_chr_error(data, filename, '(', ')')
+ error = true if some_key_error(data, filename, valid)
+ message("no errors in tex code", filename) unless error
+ return error
else
return false
end
end
def check_file_mp (filename)
+ error = false
if data = load_file(filename) then
message("checking metapost file", filename)
interface = guess_interface(data)
valid = load_valid(data,interface)
$valid[interface].each do |v|
- return false if some_wrd_error(data, filename, v[0], v[1] ,$valid_tex)
+ if some_wrd_error(data, filename, v[0], v[1] ,$valid_tex) then
+ error = true
+ break
+ end
end
# return false if some_wrd_error(data, filename, '', 'begin', 'end', $valid_mp)
- return false if some_chr_error(data, filename, '{', '}')
- return false if some_chr_error(data, filename, '[', ']')
- return false if some_chr_error(data, filename, '(', ')')
- return false if some_key_error(data, filename, valid)
- message("no errors in metapost code", filename)
- return true
+ error = true if some_chr_error(data, filename, '{', '}')
+ error = true if some_chr_error(data, filename, '[', ']')
+ error = true if some_chr_error(data, filename, '(', ')')
+ error = true if some_key_error(data, filename, valid)
+ message("no errors in metapost code", filename) unless error
+ return error
else
- return true
+ return false
end
end
@@ -440,7 +449,7 @@ def check_file(filename='')
when '' then
message("provide filename")
return false
- when /\.tex$/i then
+ when /\.(tex|mk.+)$/i then
return check_file_tex(filename) # && check_file_text(filename)
when /\.mp$/i then
return check_file_mp(filename)
@@ -450,12 +459,13 @@ def check_file(filename='')
end
end
-if filename = ARGV[0] then
- if check_file(filename) then
- exit 0
- else
- exit 1
+if ARGV.size > 0 then
+ someerror = false
+ ARGV.each do |filename|
+ somerror = true if check_file(filename)
end
+ exit (if someerror then 1 else 0 end)
else
exit 1
end
+
diff --git a/Master/texmf-dist/scripts/context/ruby/ctxtools.rb b/Master/texmf-dist/scripts/context/ruby/ctxtools.rb
index 0cf96e10d70..567c927a57c 100644
--- a/Master/texmf-dist/scripts/context/ruby/ctxtools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/ctxtools.rb
@@ -46,16 +46,13 @@
banner = ['CtxTools', 'version 1.3.3', '2004/2006', 'PRAGMA ADE/POD']
-# todo dirname
-
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
require 'base/system'
+require 'base/kpse'
+require 'base/file'
require 'rexml/document'
require 'net/http'
@@ -86,6 +83,10 @@ class String
end
end
+ def nosuffix(suffix)
+ self.sub(/\.#{suffix}/,'') # no /o
+ end
+
end
class Commands
@@ -108,7 +109,7 @@ class Commands
maincontextfile = 'context.tex'
unless FileTest.file?(maincontextfile) then
begin
- maincontextfile = `kpsewhich -progname=context #{maincontextfile}`.chomp
+ maincontextfile = Kpse.found(maincontextfile,'context')
rescue
maincontextfile = ''
end
@@ -417,6 +418,8 @@ class Commands
public
+ # faster is to glob the whole dir and regexp over that list
+
def purgefiles
pattern = @commandline.arguments
@@ -444,13 +447,16 @@ class Commands
files = Dir.glob(globbed)
report("purging#{if purgeall then ' all' end} temporary files : #{globbed}")
else
+ report("purging#{if purgeall then ' all' end} temporary files : #{pattern.join(' ')}")
pattern.each do |pat|
- globbed = if recurse then "**/#{pat}-*.*" else "#{pat}-*.*" end
+ nosuf = File.unsuffixed(pat)
+ globbed = if recurse then "**/#{nosuf}-*.*" else "#{nosuf}-*.*" end
+ report("checking files that match '#{globbed}'")
files = Dir.glob(globbed)
- globbed = if recurse then "**/#{pat}.*" else "#{pat}.*" end
+ globbed = if recurse then "**/#{nosuf}.*" else "#{nosuf}.*" end
+ report("checking files that match '#{globbed}'")
files.push(Dir.glob(globbed))
end
- report("purging#{if purgeall then ' all' end} temporary files : #{pattern.join(' ')}")
end
files.flatten!
files.sort!
@@ -522,6 +528,7 @@ class Commands
$dontaskprefixes = [
# "tex-form.tex", "tex-edit.tex", "tex-temp.tex",
"texexec.tex", "texexec.tui", "texexec.tuo",
+ "texexec.tuc", "texexec.tua",
"texexec.ps", "texexec.pdf", "texexec.dvi",
"cont-opt.tex", "cont-opt.bak"
]
@@ -531,7 +538,7 @@ class Commands
"xlscript\\.xsl"
]
$forsuresuffixes = [
- "tui", "tup", "ted", "tes", "top",
+ "tui", "tua", "tup", "ted", "tes", "top",
"log", "tmp", "run", "bck", "rlg",
"mpt", "mpx", "mpd", "mpo", "mpb",
"ctl",
@@ -541,7 +548,7 @@ class Commands
"dvi", "ps", "pdf"
]
$texnonesuffixes = [
- "tuo", "tub", "top"
+ "tuo", "tub", "top", "tuc"
]
$dummyfiles = [
"mpgraph"
@@ -639,7 +646,7 @@ class Commands
nofdocuments, nofdefinitions, nofskips = 0, 0, 0
skiplevel, indocument, indefinition, skippingbang = 0, false, false, false
if processtype.empty? then
- filetype = filesuffix.downcase
+ filetype = filesuffix.downcase.sub(/^mk.+$/,'tex') # make sure that mkii and mkiv files are handled
else
filetype = processtype.downcase
end
@@ -1049,7 +1056,7 @@ class Language
commentfile = rmename.dup
begin
- desfile = `kpsewhich -progname=context #{desname}`.chomp
+ desfile = Kpse.found(desname,'context')
if f = File.new(desfile) then
if doc = REXML::Document.new(f) then
if e = REXML::XPath.first(doc.root,"/descriptions/description[@language='#{@language}']") then
@@ -1188,7 +1195,7 @@ class Language
def located(filename)
begin
- fname = `kpsewhich -progname=context #{filename}`.chomp
+ fname = Kpse.found(filename, 'context')
if FileTest.file?(fname) then
report("using file #{fname}")
return fname
@@ -1519,7 +1526,7 @@ class Language
if ! encoding.empty? then
begin
- filename = `kpsewhich -progname=context #{filename}`
+ filename = Kpse.found(filename, 'context')
if data = IO.readlines(filename.chomp) then
report("preloading #{encoding} character mappings")
accept = false
@@ -1865,8 +1872,7 @@ class Commands
entities = Hash.new
filenames.each do |filename|
- # filename = `texmfstart tmftools.rb --progname=context #{filename}`.chomp
- filename = `kpsewhich --progname=context #{filename}`.chomp
+ filename = Kpse.found(filename, 'context')
if filename and not filename.empty? and FileTest.file?(filename) then
report("loading #{filename.gsub(/\\/,'/')}") unless outputname.empty?
IO.readlines(filename).each do |line|
@@ -1874,7 +1880,7 @@ class Commands
when /^[\#\%]/io then
# skip comment line
when /\\definecharacter\s+([a-z]+)\s+\{\\uchar\{*(\d+)\}*\{(\d+)\}\}/io then
- name, code = $1, ($2.to_i*256 + $3.to_i).to_s
+ name, code = $1, sprintf("%04X",$2.to_i*256 + $3.to_i)
entities[name] = code.rjust(4,'0') unless entities.key?(name)
when /^([A-F0-9]+)\;([a-z][a-z]+)\;(.*?)\;(.*?)\s*$/io then
code, name, adobe, comment = $1, $2, $3, $4
@@ -2076,187 +2082,424 @@ class TexDeps
noInputMode noOutputMode noDefaultInputMode noDefaultOutputMode
/.split
- @@cs_plain = %q/
- TeX
- bgroup egroup endgraf space empty null
- newcount newdimen newskip newmuskip newbox newtoks newhelp newread newwrite newfam newlanguage newinsert newif
- maxdimen magstephalf magstep
- frenchspacing nonfrenchspacing normalbaselines obeylines obeyspaces raggedright ttraggedright
- thinspace negthinspace enspace enskip quad qquad
- smallskip medskip bigskip removelastskip topglue vglue hglue
- break nobreak allowbreak filbreak goodbreak smallbreak medbreak bigbreak
- line leftline rightline centerline rlap llap underbar strutbox strut
- cases matrix pmatrix bordermatrix eqalign displaylines eqalignno leqalignno
- pageno folio tracingall showhyphens fmtname fmtversion
- hphantom vphantom phantom smash
+ @@cs_metatex = %q/
/.split
- @@cs_eplain = %q/
- eTeX
- newmarks grouptype interactionmode nodetype iftype
- tracingall loggingall tracingnone
+ @@cs_xetex = %q/
+ /.split
+
+ @@cs_skip = %q/
+ v\! c\! s\! e\! m\! f\!
+ \!tf \!tt \!tq \!ta \?\?
+ csname endcsname relax
+ \!\!string[a-f] \!\!dimen[a-k] \!\!count[a-f] \!\!toks[a-e] \!\!box[a-e]
+ \!\!width[a-c] \!\!height[a-c] \!\!depth[a-c]
+ \!\!done[a-f] if\!\!done[a-f] if\:\!\!done[a-f]
+ scratch globalscratch
+ ascii[a-d] globalascii
+ @@expanded @@globalexpanded @EA @EAEA @EAEAEA
+ bgroup egroup par next nextnext docommand dodocommand dododocommand
+ \!\!width \!\!height \!\!depth \!\!plus \!\!minus \!\!to
+ /.split
+
+ @@cs_skip = %q/
+ [vcsemf]\! \?\?
+ \!t[ftqa]
+ csname endcsname relax
+ \!\!string[a-f] \!\!dimen[a-k] \!\!count[a-f] \!\!toks[a-e] \!\!box[a-e]
+ \!\!width[a-c] \!\!height[a-c] \!\!depth[a-c]
+ \!\!done[a-f] if\!\!done[a-f] if\:\!\!done[a-f]
+ scratch globalscratch
+ ascii[a-d] globalascii
+ @@expanded @@globalexpanded @(EA)+
+ [be]group par next nextnext (do)+command
+ \!\!(width|height|depth|plus|minus|to)
/.split
# let's ignore \dimendef etc
- @@primitives_def = "def|edef|xdef|gdef|let|newcount|newdimen|newskip|newbox|newtoks|newmarks|chardef|mathchardef|newconditional"
+ @@primitives_def = %q/
+ def edef xdef gdef let
+ newcount newdimen newskip newbox newtoks newmarks newif newinsert newmuskip
+ chardef mathchardef dimendef countdef toksdef
+ newconditional definecomplexorsimple definecomplexorsimpleempty
+ newcounter newpersistentmark
+ installinsertion installspecial\s*\\[* installoutput\s*\\[*
+ /.split
- @@cs_global = [@@cs_tex,@@cs_etex,@@cs_pdftex,@@cs_omega].sort.flatten
- @@types = [['invalid','*'],['okay','='],['forward','>'],['backward','<'],['unknown','?']]
+ @@types = [['invalid','*'],['okay','='],['forward','>'],['backward','<'],['unknown','?']]
+
+ @@skips = /^(#{@@cs_skip.join('|')})/o
+
+ def initialize(logger=nil,compact=false)
+ @defined = Hash.new
+ @definitive = Hash.new
+ @used_before = Hash.new
+ @used_after = Hash.new
+ @dependencies = Hash.new
+ @fineorder = Hash.new
+ @forward = Hash.new
+ @backward = Hash.new
+ @disorder = Hash.new
+ @disordercs = Hash.new
+ @type = Hash.new
+ @filename = 'context.tex'
+ @files = Array.new # keep load order !
+ @order = Hash.new
+ @logger = logger
+ @filefilter = nil
+ @namefilter = nil
+ @compact = compact
+ #
+ @@cs_tex.each do |cs| @defined[cs] = ['-tex--------'] end
+ @@cs_etex.each do |cs| @defined[cs] = ['-etex-------'] end
+ @@cs_pdftex.each do |cs| @defined[cs] = ['-pdftex-----'] end
+ @@cs_omega.each do |cs| @defined[cs] = ['-omega------'] end
+ @@cs_xetex.each do |cs| @defined[cs] = ['-xetex------'] end
+ @@cs_metatex.each do |cs| @defined[cs] = ['-metatex----'] end
+ end
- def initialize(logger=nil)
- @cs_local = Hash.new
- @cs_new = Hash.new
- @cs_defd = Hash.new
- @cs_used = Hash.new
- @filename = 'context.tex'
- @files = Array.new # keep load order !
- @compact = false
- @logger = logger
+ def report(str)
+ @logger.report(str) rescue false
end
- def load(filename='context.tex',omitlist=['mult-com.tex'])
+ def setfilter(data)
+ data.split(/\s*\,\s*/).each do |d|
+ if d =~ /\.tex$/ then
+ @filefilter = Array.new unless @filefilter
+ @filefilter << d
+ else
+ @namefilter = Array.new unless @namefilter
+ @namefilter << d
+ end
+ end
+ end
+
+ def load(filename='context.tex')
begin
@filename = filename
+ n = 0
File.open(filename) do |f|
f.each do |line|
- if line =~ /^\\input\s+(\S+)\s*/o then
- @files.push($1) unless omitlist.include?(File.basename($1))
+ if line =~ /^(\\input\s+|\\load[a-z]+\{)([a-z\-\.]+)(\}*)/ then
+ ante, name, post = $1, $2, $3
+ @files.push(name)
+ @order[name] = n += 1
end
end
end
rescue
@files = Array.new
+ @order = Hash.new
+ end
+ end
+
+ def save(filename='context.tex')
+ unless @filefilter || @namefilter then
+ begin
+ data = IO.readlines(filename).each do |line|
+ line.gsub!(/^(\\input\s+|\\load[a-z]+\{)([a-z\-\.]+)(\}*)\s*$/) do
+ ante, name, post = $1, $2, $3
+ fin = (@fineorder[name] || [])-[name]
+ dep = (@dependencies[name] || [])-[name]
+ dis = (@disorder[name] || [])-[name]
+ fin = if fin.size > 0 then " B[#{fin.join(' ')}]" else "" end
+ dep = if dep.size > 0 then " A[#{dep.join(' ')}]" else "" end
+ dis = if dis.size > 0 then " D[#{dis.join(' ')}]" else "" end
+ "#{ante}#{name}#{post} %#{fin}#{dep}#{dis}\n"
+ end
+ end
+ rescue
+ report("error: #{$!}")
+ else
+ begin
+ newname = filename.sub(/\..*$/,'.log')
+ report("")
+ report("writing to #{newname}")
+ report("")
+ File.open(newname,'w') do |f|
+ f << data
+ end
+ rescue
+ report("error: #{$!}")
+ end
+ end
end
end
def analyze
+ report('')
+ report("loading files")
+ report('')
+ n = 0
@files.each do |filename|
if f = File.open(filename) then
- @logger.report("loading #{filename}") if @logger
- defs, uses, n = 0, 0, 0
+ defs, uses, l = 0, 0, 0
+ n += 1
+ report("#{n.to_s.rjust(5,' ')} #{filename}")
f.each do |line|
- n += 1
+ l += 1
+ line.chomp!
+
+
+ line.sub!(/\%.*$/, '')
+ line.gsub!(/\\(unexpanded|unprotected|global|protected|long)\s*(\\)/, "\\")
+ # the superseded, overloaded, forwarded, and predefined macros
+ # are at the outer level anyway, so there we may ignore leading
+ # spaces (could be inside an \if); other definitions are only
+ # accepted when they start at the beginning of a line
case line
- when /^%/
- # skip
- when /\\newif\s*\\if([a-zA-Z@\?\!]+)/ then
- pushdef(filename,n,"if:#{$1}")
- when /\\([a-zA-Z@\?\!]+)(true|false)/ then
- pushuse(filename,n,"if:#{$1}")
- when /^\s*\\(#{@primitives_def})\\([a-zA-Z@\?\!]{3,})/o
- pushdef(filename,n,$2)
- when /\\([a-zA-Z@\?\!]{3,})/o
- pushuse(filename,n,$1)
+ when /^\\ifx\s*\\[a-zA-Z\@\!\?]+\s*\\undefined\s*(\\else)*(.*?)$/ then
+ if $2 =~ /^\s*\\(#{@@primitives_def.join('|')})\s*\\([a-zA-Z\@\?\!]{3,})/o then
+ pushdef(filename,l,$2,5) # kind of auto-predefined
+ end
+ when /^\s*\\superseded\s*\\(#{@@primitives_def.join('|')})\s*\\([a-zA-Z\@\?\!]{3,})(.*)$/o
+ name, rest = $2, $3
+ pushdef(filename,l,name,1)
+ moreuse(filename,l,rest)
+ when /^\s*\\overloaded\s*\\(#{@@primitives_def.join('|')})\s*\\([a-zA-Z\@\?\!]{3,})(.*)$/o
+ name, rest = $2, $3
+ pushdef(filename,l,name,2)
+ moreuse(filename,l,rest)
+ when /^\s*\\forwarded\s*\\(#{@@primitives_def.join('|')})\s*\\([a-zA-Z\@\?\!]{3,})(.*)$/o
+ name, rest = $2, $3
+ pushdef(filename,l,name,3)
+ moreuse(filename,l,rest)
+ when /^\s*\\predefined\s*\\(#{@@primitives_def.join('|')})\s*\\([a-zA-Z\@\?\!]{3,})(.*)$/o
+ name, rest = $2, $3
+ pushdef(filename,l,name,4)
+ moreuse(filename,l,rest)
+ when /^\\(#{@@primitives_def.join('|')})[\=\s]*\\([a-zA-Z\@\?\!]{3,})(.*)$/o
+ name, rest = $2, $3 # \=* catches the \let \a = \b
+ pushdef(filename,l,name,0)
+ moreuse(filename,l,rest)
+ when /\\newevery\s*\\([a-zA-Z\@\?\!]+)\s*\\([a-zA-Z\@\?\!]+)/ then
+ a, b = $1, $2
+ pushdef(filename,l,a,0)
+ pushdef(filename,l,b,0)
+ else
+ moreuse(filename,l,line)
end
end
f.close
end
end
+ @used_after.each do |cs,files|
+ (@defined[cs] || []).each do |name|
+ @dependencies[name] = Array.new unless @dependencies[name]
+ files.each do |file|
+ @dependencies[name] << file unless @dependencies[name].include?(file)
+ end
+ end
+ end
+ @used_before.each do |cs,files|
+ (@defined[cs] || []).each do |name|
+ @disorder[name] = Array.new unless @disorder[name]
+ @disordercs[name] = Array.new unless @disordercs[name]
+ @fineorder[name] = Array.new unless @fineorder[name]
+ files.each do |file|
+ unless @disorder[name].include?(file) || name == file then
+ unless @defined[cs].include?(file) then
+ if @order[name] > @order[file] then
+ @disorder[name] << file
+ @disordercs[name] << "#{file}:#{cs}"
+ end
+ end
+ end
+ @fineorder[name] << file unless @fineorder[name].include?(file) || name == file
+ end
+ end
+ end
end
- def feedback(compact=false)
+ def moreuse(filename,l,line)
+ line.scan(/\\if([a-zA-Z@\?\!]{3,})/) do |name, rest| # rest, else array
+ pushuse(filename,l,"if#{name}") unless name =~ /^(true|false)$/
+ end
+ line.scan(/\\([a-zA-Z@\?\!]{3,})/) do |name, rest| # rest, else array
+ if name =~ /(true|false)$/ then
+ pushuse(filename,l,"if#{name}") unless name =~ /^(if|set)$/
+ else
+ pushuse(filename,l,name)
+ end
+ end
+ end
+
+ def feedback
begin
- outputfile = File.basename(@filename).sub(/\.tex$/,'')+'.dep'
- File.open(outputfile,'w') do |f|
- @compact = compact
- @logger.report("saving analysis in #{outputfile}") if @logger
- list, len = @cs_local.keys.sort, 0
- if @compact then
- list.each do |cs|
- if cs.length > len then len = cs.length end
+ # get max length
+ l = 0
+ list = @defined.keys.sort
+ list.each do |cs|
+ l = cs.length if cs.length > l
+ end
+ if ! @compact then
+ n = 0
+ report('')
+ report("defined: #{@defined.size}")
+ report('')
+ @defined.keys.sort.each do |cs|
+ next if @namefilter && ! @namefilter.include?(cs)
+ next if @filefilter && ! @defined[cs].include?(cs)
+ if @defined[cs].size > 1 then
+ dlist = @defined[cs].collect do |d|
+ if d == @definitive[cs] then d else "[#{d}]" end
+ end
+ else
+ dlist = @defined[cs]
end
- len += 1
- else
- f.puts "<?xml version='1.0'?>\n"
- f.puts "<dependencies xmlns='http://www.pragma-ade.com/schemas/texdeps.rng' rootfile='#{@filename}'>\n"
+ report("#{(n += 1).to_s.rjust(5,' ')} #{cs.ljust(l,' ')} == #{dlist.join(' ')}")
end
- list.each do |cs|
- if @cs_new.key?(cs) then
- if @cs_new[cs] == @cs_local[cs] then
- f.puts some_struc(cs,len,1,some_str(@cs_new,@cs_defd,cs))
- elsif @cs_new[cs].first == @cs_local[cs].first then
- f.puts some_struc(cs,len,2,some_str(@cs_new,@cs_defd,cs),some_str(@cs_local,@cs_used,cs))
- else
- f.puts some_struc(cs,len,3,some_str(@cs_new,@cs_defd,cs),some_str(@cs_local,@cs_used,cs))
- end
+ end
+ if true then
+ n = 0
+ report('')
+ report("used before defined: #{@used_before.size}")
+ report('')
+ @used_before.keys.sort.each do |cs|
+ next if @namefilter && ! @namefilter.include?(cs)
+ next if @filefilter && (@used_before[cs] & @filefilter).size == 0
+ used = @used_before[cs] - (@defined[cs] || [])
+ defined = (@defined[cs] || []).join(' ')
+ defined = "[ ? ]" if defined.empty?
+ if used.size > 0 then
+ report("#{(n += 1).to_s.rjust(5,' ')} #{cs.ljust(l,' ')} == #{defined} -> #{used.join(' ')}")
else
- f.puts some_struc(cs,len,4,some_str(@cs_local,@cs_used,cs))
+ report("#{(n += 1).to_s.rjust(5,' ')} #{cs.ljust(l,' ')} == #{defined}")
end
end
- if @compact then
- # nothing
- else
- "</dependencies>\n" unless @compact
+ report(' none') if n == 0
+ end
+ if ! @compact then
+ n = 0
+ report('')
+ report("used after defined: #{@used_after.size}")
+ report('')
+ @used_after.keys.sort.each do |cs|
+ next if @namefilter && ! @namefilter.include?(cs)
+ next if @filefilter && (@used_after[cs] & @filefilter).size == 0
+ used = @used_after[cs] - (@defined[cs] || [])
+ defined = (@defined[cs] || []).join(' ')
+ if used.size > 0 then
+ report("#{(n += 1).to_s.rjust(5,' ')} #{cs.ljust(l,' ')} == #{defined} <- #{used.join(' ')}")
+ else
+ report("#{(n += 1).to_s.rjust(5,' ')} #{cs.ljust(l,' ')} == #{defined}")
+ end
+ end
+ report(' none') if n == 0
+ end
+ if ! @compact then
+ unless @filefilter || @namefilter then
+ [false,true].each do |mode|
+ n = 0
+ report("")
+ report("file dependecies #{if mode then '(critical)' end}")
+ [@dependencies].each do |dependencies|
+ report("")
+ dependencies.keys.sort.each do |f|
+ if dependencies[f].size > 0 then
+ dependencies[f].delete(f)
+ end
+ if mode then
+ dep = dependencies[f].delete_if do |d|
+ f[0..3] == d[0..3] # same xxxx- prefix
+ end
+ else
+ dep = dependencies[f]
+ end
+ if dep.size > 0 then
+ name = f.nosuffix('tex').ljust(8,' ')
+ list = dep.sort.collect do |k| k.nosuffix('tex') end
+ report("#{(n += 1).to_s.rjust(5,' ')} #{name} !! #{list.join(' ')}")
+ end
+ end
+ end
+ report(' none') if n == 0
+ end
+ end
+ end
+ if true then
+ unless @filefilter || @namefilter then
+ [false,true].each do |mode|
+ [@disorder,@disordercs].each do |disorder|
+ n = 0
+ report("")
+ report("file disorder #{if mode then '(critical)' end}")
+ report("")
+ disorder.keys.sort.each do |f|
+ if disorder[f].size > 0 then
+ disorder[f].delete(f)
+ end
+ if mode then
+ dis = disorder[f].delete_if do |d|
+ f[0..3] == d[0..3] # same xxxx- prefix
+ end
+ else
+ dis = disorder[f]
+ end
+ if dis.size > 0 then
+ name = f.nosuffix('tex').ljust(8,' ')
+ list = dis.sort.collect do |k| k.nosuffix('tex') end
+ report("#{(n += 1).to_s.rjust(3,' ')} #{name} ?? #{list.join(' ')}")
+ end
+ end
+ end
+ report(' none') if n == 0
+ end
end
end
rescue
+ puts("fatal error: #{$!} #{$@.join("\n")}")
end
end
private
- def some_struc(cs,len,type=1,defstr='',usestr='')
- if @compact then
- "#{cs.ljust(len)} #{@@types[type][1]} #{defstr} #{usestr}"
- else
- "<macro name='#{cs}' type='#{type}'>\n" +
- if defstr.empty? then " <defined/>\n" else " <defined>\n#{defstr} <\defined>\n" end +
- if usestr.empty? then " <used/>\n" else " <used>#{usestr}\n <\used>\n" end +
- "</macro>\n"
- end
+ def csdefined?(cs,filename)
+ @defined[cs] && @defined[cs].include?(filename)
+ end
+ def csbefore?(cs,filename)
+ @used_before[cs] && @used_before[cs].include?(filename)
+ end
+ def csafter?(cs,filename)
+ @used_after[cs] && @used_after[cs].include?(filename)
end
- def some_str(files, lines, cs)
- return '' unless files[cs]
- if @compact then
- str = '[ '
- files[cs].each do |c|
- str += c
- str += " (#{lines[cs][c].join(' ')}) " if lines[cs][c]
- str += ' '
- end
- str += ']'
- str.gsub(/ +/, ' ')
- else
- str = ''
- files[cs].each do |c|
- if lines[cs][c] then
- str += " <file name='#{c}'>\n"
- str += " "
- lines[cs][c].each do |l|
- # str += " <line n='#{l}'/>\n"
- str += "<line n='#{l}'/>"
- end
- str += "\n"
- str += " </file>\n"
- else
- str += " <file name='#{c}'/>\n"
- end
- end
- str
- end
+ def csignored?(cs)
+ cs.to_s =~ @@skips
end
- def pushdef(filename,n,cs)
- unless @cs_new.key?(cs) then
- @cs_new[cs] = Array.new
- @cs_defd[cs] = Hash.new unless @cs_defd.key?(cs)
+ def pushdef(filename,n,cs,type)
+ if csignored?(cs) then
+ # nothing
+ elsif @defined[cs] then
+ case type
+ when 5 then
+ # if test, no definition done
+ else
+ @definitive[cs] = filename
+ unless @filefilter || @namefilter then
+ report("#{cs} is redefined") unless csdefined?(cs,filename) || @compact
+ end
+ end
+ @defined[cs] << filename unless @defined[cs].include?(filename)
+ else
+ @defined[cs] = Array.new
+ @defined[cs] << filename
+ @definitive[cs] = filename
+ @type[cs] = type
end
- @cs_defd[cs][filename] = Array.new unless @cs_defd[cs][filename]
- @cs_new[cs].push(filename) unless @cs_new[cs].include?(filename)
- @cs_defd[cs][filename] << n
end
def pushuse(filename,n,cs)
- unless @@cs_global.include?(cs.to_s) then
- unless @cs_local[cs] then
- @cs_local[cs] = Array.new
- @cs_used[cs] = Hash.new unless @cs_used.key?(cs)
- end
- @cs_used[cs][filename] = Array.new unless @cs_used[cs][filename]
- @cs_local[cs].push(filename) unless @cs_local[cs].include?(filename)
- @cs_used[cs][filename] << n
+ if csignored?(cs) then
+ # nothing
+ elsif @defined[cs] then
+ @used_after[cs] = Array.new unless @used_after[cs]
+ @used_after[cs] << filename unless csafter?(cs,filename)
+ else
+ @used_before[cs] = Array.new unless @used_before[cs]
+ @used_before[cs] << filename unless csbefore?(cs,filename)
end
end
@@ -2271,9 +2514,9 @@ class Commands
filename = if @commandline.arguments.empty? then 'context.tex' else @commandline.arguments.first end
compact = @commandline.option('compact')
- ['progname=context',''].each do |progname|
+ ['context',''].each do |progname|
unless FileTest.file?(filename) then
- name = `kpsewhich #{progname} #{filename}`.chomp
+ name = Kpse.found(filename, progname)
if FileTest.file?(name) then
filename = name
break
@@ -2281,10 +2524,12 @@ class Commands
end
end
- if FileTest.file?(filename) && deps = TexDeps.new(logger) then
+ if FileTest.file?(filename) && deps = TexDeps.new(logger,compact) then
+ deps.setfilter(@commandline.option('filter'))
deps.load
deps.analyze
- deps.feedback(compact)
+ deps.feedback
+ deps.save if @commandline.option('save')
else
report("unknown file #{filename}")
end
@@ -2365,9 +2610,9 @@ class Commands
end
def locatedlocaltree
- tree = `kpsewhich --expand-path $TEXMFLOCAL`.chomp rescue nil
+ tree = Kpse.used_path('TEXMFLOCAL')
unless tree && FileTest.directory?(tree) then
- tree = `kpsewhich --expand-path $TEXMF`.chomp rescue nil
+ tree = Kpse.used_path('TEXMF')
end
return tree
end
@@ -2377,7 +2622,8 @@ class Commands
report("fatal error, '#{archive}' has not been downloaded")
return false
end
- unless system("unzip -uo #{archive}") then
+ # unless system("unzip -uo #{archive}") then
+ unless system("unzip -o #{archive}") then
report("fatal error, make sure that you have 'unzip' in your path")
return false
end
@@ -2441,15 +2687,18 @@ commandline.registeraction('dpxmapfiles' , 'convert pdftex mapfiles to dvi
commandline.registeraction('listentities' , 'create doctype entity definition from enco-uc.tex')
commandline.registeraction('brandfiles' , 'add context copyright notice [--force]')
commandline.registeraction('platformize' , 'replace line-endings [--recurse --force] [pattern]')
-commandline.registeraction('dependencies' , 'analyze depedencies witin context [--compact] [rootfile]')
+commandline.registeraction('dependencies' , 'analyze depedencies within context [--save --compact --filter=[macros|filenames]] [filename]')
commandline.registeraction('updatecontext' , 'download latest version and remake formats')
commandline.registeraction('disarmutfbom' , 'remove utf bom [--force]')
commandline.registervalue('type','')
+commandline.registervalue('filter','')
commandline.registerflag('recurse')
commandline.registerflag('force')
+commandline.registerflag('compact')
commandline.registerflag('pipe')
+commandline.registerflag('save')
commandline.registerflag('all')
commandline.registerflag('xml')
commandline.registerflag('log')
diff --git a/Master/texmf-dist/scripts/context/ruby/pdftools.rb b/Master/texmf-dist/scripts/context/ruby/pdftools.rb
index 8a62a048728..d40e2d85281 100644
--- a/Master/texmf-dist/scripts/context/ruby/pdftools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/pdftools.rb
@@ -15,10 +15,7 @@
banner = ['PDFTools', 'version 1.2.1', '2003/2005', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/pstopdf.rb b/Master/texmf-dist/scripts/context/ruby/pstopdf.rb
index 197f83961ff..a677cb61788 100644
--- a/Master/texmf-dist/scripts/context/ruby/pstopdf.rb
+++ b/Master/texmf-dist/scripts/context/ruby/pstopdf.rb
@@ -12,7 +12,7 @@
banner = ['PsToPdf', 'version 2.0.1', '2002-2006', 'PRAGMA ADE/POD']
-$: << File.expand_path(File.dirname($0))
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
# todo: paden/prefix in magick and inkscape
# todo: clean up method handling (pass strings, no numbers)
diff --git a/Master/texmf-dist/scripts/context/ruby/rlxtools.rb b/Master/texmf-dist/scripts/context/ruby/rlxtools.rb
index 1225dedb301..40a45bd51a8 100644
--- a/Master/texmf-dist/scripts/context/ruby/rlxtools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/rlxtools.rb
@@ -12,10 +12,7 @@
banner = ['RlxTools', 'version 1.0.1', '2004/2005', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
@@ -98,6 +95,9 @@ class Commands
if conversion = variables['conversion'] then
report("testing for conversion #{conversion}")
if suffix = variables['suffix'].downcase then
+ if ! suffix.empty? && variables['file'] && variables['file'] !~ /\.([a-z]+)$/i then
+ variables['file'] += ".#{suffix}"
+ end
if file = variables['file'] then
report("conversion #{conversion} for suffix #{suffix} for file #{file}")
else
@@ -251,17 +251,43 @@ class Commands
include CommandBase
- def identify
- @commandline.arguments.each do |filename|
- if state = do_identify(filename) then
- begin
- File.open(filename+'.rli','w') do |f|
- f << state
+ @@xmlbanner = "<?xml version='1.0' standalone='yes'?>"
+
+ def identify(resultfile='rlxtools.rli')
+ if @commandline.option('collect') then
+ begin
+ File.open(resultfile,'w') do |f|
+ f << "#{@@xmlbanner}\n"
+ f << "<rl:identification>\n"
+ @commandline.arguments.each do |filename|
+ if state = do_identify(filename) then
+ report("#{filename} is identified")
+ f << state
+ else
+ report("unable to identify #{filename}")
+ end
+ end
+ f << "</rl:identification>\n"
+ report("result saved in #{resultfile}")
+ end
+ rescue
+ report("error in writing result")
+ end
+ else
+ @commandline.arguments.each do |filename|
+ if state = do_identify(filename) then
+ begin
+ File.open(filename+'.rli','w') do |f|
+ f << "#{@@xmlbanner}\n"
+ f << state
+ end
+ rescue
+ report("error in identifying #{filename}")
+ else
+ report("#{filename} is identified")
end
- rescue
- report("error in identifying #{filename}")
else
- report("#{filename} is identified")
+ report("unable to identify #{filename}")
end
end
end
@@ -269,11 +295,15 @@ class Commands
private
- def do_identify(filename)
+ def do_identify(filename,centimeters=false)
begin
str = nil
if FileTest.file?(filename) then
- result = `identify -format \"x=%x,y=%y,w=%w,h=%h,b=%b\" #{filename}`.chomp.split(',')
+ if centimeters then
+ result = `identify -units PixelsPerCentimeter -format \"x=%x,y=%y,w=%w,h=%h,b=%b\" #{filename}`.chomp.split(',')
+ else
+ result = `identify -units PixelsPerInch -format \"x=%x,y=%y,w=%w,h=%h,b=%b\" #{filename}`.chomp.split(',')
+ end
tags = Hash.new
result.each do |r|
if rr = r.split("=") then
@@ -285,7 +315,6 @@ class Commands
height = unified(tags['h']||0,tags['y']||'1')
if size > 0 then
str = ''
- str << "<?xml version='1.0' standalone='yes'?>\n"
str << "<rl:identify name='#{File.basename(filename)}'>\n"
str << " <rl:size>#{size}</rl:size>\n"
str << " <rl:path>#{File.dirname(filename).sub(/\\/o,'/')}</rl:path>\n"
@@ -322,13 +351,14 @@ end
logger = Logger.new(banner.shift)
commandline = CommandLine.new
-commandline.registeraction('manipulate', ' [--test] manipulatorfile resourselog')
-commandline.registeraction('identify', 'filename')
+commandline.registeraction('manipulate', '[--test] manipulatorfile resourselog')
+commandline.registeraction('identify' , '[--collect] filename')
commandline.registeraction('help')
commandline.registeraction('version')
commandline.registerflag('test')
+commandline.registerflag('collect')
commandline.expand
diff --git a/Master/texmf-dist/scripts/context/ruby/texexec.rb b/Master/texmf-dist/scripts/context/ruby/texexec.rb
index 1a7175f230e..55636780dc2 100644
--- a/Master/texmf-dist/scripts/context/ruby/texexec.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texexec.rb
@@ -1,9 +1,6 @@
banner = ['TeXExec', 'version 6.2.0', '1997-2006', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'ftools' # needed ?
@@ -97,6 +94,16 @@ class Commands
end
end
+ def mpstatic
+ if job = TEX.new(logger) then
+ job.setvariable('filename',@commandline.arguments.first)
+ prepare(job)
+ job.processmpstatic
+ job.inspect && Kpse.inspect if @commandline.option('verbose')
+ exit 1 if job.error?
+ end
+ end
+
# hard coded goodies # to be redone as s-ctx-.. with vars passed as such
def listing
@@ -143,21 +150,23 @@ class Commands
end
def figures
- # this one will be redone using rlxtools
+ # we replaced "texutil --figures ..."
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
+ fast = @commandline.option('fast')
files = @commandline.arguments.sort
- if files.length > 0 then
+ if fast or (files.length > 0) then
if f = File.open(job.tempfilename('tex'),'w') then
- # will be replaced, does not work any more
- Kpse.runscript('texutil.pl',files.join(' '),'--figures')
+ files.delete("texexec.pdf")
+ Kpse.runscript('rlxtools', ['--identify','--collect'], files.join(' ')) unless fast
figures = @commandline.checkedoption('method', 'a').downcase
paperoffset = @commandline.checkedoption('paperoffset', '0pt')
backspace = @commandline.checkedoption('backspace', '1.5cm')
topspace = @commandline.checkedoption('topspace', '1.5cm')
boxtype = @commandline.checkedoption('boxtype','')
f << "% format=english\n";
+ f << "\\usemodule[res-20]\n"
f << "\\setuplayout\n";
f << " [topspace=#{topspace},backspace=#{backspace},\n"
f << " header=1.5cm,footer=0pt,\n";
@@ -175,10 +184,9 @@ class Commands
f.close
job.setvariable('interface','english')
job.setvariable('simplerun',true)
- # job.setvariable('nooptionfile',true)
job.setvariable('files',[job.tempfilename])
job.processtex
- File.silentdelete('texutil.tuf')
+ # File.silentdelete('rlxtools.rli') unless job.getvariable('keep')
else
report('no figures to show')
end
@@ -194,7 +202,7 @@ class Commands
prepare(job)
job.cleanuptemprunfiles
files = @commandline.arguments.sort
- msuffixes = ['tex','mp','pl','pm','rb']
+ msuffixes = ['tex','mkii','mkiv','mp','pl','pm','rb']
if files.length > 0 then
files.each do |fname|
fnames = Array.new
@@ -208,6 +216,11 @@ class Commands
fnames.each do |ffname|
if msuffixes.include?(File.splitname(ffname)[1]) && FileTest.file?(ffname) then
if mod = File.open(job.tempfilename('tex'),'w') then
+if File.suffix(ffname) =~ /^(mkii|mkiv)$/o then
+ markfile = $1
+else
+ markfile = nil
+end
Kpse.runscript('ctxtools',ffname,'--document')
if ted = File.silentopen(File.suffixed(ffname,'ted')) then
firstline = ted.gets
@@ -220,7 +233,7 @@ class Commands
else
mod << "% interface=en\n"
end
- mod << "\\usemodule[abr-01,mod-01]\n"
+ mod << "\\usemodule[mod-01]\n"
mod << "\\def\\ModuleNumber{1}\n"
mod << "\\starttext\n"
# todo: global file too
@@ -231,10 +244,15 @@ class Commands
job.setvariable('simplerun',true)
# job.setvariable('nooptionfile',true)
job.setvariable('files',[job.tempfilename])
+result = File.unsuffixed(File.basename(ffname))
+if markfile then
+ result = result+'-'+markfile
+end
+job.setvariable('result',result)
job.processtex
- ["dvi", "pdf","tuo"].each do |s|
- File.silentrename(job.tempfilename(s),File.suffixed(ffname,s));
- end
+ # ["dvi", "pdf","ps"].each do |s|
+ # File.silentrename(job.tempfilename(s),File.suffixed(ffname,s));
+ # end
end
end
end
@@ -246,6 +264,39 @@ class Commands
end
end
+ def pdfsplit
+ if job = TEX.new(logger) then
+ prepare(job)
+ job.cleanuptemprunfiles
+ filename = File.expand_path(@commandline.arguments.first)
+ if FileTest.file?(filename) then
+ basename = filename.sub(/\..*?$/,'')
+ tempfile = File.suffixed(job.tempfilename,'tex')
+ if basename != filename then
+ info = `pdfinfo #{filename}`
+ if info =~ /Pages:\s*(\d+)/ then
+ nofpages = $1.to_i
+ nofpages.times do |i|
+ if f = File.open(tempfile,"w") then
+ n = i + 1
+ report("extracting page #{n}")
+ f << "\\starttext\\startTEXpage\n"
+ f << "\\externalfigure[#{filename}][object=no,page=#{n}]\n"
+ f << "\\stopTEXpage\\stoptext\n"
+ f.close
+ job.setvariable('interface','english') # redundant
+ job.setvariable('simplerun',true)
+ job.setvariable('files',[tempfile])
+ job.processtex
+ end
+ end
+ end
+ end
+ end
+ job.cleanuptemprunfiles
+ end
+ end
+
def arrangeoutput
if job = TEX.new(logger) then
prepare(job)
@@ -391,8 +442,8 @@ class Commands
f << "]\n"
f << "\\definepapersize\n"
f << " [copy]\n"
- f << " [width=\\naturalfigurewidth,\n"
- f << " height=\\naturalfigureheight]\n"
+ f << " [width=\\figurewidth,\n"
+ f << " height=\\figureheight]\n"
f << "\\setuppapersize\n"
f << " [copy][copy]\n"
f << "\\setuplayout\n"
@@ -578,6 +629,7 @@ commandline.registeraction('process', 'process file')
commandline.registeraction('mptex', 'process mp file')
commandline.registeraction('mpxtex', 'process mpx file')
commandline.registeraction('mpgraphic', 'process mp file to stand-alone graphics')
+commandline.registeraction('mpstatic', 'process mp/ctx file to stand-alone graphics')
commandline.registeraction('listing', 'list of file content')
commandline.registeraction('figures', 'generate overview of figures')
@@ -587,6 +639,7 @@ commandline.registeraction('pdfselect', 'select pages from file(s)')
commandline.registeraction('pdfcopy', 'copy pages from file(s)')
commandline.registeraction('pdftrim', 'trim pages from file(s)')
commandline.registeraction('pdfcombine', 'combine multiple pages')
+commandline.registeraction('pdfsplit', 'split file in pages')
# compatibility switch
diff --git a/Master/texmf-dist/scripts/context/ruby/texmfstart.rb b/Master/texmf-dist/scripts/context/ruby/texmfstart.rb
index 411cb924873..b9ced8813e3 100644
--- a/Master/texmf-dist/scripts/context/ruby/texmfstart.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texmfstart.rb
@@ -31,9 +31,7 @@
# we don't depend on other libs
-$ownpath = File.expand_path(File.dirname($0)) unless defined? $ownpath
-
-$: << $ownpath
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require "rbconfig"
require "md5"
@@ -176,6 +174,8 @@ end
# concept : Hans Hagen
# info : j.hagen@xs4all.nl
+# todo: multiple cnf files
+#
class String
@@ -1429,7 +1429,8 @@ end
$mswindows = Config::CONFIG['host_os'] =~ /mswin/
$separator = File::PATH_SEPARATOR
-$version = "2.0.0"
+$version = "2.0.2"
+$ownpath = File.dirname($0)
if $mswindows then
require "win32ole"
@@ -1473,6 +1474,8 @@ $predefined['pdftools'] = 'pdftools.rb'
$predefined['mpstools'] = 'mpstools.rb'
$predefined['exatools'] = 'exatools.rb'
$predefined['xmltools'] = 'xmltools.rb'
+$predefined['luatools'] = 'luatools.lua'
+$predefined['mtxtools'] = 'mtxtools.rb'
$predefined['newpstopdf'] = 'pstopdf.rb'
$predefined['newtexexec'] = 'texexec.rb'
@@ -1497,6 +1500,8 @@ $makelist = [
'exatools',
'runtools',
'rlxtools',
+ 'luatools',
+ 'mtxtools',
#
# no, 'texmfstart'
]
@@ -1509,31 +1514,36 @@ $makelist = [
$scriptlist = 'rb|pl|py|lua|jar'
$documentlist = 'pdf|ps|eps|htm|html'
-$editor = ENV['TEXMFSTART_EDITOR'] || ENV['EDITOR'] || ENV['editor'] || 'scite'
+$editor = ENV['TEXMFSTART_EDITOR'] || ENV['EDITOR'] || ENV['editor'] || 'scite'
-$crossover = true # to other tex tools, else only local
+$crossover = true # to other tex tools, else only local
+$kpse = nil
-$applications['unknown'] = ''
-$applications['perl'] = $applications['pl'] = 'perl'
-$applications['ruby'] = $applications['rb'] = 'ruby'
-$applications['python'] = $applications['py'] = 'python'
-$applications['lua'] = $applications['lua'] = 'lua'
-$applications['java'] = $applications['jar'] = 'java'
+def set_applications(page=1)
-if $mswindows then
- $applications['pdf'] = ['',"pdfopen --page #{$page} --file",'acroread']
- $applications['html'] = ['','netscape','mozilla','opera','iexplore']
- $applications['ps'] = ['','gview32','gv','gswin32','gs']
-else
- $applications['pdf'] = ["pdfopen --page #{$page} --file",'acroread']
- $applications['html'] = ['netscape','mozilla','opera']
- $applications['ps'] = ['gview','gv','gs']
-end
+ $applications['unknown'] = ''
+ $applications['perl'] = $applications['pl'] = 'perl'
+ $applications['ruby'] = $applications['rb'] = 'ruby'
+ $applications['python'] = $applications['py'] = 'python'
+ $applications['lua'] = $applications['lua'] = 'lua'
+ $applications['java'] = $applications['jar'] = 'java'
-$applications['htm'] = $applications['html']
-$applications['eps'] = $applications['ps']
+ if $mswindows then
+ $applications['pdf'] = ['',"pdfopen --page #{page} --file",'acroread']
+ $applications['html'] = ['','netscape','mozilla','opera','iexplore']
+ $applications['ps'] = ['','gview32','gv','gswin32','gs']
+ else
+ $applications['pdf'] = ["pdfopen --page #{page} --file",'acroread']
+ $applications['html'] = ['netscape','mozilla','opera']
+ $applications['ps'] = ['gview','gv','gs']
+ end
-$kpse = nil
+ $applications['htm'] = $applications['html']
+ $applications['eps'] = $applications['ps']
+
+end
+
+set_applications()
def check_kpse
if $kpse then
@@ -1795,6 +1805,21 @@ def expanded(arg) # no "other text files", too restricted
end
end
+def changeddir?(path)
+ if path.empty? then
+ return true
+ else
+ begin
+ Dir.chdir(path) if ! path.empty?
+ rescue
+ report("unable to change to directory: #{path}")
+ else
+ report("changed to directory: #{path}")
+ end
+ return File.expand_path(Dir.getwd) == File.expand_path(path)
+ end
+end
+
def runcommand(command)
if $locate then
command = command.split(' ').collect do |c|
@@ -1810,20 +1835,10 @@ def runcommand(command)
print command # to stdout and no newline
elsif $execute then
report("using 'exec' instead of 'system' call: #{command}")
- begin
- Dir.chdir($path) if ! $path.empty?
- rescue
- report("unable to chdir to: #{$path}")
- end
- exec(command)
+ exec(command) if changeddir?($path)
else
report("using 'system' call: #{command}")
- begin
- Dir.chdir($path) if ! $path.empty?
- rescue
- report("unable to chdir to: #{$path}")
- end
- system(command)
+ system(command) if changeddir?($path)
end
end
@@ -1961,7 +1976,10 @@ def find(filename,program)
end
filename.sub!(/^.*[\\\/]/, '')
# next we look at the current path and the callerpath
- [['.','current'],[$ownpath,'caller'],[registered("THREAD"),'thread']].each do |p|
+ [ ['.','current'],
+ [$ownpath,'caller'], ["#{$ownpath}/../#{suffixlist[0]}",'caller'],
+ [registered("THREAD"),'thread'], ["#{registered("THREAD")}/../#{suffixlist[0]}",'thread'],
+ ].each do |p|
if p && ! p.empty? && ! (p[0] == 'unknown') then
suffixlist.each do |suffix|
fname = "#{filename}.#{suffix}"
@@ -2125,9 +2143,9 @@ def find(filename,program)
return ''
end
rescue
- # error, trace = $!, $@.join("\n")
- # report("fatal error: #{error}\n#{trace}")
- report("fatal error")
+ error, trace = $!, $@.join("\n")
+ report("fatal error: #{error}\n#{trace}")
+ # report("fatal error")
end
end
@@ -2402,7 +2420,7 @@ def execute(arguments)
$program = $directives['program'] || 'context'
$direct = $directives['direct'] || false
$edit = $directives['edit'] || false
- $page = $directives['page'] || 0
+ $page = $directives['page'] || 1
$browser = $directives['browser'] || false
$report = $directives['report'] || false
$verbose = $directives['verbose'] || false
@@ -2440,6 +2458,8 @@ def execute(arguments)
$verbose = true if (ENV['_CTX_VERBOSE_'] =~ /(y|yes|t|true|on)/io) && ! $locate && ! $report
+ set_applications($page)
+
# private:
$selfmerge = $directives['selfmerge'] || false
diff --git a/Master/texmf-dist/scripts/context/ruby/texsync.rb b/Master/texmf-dist/scripts/context/ruby/texsync.rb
index 22b7d46c0fe..ade307d8ef2 100644
--- a/Master/texmf-dist/scripts/context/ruby/texsync.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texsync.rb
@@ -16,10 +16,7 @@
banner = ['TeXSync', 'version 1.1.1', '2002/2004', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/]\w*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/textools.rb b/Master/texmf-dist/scripts/context/ruby/textools.rb
index 99338834736..345a2757204 100644
--- a/Master/texmf-dist/scripts/context/ruby/textools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/textools.rb
@@ -15,10 +15,7 @@
banner = ['TeXTools', 'version 1.3.1', '2002/2006', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/texutil.rb b/Master/texmf-dist/scripts/context/ruby/texutil.rb
index da9a192054d..ee0fc1e5e40 100644
--- a/Master/texmf-dist/scripts/context/ruby/texutil.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texutil.rb
@@ -1,9 +1,6 @@
banner = ['TeXUtil ', 'version 9.1.0', '1997-2005', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/tmftools.rb b/Master/texmf-dist/scripts/context/ruby/tmftools.rb
index 074e949d139..626ef1f4a33 100644
--- a/Master/texmf-dist/scripts/context/ruby/tmftools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/tmftools.rb
@@ -27,10 +27,7 @@
banner = ['TMFTools', 'version 1.1.0 (experimental, no help yet)', '2005/2006', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/www/exa.rb b/Master/texmf-dist/scripts/context/ruby/www/exa.rb
index c6d59d86434..5e9b3fd82e3 100644
--- a/Master/texmf-dist/scripts/context/ruby/www/exa.rb
+++ b/Master/texmf-dist/scripts/context/ruby/www/exa.rb
@@ -145,12 +145,12 @@ class WWW
dat << "</exa:data>\n"
if req.empty? then
req << "<?xml version='1.0' ?>\n"
- req << "<exa:request #{@@namespace}'>\n"
+ req << "<exa:request xmlns:exa='#{@@namespace}'>\n"
req << "<exa:application>\n"
req << "<exa:action>'#{action}</exa:action>\n" unless action.empty?
# req << "<exa:command>'#{command}</exa:command>\n" unless command.empty?
# req << "<exa:url>'#{url}</exa:url>\n" unless url.empty?
- req << "<exa:application>\n"
+ req << "</exa:application>\n"
req << "<exa:comment>constructed request</exa:comment>\n"
req << dat
req << "</exa:request>\n"
diff --git a/Master/texmf-dist/scripts/context/ruby/www/lib.rb b/Master/texmf-dist/scripts/context/ruby/www/lib.rb
index 542c31166d3..f5f362b12d0 100644
--- a/Master/texmf-dist/scripts/context/ruby/www/lib.rb
+++ b/Master/texmf-dist/scripts/context/ruby/www/lib.rb
@@ -172,8 +172,8 @@ class WWW
@interface.set('process:os' , platform)
@interface.set('process:texos' , 'texmf-' + platform)
- @interface.set('trace:run' , 'yes') if (ENV['EXA:TRACE:RUN'] || '') =~ @@re_true
- @interface.set('trace:errors' , 'yes') if (ENV['EXA:TRACE:ERRORS'] || '') =~ @@re_true
+ @interface.set('trace:run' , 'yes') if (ENV['EXA_TRACE_RUN'] || '') =~ @@re_true
+ @interface.set('trace:errors' , 'yes') if (ENV['EXA_TRACE_ERRORS'] || '') =~ @@re_true
yield self if block_given?
end
diff --git a/Master/texmf-dist/scripts/context/ruby/wwwclient.rb b/Master/texmf-dist/scripts/context/ruby/wwwclient.rb
index 8f5451a8dcf..d41541a095d 100644
--- a/Master/texmf-dist/scripts/context/ruby/wwwclient.rb
+++ b/Master/texmf-dist/scripts/context/ruby/wwwclient.rb
@@ -19,7 +19,7 @@
banner = ['WWWClient', 'version 1.0.0', '2003-2006', 'PRAGMA ADE/POD']
-$: << File.dirname(File.expand_path($0))
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/wwwserver.rb b/Master/texmf-dist/scripts/context/ruby/wwwserver.rb
index 18ea57df1d2..53e1cdc518e 100644
--- a/Master/texmf-dist/scripts/context/ruby/wwwserver.rb
+++ b/Master/texmf-dist/scripts/context/ruby/wwwserver.rb
@@ -2,7 +2,7 @@
banner = ['WWWServer', 'version 1.0.0', '2003-2006', 'PRAGMA ADE/POD']
-$: << File.dirname(File.expand_path($0))
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
diff --git a/Master/texmf-dist/scripts/context/ruby/wwwwatch.rb b/Master/texmf-dist/scripts/context/ruby/wwwwatch.rb
index 0afb9a39291..0faa45aec44 100644
--- a/Master/texmf-dist/scripts/context/ruby/wwwwatch.rb
+++ b/Master/texmf-dist/scripts/context/ruby/wwwwatch.rb
@@ -2,7 +2,7 @@
banner = ['WWWWatch', 'version 1.0.0', '2003-2006', 'PRAGMA ADE/POD']
-$: << File.dirname(File.expand_path($0))
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
@@ -46,6 +46,7 @@ class Watch < Monitor
@logger = logger
@verbose = false
@create = false
+ @onlyonerun = false
# [:INT, :TERM, :EXIT].each do |signal|
# trap(signal) do
# kill
@@ -100,7 +101,7 @@ class Watch < Monitor
exit! rescue false # no checking, no at_exit done
end
unless File.writable?(@cache_path) then
- puts "no valid work path: #{@work_path}" ; # no reason to exit
+ puts "no valid cache path: #{@cache_path}" ; # no reason to exit
end
@last_action = Time.now
report("watching path #{@work_path}") if @verbose
@@ -302,7 +303,7 @@ class Watch < Monitor
lck = File.expand_path(sessionfile.sub(/ses$/,'lck'))
start_of_run = Time.now
start_of_job = start_of_run.dup
- max_runtime = @max_age
+ max_time = @max_age
begin
start_of_job = vars['starttime'].to_i || start_of_run
start_of_job = start_of_run if start_of_job == 0
@@ -356,7 +357,11 @@ class Watch < Monitor
else
report("watchdog: skipping - id (#{vars['id']}) / status (#{vars['status']})") if @verbose
end
- @skips[sessionfile] = true
+ if @onlyonerun then
+ @skips[sessionfile] = true
+ else
+ @skips.delete(sessionfile)
+ end
else
# not yet ok
end
@@ -379,6 +384,15 @@ class Watch < Monitor
begin
# report(Time.now.to_s) if @verbose
loop do
+ @threads.delete_if do |k,v|
+ begin
+ v == nil || v.stop?
+ rescue
+ true
+ else
+ false
+ end
+ end
if @threads.length == @max_threads then
if @delay > @max_threads then
sleep(@delay)
diff --git a/Master/texmf-dist/scripts/context/ruby/xmltools.rb b/Master/texmf-dist/scripts/context/ruby/xmltools.rb
index a10d34314aa..fe4fbde22ec 100644
--- a/Master/texmf-dist/scripts/context/ruby/xmltools.rb
+++ b/Master/texmf-dist/scripts/context/ruby/xmltools.rb
@@ -17,11 +17,7 @@
banner = ['XMLTools', 'version 1.2.0', '2002/2006', 'PRAGMA ADE/POD']
-unless defined? ownpath
- ownpath = $0.sub(/[\\\/][a-z0-9\-]*?\.rb/i,'')
- # ownpath = File.dirname($0)
- $: << ownpath
-end
+$: << File.expand_path(File.dirname($0)) ; $: << File.join($:.last,'lib') ; $:.uniq!
require 'base/switch'
require 'base/logger'
@@ -106,6 +102,11 @@ class Commands
output.xputs("<type>#{bt}</type>\n", 6)
end
output.xputs("<size>#{File.stat(f).size}</size>\n", 6)
+ permissions = ''
+ permissions << 'r' if File.readable?(f)
+ permissions << 'w' if File.writable?(f)
+ permissions << 'x' if File.executable?(f)
+ output.xputs("<permissions>#{permissions}</permissions>\n", 6) unless permissions.empty?
end
output.xputs("<date>#{File.stat(f).mtime.strftime("%Y-%m-%d %H:%M")}</date>\n", 6)
output.xputs("</file>\n", 4)
diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/luatools.bat b/Master/texmf-dist/scripts/context/stubs/mswin/luatools.bat
new file mode 100644
index 00000000000..383bcb113b2
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/mswin/luatools.bat
@@ -0,0 +1,2 @@
+@echo off
+texmfstart luatools.lua %*
diff --git a/Master/texmf-dist/scripts/context/stubs/mswin/mtxtools.bat b/Master/texmf-dist/scripts/context/stubs/mswin/mtxtools.bat
new file mode 100644
index 00000000000..cb0b1e39e47
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/mswin/mtxtools.bat
@@ -0,0 +1,2 @@
+@echo off
+texmfstart mtxtools.rb %*
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/luatools b/Master/texmf-dist/scripts/context/stubs/unix/luatools
new file mode 100644
index 00000000000..cb3ec1add4a
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/unix/luatools
@@ -0,0 +1,2 @@
+#!/bin/sh
+texmfstart luatools.lua "$@"
diff --git a/Master/texmf-dist/scripts/context/stubs/unix/mtxtools b/Master/texmf-dist/scripts/context/stubs/unix/mtxtools
new file mode 100644
index 00000000000..2922e0b4674
--- /dev/null
+++ b/Master/texmf-dist/scripts/context/stubs/unix/mtxtools
@@ -0,0 +1,2 @@
+#!/bin/sh
+texmfstart mtxtools.rb "$@"
diff --git a/Master/texmf-dist/tex/context/base/colo-ext.tex b/Master/texmf-dist/tex/context/base/colo-ext.tex
index 182c438fa5a..33e87459df1 100644
--- a/Master/texmf-dist/tex/context/base/colo-ext.tex
+++ b/Master/texmf-dist/tex/context/base/colo-ext.tex
@@ -29,11 +29,6 @@
%D
%D will negate the colors in box zero.
-\def\negatecolorcomponent#1% #1 = \macro
- {\scratchdimen\onepoint\advance\scratchdimen-#1\onepoint
- \ifdim\scratchdimen<\zeropoint\scratchdimen\zeropoint\fi
- \edef#1{\withoutpt\the\scratchdimen}}
-
\def\negatecolorbox#1%
{\setbox#1\hbox
{\dostartnegative
diff --git a/Master/texmf-dist/tex/context/base/colo-ini.tex b/Master/texmf-dist/tex/context/base/colo-ini.tex
index bb0b8c6e84b..0042429f5ea 100644
--- a/Master/texmf-dist/tex/context/base/colo-ini.tex
+++ b/Master/texmf-dist/tex/context/base/colo-ini.tex
@@ -371,8 +371,8 @@
% {\executeifdefined{\??cr\currentpalet#1}{\executeifdefined{\??cr#1}\empty}}
{\csname\??cr\currentpalet#1\endcsname}
-%D Hex color support is not enabled by default. You need to say \setupcolor
-%D [hex] to get this working.
+%D Hex color support is not enabled by default. You need to say \type
+%D {\setupcolor [hex]} to get this working.
\ifx\colorHpattern\undefined \let\colorHpattern\colorZpattern \fi
@@ -540,6 +540,10 @@
%D The names of colors are stored in a comma separated list
%D only for the purpose of showing them with \type {\showcolor}.
%D
+%D \startbuffer
+%D \definecolor [SomeKindOfRed] [r=.8,g=.05,b=.05]
+%D \stopbuffer
+%D
%D \typebuffer
%D \getbuffer
%D
@@ -644,11 +648,6 @@
\newif\ifconverttoGRAY
-%D This module also needs:
-
-% \newif\ifMPgraphics
-% \newif\ifinpagebody
-
%D \macros
%D {startcolormode,stopcolormode,permitcolormode}
%D
@@ -659,25 +658,6 @@
\newif\ifpermitcolormode \permitcolormodetrue
-%D Since color is used frequently today (at least by the
-%D author of this module) it makes sense to optimize switching
-%D to the max.
-%D
-%D \starttyping
-%D \def\startcolormode#1%
-%D {\ifincolor\ifpermitcolormode
-%D \doifcolorelse{#1}
-%D {\getcurrentcolorspecs{#1}%
-%D \expandafter\dostartcolormode\currentcolorspecs\od}
-%D {\nostartcolormode}%
-%D \fi\fi}
-%D \stoptyping
-%D
-%D So, the more readable alternatives like the one above are
-%D gone now.
-
-\beginETEX \ifcsname
-
\def\dowithcolor#1#2% #1=\action #2=color
{\ifincolor\ifpermitcolormode
\ifcsname\??cr\currentpalet#2\endcsname
@@ -687,23 +667,6 @@
\fi\fi
\fi\fi}
-\endETEX
-
-\beginTEX
-
-\def\dowithcolor#1#2% #1=\action #2=color
- {\ifincolor\ifpermitcolormode
- \@EA\ifx\csname\??cr\currentpalet#2\endcsname\relax
- \@EA\ifx\csname\??cr#2\endcsname\relax \else
- \handlecolorwith#1\csname\??cr#2\endcsname\od
- \fi
- \else
- \handlecolorwith#1\csname\??cr\currentpalet#2\endcsname\od
- \fi
- \fi\fi}
-
-\endTEX
-
\def\startcolormode % includes \ifincolor\ifpermitcolormode
{%\dostoptransparency % needed for: {test \trans test \notrans test}
\conditionalstoptransparency
@@ -1074,12 +1037,12 @@
%D be created.
\def\registerspotcolor#1:%
- {\ifundefined{\??cl:\c!p:\@@cl@@n}%
+ {\ifcsname\??cl:\c!p:\@@cl@@n\endcsname
+ \@EA\dontregisterspotcolor
+ \else
\letgvalue{\??cl:\c!p:\@@cl@@n}\empty
%\@EA\@EA\csname registerspotcolor#1\endcsname
\csname registerspotcolor#1\@EA\endcsname
- \else
- \@EA\dontregisterspotcolor
\fi}
\def\dontregisterspotcolor #1\od{}
@@ -1112,12 +1075,12 @@
%D Experimental too (special purpose code).
\def\registerindexcolor#1:%
- {\ifundefined{\??cl:i:\@@cl@@n}%
+ {\ifcsname\??cl:i:\@@cl@@n\endcsname
+ \@EA\dontregisterindexcolor
+ \else
\letgvalue{\??cl:i:\@@cl@@n}\empty % signal
\showmessage\m!colors{12}\@@cl@@n
\@EA\@EA\csname registerindexcolor#1\endcsname
- \else
- \@EA\dontregisterindexcolor
\fi}
\let\dontregisterindexcolor\dontregisterspotcolor
@@ -1259,10 +1222,6 @@
\def\definetransparency
{\dodoubleargument\dodefinetransparency}
-%\def\dodefinetransparency[#1][#2]%
-% {\@EA\chardef\csname\??cl-#1\endcsname#2\relax
-% \ifundefined{\??cl-#2}#2\else\csname\??cl-#2\endcsname\fi}
-
\def\dodefinetransparency[#1][#2]%
{\@EA\chardef\csname\??cl-#1\endcsname#2\relax}
@@ -1570,11 +1529,6 @@
\def\colorsplitsuffix{\ifcase\currentcolorchannel\else-\@@clsplit\fi}
\def\colorsplitprefix{\ifcase\currentcolorchannel\else\@@clsplit-\fi}
-\ifx\resetsystemmode\undefined
- \let\setsystemmode \gobbleoneargument
- \let\resetsystemmode\gobbleoneargument
-\fi
-
\def\setcolorsplitting
{\resetsystemmode{\v!color\colorsplitsuffix}%
\resetcolorsplitting
@@ -1629,7 +1583,7 @@
\processaction
[\@@clconversion]
[ \v!yes=>\preferGRAYtrue,
- \v!always=>\preferGRAYtrue\RGBsupportedfalse\CMYKsupportedfalse]%
+ \v!always=>\preferGRAYtrue\RGBsupportedfalse\CMYKsupportedfalse]%
\ifRGBsupported
\converttoGRAYfalse
\forcegrayMPcolorsfalse
@@ -1669,19 +1623,6 @@
\let\currentpalet\empty
-\beginTEX
-
-\def\doifcolorelse#1%
- {\@EA\ifx\csname\??cr\@EA\ifx\csname\??cr\currentpalet#1\endcsname\relax\else\currentpalet\fi#1\endcsname\relax
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\endTEX
-
-\beginETEX \ifcsname
-
\def\doifcolorelse#1%
{\ifcsname\??cr\ifcsname\??cr\currentpalet#1\endcsname\currentpalet\fi#1\endcsname
\expandafter\firstoftwoarguments
@@ -1689,8 +1630,6 @@
\expandafter\secondoftwoarguments
\fi}
-\endETEX
-
%D \macros
%D {localstartcolor,localstopcolor}
%D
@@ -1755,11 +1694,64 @@
\def\@@currentcolorstop {\??cl\the\colorlevel S}
%def\@@currenttransparent{\??cl\the\colorlevel T}
-\def\currentcolor
+% \def\currentcolorname
+% {\csname
+% \ifcsname\@@currentcolorname\endcsname\@@currentcolorname\else\s!empty\fi
+% \endcsname}
+
+\letvalue{\??cl*\s!black}\s!black
+
+\def\currentcolorname
{\csname
- \ifundefined\@@currentcolorname\s!empty\else\@@currentcolorname\fi
+ \ifcsname\@@currentcolorname\endcsname
+ \expandafter\ifx\csname\@@currentcolorname\endcsname\empty
+ \??cl*\s!black
+ \else
+ \@@currentcolorname
+ \fi
+ \else
+ \??cl*\s!black
+ \fi
\endcsname}
+% \def\outercolorname
+% {\ifcsname\@@currentcolorname\endcsname currentcolor\else\s!black\fi}
+
+\def\outercolorname
+ {\ifcsname\@@currentcolorname\endcsname
+ \expandafter\ifx\csname\@@currentcolorname\endcsname\empty
+ \s!black
+ \else
+ currentcolor%
+ \fi
+ \else
+ \s!black
+ \fi}
+
+\def\startcurrentcolor{\startcolor[\outercolorname]}
+\def\stopcurrentcolor {\stopcolor}
+
+% not the following, because we need a different tag in order to trick the stack
+%
+% \def\outercolorname{\executeifdefined\@@currentcolorname\s!black}
+%
+% \def\startcurrentcolor{\expanded{\startcolor[\s!black]\noexpand\startcolor[\outercolorname]}}
+% \def\stopcurrentcolor {\stopcolor\stopcolor}
+%
+% test case:
+%
+% \setupcolors[state=start,textcolor=red]
+% \starttext
+% red
+% \color[green]{green
+% \startMPcode
+% label(\sometxt{green\color[blue]{blue}green}, origin) withcolor red;
+% draw fullcircle scaled 1cm xscaled 2;
+% \stopMPcode
+% green}
+% red
+% \stoptext
+
\def\dodoglobalstartcolor
{\global\@EA\let\@EA\@@currentcolor\csname\@@currentcolorname\endcsname
\global\advance\colorlevel \@@colorplus
@@ -2244,13 +2236,13 @@
\def\dodefinepalet[#1][#2]%
{\doifassignmentelse{#2}
- {\showmessage\m!colors6{#1}%
+ {%\showmessage\m!colors6{#1}%
\letvalue{\??pa#1}\empty
\setevalue{\??pa\??pa#1}{#2}%
\def\dodododefinepalet[##1=##2]%
{\doifvaluesomething{\??pa#1}
{\setevalue{\??pa#1}{\csname\??pa#1\endcsname,}}%
- \setevalue{\??pa#1}{\csname\??pa\endcsname##1}%
+ \setevalue{\??pa#1}{\csname\??pa#1\endcsname##1}%
\doifassignmentelse{##2}
{% == \definepalet[test][xx={y=.4}]
\definecolor[\??pa#1:##1][##2]%
@@ -2298,15 +2290,12 @@
{\edef\currentpalet{#1}%
\ifx\currentpalet\empty
% seems to be a reset
+ \else\ifcsname\??pa\currentpalet\endcsname
+ \edef\currentpalet{#1:}%
\else
- % fast enough for tex and etex
- \@EA\ifx\csname\??pa\currentpalet\endcsname\relax
- \showmessage\m!colors7\currentpalet
- \let\currentpalet\empty
- \else
- \edef\currentpalet{#1:}%
- \fi
- \fi}
+ \showmessage\m!colors7\currentpalet
+ \let\currentpalet\empty
+ \fi\fi}
%D \macros
%D {showpalet}
@@ -2518,23 +2507,6 @@
\newif\ifMPcmykcolors % \MPcmykcolorsfalse
\newif\ifMPspotcolors % \MPspotcolorsfalse
-\beginTEX
-
-\def\scaledMPcolor#1#2%
- {\ifMPgraphics
- \handlecolorwith\doMPcolor
- \csname\??cr\@EA
- \ifx\csname\??cr\currentpalet#2\endcsname\relax\else\currentpalet\fi
- #2\endcsname
- :::::::\end#1\end
- \else
- #2%
- \fi}
-
-\endTEX
-
-\beginETEX \ifcsname
-
\def\scaledMPcolor#1#2%
{\ifMPgraphics
\handlecolorwith\doMPcolor
@@ -2546,8 +2518,6 @@
#2%
\fi}
-\endETEX
-
\def\MPcolor{\scaledMPcolor1}
%D Before we had transparency available, the following
@@ -2566,9 +2536,10 @@
%D expandabele.
\def\doMPcolor#1:% #1 can be \relax ! ! ! i.e. an empty color
- {\csname
- MPc\@EA\ifx\csname MPc\string#1\endcsname\relax B\else#1\fi
- \endcsname}
+ {\csname MPc\@EA\ifx\csname MPc\string#1\endcsname\relax B\else#1\fi\endcsname}
+
+% \def\doMPcolor#1:% #1 can be \relax ! ! ! i.e. an empty color
+% {\csname MPc\ifcsname MPc#1\endcsname#1\else B\fi\endcsname}
\def\MPcR{\doMPrgb}
\def\MPcC{\ifMPcmykcolors\@EA\doMPcmykY\else\@EA\doMPcmykN\fi}
@@ -2766,4 +2737,30 @@
%D As we can see, color support is turned off by default.
%D Reduction of gray colors to gray scales is turned on.
+%D \macros
+%D {negatecolorcomponent,negatedcolorcomponent}
+%D
+%D These speak for themselves. See \type {colo-ext} for usage.
+
+\def\negatecolorcomponent#1% #1 = \macro
+ {\scratchdimen\onepoint\advance\scratchdimen-#1\onepoint
+ \ifdim\scratchdimen<\zeropoint\scratchdimen\zeropoint\fi
+ \edef#1{\withoutpt\the\scratchdimen}}
+
+\let\negatedcolorcomponent\firstofoneargument
+
+\beginETEX
+
+\def\negatedcolorcomponent#1%
+ {\ifdim\dimexpr\onepoint-#1\onepoint\relax<\zeropoint
+ \!!zerocount
+ \else
+ \expandafter\withoutpt\the\dimexpr\onepoint-#1\onepoint\relax
+ \fi}
+
+\def\negatecolorcomponent#1% #1 = \macro
+ {\edef#1{\negatedcolorcomponent{#1}}}
+
+\endETEX
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-err.tex b/Master/texmf-dist/tex/context/base/cont-err.tex
index 8b4ca8a543c..f01ce87aadb 100644
--- a/Master/texmf-dist/tex/context/base/cont-err.tex
+++ b/Master/texmf-dist/tex/context/base/cont-err.tex
@@ -11,16 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% todo : translate into language
+\unprotect
-% \writeline
-% \writestring{>>>> I cannot locate your local setup file. Locate 'cont-sys.rme'}
-% \writestring{>>>> and copy this file to '../tex/context/usr/cont-sys.tex'. You}
-% \writestring{>>>> can set cq. uncomment your local preferences in this file.}
-% \writeline
+\writestatus\m!systems{no file 'cont-sys.tex', using 'cont-sys.rme' instead}
-\writeline
-\writestring{> User file 'cont-sys.tex' not found, 'cont-sys.rme' has been used instead. <}
-\writeline
-
-\endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-fil.tex b/Master/texmf-dist/tex/context/base/cont-fil.tex
index 6988f57f008..417bc437fdd 100644
--- a/Master/texmf-dist/tex/context/base/cont-fil.tex
+++ b/Master/texmf-dist/tex/context/base/cont-fil.tex
@@ -30,6 +30,7 @@
%definefilesynonym [sch-make] [sch-01]
\definefilesynonym [dir-make] [dir-01]
+\definefilesynonym [dir-identify] [dir-05]
\definefilesynonym [xml-format] [xml-01]
\definefilesynonym [xml-pretty] [xml-02]
@@ -50,6 +51,7 @@
\definefilesynonym [res-crop] [res-07]
\definefilesynonym [res-trace] [res-08]
\definefilesynonym [res-log] [res-09]
+\definefilesynonym [res-identify] [res-12]
\definefilesynonym [med-show] [res-50]
diff --git a/Master/texmf-dist/tex/context/base/cont-log.tex b/Master/texmf-dist/tex/context/base/cont-log.tex
index dae135a1c1f..4f9bf2d5e3e 100644
--- a/Master/texmf-dist/tex/context/base/cont-log.tex
+++ b/Master/texmf-dist/tex/context/base/cont-log.tex
@@ -213,32 +213,29 @@
%D And this is how they show up: \TeX, \MetaFont, \MetaPost,
%D \PiCTeX, \TaBlE, \ConTeXt, \PPCHTeX, \AmSTeX, \LaTeX,
-%D \LamSTeX. We also define some logos for the programs that
-%D we wrote and use at \PRAGMA: \TeX EDIT, \TeX FORM, \TeX
-%D ADRES, \TeX SPELL, \TeX UTIL and \TeX.
+%D \LamSTeX.
-\def\TEXEDIT {\TeX edit}
-\def\TEXFORM {\TeX form}
-\def\TEXADRES {\TeX adres}
-\def\TEXSPELL {\TeX spell}
-\def\TEXUTIL {\TeX util}
-\def\TEXEXEC {\TeX exec}
+% \def\TEXEDIT {\TeX edit}
+% \def\TEXFORM {\TeX form}
+% \def\TEXADRES {\TeX adres}
+% \def\TEXSPELL {\TeX spell}
+% \def\TEXUTIL {\TeX util}
+% \def\TEXEXEC {\TeX exec}
%D Some placeholders:
\def\eTeX {\mathematics{\varepsilon}-\TeX}
\def\pdfTeX {pdf\TeX}
\def\pdfeTeX {pdfe-\TeX}
+\def\luaTeX {lua\TeX}
\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX}
\let\ETEX \eTeX
\let\PDFTEX \pdfTeX
\let\PDFETEX \pdfeTeX
+\let\LUATEX \luaTeX
\let\XETEX \XeTeX
-\def\XML {XML}
-\def\MATHML {MathML}
-
\beginXETEX depth adjustment of logos
% The next patch by Adam Lindsay is needed to satisfy XeTeX's
diff --git a/Master/texmf-dist/tex/context/base/cont-new.mkii b/Master/texmf-dist/tex/context/base/cont-new.mkii
new file mode 100644
index 00000000000..9610dbd4b9d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/cont-new.mkii
@@ -0,0 +1,14 @@
+%D \module
+%D [ file=cont-new,
+%D version=1995.10.10,
+%D title=\CONTEXT\ Miscellaneous Macros,
+%D subtitle=New Macros,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-new.tex b/Master/texmf-dist/tex/context/base/cont-new.tex
index 0cdb791700c..daaeb578248 100644
--- a/Master/texmf-dist/tex/context/base/cont-new.tex
+++ b/Master/texmf-dist/tex/context/base/cont-new.tex
@@ -11,192 +11,60 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2006.08.08 21:51}
+% it's about time to clean up this file ...
+
+\newcontextversion{2006.11.17 19:52}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
%D features.
-% \font\f=dummyfont \rpcode\f0=500 \hbox{..}\char0
+\unprotect
+\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex}
+
+% \font\f=dummyfont \rpcode\f0=500 \hbox{..}\char0
% todo: mp-new
% caption: grid=top|bottom in xml defs
-
-\unprotect
-
-% \setuplabeltext[\s!itemcount1={{I(},{)}}]
-% \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}}
-\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex}
-
-% we need to overhaul the page modules anyway
-
-\def\settext
- {\doquintupleempty\dosettext}
-
-\def\dosettext[#1][#2][#3][#4][#5]% header text middle text/text
- {\iffifthargument
- \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}%
- {\dodoubletexts{\??tk#1}{#2}%
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}%
- \else\iffourthargument
- \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}%
- {\dodoubletexts{\??tk#1}{#2}%
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}%
- \else\ifthirdargument
- \setvalue{\??tk#1#2\c!middletext}%
- {\dodoubletexts{\??tk#1}{#2}%
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}%
- \fi\fi\fi}
-
-\def\resettext
- {\dotripleempty\doresettext}
-
-\def\doresettext[#1][#2][#3]% header text middle
- {\ifthirdargument
- \letvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}\empty
- \else\ifsecondargument
- \letvalue{\??tk#1#2\c!lefttext }\empty
- \letvalue{\??tk#1#2\c!middletext}\empty
- \letvalue{\??tk#1#2\c!righttext }\empty
- \fi\fi}
-
-\setvalue{:\c!middle:\c!text:}{\c!middletext}
-\setvalue{:\c!left :\c!text:}{\c!lefttext }
-\setvalue{:\c!right :\c!text:}{\c!righttext }
-
-% \settext[header][text][middle][xxx][yyy]
+\def\dividedsize#1#2#3% size gap n
+ {\dimexpr
+ \ifnum\dimexpr#1\relax>\plusone
+ (\dimexpr#1\relax-\numexpr#3-1\relax\dimexpr#2\relax)/#3\else#1%
+ \fi
+ \relax}
-%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
+% maybe to be integrated (option=...)
-% better collectitems als conditional and a real plugin mechanism (some day)
+\def\directexternalfigure
+ {\dodoubleempty\dodirectexternalfigure}
-\@EA\long\@EA\def\@EA\collectitemgroupitem\@EA#\@EA1\csname\e!stop\v!item\endcsname
- {\increment\itemcollectcounter
- \long\setvalue{\v!item*\itemcollectcounter}{\item#1\par}}
-
-\def\flushcollecteditems
- {\ifconditional\randomizeitems
- \getrandomnumber\itemcollectcounternow\plusone\itemcollectcounter
- \else
- \increment\itemcollectcounternow
- \fi
- \doifdefined{\v!item*\itemcollectcounternow}
- {\getvalue{\v!item*\itemcollectcounternow}%
- \letbeundefined{\v!item*\itemcollectcounternow}%
- \increment\itemcollectcounterdone}%
- \ifnum\itemcollectcounterdone<\itemcollectcounter\relax
- \expandafter\flushcollecteditems
- \fi}
-
-\def\stopcollectitems
- {\ifconditional\randomizeitems
- \newcounter\itemcollectcounterdone
- \ifnum\itemcollectcounter>\zerocount
- \@EAEAEA\flushcollecteditems
- \fi
- \fi}
+\def\dodirectexternalfigure[#1][#2]%
+ {\bgroup
+ \getparameters[\??ef][\c!type=\splitofftype,\c!page=1,#2]%
+ \sanitizefilename#1\to\expandedfigurename
+ \splitfilename\expandedfigurename
+ \let\@@DriverImageWidth \!!zeropoint
+ \let\@@DriverImageHeight \!!zeropoint
+ \let\@@DriverImageFile \splitofffull
+ \let\@@DriverImageType \@@eftype
+ \let\@@DriverImageMethod \@@eftype
+ \let\@@DriverImageLabel \empty
+ \let\@@DriverImagePage \@@efpage
+ \doinsertfile
+ \egroup}
-\def\startcollectitems
- {\ifconditional\randomizeitems
- \newcounter\itemcollectcounter
- \letvalue{\e!start\v!item}\collectitemgroupitem
- \fi}
+% \directexternalfigure[cow.pdf]
-% This will move to core-fig asap:
-%
-% todo: process between runs
-
-\startXMLmapping[rli]
- \defineXMLprocess[rl:identify]
- \defineXMLsavecontent[rl:width] {\!!zeropoint}
- \defineXMLsavecontent[rl:height]{\!!zeropoint}
-\stopXMLmapping
-
-\let\rliwidth \!!zeropoint
-\let\rliheight\!!zeropoint
-
-\def\getRLIfiguredimensions#1%
- {\global\let\rliwidth \!!zeropoint
- \global\let\rliheight\!!zeropoint
- \doifelsenothing\@@efconversion
- {\doiffileelse\@@effilenametype
- {\doiffileelse{\@@effilenametype.rli}
- {}
- {% let's try runtime running first
- \writestatus\m!figures{using rlxtools to determine size of \@@effilenametype}%
- \executesystemcommand{texmfstart rlxtools --identify \@@effilenametype}}%
- \doiffileelse{\@@effilenametype.rli}
- {}
- {% we assume that runtime running failed
- \installprogram{texmfstart rlxtools --identify \@@effilenametype}}%
- \startnointerference
- \startXMLmapping[rli]%
- \startXMLignore
- \processXMLfile{\@@effilenametype.rli}%
- \xdef\rliwidth {\XMLflush{rl:width}}%
- \xdef\rliheight{\XMLflush{rl:height}}%
- \stopXMLignore
- \stopXMLmapping
- \stopnointerference}
- {}}
- {}} % no rli when rlx conversion is in place
-
-\def\getfiguredimensionsC
- {\ifcase\figurestatus\ifcase\figurefilemode\else
- \doifsomething\@@efcurrentpath
- {\doifnotinset\@@effiletype{\c!tex,\c!tmp}
- {\doiffileelse\@@efcurrentfile
- {\@@eftrace{using rlxtools to identify \@@effilenametype}%
- \getRLIfiguredimensions{\@@effilenametype}%
- \ifdim\rliwidth>\zeropoint \ifdim\rliheight>\zeropoint
- \geteparameters % e !
- [\??ep]
- [\c!x=\!!zeropoint,\c!y=\!!zeropoint, % brrr, todo: bbox
- \c!w=\rliwidth,\c!h=\rliheight]%
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile
- \chardef\figurestatus\plusfour % todo, message is wrong now
- \fi \fi
- \@@eftrace{\ifcase\figurestatus not \fi found}}
- {}}}%
- \fi\fi}
+% normally one does not want this to happen nested, maybe there
+% is more; non public vars btw, will become conditionals
-\let\doanalyzefigurefilesB\relax % obsolete
-\let\doanalyzefigurefilesC\relax % obsolete
+\appendtoks \writetoregisterfalse \to \everybeforeutilityread
+\appendtoks \writetolistfalse \to \everybeforeutilityread
+\appendtoks \notesenabledfalse \to \everybeforeutilityread
-\def\environment #1 % at outermost level only (load only once)
- {\pushmacro\startenvironment
- \pushmacro\stopenvironment
- \def\startenvironment ##1 {}%
- \let\stopenvironment\relax
- \startreadingfile
- \doexecutefileonce{#1}
- \stopreadingfile
- \popmacro\startenvironment
- \popmacro\stopenvironment}
+% \setuplabeltext[\s!itemcount1={{I(},{)}}]
+% \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}}
\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
@@ -214,204 +82,10 @@
%
% \def\getlocation#1{\executeifdefined{loc:#1}{#1}}
-\def\convertencodedtokens{\stringifyencodedtokens}
-
-% test case:
-%
-% \enableregime[cp1250]
-% \mainlanguage[cz]
-%
-% \starttext
-%
-% \title{Žluouècí konì úpí}
-% \placelist[chapter][criterium=all]
-%
-% \startbuffer
-% <chapter>
-% <title>Žluouècí konì úpí</title>
-% </chapter>
-% \stopbuffer
-%
-% \defineXMLenvironment
-% [chapter]
-% {\defineXMLsave[title]}
-% {\expanded{\chapter{\XMLflush{title}}}}
-% \processXMLbuffer
-%
-% \setuphead[chapter][expansion=yes]
-% \defineXMLenvironment
-% [chapter]
-% {\defineXMLsave[title]}
-% {\chapter{\XMLflush{title}}}
-% \processXMLbuffer
-%
-% \stoptext
-
% just in case we load something from a file (pdfr-ec for instance)
\prependtoks \restoreendofline \to \everybeforeshipout
-% \tracefilestrue
-%
-% \unexpanded\def\readfile#1#2#3%
-% {\readlocfile{#1}{#2}
-% {\readjobfile{#1}{#2}
-% {\readsysfile{#1}{#2}{#3}}}}
-
-\unexpanded\def\readfile#1#2#3%
- {\readlocfile{#1}{#2}{\readsysfile{#1}{#2}{#3}}}
-
-\chardef\preprocessmethod 2 % 0=no check 1=present_check 2=log_check
-\chardef\preprocessstate 0 % 1=found 2=not_present (skip)
-\def \preprocesssuffix {.prep}
-
-\def\loadctxpreplist
- {\ifcase\preprocessmethod
- % no checking
- \or
- % simple checking
- \or
- \doiffileexistselse{./\jobname.ctl}
- {\bgroup
- \defineXMLenvironment[ctx:preplist]
- {\writestatus\m!systems{loading ctx log file}}
- {}%
- \defineXMLenvironmentsave[ctx:prepfile][done=no]
- {}
- {\writestatus\m!systems{registering \XMLflush{ctx:prepfile} -> \XMLop{done}}%
- \setxvalue{fp..\XMLflush{ctx:prepfile}}{\XMLop{done}}}%
- \processXMLfile{./\jobname.ctl}%
- \egroup}%
- {\global\chardef\preprocessmode\plusone}%
- \fi
- \global\let\loadctxpreplist\relax}
-
-\appendtoks\loadctxpreplist\to\everystarttext % will become: \prependtoks\loadctxpreplist\to\everyjob
-
-\def\docheckprepfile
- {\ifcase\preprocessmethod
- \iftracefiles\writestatus\m!systems{preprocessing - not needed}\fi
- % no preprocessing
- \or
- % only check for existence
- \iftracefiles\writestatus\m!systems{preprocessing - check exitence of \readfilename\preprocesssuffix}\fi
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- \donothing
- \or
- % check when in list, otherwise assume normal file
- \bgroup
- \splitfilename\readfilename
- \ifx\splitofftype\empty
- % saveguard and speed up
- \iftracefiles\writestatus\m!systems{preprocessing - no suffix}\fi
- \egroup
- \else
- \iftracefiles\writestatus\m!systems{preprocessing - check presence of \readfilename\preprocesssuffix}\fi
- \doifdefinedelse{fp..\readfilename}
- {\egroup
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- {\chardef\preprocessstate\plustwo}}%
- {\doifdefinedelse{fp..\splitoffname.\splitofftype}
- {\egroup
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- {\chardef\preprocessstate\plustwo}}%
- {\egroup}}%
- \fi
- \fi}
-
-% beware, \readfilename keeps the original one, but we load and store the
-% suffixed with .prep file (if present)
-
-\def\doreadfile#1#2#3#4% beware, this one already works at format generation time!
- {\sanitizefilename#2\to\readfilename
- \ifx\readfilename\empty
- % silently ignore
- \else
- \let\trackedfilename\readfilename
- \chardef\preprocessstate\zerocount
- \ifconditional\trackfilenames
- \doifundefinedelse{fn..\trackedfilename}\donetrue\donefalse
- \else
- \donetrue
- \fi
- \ifdone
- \checkfilename\readfilename
- \ifcase\kindoffile
- % not a full path or url, check for existence
- \doifelsenothing{#1}
- {\iftracefiles\writestatus\m!systems{searching for \readfilename\space on tex path}\fi
- \def\next{\redoreadfile\readfilename{#3}{#4}}}%
- {\iftracefiles\writestatus\m!systems{searching for \readfilename\space on #1}\fi
- \def\next{\redoreadfile{\pathplusfile{#1}{\readfilename}}{#3}{#4}}}%
- \else
- % a full path or url, no further checking done
- \docheckprepfile
- \ifcase\preprocessstate
- \doiffileexistselse\readfilename
- {\iftracefiles\writestatus\m!systems{located \readfilename}\fi
- \def\next{#3\dodoreadfile}}%
- {\iftracefiles\writestatus\m!systems{not found \readfilename}\fi
- \def\next{#4}}%
- \or
- \iftracefiles\writestatus\m!systems{located \readfilename\preprocesssuffix}\fi
- \def\next{#3\dodoreadfile}%
- \or
- \iftracefiles\writestatus\m!systems{not found \readfilename\preprocesssuffix}\fi
- \def\next{#4}%
- \fi
- \fi
- \else
- \edef\readfilename{\getvalue{fn..\readfilename}}%
- \iftracefiles\writestatus\m!systems{already located \readfilename}\fi
- \def\next{#3\dodoreadfile}%
- \fi
- \expandafter\next
- \fi}
-
-\def\redoreadfile#1#2#3%
- {\docheckprepfile
- \ifcase\preprocessstate
- \doiffileexistselse{#1}%
- {\edef\readfilename{#1}%
- \iftracefiles\writestatus\m!systems{#1 located}\fi
- \def\next{#2\dodoreadfile}}%
- {\iftracefiles\writestatus\m!systems{cannot locate #1}\fi
- \decrement\readlevel\relax
- \ifnum\readlevel>\zerocount
- \edef\readfilename{\pathplusfile{\f!parentpath}{\readfilename}}%
- \def\next{\redoreadfile\readfilename{#2}{#3}}%
- \else
- \def\next{#3}%
- \fi}%
- \or
- \edef\readfilename{#1}%
- \iftracefiles\writestatus\m!systems{#1\preprocesssuffix\space located}\fi
- \def\next{#2\dodoreadfile}%
- \or
- \def\next{#3}%
- \fi
- \next}
-
-\def\dodoreadfile % we provide hooks, for instance for \enableXML
- {\ifconditional\trackfilenames
- \setxvalue{fn..\trackedfilename}{\readfilename\ifcase\preprocessstate\or\preprocesssuffix\fi}%
- \fi
- \the\everybeforereadfile
- \ifcase\preprocessstate
- % no checking or not found when using method 1
- \normalinput\readfilename
- \or
- % found when using method 1 or 2
- \normalinput\readfilename\preprocesssuffix
- \or
- % not found when using method 2
- \fi
- \relax
- \the\everyafterreadfile}
-
% The following may be a solution for the fact that one cannot
% change catcodes of characters like : and ; inside an environment.
@@ -437,66 +111,6 @@
\let\cs\getvalue
-%D Krzysztof Leszczynski suggested to provide access to the level by
-%D means of a \type {#1}. I decided to pass the more frquently used
-%D level as \type {#1} and the less favoured depth as \type {#2}. The
-%D intended usage is:
-%D
-%D \starttyping
-%D \dorecurse{3}{\definesymbol[test-#1][xx-#1]}
-%D
-%D \def\test{\dorecurse{3}{\definesymbol[test-##1][xx-##1]}} \test
-%D
-%D \symbol[test-1]\quad\symbol[test-2]\quad\symbol[test-3]
-%D \stoptyping
-%D
-%D Since the hashed arguments are expanded, we don't need tricky
-%D expansion here.
-%D
-%D \starttyping
-%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}}
-%D \stoptyping
-
-\def\expandrecursecontent
- {\csname\@@arecurse\recursedepth\@EA\@EA\@EA\endcsname\@EA\@EA\@EA{\@EA\recurselevel\@EA}\@EA{\recursedepth}}
-
-\long\def\xdorecurse#1#2%
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \@EA\dodorecurse\@EA1\@EA{\number#1}}
-
-\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#4}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \ifnum#3>0\relax
- \ifnum#2<#1\relax
- \let\nextrecurse\exitstepwiserecurse
- \else
- \let\nextrecurse\dodostepwiserecurse
- \fi
- \else
- \ifnum#3<0\relax
- \ifnum#1<#2\relax
- \let\nextrecurse\exitstepwiserecurse
- \else
- \let\nextrecurse\dodostepwisereverse
- \fi
- \else
- \let\nextrecurse\exitstepwiserecurse
- \fi
- \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}}
-
-\long\def\doloop#1%
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#1}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \let\endofloop\dodoloop
- \dodoloop1} % no \plusone else \recurselevel wrong
-
-\ifx\normalcompound\undefined \let\normalcompound=| \fi
-
% experimental so this may change
\def\startdescriptions
@@ -591,8 +205,6 @@
%
% \shapesynonym{eacute}
-% new: \forcebaselinecorrection --> core-spa & core-grd
-
\chardef\baselinecorrectionmode\plusone
\def\onbaselinecorrection {\chardef\baselinecorrectionmode\plusone }
@@ -692,47 +304,6 @@
\normalstartbaselinecorrection
\fi}
-% todo: fast processor
-
-\def\gettwopassdatalist#1%
- {\loadtwopassdata
- \ifcsname#1:\s!list\endcsname
- \letcscsname\twopassdatalist\csname#1:\s!list\endcsname
- \else
- \let\twopassdatalist\empty
- \fi}
-
-% \def\literateencodedtokens
-% {% \let\dohandleaccent \keephandleaccent % assumes named chars % defineaccent "e {name}
-% % \let\dohandlecommand \keephandlecommand % assumes named chars % definecommand crap {name}
-% \let\dohandlecharacter\keephandlecharacter}
-%
-% \def\convertmeaning#1\to % watch the double expansion !
-% {\bgroup
-% \honorunexpanded
-% %\dontexpandencoding % new
-% \literateencodedtokens % newer
-% \xdef\@@globalexpanded{#1}%
-% \xdef\@@globalexpanded{\@@globalexpanded}%
-% \egroup
-% \convertcommand\@@globalexpanded\to}
-
-\def\defXMLattributestring#1#2#3#4%
- {\ifcsname\@@XMLvariable:#2:#3\endcsname
- \@EA\convertcommand\csname\@@XMLvariable:#2:#3\endcsname\to#1%
- \else
- \convertargument#4\to#1%
- \fi}
-
-\bgroup \catcode`\<=\active
-
-% usage: \expanded{\rescanXMLatttributes{fo:table-cell}}
-
-\gdef\rescanXMLattributes #1{\noexpand\dogetXMLarguments{#1}\currentXMLarguments>}
-\gdef\parseXMLattributes #1#2{\dogetXMLarguments{#1}#2>}
-
-\egroup
-
% \page[left]
% \definecolumntextarea[intro][left][x=1,y=1,nx=4,ny=20,state=start,background=introlayer]
% \setupcolumntextareatext[intro][left][\setups{intro}]
@@ -742,23 +313,6 @@
{\initializecolumntextareas
\setvsize}
-% And so, after a few years of keeping this potentially dangerous
-% speedup in cont-exp, we now move it to the kernel: the next
-% patch is 30\% faster on main interface (seconds) (9->7 sec on
-% 1 million calls). Another speed up is still under testing.
-
-\startinterface english
-
- \def\dosetevalue #1#2{\@EA\edef\csname#1#2\endcsname}
- \def\dosetgvalue #1#2{\@EA\gdef\csname#1#2\endcsname}
- \def\dosetvalue #1#2{\@EA\def \csname#1#2\endcsname}
- \def\docopyvalue#1#2#3{\@EA\def \csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}}
-
-\stopinterface
-
-\def\XMLprocess#1%
- {\begingroup\enableXML\XMLflush{#1}\endgroup}
-
%D (Inspired by a discussion on the \CONTEXT\ mailing list)
%D
%D In \TEX\ each character can have one of 16 catcodes. This way the
@@ -822,6 +376,11 @@
\long\def\rescan#1{\scantokens{#1\ignorespaces}}
\long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup}
+
+\ifx\scantextokens\undefined \else
+ \long\def\rescan#1{\scantextokens{#1}}
+ \long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantextokens{#2}\endgroup}
+\fi
% In 2005 we will abandon support for font encodings that don't have
% the ascii characters { } $ etc in their normal slot, i.e. latin modern
@@ -853,7 +412,7 @@
\honorunexpanded
% \dontexpandencoding
% \dontexpandutf
- \let\dohandleactivecharacter\donthandleactivecharacter
+ \chardef\activecharactermode\zerocount
\xdef\@@globalexpanded{#1}%
\egroup
\@@globalexpanded}
@@ -862,23 +421,6 @@
{\XMLexpanded{\scratchtoks{\enableXML#2}}%
\expanded{\normalsetnormalmark{#1}{\the\scratchtoks}}}
-%D Ok, I got tired of making dedicated clean up macros using the
-%D same mechanism again and again, so now we have:
-%D
-%D \starttyping
-%D \def\xxxx{abc.d} \replacecharacters\xxxx{a.}{-} \xxxx
-%D \stoptyping
-
-\def\replacecharacters#1#2#3% macro characters replacement
- {\bgroup
- \edef\ascii{#1}%
- \retainlccodes
- \def\docommand##1{\lccode\expandafter`\csname##1\endcsname=\expandafter`\csname#3\endcsname}%
- \handletokens#2\with\docommand
- \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
- \egroup
- \dodoglobal\let#1\globalascii}
-
\ifx\pagediscards\undefined \let\pagediscards\relax \fi
\installoutput\synchronizeoutput % maybe add pagediscards
@@ -893,43 +435,11 @@
{\expanded{\everyhbox{\the\everyhbox\noexpand\fastenableencoding{\currentencoding}}}%
\def\dealwithmathtextencoding{\let\characterencoding\nocharacterencoding}%
\dealwithmathtextencoding}
+
\appendtoks
\dealwithmathtextencoding
\to \everymathematics
-\def\dohandlemathtoken#1%
- {\csname
- \ifmmode
- \ifcsname\@mt@\mathcollection:\outerencoding#1\endcsname
- \@mt@\mathcollection:\outerencoding
- \else\ifcsname\@mt@\mathcollection#1\endcsname
- \@mt@\mathcollection
- \else\ifcsname\@mt@\nomathcollection#1\endcsname
- \@mt@\nomathcollection
- \else\ifcsname\characterencoding#1\endcsname
- \characterencoding
- \else
- \nocharacterencoding
- \fi\fi\fi\fi
- \else
- \ifcsname\characterencoding#1\endcsname
- \characterencoding
- \else\ifcsname\nocharacterencoding#1\endcsname
- \nocharacterencoding
- \else\ifcsname\@mt@\mathcollection:\outerencoding#1\endcsname
- \@mt@\mathcollection:\outerencoding
- \else\ifcsname\@mt@\mathcollection#1\endcsname
- \strippedcsname\mathematics\expandafter\endcsname\csname\@mt@\mathcollection
- \else\ifcsname\@mt@\nomathcollection#1\endcsname
- \strippedcsname\mathematics\expandafter\endcsname\csname\@mt@\nomathcollection
- \else
- \nocharacterencoding
- \fi\fi\fi\fi\fi
- \fi
- #1\endcsname}
-
-\let\dohandlecommand\dohandlemathtoken
-
\let\outerencoding\empty
\def\checkoutermathencoding
@@ -943,10 +453,10 @@
\checkoutermathencoding
\to \everymathematics
-% \startmathcollection[euler:texnansi]
+% \startmathcollection[eul:texnansi]
% \definemathsymbol [breve] [accent] [tf] ["15]
% \stopmathcollection
-% \startmathcollection[euler:ec]
+% \startmathcollection[eul:ec]
% \definemathsymbol [breve] [accent] [tf] ["08]
% \stopmathcollection
%
@@ -978,11 +488,6 @@
% \markpage[nobackgrounds]
% \doifmarkedpageelse{nobackgrounds}
-\def\gettwopassdatalist#1%
- {\loadtwopassdata
- \letcscsname\twopassdatalist\csname#1:\s!list\endcsname
- \ifx\twopassdatalist\relax\let\twopassdatalist\empty\fi}
-
\newcounter\nofmarkedpages
\def\definemarkedpage[#1]%
@@ -991,13 +496,7 @@
\def\markpage[#1]% looks very much like domarginreference
{\iftrialtypesetting\else
\doglobal\increment\nofmarkedpages\relax
- \edef\writeparref%
- {\writeutilitycommand%
- {\twopassentry%
- {\v!page:#1}%
- {\nofmarkedpages}%
- {\noexpand\realfolio}}}%
- \writeparref
+ \lazysavetwopassdata{\v!page:#1}{\nofmarkedpages}{\noexpand\realfolio}%
\fi}
\def\doifmarkedpageelse#1%
@@ -1095,7 +594,7 @@
\ifx\@@expanded\empty\else
\bgroup
\global\percentdimendonefalse
- \def\%{\dimexpr(#1/100)\global\percentdimendonetrue\ignorespaces}| scantokens add's a space
+ \def\%{\dimexpr#1/100\relax\global\percentdimendonetrue\ignorespaces}| scantokens add's a space
\catcode`%=\@@active
\catcode`\\=\@@escape
\let%\%|
@@ -1151,52 +650,6 @@
\egroup
-% \def\doshowpardata#1#2{\hbox{\string#1: \the#2}\endgraf}
-%
-% \def\showpardata
-% {\edef\thepardata
-% {\hbox{font: \fontname\font}\endgraf
-% \doshowpardata{interword space}{\fontdimen2\font}%
-% \doshowpardata{interword stretch}{\fontdimen3\font}%
-% \doshowpardata{interword shrink}{\fontdimen4\font}%
-% \doshowpardata{quad space}{\fontdimen6\font}%
-% \doshowpardata{extra space}{\fontdimen7\font}%
-% \doshowpardata\hsize\hsize
-% \doshowpardata\leftskip\leftskip
-% \doshowpardata\rightskip\rightskip
-% \doshowpardata\spaceskip\spaceskip
-% \doshowpardata\xspaceskip\xspaceskip
-% \doshowpardata\parindent\parindent
-% \doshowpardata\parfillskip\parfillskip
-% \doshowpardata\hyphenpenalty\hyphenpenalty
-% \doshowpardata\exhyphenpenalty\exhyphenpenalty
-% \doshowpardata\displaywidowpenalty\displaywidowpenalty
-% \doshowpardata\widowpenalty\widowpenalty
-% \doshowpardata\clubpenalty\clubpenalty
-% \doshowpardata\brokenpenalty\brokenpenalty
-% \doshowpardata\doublehyphendemerits\doublehyphendemerits
-% \doshowpardata\finalhyphendemerits\finalhyphendemerits
-% \doshowpardata\adjdemerits\adjdemerits}%
-% \begingroup
-% \dontshowcomposition
-% \inleftmargin{\vsmash
-% {\switchtobodyfont[7pt,tt]%
-% \framed[\c!align=\v!right]{\thepardata}}}%
-% \endgroup}
-%
-% \def\startshowpardata
-% {\begingroup
-% \showcomposition
-% \showstruts\tracepositionstrue \tracingparagraphs\maxdimen
-% \appendtoksonce\showpardata\let\showpardata\relax\to\everypar}
-%
-% \def\stopshowpardata
-% {\endgraf
-% \endgroup}
-%
-% \defineXMLenvironment[showpardata] \startshowpardata \stopshowpardata
-% \defineXMLsingular [showpardata] \showpardata
-
% todo : test low level translation (nl->en) and optimize script
% \definestylecollection[mine]
@@ -1308,12 +761,12 @@
\def\locatefilepath#1%
{\let\locatedfilepath\empty
\ifx\allinputpaths\empty \else
- \def\docommando##1%
+ \def\docommand##1%
{\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\locatedfilepath{##1}}\donefalse
\ifdone\expandafter\quitcommalist\fi}%
\doifparentfileelse{#1} % new
- {\processcommacommand [\allinputpaths]\docommando}
- {\processcommacommand[.,\allinputpaths]\docommando}%
+ {\processcommacommand [\allinputpaths]\docommand}
+ {\processcommacommand[.,\allinputpaths]\docommand}%
\fi}
% todo : share symbols
@@ -1482,19 +935,21 @@
% \readfile{cont-exp}\donothing\donothing % speed up (5-20%)
\def\dimenratio#1#2% etex only
- {\withoutpt\the\dimexpr(2\dimexpr(#1)/(\dimexpr(#2)/32768))}
+ {\withoutpt\the\dimexpr2\dimexpr(#1)/\dimexpr(#2)/32768\relax\relax}
\def\doxprecurse#1#2%
{\ifnum#1=\zerocount % no \ifcase
\expandafter\gobblethreearguments
\else
#2\expandafter\expandafter\expandafter\doxprecurse\expandafter
- \fi\expandafter{\the\numexpr(#1-1)}{#2}}
+ \fi\expandafter{\the\numexpr#1-1\relax}{#2}}
\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie
\unexpanded\def\asciistr#1{\convertargument#1\to\ascii{\verbatimfont\ascii}}
+% messy, will be improved:
+
\prependtoks \setnormalcatcodes \to \everyTEXinputmode
\appendtoks \processingXMLfalse \to \everyTEXinputmode
@@ -1520,59 +975,14 @@
\endETEX
-% Currently there is a bug in \lastnodetype, so we will enable this
-% feature when the bugfix is widespread.
-
-% \beginETEX \lastnodetype
-%
-% \def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
-% {\ifnum\lastnodetype=\@@gluenode % \ifcase\lastskip % \ifdim\lastskip=\zeropoint\relax
-% \shapeskip\lastskip
-% \global\setbox\tmpshapebox\normalvbox{#4\unvbox\tmpshapebox}%
-% \unskip
-% \else\ifnum\lastnodetype=\@@kernnode % \ifcase\lastkern % \ifdim\lastkern=\zeropoint\relax
-% \shapekern\lastkern
-% \global\setbox\tmpshapebox\normalvbox{#3\unvbox\tmpshapebox}%
-% \unkern
-% \else\ifnum\lastnodetype=\@@penaltynode % \ifcase\lastpenalty % \ifnum\lastpenalty=\zerocount
-% \shapepenalty\lastpenalty
-% \global\setbox\tmpshapebox\normalvbox{#2\unvbox\tmpshapebox}%
-% \unpenalty
-% \else
-% \setbox\shapebox\lastbox
-% \ifvoid\shapebox
-% \unskip\unpenalty\unkern
-% \else
-% \ifdim\wd\shapebox=\shapesignal\relax
-% \exitloop
-% \else
-% \shapecounter\zerocount
-% \global\setbox\tmpshapebox\normalvbox{#1\unvbox\tmpshapebox}%
-% \fi
-% \fi
-% \fi\fi\fi
-% \ifnum\shapecounter>100 % can be less
-% \message{<<forced exit from shapebox>>}%
-% \global\setbox\tmpshapebox\copy\oldshapebox
-% \exitloop
-% \else
-% \advance\shapecounter \plusone
-% \fi}
-%
-% \endETEX
-
\let\normaltype\type
\beginTEX
-
\unexpanded\def\retype#1{\bgroup\convertargument#1\to\ascii\@EA\normaltype\@EA{\ascii}\egroup}
-
\endTEX
\beginETEX
-
\unexpanded\def\retype#1{\scantokens{\normaltype{#1}\ignorespaces}}
-
\endETEX
\def\simplifytype{\let\type\retype}
@@ -1656,27 +1066,6 @@
% \headsym{xx} test \par test
% \stopitemize
-% \def\removeunwantedspaces
-% {\ifhmode
-% \doloop{\ifdim\lastskip>\zeropoint\unskip\else\exitloop\fi}%
-% \fi}
-
-\def\removeunwantedspaces
- {\ifhmode \ifdim\lastskip>\zeropoint
- \unskip \@EAEAEA\removeunwantedspaces
- \fi \fi}
-
-% wait till bugfix in etex is widespead
-%
-% \beginETEX \lastnodetype
-%
-% \def\removeunwantedspaces
-% {\ifhmode
-% \doloop{\ifnum\lastnodetype=\@@gluenode\unskip\else\exitloop\fi}%
-% \fi}
-%
-% \endETEX
-
% \def\dodimchoice#1#2#3%
% {\ifx#3\relax
% #1\@EA\gobbleuntilrelax
@@ -2178,12 +1567,6 @@
\long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
-\def\overloaded#1#2%
- {\appendtoks
- \writestatus\m!systems{overloaded: \string#2}%
- \to \everybye
- #1#2}
-
\def\expandifnonempty#1%
{\@EA\ifx\csname#1\endcsname\empty
\expandafter\secondoftwoarguments
@@ -2224,16 +1607,6 @@
\def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox}
\def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
-% pretty important (esp since we now ignore shipouts)
-%
-% actually we should nil all writes, marks, specials
-
-\appendtoks \globallet\popproperties \relax \to \everylastshipout
-\appendtoks \globallet\popsplitproperties\relax \to \everylastshipout
-
-\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
-\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
-
% \translateMPinput{il2-pl}
%
% \startMPenvironment[global]
@@ -2246,10 +1619,6 @@
% draw btex MetaPost: ± ¶ etex scaled 5 ;
% \stopMPcode
-% \startcolumnset[two] \input tufte
-% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan
-% \input tufte \stopcolumnset
-
% now in cont-loc.tex, for the sake of testing.
%
% %D When \type {\somecolor} is issued, we can savely assume
@@ -2356,11 +1725,6 @@
\setinnerparpositions % see "techniek" for application
\to \everytabulate
-\appendtoks \checkcurrentlayout \to \everystarttext
-
-\def\flushfootnotes {\flushnotes}
-\def\doflushfootnotes{\doflushnotes}
-
%D This alternative is slower, since it works on top of the
%D color (stack) mechanism, but it does provide nesting.
@@ -2384,6 +1748,8 @@
\def\localstopraster{\ifincolor\localstopcolor\fi}
\def\stopraster {\ifincolor\stopcolor\fi}
+
+\def\raster[#1]{\groupedcommand{\startraster[#1]}{\stopraster}}
\def\fontclassname#1#2%
{\ifcsname\??ff#1#2\endcsname
@@ -2540,136 +1906,6 @@
%D To be documented, \type {\includemenu[menu]}.
%D To be documented, \type {\emphbf} cum suis.
-%D A prelude to strategies. Note for myself: overloads
-%D previous stuff from local pragma test files.
-
-\def\s!strategy{strategy}
-
-\def\currentstrategypass {1}
-\def\currentstrategyvariable{0}
-\def\maximumstrategypass {8}
-
-\newconditional\strategypassneeded
-\newconditional\strategypassforced
-
-\definetwopasslist{\s!strategy}
-
-\def\registerstrategypass%
- {\ifnum\currentstrategypass>\maximumstrategypass \else
- \ifconditional\strategypassforced
- \doglobal\increment\currentstrategypass
- \else%\ifconditional\strategypassneeded
- %\doglobal\increment\currentstrategypass
- \fi%\fi
- \fi
- \savecurrentvalue\currentstrategypass{\currentstrategypass}}
-
-\appendtoks \registerstrategypass \to \everybye % \everylastshipout
-
-\def\setstrategyvariable#1#2% key value
- {%\doifnotstrategyvariable{#1}{\global\settrue\strategypassneeded}%
- \doglobal\increment\currentstrategyvariable
- \expanded{\immediatewriteutilitycommand{\noexpand
- \twopassentry{\s!strategy}{\currentstrategyvariable}{#1::#2}}}}
-
-\def\doifstrategyvariableelse#1#2#3%
- {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi}
-
-\def\getstrategyvariable#1% key
- {\findtwopassdata{\s!strategy}{#1::}%
- \setxvalue{\s!strategy:#1}{\twopassdata}}
-
-\def\retainstrategyvariable#1% key
- {\expanded{\setstrategyvariable{#1}{\strategyvariable{#1}}}}
-
-\def\strategyvariable#1% key
- {\csname\s!strategy:#1\endcsname}
-
-\let\stratvar\strategyvariable
-
-\def\forcestrategy{\global\settrue \strategypassforced}
-\def\abortstrategy{\global\setfalse\strategypassforced}
-
-\def\doifstrategyvariableelse#1#2#3%
- {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi}
-
-\def\doifstrategyvariable #1#2{\doifstrategyvariableelse{#1}{#2}{}}
-\def\doifnotstrategyvariable#1#2{\doifstrategyvariableelse{#1}{}{#2}}
-
-%D New: only at start of columns; may change ! Rather
-%D interwoven and therefore to be integrated when the multi
-%D column modules are merged.
-
-% already taken care of: \definesystemvariable{ks}
-
-% is buggy now and does not work any longer
-
-\def\setupcolumnspan[#1]%
- {\getparameters[\??ks][#1]}
-
-\presetlocalframed
- [\??ks]
-
-\setupcolumnspan
- [\c!n=2,
- \c!offset=\v!overlay,
- \c!frame=\v!off]
-
-\newbox\columnspanbox \let\postprocesscolumnspanbox\gobbleoneargument
-
-\def\dostartcolumnspan[#1]%
- {\bgroup
- \setupcolumnspan[#1]%
- \forgetall
- \ifinsidecolumns
- \advance\hsize \intercolumnwidth
- \hsize\@@ksn\hsize
- \advance\hsize -\intercolumnwidth
- \fi
- \dowithnextbox
- {\setbox\columnspanbox\flushnextbox
- \ifinsidecolumns\wd\columnspanbox\hsize\fi
- \postprocesscolumnspanbox\columnspanbox
- \scratchdimen\ht\columnspanbox
- \setbox\columnspanbox\hbox % depth to be checked, probably option!
- {\localframed[\??ks][\c!offset=\v!overlay]{\box\columnspanbox}}%
- \ht\columnspanbox\scratchdimen
- \dp\columnspanbox\strutdp
- \wd\columnspanbox\hsize
- \ifinsidecolumns
- \ifnum\@@ksn>1
- \setvsize
- \dohandleallcolumns
- {\ifnum\currentcolumn>\@@ksn\else
- \global\setbox\currenttopcolumnbox=\vbox
- {\ifnum\currentcolumn=1
- \snaptogrid\vbox{\copy\columnspanbox}
- \else
- \snaptogrid\vbox{\vphantom{\copy\columnspanbox}}
- \fi}%
- \wd\currenttopcolumnbox\hsize
- \global\advance\vsize -\ht\currenttopcolumnbox
- \fi}
- \global\pagegoal\vsize
- \else
- \snaptogrid\vbox{\box\columnspanbox}
- \fi
- \else
- \snaptogrid\vbox{\box\columnspanbox}
- \fi
- \endgraf
- \ifvmode\prevdepth\strutdp\fi
- \egroup}
- \vbox\bgroup
- %\topskipcorrection % becomes an option !
- \EveryPar{\begstrut\EveryPar{}}} % also !
-
-\def\startcolumnspan
- {\dosingleempty\dostartcolumnspan}
-
-\def\stopcolumnspan
- {\egroup}
-
%D For Ton. To be documented.
\def\plaatsexterndocument[#1]%
@@ -2689,7 +1925,10 @@
%D live on on my machine and are not distributed, but they may end
%D up in the distributed files.
+\loadmarkfile{cont-new}
+
\readsysfile {cont-loc} {} {} % local improvements, patches, new features
\readsysfile {cont-exp} {} {} % experimental features (e.g. local speed-ups)
+\readsysfile {cont-mtx} {} {} % experimental metatex features
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-usr.ori b/Master/texmf-dist/tex/context/base/cont-usr.ori
index 67a3f4d37fa..ee0627836c1 100644
--- a/Master/texmf-dist/tex/context/base/cont-usr.ori
+++ b/Master/texmf-dist/tex/context/base/cont-usr.ori
@@ -91,7 +91,9 @@
%D In some languages, compound characters, like \type {"e}
%D are used to get accented and non latin characters.
- \useencoding[fde] % german
+% Per 21/9/2006 one needs to explicitly enable this.
+
+% \useencoding[fde] % german
% \useencoding[ffr] % french
% \useencoding[fro] % romanian
% \useencoding[fpl] % polish
diff --git a/Master/texmf-dist/tex/context/base/context.tex b/Master/texmf-dist/tex/context/base/context.tex
index 4dac19ed231..d8736992b3c 100644
--- a/Master/texmf-dist/tex/context/base/context.tex
+++ b/Master/texmf-dist/tex/context/base/context.tex
@@ -13,6 +13,7 @@
% dec 07 2001 : cont-en.efmt : 4,035,912
% aug 07 2004 : cont-en.efmt : 4,928,967 (5 more patterns)
+% aug 31 2006 : cont-en.fmt : 7,048,748 (all patterns)
% todo 1: each module english commands
% todo 2: replace lowlevel *!* by english variants
@@ -23,7 +24,16 @@
% todo 7: conditionals
% todo 8: redesign tui/tuo
-\catcode`\{=1 \catcode`\}=2
+\catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+
+%D For many years \CONTEXT\ supported both good old \TEX\ and \ETEX, but
+%D the time has come (August 2006) to advance, especially now that all
+%D engines provide \ETEX\ functionality and more is on the horizon.
+
+\ifx\eTeXversion\undefined
+ \immediate\write16{SORRY CONTEXT NOW NEEDS ETEX}
+ \expandafter \end
+\fi
%D From the next string (which is set by the script that assembles the
%D distribution) later on we will calculate a number that can be used
@@ -31,11 +41,47 @@
%D 2004.8.30 the low level interface is english. Watch out and adapt
%D your styles an modules.
-\def\contextversion{2006.08.08 21:51}
+\edef\contextformat {\jobname}
+\edef\contextversion{2006.11.17 19:52}
%D For those who want to use this:
-\def\fmtname{context}
+\def\fmtname {context}
+\def\fmtversion{3.1415926}
+
+\let\showcontextbanner\relax
+
+%D Here we will test for what branch of source files we will take. The
+%D file suffix depends on the maintream engine: either lua enhanced,
+%D or traditional:
+%D
+%D \starttyping
+%D mki : low level dutch
+%D mkii : low level english
+%D mkiv : lua enhanced
+%D \stoptyping
+%D
+%D There is no \type {mkiii} unless you want to tag the transition
+%D version that way (going completely etex, code cleanup and such).
+
+\ifx\normalinput\undefined \let\normalinput\input \fi
+
+\edef\mksuffix {mk\ifx\directlua\undefined ii\else iv\fi}
+
+\def\loadcorefile#1{\normalinput#1\relax}
+\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax}
+
+\ifx\directlua\undefined
+ \def\loadmarkivfile#1{} \let\loadmarkiifile\loadcorefile
+\else
+ \def\loadmarkiifile#1{} \let\loadmarkivfile\loadcorefile
+\fi
+
+\let\loadmkiifile\loadmarkiifile
+\let\loadmkivfile\loadmarkivfile
+\let\loadmkfile \loadmarkfile
+
+\edef\contextmark{MK \ifx\directlua\undefined II\else IV\fi}
%D Welcome to the main module. When this module is ran through
%D \type{initex} or \type {tex -i} or \type {whatevertex} using
@@ -80,19 +126,31 @@
%D manipulation macros. The first one loads \PLAIN\ \TEX, as
%D minimal as possible.
-\input syst-pln.tex % stripped plain
-\input syst-prm.tex % saved primitives (will be extended)
+\loadcorefile{syst-pln.tex}
+\loadcorefile{syst-prm.tex}
+
+\loadmkivfile{luat-env.tex}
+\loadmkivfile{luat-lib.tex}
+\loadcorefile{syst-cat.tex}
-\input syst-etx.tex % etex
-\input syst-omg.tex % omega-aleph
-\input syst-xtx.tex % xetex
-\input syst-gen.tex
-\input syst-ext.tex
-\input syst-new.tex
-\input syst-con.tex
-\input syst-var.tex
+\loadcorefile{syst-etx.tex}
+\loadcorefile{syst-pdt.tex}
+\loadcorefile{syst-omg.tex}
+\loadcorefile{syst-xtx.tex}
+\loadcorefile{syst-mtx.tex}
-\input math-pln.tex % basic plain math
+\loadcorefile{syst-gen.tex}
+\loadcorefile{syst-ext.tex}
+\loadcorefile{syst-chr.tex}
+\loadcorefile{syst-fnt.tex}
+\loadcorefile{syst-new.tex}
+\loadcorefile{syst-con.tex}
+\loadcorefile{syst-var.tex}
+\loadcorefile{syst-str.tex}
+
+\loadcorefile{syst-rtp.tex}
+
+\loadcorefile{math-pln.tex}
%D To enable selective loading, we say:
@@ -101,51 +159,63 @@
%D In order to conveniently load files, we need a few
%D support modules.
-\input supp-ini.tex
-\input supp-fil.tex
-\input supp-dir.tex
+\loadcorefile{supp-ini.tex}
+\loadcorefile{supp-fil.tex}
+\loadcorefile{supp-dir.tex}
%D After this we're ready for the multi||lingual interface
%D modules.
-\input mult-ini.tex
-\input mult-sys.tex
-\input mult-con.tex
-\input mult-com.tex
+\loadcorefile{mult-ini.tex}
+\loadcorefile{mult-fst.tex}
+\loadcorefile{mult-sys.tex}
+\loadcorefile{mult-con.tex}
+\loadcorefile{mult-com.tex}
+
+\loadmkivfile{luat-ini.tex}
+% \loadmkivfile{luat-lib.tex}
+\loadmkivfile{luat-lmx.tex}
+\loadmkivfile{luat-deb.tex}
+
+\loadmkivfile{luat-uni.tex}
+
+\loadmkivfile{char-ini.tex}
+\loadmkivfile{char-def.tex}
%D We also use some third party macros. These are loaded by
%D saying:
-\input thrd-ran.tex % based on: Donald Arseneau
-\input thrd-trg.tex % based on: David Carlisle
+\loadcorefile{thrd-ran.tex} % based on: Donald Arseneau
+\loadcorefile{thrd-trg.tex} % based on: David Carlisle
%D Now we're ready for some general support modules. These
%D modules implement some basic typesetting functionality.
-\input supp-box.tex
-\input supp-mrk.tex
-\input supp-vis.tex
-\input supp-fun.tex
-\input supp-eps.tex
-%input supp-pdf.tex
-\input supp-spe.tex
-\input supp-mps.tex
-%input supp-mpe.tex
-\input supp-tpi.tex
-\input supp-mat.tex
-\input supp-ran.tex
-\input supp-ali.tex
+\loadcorefile{core-var.tex}
+
+\loadcorefile{supp-box.tex}
+\loadcorefile{supp-mrk.tex}
+\loadcorefile{supp-vis.tex}
+\loadcorefile{supp-fun.tex}
+\loadcorefile{supp-eps.tex}
+\loadcorefile{supp-spe.tex}
+\loadcorefile{supp-ran.tex}
+\loadcorefile{supp-mps.tex}
+\loadcorefile{supp-tpi.tex}
+\loadcorefile{supp-mat.tex}
+\loadcorefile{supp-ali.tex}
+\loadcorefile{supp-num.tex}
%D The next module deals with language specific typographic
%D extensions.
-\input typo-ini.tex % I must not forget about this module
+\loadcorefile{typo-ini.tex}
%D Verbatim typesetting is implemented in a separate class of
%D modules. The pretty typesetting modules are loaded at run
%D time.
-\input verb-ini.tex % replaces supp-ver
+\loadcorefile{verb-ini.tex}
%D The following modules are not sequentially dependent,
%D i.e. they have ugly dependencies, which will be cleaned
@@ -155,262 +225,265 @@
%D bit more advanced file handling as well as some general
%D variables, and features, so next we load:
-\input core-var.tex
-\input core-ins.tex
-\input core-fil.tex
-\input core-con.tex
+\loadcorefile{core-ins.tex}
+\loadcorefile{core-fil.tex}
+\loadcorefile{core-con.tex}
%D We already need some synonyms (patterns). At runtime this
%D file will be reloaded.
-\input cont-fil.tex
+\loadcorefile{cont-fil.tex}
%D \CONTEXT\ does not implement its own table handling. We
%D just go for the best there is and load \TABLE. Just to be
%D sure we do it here, before we redefine \type{|}.
-\input thrd-tab.tex % based on: Michael Wichura / will be reimplemented
+\loadcorefile{thrd-tab.tex} % based on: Michael Wichura / will be reimplemented
%D Here comes the last support modules. They take care of
%D some language specific things.
-\input supp-lan.tex
-\input supp-num.tex
-\input supp-pat.tex % generic pattern loading
+%loadcorefile{supp-lan.tex} % replaced by lang-mis
+\loadcorefile{supp-pat.tex}
%D The next few modules do what their names state. They
%D load additional definition modules when needed.
-\input enco-ini.tex
-\input filt-ini.tex
-\input hand-ini.tex
-\input regi-ini.tex
-\input regi-syn.tex
-\input lang-ini.tex
-\input lang-ctx.tex
-\input lang-dis.tex % after lang-ctx !
-\input unic-ini.tex
-%input unic-ext.tex % obsolete
+\loadcorefile{regi-ini.tex}
+\loadcorefile{enco-ini.tex}
+\loadcorefile{filt-ini.tex}
+\loadcorefile{hand-ini.tex}
+\loadcorefile{regi-syn.tex}
+\loadcorefile{lang-ini.tex}
+\loadcorefile{lang-ctx.tex}
+\loadcorefile{lang-dis.tex}
+\loadcorefile{unic-ini.tex}
% \readfile{lang-url.pat}{}{} % test
-\input colo-ini.tex
-\input colo-ext.tex
+\loadcorefile{core-gen.tex}
+\loadcorefile{core-new.tex}
+\loadcorefile{core-uti.tex}
+\loadcorefile{core-two.tex}
+\loadcorefile{core-stg.tex}
+
+\loadcorefile{spec-mis.tex}
+\loadcorefile{spec-ini.tex}
+\loadcorefile{spec-def.tex}
+\loadcorefile{spec-var.tex}
-\input spec-mis.tex
-\input spec-ini.tex
-\input spec-def.tex
-\input spec-var.tex
+\loadcorefile{colo-ini.tex}
+\loadcorefile{colo-ext.tex}
%D For the moment we load a lot of languages. In the future
%D we'll have to be more space conservative.
-\input lang-spe.tex
-\input lang-lab.tex
+\loadcorefile{lang-mis.tex}
+\loadcorefile{lang-spe.tex}
+\loadcorefile{lang-lab.tex}
-\input lang-ger.tex
-\input lang-ita.tex
-\input lang-sla.tex
+\loadcorefile{lang-ger.tex}
+\loadcorefile{lang-ita.tex}
+\loadcorefile{lang-sla.tex}
-\input lang-alt.tex
-\input lang-ana.tex
-\input lang-art.tex
-\input lang-bal.tex
-\input lang-cel.tex
-\input lang-grk.tex
-\input lang-ind.tex
-\input lang-ura.tex
+\loadcorefile{lang-alt.tex}
+\loadcorefile{lang-ana.tex}
+\loadcorefile{lang-art.tex}
+\loadcorefile{lang-bal.tex}
+\loadcorefile{lang-cel.tex}
+\loadcorefile{lang-grk.tex}
+\loadcorefile{lang-ind.tex}
+\loadcorefile{lang-ura.tex}
-\input lang-vn.tex % vietnamese, maybe this belongs in lang-ita
+\loadcorefile{lang-vn.tex}
%D All kind of symbols are handled in:
-\input symb-ini.tex
+\loadcorefile{symb-ini.tex}
+
+%D Sorting:
+
+\loadcorefile{sort-ini.tex}
%D Next we load some core macro's. These implement the
%D macros' that are seen by the users. The order of loading
%D is important, due to dependancies.
-\input core-gen.tex
-\input core-new.tex
-\input core-uti.tex
-\input core-mar.tex
-\input core-mak.tex
-\input core-dat.tex
-\input core-grd.tex
-\input core-ver.tex
-\input core-vis.tex
-%input core-con.tex
-\input core-rul.tex
-\input core-num.tex
-\input core-tsp.tex % splitter
-\input core-tab.tex
-\input core-nav.tex
-\input core-ref.tex
-\input core-obj.tex
-\input core-buf.tex
-\input core-lst.tex
-\input core-itm.tex
-\input core-des.tex
-\input core-mat.tex
-\input core-syn.tex
-\input core-spa.tex
-\input core-sys.tex
-\input core-pos.tex
-
-\input page-ini.tex
-\input page-not.tex
-\input page-one.tex
-\input page-lay.tex
-\input page-log.tex
-\input page-txt.tex
-\input page-sid.tex
-\input page-flt.tex
-\input page-mul.tex
-\input page-set.tex
-\input page-lyr.tex
-\input page-mak.tex
-\input page-num.tex
-\input page-lin.tex
-\input page-mar.tex
-\input page-bck.tex
-\input page-app.tex % unfinished
-\input page-flw.tex % experimental: flows
-\input page-spr.tex % experimental: spreads
-\input page-plg.tex % experimental: plugins
-\input page-str.tex % experimental: streams
-
-\input core-job.tex
+\loadcorefile{core-spa.tex}
+\loadcorefile{core-grd.tex}
+\loadcorefile{core-mar.tex}
+\loadcorefile{core-pos.tex}
+\loadcorefile{core-mak.tex}
+\loadcorefile{core-dat.tex}
+\loadcorefile{core-ver.tex}
+\loadcorefile{core-rul.tex}
+\loadcorefile{core-vis.tex}
+\loadcorefile{core-num.tex}
+\loadcorefile{core-tsp.tex}
+\loadcorefile{core-tab.tex}
+\loadcorefile{core-nav.tex}
+\loadcorefile{core-ref.tex}
+\loadcorefile{core-obj.tex}
+\loadcorefile{core-lst.tex}
+\loadcorefile{core-itm.tex}
+\loadcorefile{core-des.tex}
+\loadcorefile{core-mat.tex}
+\loadcorefile{core-syn.tex}
+\loadcorefile{core-sys.tex}
+
+\loadcorefile{page-ini.tex}
+\loadcorefile{page-bck.tex}
+\loadcorefile{page-not.tex}
+\loadcorefile{page-one.tex}
+\loadcorefile{page-lay.tex}
+\loadcorefile{page-log.tex}
+\loadcorefile{page-txt.tex}
+\loadcorefile{page-sid.tex}
+\loadcorefile{page-flt.tex}
+\loadcorefile{page-mul.tex}
+\loadcorefile{page-set.tex}
+\loadcorefile{page-lyr.tex}
+\loadcorefile{page-mak.tex}
+\loadcorefile{page-num.tex}
+\loadcorefile{page-lin.tex}
+\loadcorefile{page-mar.tex}
+
+\loadcorefile{core-job.tex} % why so late?
% so far
-\input core-sec.tex
-\input page-imp.tex
-\input core-tbl.tex
-\input core-int.tex
-\input core-ntb.tex
-\input core-ltb.tex
-
-%D Like languages, fonts, encodings and symbols, \METAPOST\
-%D support is also organized in its own class of modules.
-
-\input meta-ini.tex
-\input meta-pdf.tex
-\input meta-pag.tex
-\input meta-fig.tex
-
-%D On which the next one depends:
-
-\input core-pgr.tex
-\input core-bar.tex
-\input core-snc.tex
+\loadcorefile{core-sec.tex}
+\loadcorefile{core-buf.tex}
+\loadcorefile{core-blk.tex}
+\loadcorefile{page-imp.tex}
+\loadcorefile{core-tbl.tex}
+\loadcorefile{core-int.tex}
+\loadcorefile{core-ntb.tex}
+\loadcorefile{core-ltb.tex}
%D A few more languages, that have specifics using core
%D functionality:
-\input lang-chi.tex
-\input lang-jap.tex
+\loadcorefile{lang-chi.tex}
+\loadcorefile{lang-jap.tex}
%D How about fill||in fields and related stuff?
-\input java-ini.tex % needs a cleanup
-\input core-fld.tex % needs a cleanup
-\input core-hlp.tex % will become a m-module
+\loadcorefile{java-ini.tex}
+\loadcorefile{core-fld.tex}
+\loadcorefile{core-hlp.tex}
%D Registers can depend on fields, so we load that now.
-\input core-reg.tex
+\loadcorefile{core-reg.tex}
%D Of course we do need fonts. There are no \TFM\ files
%D loaded yet, so the format file is independant of their
%D content. Here we also redefine \type{\it} as {\it italic}
%D instead of italian.
-\input font-ini.tex
-\input font-uni.tex
-\input font-bfm.tex
+\loadcorefile{font-ini.tex}
+\loadcorefile{font-uni.tex}
+\loadcorefile{font-bfm.tex}
-\input enco-pfr.tex % uses \everyfont
+\loadcorefile{enco-pfr.tex}
-\input type-ini.tex
-\input type-def.tex
+\loadcorefile{type-ini.tex}
+\loadcorefile{type-def.tex}
-\input meta-tex.tex % we need fonts
+%D Properties. Don't ask.
-\input prop-ini.tex
-\input prop-lay.tex % needs core-ref.tex
-\input prop-mis.tex
+\loadcorefile{prop-ini.tex}
+\loadcorefile{prop-lay.tex}
+\loadcorefile{prop-mis.tex}
-\input math-ini.tex % needs enco-ini.tex
-\input math-ext.tex
+%D Like languages, fonts, encodings and symbols, \METAPOST\
+%D support is also organized in its own class of modules.
-%D Now we're ready for more core modules.
+\loadcorefile{meta-ini.tex}
+\loadcorefile{meta-pdf.tex}
+\loadcorefile{meta-pag.tex}
+\loadcorefile{meta-tex.tex}
-\input core-fnt.tex % todo: document setupinitial !
-\input core-not.tex
-\input core-lnt.tex % to be documented (with idris)
+%D Special page handling (maybe even later)
-\input core-mis.tex
+\loadcorefile{page-flw.tex}
+\loadcorefile{page-spr.tex}
+\loadcorefile{page-plg.tex}
+\loadcorefile{page-str.tex}
-\input core-fig.tex % after page body
-\input core-par.tex % maybe this should become a m-module
+%D Hm.
-\input core-box.tex
+\loadcorefile{core-pgr.tex}
+\loadcorefile{core-bar.tex}
+\loadcorefile{core-snc.tex}
-%D Language specific spacing.
-\input lang-spa.tex
+%D Math.
-%D Sorting:
+\loadcorefile{math-ini.tex}
+\loadcorefile{math-ext.tex}
-\input sort-ini.tex
+%D Now we're ready for more core modules.
-%D Only the basic XML parser and remapper are part of the core.
-%D These macrosa re loaded last since they overload and|/|or
-%D extend previously defined ones.
+\loadcorefile{core-fnt.tex}
+\loadcorefile{core-not.tex}
+\loadcorefile{core-lnt.tex}
-\input xtag-ini.tex
-\input xtag-ext.tex
-\input xtag-prs.tex
-\input xtag-map.tex % may become obsolete
-\input xtag-stk.tex
-\input xtag-exp.tex
-\input xtag-pre.tex
-\input xtag-xsd.tex
-\input xtag-rng.tex
-%input xtag-ent.tex
+\loadcorefile{core-mis.tex}
-%D How about this:
+\loadcorefile{core-trf.tex}
+\loadcorefile{core-fig.tex}
+\loadcorefile{core-par.tex}
-\input meta-xml.tex % to be documented
+\loadcorefile{core-box.tex}
+\loadcorefile{page-app.tex}
+\loadcorefile{meta-fig.tex}
-%D Temporary hack, will go when we move to newtexexec:
+%D Language specific spacing.
-% \unprotect
-% \appendtoks % newtexexec/newtexutil, after option file is loaded:
-% \doif{\systemparameter\c!method} {2}
-% {\def\TEXEXECcommand{texmfstart newtexexec} %
-% \readsysfile {sort-ini} {} {}}%
-% \to \everyjob
-% \protect
+\loadcorefile{lang-spa.tex}
-% %D The next two modules implement some additional
-% %D functionality concerning classes of documents and output.
-% %D These modules probably will be replaced some day.
-%
-% \input docs-ini.tex % obsolete
-% \input list-ini.tex % obsolete
+%D Only the basic XML parser and remapper are part of the core.
+%D These macros are loaded last since they overload and|/|or
+%D extend previously defined ones.
+
+\loadcorefile{xtag-ini.tex}
+\loadcorefile{xtag-ext.tex}
+\loadcorefile{xtag-prs.tex}
+\loadcorefile{xtag-map.tex}
+\loadcorefile{xtag-stk.tex}
+\loadcorefile{xtag-exp.tex}
+\loadcorefile{xtag-pre.tex}
+\loadcorefile{xtag-xsd.tex}
+\loadcorefile{xtag-rng.tex}
+%loadcorefile{xtag-ent.tex}
+
+%D How about this:
+
+\loadcorefile{meta-xml.tex}
%D \TEX\ related logo's are always typeset in a special way.
%D Here they come:
-\input cont-log.tex
+\loadcorefile{cont-log.tex}
+
+%D This one overloads af few things:
+
+\loadcorefile{core-ctx.tex}
%D Defaults go here (more will be moved to this module
%D later):
-\input core-ini.tex
-\input core-def.tex
+\loadcorefile{core-lme.tex}
+\loadcorefile{core-ini.tex}
+\loadcorefile{core-def.tex}
+
+%D Preloaded modules (some need xml support):
+
+%usemodule[x][res-04] % xml resource libraries
+%usemodule[x][res-08] % rlx runtime conversion
+\usemodule[x][res-12] % rli external indentification
%D At run time, a few more files are loaded, like:
%D
@@ -425,82 +498,88 @@
\startinterface english
-\writestring{This package is based on Plain TeX. It uses an adapted version of the}
-\writestring{extended mark mechanism of J. Fox (1987) and a few parts of the sidefloat}
-\writestring{mechanism of D. Comenetz (1993). Most of D.E. Knuth's Plain TeX}
-\writestring{(\fmtversion) is available and can be used without problems. This package}
-\writestring{uses TaBlE, a package designed and copyrighted by M.J. Wichura (1988).}
-\writestring{Only a few auxiliary files are generated, of which some must be processed}
-\writestring{by TeXUtil (\utilityversion). The current blockversion is \blockversion.}
+\writebanner{This package is based on Plain TeX. It uses an adapted version of the}
+\writebanner{extended mark mechanism of J. Fox (1987) and a few parts of the sidefloat}
+\writebanner{mechanism of D. Comenetz (1993). Most of D.E. Knuth's Plain TeX}
+\writebanner{(\fmtversion) is available and can be used without problems. This package}
+\writebanner{uses TaBlE, a package designed and copyrighted by M.J. Wichura (1988).}
+\writebanner{Only a few auxiliary files are generated, of which some must be processed}
+\writebanner{by TeXExec.}
\stopinterface
\startinterface dutch
-\writestring{Dit pakket is gebaseerd op Plain TeX. Er wordt gebruik gemaakt van een}
-\writestring{aangepaste versie van het mark mechanisme van J. Fox (1987) en onderdelen}
-\writestring{van het sidefloat mechanisme van D. Comenetz (1993). De functionaliteit}
-\writestring{van D.E. Knuth's Plain TeX (\fmtversion) is grotendeels beschikbaar en}
-\writestring{kan zonder problemen worden gebruikt. Dit pakket gebruikt TaBlE, ontworpen door}
-\writestring{M.J. Wichura (1988), die ook het auteursrecht bezit. Er worden slechts een}
-\writestring{paar hulpfiles gegenereerd, waarvan er enkele moeten worden bewerkt door}
-\writestring{TeXUtil (\utilityversion). Het blokmechanisme heeft versienummer \blockversion.}
+\writebanner{Dit pakket is gebaseerd op Plain TeX. Er wordt gebruik gemaakt van een}
+\writebanner{aangepaste versie van het mark mechanisme van J. Fox (1987) en onderdelen}
+\writebanner{van het sidefloat mechanisme van D. Comenetz (1993). De functionaliteit}
+\writebanner{van D.E. Knuth's Plain TeX (\fmtversion) is grotendeels beschikbaar en}
+\writebanner{kan zonder problemen worden gebruikt. Dit pakket gebruikt TaBlE, ontworpen door}
+\writebanner{M.J. Wichura (1988), die ook het auteursrecht bezit. Er worden slechts een}
+\writebanner{paar hulpfiles gegenereerd, waarvan er enkele moeten worden bewerkt door}
+\writebanner{TeXExec.}
\stopinterface
\startinterface german
-\writestring{Dieses Paket basiert auf Plain-TeX und benutzt eine angepasste Version}
-\writestring{des erweiterten mark-Mechanismus von J. Fox (1987) und einige Teile des}
-\writestring{sidefloat-Mechanismus von D. Comenetz (1993). Ein Grossteil D.E. Knuths}
-\writestring{Plain-TeX (\fmtversion) ist verfuegbar und kann ohne Probleme benutzt werden.}
-\writestring{Dieses Paket benutzt TaBlE, ein von M.J. Wichura (1988) erstelltes und}
-\writestring{geschuetztes Paket. Nur einige Hilfsdateien werden erstellt; einige davon}
-\writestring{muessen von TeXUtil (\utilityversion) bearbeitet werden. Die aktuelle Block-}
-\writestring{version ist \blockversion.}
+\writebanner{Dieses Paket basiert auf Plain-TeX und benutzt eine angepasste Version}
+\writebanner{des erweiterten mark-Mechanismus von J. Fox (1987) und einige Teile des}
+\writebanner{sidefloat-Mechanismus von D. Comenetz (1993). Ein Grossteil D.E. Knuths}
+\writebanner{Plain-TeX (\fmtversion) ist verfuegbar und kann ohne Probleme benutzt werden.}
+\writebanner{Dieses Paket benutzt TaBlE, ein von M.J. Wichura (1988) erstelltes und}
+\writebanner{geschuetztes Paket. Nur einige Hilfsdateien werden erstellt; einige davon}
+\writebanner{muessen von TeXExec bearbeitet werden.}
\stopinterface
\startinterface czech
-\writestring{Tento balik je zalozen na Plain TeXu. Pouziva prizpusobenou verzi}
-\writestring{rozsireneho znackovaciho mechanismu J. Foxe (1987) a nekolik casti}
-\writestring{sidefloat mechanismu D. Comenetze (1993). Vetsina prikazu Plain TeXu}
-\writestring{D. E. Knutha (\fmtversion) je dostupna a muze byt bez problemu pouzita.}
-\writestring{Tento balik pouziva balik TaBlE, ktery vytvoril M. J. Wichura (1988).}
-\writestring{Je generovano jen nekolik pomocnych souboru, z nichz nektere musi byt}
-\writestring{zpracovany programem TeXUtil (\utilityversion). Aktualni verze}
-\writestring{}
-\writestring{THE CZECH USER INTERFACE IS STILL UNDER DEVELOPMENT!}
+\writebanner{Tento balik je zalozen na Plain TeXu. Pouziva prizpusobenou verzi}
+\writebanner{rozsireneho znackovaciho mechanismu J. Foxe (1987) a nekolik casti}
+\writebanner{sidefloat mechanismu D. Comenetze (1993). Vetsina prikazu Plain TeXu}
+\writebanner{D. E. Knutha (\fmtversion) je dostupna a muze byt bez problemu pouzita.}
+\writebanner{Tento balik pouziva balik TaBlE, ktery vytvoril M. J. Wichura (1988).}
+\writebanner{Je generovano jen nekolik pomocnych souboru, z nichz nektere musi byt}
+\writebanner{zpracovany programem TeXExec.}
\stopinterface
\startinterface italian
-\writestring{Questo pacchetto è basato sul Plain TeX. Usa una versione adattata del}
-\writestring{meccanismo di marcatura esteso di J. Fox (1987) ad alcune parti del}
-\writestring{meccanismo per gli oggetti mobili laterali di D. Comenetz (1993).}
-\writestring{La maggior parte del Plain TeX (\fmtversion) di D.E. Knuth è disponibile}
-\writestring{e può essere usata senza problemi. Questo pacchetto usa TaBlE,}
-\writestring{un pacchetto progettato da e con diritti di copia di M.J. Wichura (1988).}
-\writestring{Vengono generati pochi file ausiliari, alcuni dei quali devono essere}
-\writestring{elaborati da TeXUtil (\utilityversion). La versione attuale del blocco}
-\writestring{è \blockversion.}
-\writestring{}
-\writestring{L'INTERFACCIA UTENTE ITALIANA E' ANCORA IN VIA DI SVILUPPO!}
-\writestring{THE ITALIAN USER INTERFACE IS STILL UNDER DEVELOPMENT!}
+\writebanner{Questo pacchetto è basato sul Plain TeX. Usa una versione adattata del}
+\writebanner{meccanismo di marcatura esteso di J. Fox (1987) ad alcune parti del}
+\writebanner{meccanismo per gli oggetti mobili laterali di D. Comenetz (1993).}
+\writebanner{La maggior parte del Plain TeX (\fmtversion) di D.E. Knuth è disponibile}
+\writebanner{e può essere usata senza problemi. Questo pacchetto usa TaBlE,}
+\writebanner{un pacchetto progettato da e con diritti di copia di M.J. Wichura (1988).}
+\writebanner{Vengono generati pochi file ausiliari, alcuni dei quali devono essere}
+\writebanner{elaborati da TeXExec.}
\stopinterface
\startinterface romanian
-\writestring{Acest pachet este bazat pe Plain TeX. Foloseste o versiune adaptata a}
-\writestring{mecanismului extins de marcare a lui J. Fox (1987) si cateva parti a mecanismului }
-\writestring{blocurilor marginale a lui D. Comenetz (1993). Cea mai mare parte a Plain Tex}
-\writestring{(\fmtversion) a lui D.E. Knuth este disponibila si poate fi folosita fara probleme.}
-\writestring{Acest pachet foloseste TaBlE, un pachet proiectat si creat de M.J. Wichura (1988).}
-\writestring{Numai un numar de fisiere auxiliare sunt generate, din care unele trebuie procesate}
-\writestring{de catre TeXUtil (\utilityversion). Versiunea curenta de blocuri este \blockversion.}
+\writebanner{Acest pachet este bazat pe Plain TeX. Foloseste o versiune adaptata a}
+\writebanner{mecanismului extins de marcare a lui J. Fox (1987) si cateva parti a mecanismului }
+\writebanner{blocurilor marginale a lui D. Comenetz (1993). Cea mai mare parte a Plain Tex}
+\writebanner{(\fmtversion) a lui D.E. Knuth este disponibila si poate fi folosita fara probleme.}
+\writebanner{Acest pachet foloseste TaBlE, un pachet proiectat si creat de M.J. Wichura (1988).}
+\writebanner{Numai un numar de fisiere auxiliare sunt generate, din care unele trebuie procesate}
+\writebanner{de catre TeXExec.}
+
+\stopinterface
+
+\startinterface french
+
+\writebanner{Ce package est basé sur Plain TeX. Il utilise une version modifiée du}
+\writebanner{mécanisme de marquage étendu de J. Fox (1987) et une partie du}
+\writebanner{mécanisme de placement latéral des flottants de D. Comenetz (1993). La}
+\writebanner{majeure partie de Plain TeX (\fmtversion) de D.E. Knuth est disponible}
+\writebanner{et peut être utilisée sans problèmes. Ce package utilise TaBlE, un}
+\writebanner{package conçu et copyrighté par M.J. Wichura (1988). Seul quelques}
+\writebanner{fichiers auxiliaire sont générés, dont certains doivent être traités}
+\writebanner{par TeXExec.}
\stopinterface
@@ -508,7 +587,7 @@
{Copyright 1990-\the\normalyear\normalspace /
PRAGMA ADE / J. Hagen - A.F. Otten}
-\writeline\writestring{\copyrightversion}\writeline
+\writeline\writebanner{\copyrightversion}\writeline
% %D Except from english, no hyphenation patterns are loaded
% %D yet. Users can specify their needs in the next module:
@@ -587,6 +666,15 @@
\stopinterface
+\startinterface french
+
+ \installlanguage [\s!fr] [\c!state=\v!start]
+
+ \appendtoks \language [\s!fr] \to \everyjob
+ \appendtoks \mainlanguage [\s!fr] \to \everyjob
+
+\stopinterface
+
\protect
%D Finally we (pre)load some fonts.
diff --git a/Master/texmf-dist/tex/context/base/core-blk.tex b/Master/texmf-dist/tex/context/base/core-blk.tex
new file mode 100644
index 00000000000..a6e391e6e6a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-blk.tex
@@ -0,0 +1,678 @@
+%D \module
+%D [ file=core-blk, % split off core-buf.tex
+%D version=2000.01.05,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Blockmoves,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% investigate etex's \readline and \scantokens
+
+\writestatus{loading}{Context Core Macros / Blockmoves}
+
+\startmessages dutch library: textblocks
+ title: tekstblokken
+ 1: nieuwe versie, tweede run nodig
+ 2: wegschrijven blokken naar --
+ 3: inlezen blokken uit --
+ 4: er is een tweede run nodig
+ 5: -- niet verborgen
+ 6: -- verborgen en verwerkt
+ 7: -- verborgen
+ 8: -- gehandhaafd
+ 9: -- niet gehandhaafd
+ 10: -- geladen en verwerkt
+ 11: -- geladen en geplaatst
+ 12: -- overgeslagen
+\stopmessages
+
+\startmessages english library: textblocks
+ title: textblocks
+ 1: new version, second pass needed
+ 2: writing blocks to --
+ 3: reading blocks from --
+ 4: second pass needed
+ 5: -- not hidden
+ 6: -- hidden and processed
+ 7: -- hidden
+ 8: -- typeset
+ 9: -- not typeset
+ 10: -- loaded and processed
+ 11: -- loaded and typeset
+ 12: -- skipped
+\stopmessages
+
+\startmessages german library: textblocks
+ title: textblock
+ 1: neue Version, zweiter Durchlauf benoetigt
+ 2: schreibe Bloecke zu --
+ 3: lese Bloecke von --
+ 4: zweiter Durchlauf benoetigt
+ 5: -- nicht verborgen
+ 6: -- verborgen und verarbeitet
+ 7: -- verborgen
+ 8: -- gesetzt
+ 9: -- nicht gesetzt
+ 10: -- geladen und verarbeitet
+ 11: -- geladen und gesetzt
+ 12: -- ausgelassen
+\stopmessages
+
+\startmessages czech library: textblocks
+ title: textovyblok
+ 1: nova verze, je treba druhy beh
+ 2: zapisuji bloky do --
+ 3: ctu bloky z --
+ 4: je treba druhy beh
+ 5: -- neni skryto
+ 6: -- skryto a zpracovano
+ 7: -- skryto
+ 8: -- vysazeno
+ 9: -- nevysazeno
+ 10: -- nacteno a zpracovano
+ 11: -- nacteno a vysazeno
+ 12: -- preskoceno
+\stopmessages
+
+\startmessages italian library: textblocks
+ title: blocchi di testo
+ 1: nuova versione, seconda passata necessaria
+ 2: scrittura dei blocchi su --
+ 3: lettura dei blocchi da --
+ 4: seconda passata necessaria
+ 5: -- non nascosto
+ 6: -- nascosto ed elaborato
+ 7: -- nascosto
+ 8: -- composto
+ 9: -- non composto
+ 10: -- caricato ed elaborato
+ 11: -- caricato e composto
+ 12: -- saltato
+\stopmessages
+
+\startmessages norwegian library: textblocks
+ title: tekstblokker
+ 1: ny versjon, andre gjennomkjøring nødvendig
+ 2: skriver blokker til --
+ 3: leser blokker fra --
+ 4: andre gjennomkjøring nødvendig
+ 5: -- ikke skjult
+ 6: -- skjult og behandlet
+ 7: -- skjult
+ 8: -- tegnsatt
+ 9: -- ikke tegnsatt
+ 10: -- lest inn og behandlet
+ 11: -- lest inn og tegnsatt
+ 12: -- utelatt
+\stopmessages
+
+\startmessages romanian library: textblocks
+ title: blocuri de text
+ 1: o noua versiune, este nevoie de inca o trecere
+ 2: se scriu blocurile in --
+ 3: se citesc blocurile din --
+ 4: este nevoie de inca o trecere
+ 5: -- nu este ascuns
+ 6: -- ascuns si procesat
+ 7: -- ascuns
+ 8: -- cules
+ 9: -- nu este cules
+ 10: -- incarcat si procesat
+ 11: -- incarcat si cules
+ 12: -- sarit peste
+\stopmessages
+
+\startmessages french library: textblocks
+ title: blocs de texte
+ 1: nouvelle version, une seconde passe est nécessaire
+ 2: ecriture des blocs vers --
+ 3: lecture des blocs en provenance de --
+ 4: seconde passe nécessaire
+ 5: -- non caché
+ 6: -- caché et traité
+ 7: -- caché
+ 8: -- composé
+ 9: -- non composé
+ 10: -- chargé et traité
+ 11: -- chargé et composé
+ 12: -- sauté
+\stopmessages
+
+\unprotect
+
+\def\blockversion {1996.03.10}
+
+\def\@@blockerrormessage
+ {\showmessage\m!textblocks1\empty
+ \global\let\@@blockerrormessage\relax}
+
+\def\thisisblockversion#1%
+ {\doifnot\blockversion{#1}{\@@blockerrormessage\endinput}}
+
+\def\stopcopyingblocks
+ {\ifcopyingblocks
+ \immediate\closeout\outblocks
+ \copyblockfile
+ \global\copyingblocksfalse
+ \fi}
+
+\def\dodosetblockcounters[#1]#2%
+ {\expanded{\setvalue{\??se\s!old#2}{\@@filterheadpart[#1]}}%
+ \doifnot{#2}\lastsection
+ {\expanded{\dodosetblockcounters[\@@filtertailpart[#1]]}%
+ {\getvalue{\??se#2\c!after}}}} % ????
+
+\def\dosetblockcounters[#1]%
+ {\ifblockpermitted
+ \expanded{\dodosetblockcounters[\@@filtersecondpart[#1]]}\firstsection
+ \expanded{\setsectiontype[\@@filterfirstpart[#1]]}%
+ \def\@@sectionvalue##1{\getvalue{\??se\s!old##1}}%
+ \let\@@sectionconversion\secondoftwoarguments
+ \fi}
+
+\let\blockstatus\empty
+
+\def\setblockcounters
+ {\ifx\blockstatus\empty \else
+ \@EA\dosetblockcounters\@EA[\blockstatus]%
+ \fi}
+
+\def\getblockstatus#1%
+ {\dosetfilterlevel{\@@bscriterium}\empty
+ \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
+ {\global\blockpermittedtrue}
+ {\global\blockpermittedfalse}%
+ \def\blockstatus{#1}}
+
+\def\setupblockparameters
+ {\dodoubleargument\dosetupblockparameters}
+
+\def\dosetupblockparameters[#1][#2]%
+ {\getparameters[\??tb#1][#2]}
+
+\def\blockparameter#1#2%
+ {\@EA\csname\ifcsname\??tb#1#2\endcsname\??tb#1#2\else\s!empty\fi\endcsname}
+
+\ifx\outblocks\undefined \newwrite\outblocks \fi
+\ifx\inpblocks\undefined \newread \inpblocks \fi
+\ifx\tmpblocks\undefined \newwrite\tmpblocks \fi
+\ifx\blockbox \undefined \newbox \blockbox \fi
+
+\newif\ifcopyingblocks
+\newif\ifblockpermitted
+\newif\iftmpblockstarted
+\newif\ifoldinbijlagen
+\newif\ifdoingblocks
+
+\newcount\blocklevel
+
+\def\setblocklevel#1% sign
+ {\global\advance\blocklevel #11
+ \ifcase\blocklevel\doingblocksfalse\else\doingblockstrue\fi}
+
+\def\opentmpblock
+ {\immediate\openout\tmpblocks\TEXbufferfile{\f!utilityfilename\the\blocklevel}}
+
+\def\closetmpblock
+ {\immediate\write\tmpblocks{}% een lege regel is handig voor \par commando's
+ \immediate\closeout\tmpblocks}
+
+\def\writetmpblock#1%
+ {\iftmpblockstarted
+ \immediate\write\tmpblocks{#1}%
+ \else
+ \doifsomething{#1}
+ {\tmpblockstartedtrue
+ \immediate\write\tmpblocks{\string#1}}%
+ \fi}
+
+\def\startcopyingblocks
+ {\global\copyingblocksfalse}
+
+\def\checkcopyingblocks
+ {\ifcopyingblocks
+ \else
+ \immediate\openout\outblocks\f!utilityfilename.\f!blockextension%
+ \immediate\write\outblocks{\string\thisisblockversion{\blockversion}}%
+ \immediate\write\outblocks{\string\thisissectionseparator{\sectionseparator}}%
+ \global\copyingblockstrue
+ \fi}
+
+\def\stopcopyingblocks
+ {\ifcopyingblocks
+ \immediate\closeout\outblocks
+ \copyblockfile
+ \global\copyingblocksfalse
+ \fi}
+
+\def\nomoreblocks
+ {\stopcopyingblocks}
+
+\def\copyblockfile
+ {\ifcopyingblocks
+ \begingroup
+ \showmessage\m!textblocks2{\jobname.\f!blockextension}%
+ \openlocin\inpblocks{\f!utilityfilename.\f!blockextension}%
+ \immediate\openout\outblocks\jobname.\f!blockextension
+ \setupcopyblock
+ \catcode`\^^M=\@@ignore\relax
+ \def\copynextline
+ {\read\inpblocks to \!!stringa
+ \immediate\write\outblocks{\!!stringa}%
+ \ifeof\inpblocks\else\expandafter\copynextline\fi}%
+ \copynextline
+ \immediate\closein\inpblocks
+ \immediate\closeout\outblocks
+ \immediate\openout\tmpblocks\f!utilityfilename.\f!blockextension
+ \immediate\closeout\tmpblocks
+ \endgroup
+ \fi}
+
+\def\loadallblocks#1%
+ {\beginrestorecatcodes
+ \catcode`\^^M=\@@endofline\relax
+ \readjobfile{#1.\f!blockextension}
+ {\showmessage\m!textblocks3{#1.\f!blockextension}}
+ {\showmessage\m!textblocks4\empty}%
+ \endrestorecatcodes}
+
+\def\setupcopyblock
+ {\setcatcodetable\vrbcatcodes
+ \obeylines}
+
+\def\writeoutblocks
+ {\immediate\write\outblocks}
+
+\long\def\processnextblocklineAB#1% #2#3%
+ {\convertargument#1 \to\next
+ \doifinstringelse\endofblockA\next
+ \firstoftwoarguments
+ {\doifinstringelse\endofblockB\next
+ \firstoftwoarguments\secondoftwoarguments}}
+
+\bgroup
+\obeylines
+\long\gdef\copyblocklineAB#1
+ {\processnextblocklineAB{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblocklineAB}}
+\long\gdef\skipblocklineAB#1
+ {\processnextblocklineAB{#1}\closeblock\skipblocklineAB}
+\egroup
+
+\long\def\processnextblockline#1% #2#3%
+ {\convertargument#1 \to\next
+ \ifx\next\emptybufferline
+ \expandafter\secondoftwoarguments% #3%
+ \else
+ \emptybufferlinefalse
+ \doifinstringelse\endofblock\next
+ {\expandafter\firstoftwoarguments }% #2}
+ {\expandafter\secondoftwoarguments}% #3}%
+ \fi}
+
+\bgroup
+\obeylines
+\long\gdef\copyblockline#1
+ {\processnextblockline{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblockline}}
+\long\gdef\skipblockline#1
+ {\processnextblockline{#1}\closeblock\skipblockline}
+\egroup
+
+\def\skipblock#1%
+ {\checkcopyingblocks
+ \@EA\convertargument\string\thiswasblock{#1}\to\endofblock
+ %testen : \expanded{\convertargument\string\thiswasblock{#1}\noexpand\to\noexpand\endofblock}%
+ \let\openblock\begingroup
+ \let\closeblock\endgroup
+ \openblock
+ \setupcopyblock
+ \skipblockline}
+
+\let\doafterblock \gobbletwoarguments
+\let\dobeforeblock\gobbletwoarguments
+
+\def\thisisblock#1%
+ {\executeifdefined{\s!thisisblock#1}{\skipblock{#1}}}
+
+\def\thiswasblock#1%
+ {\getvalue{\s!thiswasblock#1}}
+
+\def\saveblock#1#2%
+ {\checkcopyingblocks
+ \obeylines
+ \@EA\@EA\@EA\convertargument\@EA\string\csname\e!end#1\endcsname\to\endofblockA
+ %testen: \expanded{\convertargument\string\csname\e!end#1\endcsname\to\endofblockA}%
+ \@EA\convertargument\string\endblock[#1]\to\endofblockB % MULTI LINGUAL MAKEN
+ \def\openblock
+ {\dobeforeblock{#1}{#2}%
+ \opentmpblock
+ \begingroup
+ \makesectionformat
+ \immediate\write\outblocks{}%
+ \immediate\write\outblocks{\string\thisisblock{#1}{\sectionformat}[#2]}}%
+ \def\closeblock
+ {\immediate\write\outblocks{}% handig voor \par commando's
+ \immediate\write\outblocks{\string\thiswasblock{#1}}%
+ \endgroup
+ \closetmpblock
+ \doafterblock{#1}{#2}%
+ \egroup}%
+ \openblock
+ \setupcopyblock
+ \copyblocklineAB}
+
+\def\copyblock
+ {\let\opentmpblock\empty
+ \let\closetmpblock\empty
+ \let\writetmpblock\gobbleoneargument
+ \saveblock}
+
+\def\loadoneblock
+ {\edef\blockfilename{\TEXbufferfile{\f!utilityfilename\the\blocklevel}}%
+ \setblocklevel+%
+ \readjobfile\blockfilename\donothing\donothing
+ \setblocklevel-}%
+
+\def\dodefineblock[#1]%
+ {\bypassblock[#1]%
+ \keepblocks[#1]%
+ \setupblock
+ [#1]
+ [\c!before=\blank,
+ \c!after=\blank,
+ \c!inner=,
+ \c!style=,
+ \c!file=\jobname]}
+
+% \def\defineblock
+% {\dosingleargumentwithset\dodefineblock}
+
+\def\defineblock
+ {\dosingleargument\dodefineblock}
+
+\def\dosetupblock[#1][#2]%
+ {\getparameters[\??tb#1][#2]}
+
+\def\setupblock
+ {\dodoubleargumentwithset\dosetupblock}
+
+\def\bypassblock[#1]%
+ {\setvalue{\s!thisisblock#1}##1[##2]{\skipblock{#1}}}
+
+\def\dohideblock[#1][#2][#3]%
+ {\doifassignmentelse{#3}
+ {\dodohideblock[#1][#2][][#3]}
+ {\dodohideblock[#1][#2][#3][]}}
+
+\def\dodohideblock[#1][#2][#3][#4]%
+ {\doifelsenothing{#2}
+ {\global\blockpermittedfalse
+ \edef\blocktitle{#1}}
+ {\doifelsenothing{#3}
+ {\global\blockpermittedtrue
+ \edef\blocktitle{#1}}
+ {\doifcommonelse{#2}{#3}
+ {\global\blockpermittedfalse
+ \edef\blocktitle{#1:#2}}
+ {\global\blockpermittedtrue
+ \edef\blocktitle{#1:#3}}}}%
+ \ifblockpermitted
+ \showwarning\m!textblocks5\blocktitle
+ \def\next
+ {\def\dobeforeblock####1####2%
+ {\begingroup}%
+ \def\doafterblock####1####2%
+ {\endgroup
+ \doexecuteloadedblock{#1}{#4}}%
+ \saveblock{#1}{#3#4}}%
+ \else
+ \doifinsetelse{+}{#3}
+ {\showwarning\m!textblocks6\blocktitle
+ \def\next
+ {\def\dobeforeblock####1####2%
+ {\begingroup
+ \visiblefalse}%
+ \def\doafterblock####1####2%
+ {{\setbox0\vbox
+ {\catcode`\^^M=\@@endofline\relax
+ \loadoneblock
+ \par}}%
+ \endgroup}%
+ \saveblock{#1}{#3#4}}}%
+ {\showwarning\m!textblocks7\blocktitle
+ \def\next
+ {\def\dobeforeblock####1####2%
+ {\begingroup
+ \globaldefs\minusone}%
+ \def\doafterblock####1####2%
+ {\endgroup}%
+ \copyblock{#1}{#3#4}}}%
+ \fi
+ \next}
+
+\def\dohideblocks[#1][#2]%
+ {\def\docommand##1%
+ {\setvalue{\e!begin##1}%
+ {\bgroup\obeylines\dotripleempty\dohideblock[##1][#2]}}%
+ \processcommalist[#1]\docommand}
+
+\def\hideblocks
+ {\dodoubleempty\dohideblocks}
+
+\def\doexecuteloadedblock#1#2%
+ {\blockpermittedtrue % ?
+ \bgroup % before \c!before (think of: \c!before=\startitemize)
+ \dosetupblockparameters[#1][#2]% voor 'voor'?
+ \getvalue{\??tb#1\c!before}%
+ \dostartattributes{\??tb#1}\c!style\c!color\empty
+ \visibletrue
+ \catcode`\^^M=\@@endofline\relax
+ \getvalue{\??tb#1\c!inner}%
+ \ignorespaces
+ \loadoneblock
+ % \par moved
+ \dostopattributes
+ \getvalue{\??tb#1\c!after}%
+ \par
+ \egroup}
+
+\def\dokeepblock[#1][#2][#3]%
+ {\doifassignmentelse{#3}
+ {\dodokeepblock[#1][#2][][#3]}
+ {\dodokeepblock[#1][#2][#3][]}}
+
+\def\dodokeepblock[#1][#2][#3][#4]%
+ {\doifelsenothing{#2}
+ {\global\blockpermittedtrue
+ \edef\blocktitle{#1}}
+ {\doifcommonelse{#2}{#3}
+ {\global\blockpermittedtrue
+ \edef\blocktitle{#1:#2}}
+ {\doifinsetelse\v!all{#2}
+ {\doifelsenothing{#3}
+ {\global\blockpermittedtrue
+ \edef\blocktitle{#1}}
+ {\global\blockpermittedfalse
+ \edef\blocktitle{#1:#3}}}
+ {\global\blockpermittedfalse
+ \doifelsenothing{#3}
+ {\edef\blocktitle{#1}}
+ {\edef\blocktitle{#1:#3}}}}}%
+ \ifblockpermitted
+ \showwarning\m!textblocks8\blocktitle
+ \def\dobeforeblock##1##2%
+ {\begingroup}%
+ \def\doafterblock##1##2%
+ {\endgroup
+ \doexecuteloadedblock{#1}{#4}}%
+ \else
+ \showwarning\m!textblocks9\blocktitle
+ \fi
+ \saveblock{#1}{#3#4}}
+
+\def\dokeepblocks[#1][#2]%
+ {\def\docommand##1%
+ {\setvalue{\e!begin##1}%
+ {\bgroup\obeylines\dotripleempty\dokeepblock[##1][#2]}}%
+ \processcommalist[#1]\docommand}
+
+\def\keepblocks
+ {\dodoubleempty\dokeepblocks}
+
+\newconditional\processblockstatus
+\newconditional\dummyblockstatus
+\newconditional\blockassignmentstatus
+
+\def\dodouseblock#1#2#3#4%
+ {\getblockstatus{#2}%
+ \ifblockpermitted
+ \setfalse\dummyblockstatus
+ \doifassignmentelse{#3}
+ {\settrue \blockassignmentstatus}
+ {\setfalse\blockassignmentstatus}%
+ \doifelsenothing{#4}
+ {\edef\blocktitle{#1}}
+ {\ifconditional\blockassignmentstatus
+ \edef\blocktitle{#1}%
+ \else
+ \doifnotcommon{#3}{#4}
+ {\ifconditional\processblockstatus
+ \settrue\dummyblockstatus
+ \else
+ \global\blockpermittedfalse
+ \fi}%
+ \edef\blocktitle{#1:#3}%
+ \fi}%
+ \else
+ \edef\blocktitle{#1}%
+ \fi
+ \ifblockpermitted
+ \setblocklevel+%
+ \ifconditional\blockassignmentstatus \else
+ \doifinset{-}{#3}{\settrue\dummyblockstatus}%
+ \fi
+ \ifconditional\dummyblockstatus
+ \showwarning\m!textblocks{10}\blocktitle
+ \setvalue{\s!thiswasblock#1}%
+ {\removeunwantedspaces
+ \par
+ \egroup
+ \setblocklevel-}%
+ \def\next
+ {\setbox0\vbox\bgroup
+ \ifconditional\blockassignmentstatus
+ \dosetupblockparameters[#1][#3]%
+ \fi}%
+ \else
+ \showwarning\m!textblocks{11}\blocktitle
+ \setvalue{\s!thiswasblock#1}%
+ {\removeunwantedspaces
+ % \par moved
+ \dostopattributes
+ \getvalue{\??tb#1\c!after}%
+ \par
+ \egroup
+ \setblocklevel-}%
+ \def\next
+ {\bgroup
+ \ifconditional\blockassignmentstatus
+ \dosetupblockparameters[#1][#3]%
+ \fi
+ \getvalue{\??tb#1\c!before}%
+ \dostartattributes{\??tb#1}\c!style\c!color\empty
+ \visibletrue
+ \getvalue{\??tb#1\c!inner}%
+ \ignorespaces}%
+ \fi
+ \else
+ \def\next
+ {\showwarning\m!textblocks{12}\blocktitle
+ \skipblock{#1}}%
+ \fi
+ \next}
+
+\def\douseblock[#1][#2]%
+ {\setvalue{\s!thisisblock#1}##1[##2]{\dodouseblock{#1}{##1}{##2}{#2}}}
+
+\def\dodouseblocks[#1][#2]%
+ {\def\docommand##1%
+ {\douseblock[##1][#2]}%
+ \processcommalist[#1]\docommand
+ \dogetcommalistelement1\from#1\to\commalistelement
+ \doifdefined{\??tb\commalistelement\c!file}
+ {\loadallblocks{\getvalue{\??tb\commalistelement\c!file}}}%
+ \endgroup}
+
+\def\douseblocks
+ {\begingroup
+ \doassign[\??bs][\c!criterium=\v!all]%
+ \dodoubleempty\dodouseblocks}
+
+\def\useblocks
+ {\setfalse\processblockstatus\douseblocks}
+
+\def\processblocks
+ {\settrue \processblockstatus\douseblocks}
+
+\def\doselectblocks[#1][#2][#3]%
+ {\begingroup
+ \doifelsenothing{#3}
+ {\getparameters[\??bs][\c!criterium=\v!all,#2]%
+ \dodouseblocks[#1][]}
+ {\getparameters[\??bs][\c!criterium=\v!all,#3]%
+ \dodouseblocks[#1][#2]}}%
+
+\def\selectblocks
+ {\dotripleempty\doselectblocks}
+
+\def\beginblock[#1]% % we also check \endblock[..]
+ {\getvalue{\e!begin#1}}
+
+\def\forceblocks[#1]%
+ {\def\docommand##1%
+ {\setvalue{\e!begin##1}%
+ {\setblocklevel+\bgroup
+ \dodoubleempty\doforceblock[##1]}%
+ \setvalue{\e!end##1}%
+ {\dostopattributes
+ \getvalue{\??tb##1\c!after}%
+ \egroup\setblocklevel-}}%
+ \processcommalist[#1]\docommand}
+
+\def\doforceblock[#1][#2]%
+ {\doifassignmentelse{#2}
+ {\settrue \blockassignmentstatus}
+ {\setfalse\blockassignmentstatus}%
+ \ifconditional\blockassignmentstatus
+ \dosetupblockparameters[#1][#2]%
+ \fi
+ \getvalue{\??tb#1\c!before}%
+ \dostartattributes{\??tb#1}\c!style\c!color\empty
+ \getvalue{\??tb#1\c!inner}%
+ \ignorespaces}
+
+\def\bypassblocks[#1]%
+ {\def\docommand##1%
+ {\setvalue{\e!begin##1}%
+ {\setblocklevel+\bgroup
+ \obeylines % here, since we look ahead
+ \dodoubleempty\dobypassblock[##1]}%}%
+ \setvalue{\e!end##1}%
+ {}}%
+ \processcommalist[#1]\docommand}
+
+\def\dobypassblock[#1][#2]%
+ {\def\closeblock
+ {\egroup\setblocklevel-}%
+ \checkcopyingblocks
+ \obeylines
+ \@EA\@EA\@EA\convertargument\@EA\string\csname\e!end#1\endcsname\to\endofblockA
+ \@EA\convertargument\string\endblock[#1]\to\endofblockB % MULTI LINGUAL MAKEN
+ \setupcopyblock
+ \skipblocklineAB}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-box.tex b/Master/texmf-dist/tex/context/base/core-box.tex
index 184f0647ce1..16a8941512b 100644
--- a/Master/texmf-dist/tex/context/base/core-box.tex
+++ b/Master/texmf-dist/tex/context/base/core-box.tex
@@ -1,8 +1,8 @@
%D \module
%D [ file=core-box,
%D version=2002.04.12,
-%D title=\CONTEXT\ Box Macros,
-%D subtitle=New Macros,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Boxes,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\writestatus{loading}{Context Core Macros / Boxes}
+
%D This module contains all kind of macros for moving content
%D around. Many macros here come from other modules, but
%D depencies made it more clear to isolate them.
@@ -108,7 +110,7 @@
{\setvalue{\??an#1}{\dodefinedanchor[#2][#3][#4]}}
\def\dodefinedanchor[#1][#2][#3]%
- {\def\docommando[##1][##2]%
+ {\def\docommand[##1][##2]%
{\ifsecondargument
\def\next{\dodoanchorT[#1][#2,##1][#3,##2]}%
\else\iffirstargument
@@ -117,7 +119,7 @@
\def\next{\dodoanchorT[#1][#2][#3]}%
\fi\fi
\next}%
- \dodoubleempty\docommando}
+ \dodoubleempty\docommand}
\def\@@collectorbox{@@collectorbox}
@@ -141,8 +143,8 @@
{\dodoubleargument\dosetupcollector}
\def\dosetupcollector[#1][#2]%
- {\def\docommando##1{\getparameters[\??cb##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??cb##1][#2]}%
+ \processcommalist[#1]\docommand}
\def\setcollector
{\dodoubleargument\dosetcollector}
@@ -875,12 +877,12 @@
% {\dontleavehmode
% \bgroup
% \scratchdimen\zeropoint
-% \def\docommando##1%
+% \def\docommand##1%
% {\setbox\scratchbox\hbox{##1}%
% \ifdim\wd\scratchbox>\scratchdimen
% \scratchdimen\wd\scratchbox
% \fi}%
-% \processcommalist[#3]\docommando
+% \processcommalist[#3]\docommand
% \hbox to \scratchdimen{#1#4#2}%
% \egroup}
%
diff --git a/Master/texmf-dist/tex/context/base/core-buf.mkii b/Master/texmf-dist/tex/context/base/core-buf.mkii
new file mode 100644
index 00000000000..9a803764cfd
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-buf.mkii
@@ -0,0 +1,143 @@
+%D \module
+%D [ file=core-buf, % blocks are moved to core-blk
+%D version=2000.01.05,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Buffers,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\def\mkresetbuffer
+ {\unlinkfile{\TEXbufferfile\currentbuffer}}
+
+\long\def\mksetbuffer#1%
+ {\edef\bufferfilename{\TEXbufferfile{\currentbuffer}}%
+ \immediate\openout\tmpblocks\bufferfilename
+ \convertargument#1\to\ascii
+ \immediate\write\tmpblocks{\ascii}%
+ \immediate\closeout\tmpblocks}
+
+\def\mkstartbuffer#1#2#3#4#5% ook grabben a la mkiv / no, we need to add par anchors
+ {\doifelsenothing{#4}
+ {\letbeundefined{\e!stop\v!buffer}% % \let\stopbuffer=\relax % \undefined
+ \@EA\@EA\@EA\convertargument\@EA\e!start\v!buffer\to\beginofblock % else a space
+ \@EA\@EA\@EA\convertargument\@EA\e!stop \v!buffer\to\endofblock
+ \ifcase\buffernestmode
+ \let\processnextbufferline\processnextbufferlineB
+ \else
+ \let\processnextbufferline\processnextbufferlineA
+ \fi}
+ {\letbeundefined{#4}% \letvalue{#4}=\relax % \undefined
+ \@EA\convertargument\csname#3\endcsname\to\beginofblock
+ \@EA\convertargument\csname#4\endcsname\to\endofblock
+ \ifcase\buffernestmode
+ \let\processnextbufferline\processnextbufferlineB
+ \or
+ \let\processnextbufferline\processnextbufferlineB
+ \else
+ \let\processnextbufferline\processnextbufferlineA
+ \fi}%
+ \def\closebufferfile
+ {\ifsegmentatebuffer
+ \immediate\write\tmpblocks{\string\stopbufferparagraph}%
+ \fi
+ \immediate\closeout\tmpblocks
+ #5% \egroup
+ \getvalue{#4}}%
+ \doifelsenothing{#2}
+ {\edef\bufferfilename{\TEXbufferfile\jobname}}%
+ {\edef\bufferfilename{\TEXbufferfile{#2}}}%
+ \immediate\openout\tmpblocks\bufferfilename
+ \ifsegmentatebuffer
+ \immediate\write\tmpblocks{\string\startbufferparagraph}%
+ \fi
+ \newcounter\nestedbufferlevel
+ \recatcodeuppercharacterstrue
+ \setcatcodetable\vrbcatcodes
+ \obeylines
+ \copybufferline}
+
+\def\mkdobuffer#1% command
+ {\beginrestorecatcodes
+ #1%
+ \endrestorecatcodes}
+
+\def\mkgetbuffer {\readjobfile{\TEXbufferfile{\currentbuffer}}\donothing\donothing}
+\def\mktypebuffer{\typefile{\TEXbufferfile{\currentbuffer}}}
+
+% support macros
+
+\expandafter \convertargument \gobbleoneargument @ \to \emptybufferline
+
+\ifx\tmpblocks\undefined \newwrite\tmpblocks \fi
+
+\newif\iftmpblockstarted
+
+\def\flushbufferline#1%
+ {\iftmpblockstarted
+ \ifsegmentatebuffer
+ \ifemptybufferline
+ \immediate\write\tmpblocks{\string\stopbufferparagraph }%
+ \immediate\write\tmpblocks{\string\startbufferparagraph}%
+ \else
+ \immediate\write\tmpblocks{#1}%
+ \fi
+ \else
+ \immediate\write\tmpblocks{#1}%
+ \fi
+ \else
+ \doifsomething{#1}
+ {\tmpblockstartedtrue
+ \immediate\write\tmpblocks{\string#1}}%
+ \fi}
+
+\long\def\processnextbufferlineA#1%
+ {\relax % checken waarom eerdere macro dit nodig heeft / supp-mps run
+ \convertargument#1 \to\next
+ \doifinstringelse{\delcharacter\letterpercent}{\delcharacter\next}
+ {\secondoftwoarguments}
+ {\doifincsnameelse\endofblock\next
+ {\ifnum\nestedbufferlevel=\zerocount
+ \expandafter\firstoftwoarguments
+ \else
+ \decrement\nestedbufferlevel\relax
+ \expandafter\secondoftwoarguments
+ \fi}
+ {\doifincsnameelse\beginofblock\next
+ {\increment\nestedbufferlevel\relax
+ \secondoftwoarguments}
+ {\secondoftwoarguments}}}}
+
+\long\def\processnextbufferlineB#1% #2#3%
+ {\convertargument#1 \to\next
+ \ifx\next\emptybufferline
+ \ifsegmentatebuffer \emptybufferlinetrue \fi
+ \expandafter\secondoftwoarguments% #3%
+ \else
+ \emptybufferlinefalse
+ \doifinstringelse\endofblock\next
+ {\expandafter\firstoftwoarguments }% #2}
+ {\expandafter\secondoftwoarguments}% #3}%
+ \fi}
+
+\bgroup
+\obeylines
+\long\gdef\copybufferline#1
+ {\processnextbufferline{#1}\closebufferfile{\flushbufferline{#1}\copybufferline}}
+\egroup
+
+% kind of obsolete with mkiv
+
+\def\mkstartmemorybuffer
+ {\dosingleempty\dostartmemorybuffer}
+
+\long\def\dostartmemorybuffer[#1]#2\stopbuffer
+ {\setbuffer[#1]#2\endbuffer}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-buf.tex b/Master/texmf-dist/tex/context/base/core-buf.tex
index 73c93b356f5..ad98788a33c 100644
--- a/Master/texmf-dist/tex/context/base/core-buf.tex
+++ b/Master/texmf-dist/tex/context/base/core-buf.tex
@@ -1,8 +1,8 @@
%D \module
-%D [ file=core-buf,
+%D [ file=core-buf, % blocks are moved to core-blk
%D version=2000.01.05,
%D title=\CONTEXT\ Core Macros,
-%D subtitle=Buffers and Blockmoves,
+%D subtitle=Buffers,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,196 +11,37 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% investigate etex's \readline and \scantokens
+\writestatus{loading}{Context Core Macros / Buffers}
-\writestatus{loading}{Context Core Macros / Buffers and Blockmoves}
-
-\startmessages dutch library: textblocks
- title: tekstblokken
- 1: nieuwe versie, tweede run nodig
- 2: wegschrijven blokken naar --
- 3: inlezen blokken uit --
- 4: er is een tweede run nodig
- 5: -- niet verborgen
- 6: -- verborgen en verwerkt
- 7: -- verborgen
- 8: -- gehandhaafd
- 9: -- niet gehandhaafd
- 10: -- geladen en verwerkt
- 11: -- geladen en geplaatst
- 12: -- overgeslagen
-\stopmessages
-
-\startmessages english library: textblocks
- title: textblocks
- 1: new version, second pass needed
- 2: writing blocks to --
- 3: reading blocks from --
- 4: second pass needed
- 5: -- not hidden
- 6: -- hidden and processed
- 7: -- hidden
- 8: -- typeset
- 9: -- not typeset
- 10: -- loaded and processed
- 11: -- loaded and typeset
- 12: -- skipped
-\stopmessages
-
-\startmessages german library: textblocks
- title: textblock
- 1: neue Version, zweiter Durchlauf benoetigt
- 2: schreibe Bloecke zu --
- 3: lese Bloecke von --
- 4: zweiter Durchlauf benoetigt
- 5: -- nicht verborgen
- 6: -- verborgen und verarbeitet
- 7: -- verborgen
- 8: -- gesetzt
- 9: -- nicht gesetzt
- 10: -- geladen und verarbeitet
- 11: -- geladen und gesetzt
- 12: -- ausgelassen
-\stopmessages
+\unprotect
-\startmessages czech library: textblocks
- title: textovyblok
- 1: nova verze, je treba druhy beh
- 2: zapisuji bloky do --
- 3: ctu bloky z --
- 4: je treba druhy beh
- 5: -- neni skryto
- 6: -- skryto a zpracovano
- 7: -- skryto
- 8: -- vysazeno
- 9: -- nevysazeno
- 10: -- nacteno a zpracovano
- 11: -- nacteno a vysazeno
- 12: -- preskoceno
-\stopmessages
+\let\mkresetbuffer \donothing
+\let\mksetbuffer \gobbleoneargument
+\let\mkstartbuffer \gobblefivearguments
+\let\mkdobuffer \gobbleoneargument
+\let\mkstartmemorybuffer\startbuffer
+\let\mkstartfilebuffer \startbuffer
+\let\mkgetbuffer \donothing
+\let\mktypebuffer \donothing
-\startmessages italian library: textblocks
- title: blocchi di testo
- 1: nuova versione, seconda passata necessaria
- 2: scrittura dei blocchi su --
- 3: lettura dei blocchi da --
- 4: seconda passata necessaria
- 5: -- non nascosto
- 6: -- nascosto ed elaborato
- 7: -- nascosto
- 8: -- composto
- 9: -- non composto
- 10: -- caricato ed elaborato
- 11: -- caricato e composto
- 12: -- saltato
-\stopmessages
+\chardef\buffernestmode\plusone % 0: not nested, 1: startbuffer nested, 2: all buffers nested
-\startmessages norwegian library: textblocks
- title: tekstblokker
- 1: ny versjon, andre gjennomkjøring nødvendig
- 2: skriver blokker til --
- 3: leser blokker fra --
- 4: andre gjennomkjøring nødvendig
- 5: -- ikke skjult
- 6: -- skjult og behandlet
- 7: -- skjult
- 8: -- tegnsatt
- 9: -- ikke tegnsatt
- 10: -- lest inn og behandlet
- 11: -- lest inn og tegnsatt
- 12: -- utelatt
-\stopmessages
+\newif\ifsegmentatebuffer
+\newif\ifemptybufferline
-\startmessages romanian library: textblocks
- title: blocuri de text
- 1: o noua versiune, este nevoie de inca o trecere
- 2: se scriu blocurile in --
- 3: se citesc blocurile din --
- 4: este nevoie de inca o trecere
- 5: -- nu este ascuns
- 6: -- ascuns si procesat
- 7: -- ascuns
- 8: -- cules
- 9: -- nu este cules
- 10: -- incarcat si procesat
- 11: -- incarcat si cules
- 12: -- sarit peste
-\stopmessages
+\def\currentbuffer{\jobname}
-\startmessages french library: textblocks
- title: blocs de texte
- 1: nouvelle version, une seconde passe est nécessaire
- 2: ecriture des blocs vers --
- 3: lecture des blocs en provenance de --
- 4: seconde passe nécessaire
- 5: -- non caché
- 6: -- caché et traité
- 7: -- caché
- 8: -- composé
- 9: -- non composé
- 10: -- chargé et traité
- 11: -- chargé et composé
- 12: -- sauté
-\stopmessages
+\def\setcurrentbuffer#1%
+ {\doifelsenothing{#1}{\edef\currentbuffer{\jobname}}{\edef\currentbuffer{#1}}}
-\unprotect
-
-% more accurate
-%
-% \@EA\convertcommand\csname\e!start\v!buffer\endcsname\to\beginofblock % else a space
-% \@EA\convertcommand\csname\e!stop\v!buffer \endcsname\to\endofblock
-
\def\resetbuffer
{\dosingleempty\doresetbuffer}
\def\doresetbuffer[#1]%
- {\unlinkfile{\TEXbufferfile{\iffirstargument#1\else\jobname\fi}}}
-
-% \EveryPar%
-% {\doglobal\newcounter\NOfLines}
-%
-% \EveryLine%
-% {\doglobal\increment\NOfLines%
-% \hskip-3em%
-% \hbox to 3em{\hss\NOfLines\hskip1em}}
-
-%D For Willy's nested commented buffers, we need the \type
-%D {\delcharacter} trick.
-
-%\def\processnextbufferline#1% needs testing ! ! ! !
-% {\relax % checken waarom eerdere macro dit nodig heeft / supp-mps run
-% \convertargument#1 \to\next
-% \doifinstringelse{\delcharacter\texcommentsymbol}{\delcharacter\next}
-% {\let\next\secondoftwoarguments}
-% {\doifincsnameelse\endofblock\next
-% {\ifnum\nestedbufferlevel=\zerocount
-% \let\next\firstoftwoarguments
-% \else
-% \decrement\nestedbufferlevel\relax
-% \let\next\secondoftwoarguments
-% \fi}
-% {\doifincsnameelse\beginofblock\next
-% {\increment\nestedbufferlevel\relax
-% \let\next\secondoftwoarguments}
-% {\let\next\secondoftwoarguments}}}%
-% \next}
-
-\long\def\processnextbufferline#1%
- {\relax % checken waarom eerdere macro dit nodig heeft / supp-mps run
- \convertargument#1 \to\next
- \doifinstringelse{\delcharacter\texcommentsymbol}{\delcharacter\next}
- {\secondoftwoarguments}
- {\doifincsnameelse\endofblock\next
- {\ifnum\nestedbufferlevel=\zerocount
- \expandafter\firstoftwoarguments
- \else
- \decrement\nestedbufferlevel\relax
- \expandafter\secondoftwoarguments
- \fi}
- {\doifincsnameelse\beginofblock\next
- {\increment\nestedbufferlevel\relax
- \secondoftwoarguments}
- {\secondoftwoarguments}}}}
+ {\begingroup
+ \setcurrentbuffer{#1}%
+ \mkresetbuffer
+ \endgroup}
\def\dostartbuffer
{\bgroup
@@ -209,107 +50,34 @@
\def\dodostartbuffer[#1][#2][#3][#4]% upward compatible
{\iffourthargument
- \def\next{\dododostartbuffer[#1][#2][#3][#4]}%
+ \def\next{\dododostartbuffer{#1}{#2}{#3}{#4}}%
\else
- \def\next{\dododostartbuffer[][#1][#2][#3]}%
+ \def\next{\dododostartbuffer {}{#1}{#2}{#3}}%
\fi
\next}
-\chardef\buffernestmode\plusone % 0: not nested, 1: startbuffer nested, 2: all buffers nested
-
-\def\dododostartbuffer[#1][#2][#3][#4]%
+\def\dododostartbuffer#1#2#3#4%
{%\showmessage\m!systems{15}{#2}%
\doifelsevalue{\??bu#1\c!paragraph}\v!yes
- {\segmentatebuffertrue}
+ {\segmentatebuffertrue} % todo in mkiv
{\doifnumberelse{\getvalue{\??bu#1\c!paragraph}}\segmentatebuffertrue\segmentatebufferfalse}%
\doifvalue{\??bu#1\c!local}\v!yes
{\chardef\buffernestmode\plustwo}% permit nesting
- \doifelsenothing{#4}
- {\letbeundefined{\e!stop\v!buffer}% % \let\stopbuffer=\relax % \undefined
- \@EA\@EA\@EA\convertargument\@EA\e!start\v!buffer\to\beginofblock % else a space
- \@EA\@EA\@EA\convertargument\@EA\e!stop \v!buffer\to\endofblock
- \ifcase\buffernestmode \else
- \let\processnextblockline\processnextbufferline
- \fi}
- {\letbeundefined{#4}% \letvalue{#4}=\relax % \undefined
- \@EA\convertargument\csname#3\endcsname\to\beginofblock
- \@EA\convertargument\csname#4\endcsname\to\endofblock
- \ifcase\buffernestmode \or \else
- \let\processnextblockline\processnextbufferline
- \fi}%
- \def\closeblock
- {\ifsegmentatebuffer
- \immediate\write\tmpblocks{\string\stopbufferparagraph}%
- \fi
- \immediate\closeout\tmpblocks
- \egroup
- \getvalue{#4}}%
- \doifelsenothing{#2}
- {\edef\bufferfilename{\TEXbufferfile\jobname}}%
- {\edef\bufferfilename{\TEXbufferfile{#2}}}%
- \message{<\bufferfilename>}%
- \immediate\openout\tmpblocks\bufferfilename
- \ifsegmentatebuffer
- \immediate\write\tmpblocks{\string\startbufferparagraph}%
- \fi
- \newcounter\nestedbufferlevel
- \setupcopyblock
- \let\writeoutblocks\gobbleoneargument
- \copyblockline}
+ \setcurrentbuffer{#2}%
+ \mkstartbuffer{#1}{#2}{#3}{#4}{\egroup}}
\letvalue{\e!start\v!buffer}\dostartbuffer
-% \setbuffer[name]#2\endbuffer : saves to file #1.tmp
+\let\endbuffer\undefined % to please the dep parser
-\def\setbuffer[#1]#2\endbuffer
- {\edef\bufferfilename{\TEXbufferfile{#1}}%
- \message{<\bufferfilename>}%
- \immediate\openout\tmpblocks\bufferfilename
- \convertargument#2\to\ascii
- \immediate\write\tmpblocks{\ascii}%
- \immediate\closeout\tmpblocks}
-
-\def\dodobuffer#1#2%
- {\beginrestorecatcodes
- \ifundefined{\??bu#2\c!number}%
- \edef\bufferfilename{\TEXbufferfile{#2}}%
- \else
- \edef\bufferfilename{\TEXbufferfile{def-\getvalue{\??bu#2\c!number}}}%
- \fi
- #1\bufferfilename\donothing\donothing
- \endrestorecatcodes}
+\def\setbuffer
+ {\dosingleempty\dosetbuffer}
-\def\dobuffer#1[#2]#3%
- {\doifelsenothing{#2}
- {\dodobuffer#3\jobname}
- {\processcommalist[#2]{\dodobuffer#3}}}
-
-\def\processTEXbuffer
- {\dodoubleempty\doprocessTEXbuffer}
-
-\def\doprocessTEXbuffer[#1][#2]%
- {\ifsecondargument
- \dodoprocessTEXbuffer[#1][#2]%
- \else
- \dodoprocessTEXbuffer[][#1]%
- \fi}
-
-\def\dodoprocessTEXbuffer[#1][#2]%
- {\getvalue{\??bu#1\c!before}%
- \dobuffer{16}[#2]\readjobfile
- \getvalue{\??bu#1\c!after}}
-
-\let\getbuffer\processTEXbuffer % handy
-
-\def\typebuffer
- {\dodoubleempty\dotypebuffer}
-
-\def\dotypebuffer[#1][#2]%
- {\iffirstargument
- \dobuffer{17}[#1]\typefile
- \else
- \dobuffer{17}[#2]\typefile
- \fi}
+\def\dosetbuffer[#1]#2\endbuffer % seldom used so we just pass #2
+ {\begingroup
+ \setcurrentbuffer{#1}%
+ \mksetbuffer{#2}%
+ \endgroup}
\def\setupbuffer
{\dodoubleempty\dosetupbuffer}
@@ -324,49 +92,65 @@
\def\dodefinebuffer[#1][#2]%
{\iffirstargument % else problems
\doglobal\increment\nofdefinedbuffers
- \letvalue{\??bu#1\c!number}\nofdefinedbuffers
+ \letvalue{\??bu#1\c!number }\nofdefinedbuffers
\letvalue{\??bu#1\c!paragraph}\v!no
- \setevalue{\e!start#1}%
- {\noexpand\dostartbuffer[#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}%
- \setevalue{\e!get#1}%
- {\noexpand\dodoprocessTEXbuffer[#1][def-\nofdefinedbuffers]}%
- \setevalue{\e!type#1}%
- {\noexpand\dotypebuffer[#1][def-\nofdefinedbuffers]}%
+ \setevalue{\e!start#1}{\noexpand\dostartbuffer [#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}%
+ \setevalue{\e!get #1}{\noexpand\dodoprocessTEXbuffer[#1][def-\nofdefinedbuffers]}%
+ \setevalue{\e!type #1}{\noexpand\dotypebuffer [#1][def-\nofdefinedbuffers]}%
\getparameters[\??bu#1][#2]%
\fi}
\def\definebuffer
{\dodoubleempty\dodefinebuffer}
-% yet another undocumented feature, but who cares:
+\def\getbuffer
+ {\dodoubleempty\dogetbuffer}
-\let\startfilebuffer\startbuffer
+\def\dogetbuffer[#1][#2]%
+ {\ifsecondargument
+ \dodogetbuffer[#1][#2]%
+ \else
+ \dodogetbuffer[][#1]%
+ \fi}
-\def\usememorybuffers{\let\startbuffer\startmemorybuffer}
-\def\usefilebuffers {\let\startbuffer\startfilebuffer}
+\def\dodogetbuffer[#1][#2]%
+ {\getvalue{\??bu#1\c!before}%
+ \dobuffer{16}{#2}\mkgetbuffer
+ \getvalue{\??bu#1\c!after}}
-\def\startmemorybuffer
- {\dosingleempty\dostartmemorybuffer}
+\def\typebuffer
+ {\dodoubleempty\dotypebuffer}
-\long\def\dostartmemorybuffer[#1]#2\stopbuffer
- {\setbuffer[\iffirstargument#1\else\jobname\fi]#2\endbuffer}
+\def\dotypebuffer[#1][#2]%
+ {\iffirstargument
+ \dobuffer{17}{#1}\mktypebuffer
+ \else
+ \dobuffer{17}{#2}\mktypebuffer
+ \fi}
-% \long\def\startcrap#1\stopcrap
-% {\usememorybuffers#1\usefilebuffers} % or {{...}}
-%
-% \startcrap
-% \startbuffer
-% some awful code
-% \stopbuffer
-% \placefigure{crap}{\getbuffer}
-% \stopcrap
-
-% TODO: no grouping due to sidefloats
+\def\dobuffer#1#2#3%
+ {\doifelsenothing{#2}
+ {\dodobuffer#3\jobname}
+ {\processcommalist[#2]{\dodobuffer#3}}}
-\expandafter \convertargument \gobbleoneargument @ \to \emptybufferline
+\def\dodobuffer#1#2% command name
+ {\pushmacro\currentbuffer
+ \edef\currentbuffer{\ifcsname\??bu#2\c!number\endcsname def-\csname\??bu#2\c!number\endcsname\else#2\fi}%
+ \mkdobuffer#1%
+ \popmacro\currentbuffer}
-\newif\ifsegmentatebuffer
-\newif\ifemptybufferline
+\def\processTEXbuffer{\getbuffer} % handy
+
+% seldom used, only in a few projects that demanded more speed
+
+\def\usememorybuffers{\let\startbuffer\mkstartmemorybuffer}
+\def\usefilebuffers {\let\startbuffer\mkstartfilebuffer}
+
+% this features is soldom used (complex examns where we need to fetch
+% special parts of a text
+%
+% this is not yet supported in mkiv (relatively easy to do but there
+% we don't have the par tags but need to grab 'm
\def\skippedbufferparagraphs{0}
@@ -408,7 +192,7 @@
\next}
\def\getparagraphedbuffer[#1]%
- {\dobuffer{16}[#1]\readjobfile}
+ {\dobuffer{16}{#1}\mkgetbuffer}
\def\dostopbufferparagraph#1%
{\getvalue{\??bu#1\c!after}\par}
@@ -426,27 +210,14 @@
\def\filterbufferparagraph#1#2%
{\advance\currentbufferparagraph \plusone
- \ifnum\currentbufferparagraph>\zerocount
- \doifinsetelse{\the\currentbufferparagraph}{#2}
- {\let\next\dostartbufferparagraph}
- {\let\next\fakebufferparagraph}%
+ \ifcase\currentbufferparagraph
+ \@EA\gobblebufferparagraph
\else
- \let\next\gobblebufferparagraph
+ \doifinsetelse{\the\currentbufferparagraph}{#2}
+ {\@EA\dostartbufferparagraph}
+ {\@EA\fakebufferparagraph}%
\fi
- \next{#1}}
-
-% nicer, but untested
-%
-% \def\filterbufferparagraph#1#2%
-% {\advance\currentbufferparagraph \plusone
-% \ifcase\currentbufferparagraph
-% \@EA\gobblebufferparagraph
-% \else
-% \doifinsetelse{\the\currentbufferparagraph}{#2}
-% {\@EA\dostartbufferparagraph}
-% {\@EA\fakebufferparagraph}%
-% \fi
-% {#1}}
+ {#1}}
\long\def\gobblebufferparagraph#1#2\stopbufferparagraph
{}
@@ -455,606 +226,15 @@
{\bgroup
\def\stopbufferparagraph{\dostopbufferparagraph{#1}\egroup\egroup}%
\setbox\scratchbox\vbox\bgroup\dostartbufferparagraph{#1}}
-
-\def\blockversion {1996.03.10}
-
-\def\@@blockerrormessage%
- {\showmessage\m!textblocks1\empty
- \global\let\@@blockerrormessage\relax}
-
-\def\thisisblockversion#1%
- {\doifnot\blockversion{#1}{\@@blockerrormessage\endinput}}
-
-\def\stopcopyingblocks
- {\ifcopyingblocks
- \immediate\closeout\outblocks
- \copyblockfile
- \global\copyingblocksfalse
- \fi}
-
-\def\dodosetblockcounters[#1]#2%
- {\expanded{\setvalue{\??se\s!old#2}{\@@filterheadpart[#1]}}%
- \doifnot{#2}\lastsection
- {\expanded{\dodosetblockcounters[\@@filtertailpart[#1]]}%
- {\getvalue{\??se#2\c!after}}}} % ????
-
-\def\dosetblockcounters[#1]%
- {\ifblockpermitted
- \expanded{\dodosetblockcounters[\@@filtersecondpart[#1]]}\firstsection
- \expanded{\setsectiontype[\@@filterfirstpart[#1]]}%
- \def\@@sectionvalue##1{\getvalue{\??se\s!old##1}}%
- \let\@@sectionconversion\secondoftwoarguments
- \fi}
-
-\let\blockstatus\empty
-
-\def\setblockcounters
- {\ifx\blockstatus\empty \else
- \@EA\dosetblockcounters\@EA[\blockstatus]%
- \fi}
-
-\def\getblockstatus#1%
- {\dosetfilterlevel{\@@bscriterium}\empty
- \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
- {\global\blockpermittedtrue}
- {\global\blockpermittedfalse}%
- \def\blockstatus{#1}}
-
-\def\setupblockparameters
- {\dodoubleargument\dosetupblockparameters}
-
-\def\dosetupblockparameters[#1][#2]%
- {\getparameters[\??tb#1][#2]}
-
-\beginTEX
-
-\def\blockparameter#1#2%
- {\csname\@EA\ifx\csname\??tb#1#2\endcsname\relax\s!empty\else\??tb#1#2\fi\endcsname}
-
-\endTEX
-
-\beginETEX \ifcsname
-
-\def\blockparameter#1#2%
- {\@EA\csname\ifcsname\??tb#1#2\endcsname\??tb#1#2\else\s!empty\fi\endcsname}
-
-\endETEX
-\ifx\outblocks\undefined \newwrite\outblocks \fi
-\ifx\inpblocks\undefined \newread \inpblocks \fi
-\ifx\tmpblocks\undefined \newwrite\tmpblocks \fi
-\ifx\blockbox \undefined \newbox \blockbox \fi
+% plugins
-\newif\ifcopyingblocks
-\newif\ifvisible \visibletrue
-\newif\ifblockpermitted
-\newif\iftmpblockstarted
-\newif\ifoldinbijlagen
-\newif\ifdoingblocks
+\loadmarkfile{core-buf}
-\newcount\blocklevel \blocklevel=0
-
-%\def\setblocklevel#1%
-% {\global\advance\blocklevel by #11
-% \ifnum\blocklevel>2\relax\doingblockstrue\else\doingblocksfalse\fi}
-%
-% oeps, got bugged
-
-\def\setblocklevel#1% sign
- {\global\advance\blocklevel #11
- \ifcase\blocklevel\doingblocksfalse\else\doingblockstrue\fi}
-
-\def\opentmpblock
- {\immediate\openout\tmpblocks\TEXbufferfile{\f!utilityfilename\the\blocklevel}}
-
-\def\closetmpblock
- {\immediate\write\tmpblocks{}% een lege regel is handig voor \par commando's
- \immediate\closeout\tmpblocks}
-
-\def\writetmpblock#1%
- {\iftmpblockstarted
- \ifsegmentatebuffer
- \ifemptybufferline
- \immediate\write\tmpblocks{\string\stopbufferparagraph }%
- \immediate\write\tmpblocks{\string\startbufferparagraph}%
- \else
- \immediate\write\tmpblocks{#1}%
- \fi
- \else
- \immediate\write\tmpblocks{#1}%
- \fi
- \else
- \doifsomething{#1}
- {\tmpblockstartedtrue
- \immediate\write\tmpblocks{\string#1}}%
- \fi}
-
-\def\startcopyingblocks
- {\global\copyingblocksfalse}
-
-\def\checkcopyingblocks
- {\ifcopyingblocks
- \else
- \immediate\openout\outblocks\f!utilityfilename.\f!blockextension%
- \immediate\write\outblocks{\string\thisisblockversion{\blockversion}}%
- \immediate\write\outblocks{\string\thisissectionseparator{\sectionseparator}}%
- \global\copyingblockstrue
- \fi}
-
-\def\stopcopyingblocks
- {\ifcopyingblocks
- \immediate\closeout\outblocks
- \copyblockfile
- \global\copyingblocksfalse
- \fi}
-
-\def\nomoreblocks
- {\stopcopyingblocks}
-
-\def\copyblockfile
- {\ifcopyingblocks
- \begingroup
- \showmessage\m!textblocks2{\jobname.\f!blockextension}%
- \openlocin\inpblocks{\f!utilityfilename.\f!blockextension}%
- \immediate\openout\outblocks\jobname.\f!blockextension
- \setupcopyblock
- \catcode`\^^M=\@@ignore\relax
- \def\copynextline
- {\read\inpblocks to \!!stringa
- \immediate\write\outblocks{\!!stringa}%
- \ifeof\inpblocks\else\expandafter\copynextline\fi}%
- \copynextline
- \immediate\closein\inpblocks
- \immediate\closeout\outblocks
- \immediate\openout\tmpblocks\f!utilityfilename.\f!blockextension
- \immediate\closeout\tmpblocks
- \endgroup
- \fi}
-
-\def\loadallblocks#1%
- {\beginrestorecatcodes
- \catcode`\^^M=\@@endofline\relax
- \readjobfile{#1.\f!blockextension}
- {\showmessage\m!textblocks3{#1.\f!blockextension}}
- {\showmessage\m!textblocks4\empty}%
- \endrestorecatcodes}
-
-\def\setupcopyblock
- {\makeallother
- \obeylines}
-
-\def\writeoutblocks
- {\immediate\write\outblocks}
-
-% readable
-%
-% \def\processnextblocklineAB#1#2#3%
-% {\convertargument#1 \to\next
-% \doifinstringelse\endofblockA\next
-% {\def\next{#2}}
-% {\doifinstringelse\endofblockB\next
-% {\def\next{#2}}
-% {\def\next{#3}}}%
-% \next}
-%
-% faster
-%
-% \def\processnextblocklineAB#1#2#3%
-% {\convertargument#1 \to\next % space is essential
-% \doifinstringelse\endofblockA\next
-% {#2}{\doifinstringelse\endofblockB\next{#2}{#3}}}
-%
-% even more
-
-\long\def\processnextblocklineAB#1% #2#3%
- {\convertargument#1 \to\next
- \doifinstringelse\endofblockA\next
- \firstoftwoarguments
- {\doifinstringelse\endofblockB\next
- \firstoftwoarguments\secondoftwoarguments}}
-
-\bgroup
-\obeylines
-\long\gdef\copyblocklineAB#1
- {\processnextblocklineAB{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblocklineAB}}
-\long\gdef\skipblocklineAB#1
- {\processnextblocklineAB{#1}\closeblock\skipblocklineAB}
-\egroup
-
-% \def\processnextblockline#1#2#3%
-% {\convertargument#1 \to\next
-% \ifx\next\emptybufferline
-% \ifsegmentatebuffer \emptybufferlinetrue \fi
-% \def\next{#3}%
-% \else
-% \emptybufferlinefalse
-% \doifinstringelse{\endofblock}{\next}
-% {\def\next{#2}}
-% {\def\next{#3}}%
-% \fi
-% \next}
-%
-% faster
-
-\long\def\processnextblockline#1% #2#3%
- {\convertargument#1 \to\next
- \ifx\next\emptybufferline
- \ifsegmentatebuffer \emptybufferlinetrue \fi
- \expandafter\secondoftwoarguments% #3%
- \else
- \emptybufferlinefalse
- \doifinstringelse\endofblock\next
- {\expandafter\firstoftwoarguments }% #2}
- {\expandafter\secondoftwoarguments}% #3}%
- \fi}
-
-\bgroup
-\obeylines
-\long\gdef\copyblockline#1
- {\processnextblockline{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblockline}}
-\long\gdef\skipblockline#1
- {\processnextblockline{#1}\closeblock\skipblockline}
-\egroup
-
-\def\skipblock#1%
- {\checkcopyingblocks
- \@EA\convertargument\string\thiswasblock{#1}\to\endofblock
- %testen : \expanded{\convertargument\string\thiswasblock{#1}\noexpand\to\noexpand\endofblock}%
- \let\openblock\begingroup
- \let\closeblock\endgroup
- \openblock
- \setupcopyblock
- \skipblockline}
-
-\let\doafterblock \gobbletwoarguments
-\let\dobeforeblock\gobbletwoarguments
-
-\def\thisisblock#1%
- {\executeifdefined{\s!thisisblock#1}{\skipblock{#1}}}
-
-\def\thiswasblock#1%
- {\getvalue{\s!thiswasblock#1}}
-
-\def\saveblock#1#2%
- {\checkcopyingblocks
- \obeylines
- \@EA\@EA\@EA\convertargument\@EA\string\csname\e!end#1\endcsname\to\endofblockA
- %testen: \expanded{\convertargument\string\csname\e!end#1\endcsname\to\endofblockA}%
- \@EA\convertargument\string\endblock[#1]\to\endofblockB % MULTI LINGUAL MAKEN
- \def\openblock
- {\dobeforeblock{#1}{#2}%
- \opentmpblock
- \begingroup
- \makesectionformat
- \immediate\write\outblocks{}%
- \immediate\write\outblocks{\string\thisisblock{#1}{\sectionformat}[#2]}}%
- \def\closeblock
- {\immediate\write\outblocks{}% handig voor \par commando's
- \immediate\write\outblocks{\string\thiswasblock{#1}}%
- \endgroup
- \closetmpblock
- \doafterblock{#1}{#2}%
- \egroup}%
- \openblock
- \setupcopyblock
- \copyblocklineAB}
-
-\def\copyblock
- {\let\opentmpblock\empty
- \let\closetmpblock\empty
- \let\writetmpblock\gobbleoneargument
- \saveblock}
-
-\def\loadoneblock
- {\edef\blockfilename{\TEXbufferfile{\f!utilityfilename\the\blocklevel}}%
- \setblocklevel+%
- \readjobfile\blockfilename\donothing\donothing
- \setblocklevel-}%
-
-\def\dodefineblock[#1]%
- {\bypassblock[#1]%
- \keepblocks[#1]%
- \setupblock
- [#1]
- [\c!before=\blank,
- \c!after=\blank,
- \c!inner=,
- \c!style=,
- \c!file=\jobname]}
-
-% \def\defineblock
-% {\dosingleargumentwithset\dodefineblock}
-
-\def\defineblock
- {\dosingleargument\dodefineblock}
-
-\def\dosetupblock[#1][#2]%
- {\getparameters[\??tb#1][#2]}
-
-\def\setupblock
- {\dodoubleargumentwithset\dosetupblock}
-
-\def\bypassblock[#1]%
- {\setvalue{\s!thisisblock#1}##1[##2]{\skipblock{#1}}}
-
-\def\dohideblock[#1][#2][#3]%
- {\doifassignmentelse{#3}
- {\dodohideblock[#1][#2][][#3]}
- {\dodohideblock[#1][#2][#3][]}}
-
-\def\dodohideblock[#1][#2][#3][#4]%
- {\doifelsenothing{#2}
- {\global\blockpermittedfalse
- \edef\blocktitle{#1}}
- {\doifelsenothing{#3}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1}}
- {\doifcommonelse{#2}{#3}
- {\global\blockpermittedfalse
- \edef\blocktitle{#1:#2}}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1:#3}}}}%
- \ifblockpermitted
- \showwarning\m!textblocks5\blocktitle
- \def\next
- {\def\dobeforeblock####1####2%
- {\begingroup}%
- \def\doafterblock####1####2%
- {\endgroup
- \doexecuteloadedblock{#1}{#4}}%
- \saveblock{#1}{#3#4}}%
- \else
- \doifinsetelse{+}{#3}
- {\showwarning\m!textblocks6\blocktitle
- \def\next
- {\def\dobeforeblock####1####2%
- {\begingroup
- \visiblefalse}%
- \def\doafterblock####1####2%
- {{\setbox0\vbox
- {\catcode`\^^M=\@@endofline\relax
- \loadoneblock
- \par}}%
- \endgroup}%
- \saveblock{#1}{#3#4}}}%
- {\showwarning\m!textblocks7\blocktitle
- \def\next
- {\def\dobeforeblock####1####2%
- {\begingroup
- \globaldefs\minusone}%
- \def\doafterblock####1####2%
- {\endgroup}%
- \copyblock{#1}{#3#4}}}%
- \fi
- \next}
-
-\def\dohideblocks[#1][#2]%
- {\def\docommando##1%
- {\setvalue{\e!begin##1}%
- {\bgroup\obeylines\dotripleempty\dohideblock[##1][#2]}}%
- \processcommalist[#1]\docommando}
-
-\def\hideblocks
- {\dodoubleempty\dohideblocks}
-
-\def\doexecuteloadedblock#1#2%
- {\blockpermittedtrue % ?
- \bgroup % before \c!before (think of: \c!before=\startitemize)
- \dosetupblockparameters[#1][#2]% voor 'voor'?
- \getvalue{\??tb#1\c!before}%
- \dostartattributes{\??tb#1}\c!style\c!color\empty
- \visibletrue
- \catcode`\^^M=\@@endofline\relax
- \getvalue{\??tb#1\c!inner}%
- \ignorespaces
- \loadoneblock
- % \par moved
- \dostopattributes
- \getvalue{\??tb#1\c!after}%
- \par
- \egroup}
-
-\def\dokeepblock[#1][#2][#3]%
- {\doifassignmentelse{#3}
- {\dodokeepblock[#1][#2][][#3]}
- {\dodokeepblock[#1][#2][#3][]}}
-
-\def\dodokeepblock[#1][#2][#3][#4]%
- {\doifelsenothing{#2}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1}}
- {\doifcommonelse{#2}{#3}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1:#2}}
- {\doifinsetelse\v!all{#2}
- {\doifelsenothing{#3}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1}}
- {\global\blockpermittedfalse
- \edef\blocktitle{#1:#3}}}
- {\global\blockpermittedfalse
- \doifelsenothing{#3}
- {\edef\blocktitle{#1}}
- {\edef\blocktitle{#1:#3}}}}}%
- \ifblockpermitted
- \showwarning\m!textblocks8\blocktitle
- \def\dobeforeblock##1##2%
- {\begingroup}%
- \def\doafterblock##1##2%
- {\endgroup
- \doexecuteloadedblock{#1}{#4}}%
- \else
- \showwarning\m!textblocks9\blocktitle
- \fi
- \saveblock{#1}{#3#4}}
-
-\def\dokeepblocks[#1][#2]%
- {\def\docommando##1%
- {\setvalue{\e!begin##1}%
- {\bgroup\obeylines\dotripleempty\dokeepblock[##1][#2]}}%
- \processcommalist[#1]\docommando}
-
-\def\keepblocks
- {\dodoubleempty\dokeepblocks}
-
-\newconditional\processblockstatus
-\newconditional\dummyblockstatus
-\newconditional\blockassignmentstatus
-
-\def\dodouseblock#1#2#3#4%
- {\getblockstatus{#2}%
- \ifblockpermitted
- \setfalse\dummyblockstatus
- \doifassignmentelse{#3}
- {\settrue \blockassignmentstatus}
- {\setfalse\blockassignmentstatus}%
- \doifelsenothing{#4}
- {\edef\blocktitle{#1}}
- {\ifconditional\blockassignmentstatus
- \edef\blocktitle{#1}%
- \else
- \doifnotcommon{#3}{#4}
- {\ifconditional\processblockstatus
- \settrue\dummyblockstatus
- \else
- \global\blockpermittedfalse
- \fi}%
- \edef\blocktitle{#1:#3}%
- \fi}%
- \else
- \edef\blocktitle{#1}%
- \fi
- \ifblockpermitted
- \setblocklevel+%
- \ifconditional\blockassignmentstatus \else
- \doifinset{-}{#3}{\settrue\dummyblockstatus}%
- \fi
- \ifconditional\dummyblockstatus
- \showwarning\m!textblocks{10}\blocktitle
- \setvalue{\s!thiswasblock#1}%
- {\removeunwantedspaces
- \par
- \egroup
- \setblocklevel-}%
- \def\next
- {\setbox0\vbox\bgroup
- \ifconditional\blockassignmentstatus
- \dosetupblockparameters[#1][#3]%
- \fi}%
- \else
- \showwarning\m!textblocks{11}\blocktitle
- \setvalue{\s!thiswasblock#1}%
- {\removeunwantedspaces
- % \par moved
- \dostopattributes
- \getvalue{\??tb#1\c!after}%
- \par
- \egroup
- \setblocklevel-}%
- \def\next
- {\bgroup
- \ifconditional\blockassignmentstatus
- \dosetupblockparameters[#1][#3]%
- \fi
- \getvalue{\??tb#1\c!before}%
- \dostartattributes{\??tb#1}\c!style\c!color\empty
- \visibletrue
- \getvalue{\??tb#1\c!inner}%
- \ignorespaces}%
- \fi
- \else
- \def\next
- {\showwarning\m!textblocks{12}\blocktitle
- \skipblock{#1}}%
- \fi
- \next}
-
-\def\douseblock[#1][#2]%
- {\setvalue{\s!thisisblock#1}##1[##2]{\dodouseblock{#1}{##1}{##2}{#2}}}
-
-\def\dodouseblocks[#1][#2]%
- {\def\docommando##1%
- {\douseblock[##1][#2]}%
- \processcommalist[#1]\docommando
- \dogetcommalistelement1\from#1\to\commalistelement
- \doifdefined{\??tb\commalistelement\c!file}
- {\loadallblocks{\getvalue{\??tb\commalistelement\c!file}}}%
- \endgroup}
-
-\def\douseblocks
- {\begingroup
- \doassign[\??bs][\c!criterium=\v!all]%
- \dodoubleempty\dodouseblocks}
-
-\def\useblocks
- {\setfalse\processblockstatus\douseblocks}
-
-\def\processblocks
- {\settrue \processblockstatus\douseblocks}
-
-\def\doselectblocks[#1][#2][#3]%
- {\begingroup
- \doifelsenothing{#3}
- {\getparameters[\??bs][\c!criterium=\v!all,#2]%
- \dodouseblocks[#1][]}
- {\getparameters[\??bs][\c!criterium=\v!all,#3]%
- \dodouseblocks[#1][#2]}}%
-
-\def\selectblocks
- {\dotripleempty\doselectblocks}
-
-\def\beginblock[#1]% % we also check \endblock[..]
- {\getvalue{\e!begin#1}}
-
-\def\forceblocks[#1]%
- {\def\docommando##1%
- {\setvalue{\e!begin##1}%
- {\setblocklevel+\bgroup
- \dodoubleempty\doforceblock[##1]}%
- \setvalue{\e!end##1}%
- {\dostopattributes
- \getvalue{\??tb##1\c!after}%
- \egroup\setblocklevel-}}%
- \processcommalist[#1]\docommando}
-
-\def\doforceblock[#1][#2]%
- {\doifassignmentelse{#2}
- {\settrue \blockassignmentstatus}
- {\setfalse\blockassignmentstatus}%
- \ifconditional\blockassignmentstatus
- \dosetupblockparameters[#1][#2]%
- \fi
- \getvalue{\??tb#1\c!before}%
- \dostartattributes{\??tb#1}\c!style\c!color\empty
- \getvalue{\??tb#1\c!inner}%
- \ignorespaces}
-
-\def\bypassblocks[#1]%
- {\def\docommando##1%
- {\setvalue{\e!begin##1}%
- {\setblocklevel+\bgroup
- \obeylines % here, since we look ahead
- \dodoubleempty\dobypassblock[##1]}%}%
- \setvalue{\e!end##1}%
- {}}%
- \processcommalist[#1]\docommando}
-
-\def\dobypassblock[#1][#2]%
- {\def\closeblock
- {\egroup\setblocklevel-}%
- \checkcopyingblocks
- \obeylines
- \@EA\@EA\@EA\convertargument\@EA\string\csname\e!end#1\endcsname\to\endofblockA
- \@EA\convertargument\string\endblock[#1]\to\endofblockB % MULTI LINGUAL MAKEN
- \setupcopyblock
- \skipblocklineAB}
-
-% \setvalue{\e!start\v!hiding}%
-% {\dostartbuffer[buf-\nofpostponedblocks]
-% [\e!start\v!hiding][\e!stop\v!hiding]}
+% definitions
\definebuffer[\v!hiding] \setupbuffer[\v!hiding][\c!local=\v!yes]
-
+
\setupbuffer
[\c!paragraph=\v!no,
\c!before=,
diff --git a/Master/texmf-dist/tex/context/base/core-con.mkii b/Master/texmf-dist/tex/context/base/core-con.mkii
new file mode 100644
index 00000000000..9a4a0b0ff91
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-con.mkii
@@ -0,0 +1,286 @@
+%D \module
+%D [ file=core-con,
+%D version=1997.26.08,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Conversion Macros,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D When upcasing the result, we just follow the text book rules
+%D of expansion. Later on we'll see some more uppercase tricks.
+
+\def\romannumerals#1%
+ {\romannumeral#1}
+
+%D For some years we had \unknown
+%D
+%D \starttyping
+%D \def\Romannumerals#1%
+%D {\uppercase\expandafter{\romannumeral#1}}
+%D \stoptyping
+%D
+%D \unknown but we need to be fully expandable in order to get
+%D the utility output file right, so now we have the following
+%D solution. It was Patrick Gundlach who first noticed this
+%D ommision.
+
+\def\Romannumerals#1%
+ {\expandafter\doRomannumerals\number#1\relax}
+
+\def\doRomannumerals#1#2\relax % spaces after ifcase prevent \relax
+ {\ifnum#1#2<10
+ \ifcase0#1#2 \or I\or II\or III\or IV\or V\or VI\or VII\or VIII\or IX\fi
+ \else\ifnum#1#2<100
+ \ifcase0#1 \or X\or XX\or XXX\or XL\or L\or LX\or LXX\or LXXX\or XC\fi
+ \doRomannumerals#2\relax
+ \else\ifnum#1#2<1000
+ \ifcase0#1 \or C\or CC\or CCC\or CD\or D\or DC\or DCC\or DCCC\or CM\fi
+ \doRomannumerals#2\relax
+ \else\ifnum#1#2<4000
+ \ifcase0#1 \or M\or MM\or MMM\fi
+ \doRomannumerals#2\relax
+ \else
+ \uppercase\expandafter{\romannumeral#1#2}%
+ \fi\fi\fi\fi}
+
+%D Big case statements but pretty fast:
+
+\def\character#1%
+ {\ifcase#1\unknowncharacter
+ \or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
+ \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z%
+ \else
+ \unknowncharacter
+ \fi}
+
+\def\Character#1%
+ {\ifcase#1\unknowncharacter
+ \or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
+ \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z%
+ \else
+ \unknowncharacter
+ \fi}
+
+\def\greeknumerals#1%
+ {% no longer needed: \mathematics
+ {\ifcase#1\unknowncharacter\or
+ \alpha \or \beta \or \gamma \or \delta \or
+ \varepsilon \or \zeta \or \eta \or \theta \or
+ \iota \or \kappa \or \lambda \or \mu \or
+ \nu \or \xi \or \omicron \or \pi \or
+ \varrho \or \sigma \or \tau \or \upsilon \or
+ \phi \or \chi \or \psi \or \omega
+ \else
+ \unknowncharacter
+ \fi}}
+
+\def\Greeknumerals#1%
+ {% no longer needed: \mathematics
+ {\ifcase#1\unknowncharacter \or
+ \Alpha \or \Beta \or \Gamma \or \Delta \or
+ \Epsilon \or \Zeta \or \Eta \or \Theta \or
+ \Iota \or \Kappa \or \Lambda \or \Mu \or
+ \Nu \or \Xi \or \Omicron \or \Pi \or
+ \Rho \or \Sigma \or \Tau \or \Upsilon \or
+ \Phi \or \Xi \or \Psi \or \Omega
+ \else
+ \unknowncharacter
+ \fi}}
+
+\beginTEX
+
+\def\dodoconvertcharacters#1#2#3%
+ {\ifnum#3>#1
+ \bgroup
+ \!!counta#3\relax
+ \ifnum\!!counta>\zerocount
+ \advance\!!counta \minusone
+ \!!countb\!!counta
+ \divide\!!counta #1%
+ \!!countc\!!counta
+ \multiply\!!countc #1%
+ \advance\!!countb -\!!countc
+ \doconvertcharacters#3{\!!counta}%
+ \advance\!!countb \plusone
+ #3{\the\!!countb}%
+ \fi
+ \egroup
+ \else
+ #2{#3}% pure expansion, used in references
+ \fi}
+
+\endTEX
+
+%D A fully expandable alternative:
+
+\beginETEX \numexpr
+
+\def\dodoconvertcharacters#1#2#3%
+ {\ifcase#3\else
+ \ifnum#3>#1
+ \expandafter\doconvertcharacters\expandafter#2\expandafter{\the\numexpr(#3+12)/#1-1\relax}%
+ \expandafter#2\expandafter{\the\numexpr#3-((#3+12)/#1-1)*#1\relax}%
+ \else
+ \expandafter#2\expandafter{\number#3}%
+ \fi
+ \fi}
+
+\endETEX
+
+\def\doconvertcharacters{\dodoconvertcharacters{26}}
+
+\def\characters{\doconvertcharacters\character}
+\def\Characters{\doconvertcharacters\Character}
+
+\def\getdayoftheweek#1#2#3%
+ {\bgroup
+ \!!counta#3\relax
+ \advance\!!counta \minusone
+ \!!countb\!!counta
+ \multiply\!!countb 365
+ \advance\!!countb \ifcase#2\relax
+ 0 \or 0 \or 31 \or 59 \or 90 \or120 \or151 \or
+ 181 \or212 \or243 \or273 \or304 \or334 \or365 \fi
+ \advance\!!countb #1\relax
+ \ifnum#2>2
+ \doifleapyearelse{#3}{\advance\!!countb 1}{}\relax
+ \fi
+ \!!countc\!!counta
+ \dosetdivision\!!countc4\!!countc
+ \advance\!!countb \!!countc
+ \!!countc\!!counta
+ \dosetdivision\!!countc{100}\!!countc
+ \advance\!!countb -\!!countc
+ \!!countc\!!counta
+ \dosetdivision\!!countc{400}\!!countc
+ \advance\!!countb \!!countc
+ \dosetmodulo\!!countb7\!!countb
+ \advance\!!countb \plusone
+ \@EA\egroup\@EA\normalweekday\the\!!countb\relax}
+
+\def\dayoftheweek#1#2#3%
+ {\getdayoftheweek{#1}{#2}{#3}\doconvertday{\normalweekday}}
+
+\def\doifleapyearelse#1% #2#3%
+ {\bgroup
+ \!!doneafalse
+ \!!counta#1%
+ \dosetmodulo\!!counta4\!!countb
+ \ifcase\!!countb
+ \dosetmodulo\!!counta{100}\!!countb
+ \ifcase\!!countb \else \!!doneatrue \fi
+ \dosetmodulo\!!counta{400}\!!countb
+ \ifcase\!!countb \!!doneatrue \fi
+ \fi
+ \if!!donea
+ \egroup\@EA\firstoftwoarguments % \def\next{#2}%
+ \else
+ \egroup\@EA\secondoftwoarguments % \def\next{#3}%
+ \fi} % \next}
+
+% untested but cleaner:
+%
+% \def\doifleapyearelse#1% #2#3%
+% {\bgroup
+% \dosetmodulo{#1}{400}\scratchcounter
+% \ifcase\scratchcounter
+% \else
+% \dosetmodulo{#1}{100}\scratchcounter
+% \ifcase\scratchcounter
+% \scratchcounter\plusone
+% \else
+% \dosetmodulo{#1}4\scratchcounter
+% \fi
+% \fi
+% \ifcase\scratchcounter
+% \egroup\@EA\firstoftwoarguments
+% \else
+% \egroup\@EA\secondoftwoarguments
+% \fi}
+
+\def\getdayspermonth#1#2%
+ {\doifleapyearelse{#1}
+ {\def\numberofdays{29}}
+ {\def\numberofdays{28}}%
+ \edef\numberofdays
+ {\ifcase#2 \or31\or\numberofdays\or31\or30\or
+ 31\or30\or31\or31\or30\or31\or30\or31\fi}}
+
+\def\calculatecurrenttime
+ {\dosetdivision\time{60}\scratchcounter
+ \edef\currenthour {\ifnum\scratchcounter<10 0\fi \the\scratchcounter}%
+ \dosetmodulo \time{60}\scratchcounter
+ \edef\currentminute{\ifnum\scratchcounter<10 0\fi \the\scratchcounter}}
+
+
+%D \macros
+%D {defineconversionvector,conversionnumber} % bad names so no danger for clash
+%D
+%D For Adam and friends \unknown
+%D
+%D \startitemize[persiannummerals]
+%D \item test \item test \item test \item test
+%D \stopitemize
+
+\def\defineconversionvector#1#2% name base
+ {\bgroup
+ % dirty trick
+ \uccode`\*=`\1
+ % plain:
+ % \uccode`\0=\numexpr#2+0\relax \uccode`\1=\numexpr#2+1\relax
+ % \uccode`\2=\numexpr#2+2\relax \uccode`\3=\numexpr#2+3\relax
+ % \uccode`\4=\numexpr#2+4\relax \uccode`\5=\numexpr#2+5\relax
+ % \uccode`\6=\numexpr#2+6\relax \uccode`\7=\numexpr#2+7\relax
+ % \uccode`\8=\numexpr#2+8\relax \uccode`\9=\numexpr#2+9\relax
+ % context:
+ \dostepwiserecurse091{\expandafter\uccode\expandafter`\recurselevel=\numexpr#2+\recurselevel}%
+ % prepared macro
+ \uppercase\expandafter{\expandafter\gdef\csname::cvn::#1::\endcsname##*%
+ {\ifcase##* 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\fi}}%
+ \egroup}
+
+\def\conversionnumber#1#2%
+ {\ifcsname::cvn::#1::\endcsname
+ \expandafter\doconversionnumber\csname::cvn::#1::\expandafter\endcsname\number#2\relax
+ \else
+ \number#2%
+ \fi}
+
+\def\doconversionnumber#1#2%
+ {\ifx#2\relax
+ \expandafter\gobbleoneargument
+ \else
+ #1{#2}%
+ \expandafter\doconversionnumber
+ \fi#1}
+
+% actually mkiii code
+
+\beginXETEX
+
+\defineconversionvector{arabicnumerals} {"0660}
+\defineconversionvector{persiannumerals} {"06F0}
+\defineconversionvector{thainumerals} {"0E50}
+\defineconversionvector{devanagarinumerals}{"0966}
+\defineconversionvector{gurmurkhinumerals} {"0A66}
+\defineconversionvector{gujaratinumerals} {"0AE6}
+\defineconversionvector{tibetannumerals} {"0F20} % also "half numerals?"
+
+\defineconversion[arabicnumerals] [\conversionnumber{arabicnumerals}]
+\defineconversion[persiannumerals] [\conversionnumber{persiannumerals}]
+\defineconversion[thainumerals] [\conversionnumber{thainumerals}]
+\defineconversion[devanagarinumerals][\conversionnumber{devanagarinumerals}]
+\defineconversion[gurmurkhinumerals] [\conversionnumber{gurmurkhinumerals}]
+\defineconversion[gujaratinumerals] [\conversionnumber{gujaratinumerals}]
+\defineconversion[tibetannumerals] [\conversionnumber{tibetannumerals}]
+
+\endXETEX
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-con.tex b/Master/texmf-dist/tex/context/base/core-con.tex
index 98837ec6dc3..5594ccadd77 100644
--- a/Master/texmf-dist/tex/context/base/core-con.tex
+++ b/Master/texmf-dist/tex/context/base/core-con.tex
@@ -15,6 +15,9 @@
\unprotect
+\ifx\currentlanguage\undefined \let\currentlanguage\empty \fi
+\ifx\labeltext \undefined \let\labeltext\firstofoneargument \fi
+
%D This module deals with all kind of conversions from numbers
%D and dates. I considered splitting this module in a support
%D one and a core one, but to keep things simple as well as
@@ -58,9 +61,6 @@
\def\numbers#1{\purenumber{#1}}
\def\Numbers#1{\purenumber{#1}}
-\def\twodigits #1{\ifnum #1<10 0\fi\number#1}
-\def\threedigits#1{\ifnum#1<100 \ifnum#1<10 0\fi0\fi\number#1}
-
%D \macros
%D {romannumerals,Romannumerals}
%D
@@ -71,43 +71,9 @@
%D
%D \showsetup{romannumerals}
%D \showsetup{Romannumerals}
-%D
-%D When upcasing the result, we just follow the text book rules
-%D of expansion. Later on we'll see some more uppercase tricks.
-
-\def\romannumerals#1%
- {\romannumeral#1}
-%D For some years we had \unknown
-%D
-%D \starttyping
-%D \def\Romannumerals#1%
-%D {\uppercase\expandafter{\romannumeral#1}}
-%D \stoptyping
-%D
-%D \unknown but we need to be fully expandable in order to get
-%D the utility output file right, so now we have the following
-%D solution. It was Patrick Gundlach who first noticed this
-%D ommision.
-
-\def\Romannumerals#1%
- {\expandafter\doRomannumerals\number#1\relax}
-
-\def\doRomannumerals#1#2\relax % spaces after ifcase prevent \relax
- {\ifnum#1#2<10
- \ifcase0#1#2 \or I\or II\or III\or IV\or V\or VI\or VII\or VIII\or IX\fi
- \else\ifnum#1#2<100
- \ifcase0#1 \or X\or XX\or XXX\or XL\or L\or LX\or LXX\or LXXX\or XC\fi
- \doRomannumerals#2\relax
- \else\ifnum#1#2<1000
- \ifcase0#1 \or C\or CC\or CCC\or CD\or D\or DC\or DCC\or DCCC\or CM\fi
- \doRomannumerals#2\relax
- \else\ifnum#1#2<4000
- \ifcase0#1 \or M\or MM\or MMM\fi
- \doRomannumerals#2\relax
- \else
- \uppercase\expandafter{\romannumeral#1#2}%
- \fi\fi\fi\fi}
+\let\romannumerals\gobbleoneargument
+\let\Romannumerals\gobbleoneargument
%D \macros
%D {character,Character}
@@ -127,21 +93,8 @@
\def\unknowncharacter{-} % else in lists \relax
-\def\character#1%
- {\ifcase#1\unknowncharacter
- \or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
- \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z%
- \else
- \unknowncharacter
- \fi}
-
-\def\Character#1%
- {\ifcase#1\unknowncharacter
- \or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
- \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z%
- \else
- \unknowncharacter
- \fi}
+\let\character\gobbleoneargument
+\let\Character\gobbleoneargument
%D \macros
%D {characters,Characters}
@@ -153,81 +106,16 @@
%D \showsetup{characters}
%D \showsetup{Characters}
-\beginTEX
-
-\def\dodoconvertcharacters#1#2#3%
- {\ifnum#3>#1
- \bgroup
- \!!counta#3\relax
- \ifnum\!!counta>\zerocount
- \advance\!!counta \minusone
- \!!countb\!!counta
- \divide\!!counta #1%
- \!!countc\!!counta
- \multiply\!!countc #1%
- \advance\!!countb -\!!countc
- \doconvertcharacters#3{\!!counta}%
- \advance\!!countb \plusone
- #3{\the\!!countb}%
- \fi
- \egroup
- \else
- #2{#3}% pure expansion, used in references
- \fi}
-
-\endTEX
-
-%D A fully expandable alternative:
-
-\beginETEX \numexpr
-
-\def\dodoconvertcharacters#1#2#3%
- {\ifcase#3\else
- \ifnum#3>#1
- \expandafter\doconvertcharacters\expandafter#2\expandafter{\the\numexpr(#3+12)/#1-1\relax}%
- \expandafter#2\expandafter{\the\numexpr#3-((#3+12)/#1-1)*#1\relax}%
- \else
- \expandafter#2\expandafter{\number#3}%
- \fi
- \fi}
-
-\endETEX
-
-\def\doconvertcharacters{\dodoconvertcharacters{26}}
-
-\def\characters{\doconvertcharacters\character}
-\def\Characters{\doconvertcharacters\Character}
+\let\characters\gobbleoneargument
+\let\Characters\gobbleoneargument
%D \macros
%D {greeknumerals,Greeknumerals}
%D
%D Why should we only honour the romans, and not the greek?
-\def\greeknumerals#1%
- {% no longer needed: \mathematics
- {\ifcase#1\unknowncharacter\or
- \alpha \or \beta \or \gamma \or \delta \or
- \varepsilon \or \zeta \or \eta \or \theta \or
- \iota \or \kappa \or \lambda \or \mu \or
- \nu \or \xi \or \omicron \or \pi \or
- \varrho \or \sigma \or \tau \or \upsilon \or
- \phi \or \chi \or \psi \or \omega
- \else
- \unknowncharacter
- \fi}}
-
-\def\Greeknumerals#1%
- {% no longer needed: \mathematics
- {\ifcase#1\unknowncharacter \or
- \Alpha \or \Beta \or \Gamma \or \Delta \or
- \Epsilon \or \Zeta \or \Eta \or \Theta \or
- \Iota \or \Kappa \or \Lambda \or \Mu \or
- \Nu \or \Xi \or \Omicron \or \Pi \or
- \Rho \or \Sigma \or \Tau \or \Upsilon \or
- \Phi \or \Xi \or \Psi \or \Omega
- \else
- \unknowncharacter
- \fi}}
+\let\greeknumerals\gobbleoneargument
+\let\Greeknumerals\gobbleoneargument
%D \macros
%D {oldstylenumerals,oldstyleromannumerals}
@@ -242,52 +130,6 @@
\ruledhbox spread .15em{\hss\uppercased{\romannumerals{#1}}\hss}}}
%D \macros
-%D {defineconversionvector,conversionnumber} % bad names so no danger for clash
-%D
-%D For Adam and friends \unknown
-%D
-%D \startitemize[persiannummerals]
-%D \item test \item test \item test \item test
-%D \stopitemize
-
-% \defineconversionvector{alpha}{`a}
-% \edef\test{\conversionnumber{alpha}{123}}
-
-% \ifx\gobbleoneargument\undefined \long\def\gobbleoneargument#1{} \fi
-
-\def\defineconversionvector#1#2% name base
- {\bgroup
- % dirty trick
- \uccode`\*=`\1
- % plain:
- % \uccode`\0=\numexpr#2+0\relax \uccode`\1=\numexpr#2+1\relax
- % \uccode`\2=\numexpr#2+2\relax \uccode`\3=\numexpr#2+3\relax
- % \uccode`\4=\numexpr#2+4\relax \uccode`\5=\numexpr#2+5\relax
- % \uccode`\6=\numexpr#2+6\relax \uccode`\7=\numexpr#2+7\relax
- % \uccode`\8=\numexpr#2+8\relax \uccode`\9=\numexpr#2+9\relax
- % context:
- \dostepwiserecurse091{\expandafter\uccode\expandafter`\recurselevel=\numexpr#2+\recurselevel}%
- % prepared macro
- \uppercase\expandafter{\expandafter\gdef\csname::cvn::#1::\endcsname##*%
- {\ifcase##* 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\fi}}%
- \egroup}
-
-\def\conversionnumber#1#2%
- {\ifcsname::cvn::#1::\endcsname
- \expandafter\doconversionnumber\csname::cvn::#1::\expandafter\endcsname\number#2\relax
- \else
- \number#2%
- \fi}
-
-\def\doconversionnumber#1#2%
- {\ifx#2\relax
- \expandafter\gobbleoneargument
- \else
- #1{#2}%
- \expandafter\doconversionnumber
- \fi#1}
-
-%D \macros
%D {protectconversion}
%D
%D The previous two commands are not robust enough to be
@@ -385,34 +227,8 @@
\newcount\normalweekday
-\def\getdayoftheweek#1#2#3%
- {\bgroup
- \!!counta#3\relax
- \advance\!!counta \minusone
- \!!countb\!!counta
- \multiply\!!countb 365
- \advance\!!countb \ifcase#2\relax
- 0 \or 0 \or 31 \or 59 \or 90 \or120 \or151 \or
- 181 \or212 \or243 \or273 \or304 \or334 \or365 \fi
- \advance\!!countb #1\relax
- \ifnum#2>2
- \doifleapyearelse{#3}{\advance\!!countb 1}{}\relax
- \fi
- \!!countc\!!counta
- \dosetdivision\!!countc4\!!countc
- \advance\!!countb \!!countc
- \!!countc\!!counta
- \dosetdivision\!!countc{100}\!!countc
- \advance\!!countb -\!!countc
- \!!countc\!!counta
- \dosetdivision\!!countc{400}\!!countc
- \advance\!!countb \!!countc
- \dosetmodulo\!!countb7\!!countb
- \advance\!!countb \plusone
- \@EA\egroup\@EA\normalweekday\the\!!countb\relax}
-
-\def\dayoftheweek#1#2#3%
- {\getdayoftheweek{#1}{#2}{#3}\doconvertday{\normalweekday}}
+\let\getdayoftheweek\gobblethreearguments
+\let\dayoftheweek \gobblethreearguments
%D Using this macro in
%D
@@ -485,30 +301,8 @@
%D The number of days is available in the macro \type
%D {\numberofdays}.
-\def\doifleapyearelse#1% #2#3%
- {\bgroup
- \!!doneafalse
- \!!counta#1%
- \dosetmodulo\!!counta4\!!countb
- \ifcase\!!countb
- \dosetmodulo\!!counta{100}\!!countb
- \ifcase\!!countb \else \!!doneatrue \fi
- \dosetmodulo\!!counta{400}\!!countb
- \ifcase\!!countb \!!doneatrue \fi
- \fi
- \if!!donea
- \egroup\@EA\firstoftwoarguments % \def\next{#2}%
- \else
- \egroup\@EA\secondoftwoarguments % \def\next{#3}%
- \fi} % \next}
-
-\def\getdayspermonth#1#2%
- {\doifleapyearelse{#1}
- {\def\numberofdays{29}}
- {\def\numberofdays{28}}%
- \edef\numberofdays
- {\ifcase#2 \or31\or\numberofdays\or31\or30\or
- 31\or30\or31\or31\or30\or31\or30\or31\fi}}
+\def\doifleapyearelse #1{\firstoftwoarguments}
+\def\getdayspermonth#1#2{\let\numberofdays\!!zerocount}
%D \macros
%D {currentdate, date}
@@ -579,47 +373,11 @@
\hskip\datesignal\relax
\fi}
-% \def\complexcurrentdate[#1]%
-% {\bgroup
-% \let\labellanguage\currentlanguage
-% \def\betweendates{\let\betweendates\dobetweendates}%
-% \lowercase{\edef\!!stringa{#1}}% permits usage in \smallcapped
-% \@EA\processallactionsinset\@EA
-% [\!!stringa]
-% [ \v!day=>\betweendates\the\normalday,
-% %\v!day+=>\betweendates\ordinaldaynumber\normalday,
-% \v!day+=>\betweendates\convertnumber{\v!day+}\normalday,
-% \v!month=>\betweendates\month\normalmonth,
-% \v!year=>\betweendates\the\normalyear,
-% \v!space=>\unskip\ \hskip\datesignal,% optimization -)
-% \ =>\unskip\ \hskip\datesignal,% optimization -)
-% d=>\convertnumber\v!day\normalday,
-% %d+=>\ordinaldaynumber\normalday,
-% d+=>\convertnumber{\v!day+}\normalday,
-% m=>\convertnumber\v!month\normalmonth,
-% j=>\convertnumber\v!year\normalyear,
-% y=>\convertnumber\v!year\normalyear,
-% w=>\betweendates\dayoftheweek\normalday\normalmonth\normalyear,
-% dd=>\ifnum\normalday >9 \else0\fi\the\normalday,
-% %dd+=>\ordinaldaynumber{\ifnum\normalday >9 \else0\fi\the\normalday},
-% dd+=>\convertnumber{\v!day+}{\ifnum\normalday >9 \else0\fi\the\normalday},
-% mm=>\ifnum\normalmonth>9 \else0\fi\the\normalmonth,
-% jj=>\expandafter\gobbletwoarguments\the\normalyear,
-% yy=>\expandafter\gobbletwoarguments\the\normalyear,
-% \v!weekday=>\betweendates\dayoftheweek\normalday\normalmonth\normalyear,
-% \v!referral=>\expanded{\complexcurrentdate[\kenmerkdatumpatroon]},
-% \s!unknown=>\unskip
-% \commalistelement
-% \hskip\datesignal
-% \def\betweendates{\let\betweendates\dobetweendates}]%
-% \ifdim\lastskip=\datesignal\relax
-% \unskip
-% \fi
-% \egroup}
+\newtoks \everycurrentdate
\def\complexcurrentdate[#1]%
{\bgroup
- \let\labellanguage\currentlanguage
+ \the\everycurrentdate
\def\betweendates{\let\betweendates\dobetweendates}%
% was \processcommacommandp[#1]\docomplexcurrentdate
\safeedef\ascii{\empty#1}% keep encoded chars
@@ -693,13 +451,10 @@
%D a pattern similar to the previous date macro using the
%D keys \type {h}, \type {m} and a separator.
-\def\calculatecurrenttime
-% {\DoDiv\time by60to\scratchcounter\edef\currenthour {\the\scratchcounter}%
-% \DoMod\time by60to\scratchcounter\edef\currentminute{\the\scratchcounter}}
- {\dosetdivision\time{60}\scratchcounter
- \edef\currenthour {\ifnum\scratchcounter<10 0\fi \the\scratchcounter}%
- \dosetmodulo \time{60}\scratchcounter
- \edef\currentminute{\ifnum\scratchcounter<10 0\fi \the\scratchcounter}}
+\let\calculatecurrenttime\relax
+
+\let\currenthour \!!plusone
+\let\currentminute\!!plusone
\appendtoks \calculatecurrenttime \to \everyjob
@@ -773,10 +528,10 @@
% \def\dodefineconversion[#1][#2]%
% {\ConvertConstantAfter\doifinstringelse{,}{#2}
% {\scratchcounter=0
-% \def\docommando##1%
+% \def\docommand##1%
% {\advance\scratchcounter 1
% \setvalue{\??cv#1\the\scratchcounter}{##1}}%
-% \processcommalist[#2]\docommando
+% \processcommalist[#2]\docommand
% \setvalue{\??cv#1}##1{\csname\??cv#1##1\endcsname}}
% {\setvalue{\??cv#1}{#2}}}
%
@@ -797,10 +552,10 @@
%D \def\dododefineconversion[#1][#2][#3]%
%D {\ConvertConstantAfter\doifinstringelse{,}{#3}
%D {\scratchcounter\zerocount
-%D \def\docommando##1%
+%D \def\docommand##1%
%D {\advance\scratchcounter \plusone
%D \setvalue{\??cv#1#2\the\scratchcounter}{##1}}%
-%D \processcommalist[#3]\docommando
+%D \processcommalist[#3]\docommand
%D \setvalue{\??cv#1#2}##1{\executeifdefined{\??cv#1#2##1}\unknown}} % catch out-of-range numbers
%D {\setvalue{\??cv#1#2}{#3}}}
%D \stoptyping
@@ -812,10 +567,10 @@
\def\dododefineconversion[#1][#2][#3]%
{\ConvertConstantAfter\doifinstringelse{,}{#3}
{\scratchcounter\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\advance\scratchcounter \plusone
\setvalue{\??cv#1#2\the\scratchcounter}{##1}}%
- \processcommalist[#3]\docommando
+ \processcommalist[#3]\docommand
\setevalue{\??cv#1#2}##1%
{\noexpand\docheckedconversion{#1#2}{\the\scratchcounter}{##1}}}
{\setvalue{\??cv#1#2}{#3}}}
@@ -885,6 +640,13 @@
\endTEX
+\def\doifelseconversionnumber#1#2% slow but seldom used
+ {\doifdefinedelse{\??cv#1#2}}
+
+% \defineconversion[ctx][c,o,n,t,e,x,t]
+%
+% \doloop{\doifelseconversionnumber{ctx}{\recurselevel}{[\recurselevel]}{\exitloop}}
+
\defineconversion [\s!default] [\number]
%D As longs as symbols are linked to levels or numbers, we can
@@ -940,31 +702,13 @@
\defineconversion [month] [\doconvertmonthlong]
\defineconversion [month:mnem] [\doconvertmonthshort]
-\beginXETEX \number
-
-\defineconversionvector{arabicnumerals} {"0660}
-\defineconversionvector{persiannumerals} {"06F0}
-\defineconversionvector{thainumerals} {"0E50}
-\defineconversionvector{devanagarinumerals}{"0966}
-\defineconversionvector{gurmurkhinumerals} {"0A66}
-\defineconversionvector{gujaratinumerals} {"0AE6}
-\defineconversionvector{tibetannumerals} {"0F20} % also "half numerals?"
-
-\defineconversion[arabicnumerals] [\conversionnumber{arabicnumerals}]
-\defineconversion[persiannumerals] [\conversionnumber{persiannumerals}]
-\defineconversion[thainumerals] [\conversionnumber{thainumerals}]
-\defineconversion[devanagarinumerals][\conversionnumber{devanagarinumerals}]
-\defineconversion[gurmurkhinumerals] [\conversionnumber{gurmurkhinumerals}]
-\defineconversion[gujaratinumerals] [\conversionnumber{gujaratinumerals}]
-\defineconversion[tibetannumerals] [\conversionnumber{tibetannumerals}]
-
-\endXETEX
-
% Some bonus ones:
\defineconversion [\v!empty] [\gobbleoneargument]
\defineconversion [\v!none] [\numbers]
+\ifx\symbol\undefined \def\symbol[#1]{#1} \fi % todo
+
\defineconversion
[set 0]
[{\symbol[bullet]},
@@ -1021,4 +765,8 @@
\mathematics{\ast\ast},
\mathematics{\ast\ast\ast}]
+%D Plugins:
+
+\loadmarkfile{core-con}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-ctx.tex b/Master/texmf-dist/tex/context/base/core-ctx.tex
new file mode 100644
index 00000000000..ba47f07fd1a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-ctx.tex
@@ -0,0 +1,173 @@
+%D \module
+%D [ file=core-ctx,
+%D version=2006.08.16, % old stuff
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Job Control,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Core Macros / Ctx Job Files}
+
+%D After some experimenting this code moved into the core. It
+%D overloades a few file reading macros and permits runtime
+%D conversion and job control.
+
+\unprotect
+
+\chardef\preprocessmethod 2 % 0=no check 1=present_check 2=log_check
+\chardef\preprocessstate 0 % 1=found 2=not_present (skip)
+\def \preprocesssuffix {.prep}
+
+\def\loadctxpreplist
+ {\ifcase\preprocessmethod
+ % no checking
+ \or
+ % simple checking
+ \or
+ \doiffileexistselse{./\jobname.ctl}
+ {\bgroup
+ \defineXMLenvironment[ctx:preplist]
+ {\writestatus\m!systems{loading ctx log file}}
+ {}%
+ \defineXMLenvironmentsave[ctx:prepfile][done=no]
+ {}
+ {\writestatus\m!systems{registering \XMLflush{ctx:prepfile} -> \XMLop{done}}%
+ \setxvalue{fp..\XMLflush{ctx:prepfile}}{\XMLop{done}}}%
+ \processXMLfile{./\jobname.ctl}%
+ \egroup}%
+ {\global\chardef\preprocessmode\plusone}%
+ \fi
+ \global\let\loadctxpreplist\relax}
+
+\appendtoks\loadctxpreplist\to\everystarttext % will become: \prependtoks\loadctxpreplist\to\everyjob
+
+\def\docheckprepfile
+ {\ifcase\preprocessmethod
+ \iftracefiles\writestatus\m!systems{preprocessing - not needed}\fi
+ % no preprocessing
+ \or
+ % only check for existence
+ \iftracefiles\writestatus\m!systems{preprocessing - check exitence of \readfilename\preprocesssuffix}\fi
+ \doiffileexistselse{\readfilename\preprocesssuffix}
+ {\chardef\preprocessstate\plusone}
+ \donothing
+ \or
+ % check when in list, otherwise assume normal file
+ \bgroup
+ \splitfilename\readfilename
+ \ifx\splitofftype\empty
+ % saveguard and speed up
+ \iftracefiles\writestatus\m!systems{preprocessing - no suffix}\fi
+ \egroup
+ \else
+ \iftracefiles\writestatus\m!systems{preprocessing - check presence of \readfilename\preprocesssuffix}\fi
+ \doifdefinedelse{fp..\readfilename}
+ {\egroup
+ \doiffileexistselse{\readfilename\preprocesssuffix}
+ {\chardef\preprocessstate\plusone}
+ {\chardef\preprocessstate\plustwo}}%
+ {\doifdefinedelse{fp..\splitoffname.\splitofftype}
+ {\egroup
+ \doiffileexistselse{\readfilename\preprocesssuffix}
+ {\chardef\preprocessstate\plusone}
+ {\chardef\preprocessstate\plustwo}}%
+ {\egroup}}%
+ \fi
+ \fi}
+
+% beware, \readfilename keeps the original one, but we load and store the
+% suffixed with .prep file (if present)
+
+\def\doreadfile#1#2#3#4% beware, this one already works at format generation time!
+ {\sanitizefilename#2\to\readfilename
+ \ifx\readfilename\empty
+ % silently ignore
+ \else
+ \let\trackedfilename\readfilename
+ \chardef\preprocessstate\zerocount
+ \ifconditional\trackfilenames
+ \doifundefinedelse{fn..\trackedfilename}\donetrue\donefalse
+ \else
+ \donetrue
+ \fi
+ \ifdone
+ \checkfilename\readfilename
+ \ifcase\kindoffile
+ % not a full path or url, check for existence
+ \doifelsenothing{#1}
+ {\iftracefiles\writestatus\m!systems{searching for \readfilename\space on tex path}\fi
+ \def\next{\redoreadfile\readfilename{#3}{#4}}}%
+ {\iftracefiles\writestatus\m!systems{searching for \readfilename\space on #1}\fi
+ \def\next{\redoreadfile{\pathplusfile{#1}{\readfilename}}{#3}{#4}}}%
+ \else
+ % a full path or url, no further checking done
+ \docheckprepfile
+ \ifcase\preprocessstate
+ \doiffileexistselse\readfilename
+ {\iftracefiles\writestatus\m!systems{located \readfilename}\fi
+ \def\next{#3\dodoreadfile}}%
+ {\iftracefiles\writestatus\m!systems{not found \readfilename}\fi
+ \def\next{#4}}%
+ \or
+ \iftracefiles\writestatus\m!systems{located \readfilename\preprocesssuffix}\fi
+ \def\next{#3\dodoreadfile}%
+ \or
+ \iftracefiles\writestatus\m!systems{not found \readfilename\preprocesssuffix}\fi
+ \def\next{#4}%
+ \fi
+ \fi
+ \else
+ \edef\readfilename{\getvalue{fn..\readfilename}}%
+ \iftracefiles\writestatus\m!systems{already located \readfilename}\fi
+ \def\next{#3\dodoreadfile}%
+ \fi
+ \expandafter\next
+ \fi}
+
+\def\redoreadfile#1#2#3%
+ {\docheckprepfile
+ \ifcase\preprocessstate
+ \doiffileexistselse{#1}%
+ {\edef\readfilename{#1}%
+ \iftracefiles\writestatus\m!systems{#1 located}\fi
+ \def\next{#2\dodoreadfile}}%
+ {\iftracefiles\writestatus\m!systems{cannot locate #1}\fi
+ \decrement\readlevel\relax
+ \ifnum\readlevel>\zerocount
+ \edef\readfilename{\pathplusfile{\f!parentpath}{\readfilename}}%
+ \def\next{\redoreadfile\readfilename{#2}{#3}}%
+ \else
+ \def\next{#3}%
+ \fi}%
+ \or
+ \edef\readfilename{#1}%
+ \iftracefiles\writestatus\m!systems{#1\preprocesssuffix\space located}\fi
+ \def\next{#2\dodoreadfile}%
+ \or
+ \def\next{#3}%
+ \fi
+ \next}
+
+\def\dodoreadfile % we provide hooks, for instance for \enableXML
+ {\ifconditional\trackfilenames
+ \setxvalue{fn..\trackedfilename}{\readfilename\ifcase\preprocessstate\or\preprocesssuffix\fi}%
+ \fi
+ \the\everybeforereadfile
+ \ifcase\preprocessstate
+ % no checking or not found when using method 1
+ \normalinput\readfilename
+ \or
+ % found when using method 1 or 2
+ \normalinput\readfilename\preprocesssuffix
+ \or
+ % not found when using method 2
+ \fi
+ \relax
+ \the\everyafterreadfile}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-dat.tex b/Master/texmf-dist/tex/context/base/core-dat.tex
index aab352daaa5..dc39f979f9c 100644
--- a/Master/texmf-dist/tex/context/base/core-dat.tex
+++ b/Master/texmf-dist/tex/context/base/core-dat.tex
@@ -227,10 +227,10 @@
\def\doprocessrecords[#1][#2][#3]%
{\bgroup
\ifx\\\undefined\let\\\relax\fi
- \def\docommando##1%
+ \def\docommand##1%
{\resetrecordentry{##1}%
\appendtoks\resetrecordentry{##1}\to\resetrecordlist}%
- \processcommacommand[\getvalue{\??db#1\c!velden}]\docommando
+ \processcommacommand[\getvalue{\??db#1\c!velden}]\docommand
\let\setrecordentry\skiprecord
\the\resetrecordlist
\doifelse{#2}\v!all % 't Is nu eenmaal alles
diff --git a/Master/texmf-dist/tex/context/base/core-des.tex b/Master/texmf-dist/tex/context/base/core-des.tex
index 382dc8ca703..7b786ec9402 100644
--- a/Master/texmf-dist/tex/context/base/core-des.tex
+++ b/Master/texmf-dist/tex/context/base/core-des.tex
@@ -418,6 +418,8 @@
\def\currentdescriptionnumber
{\csname\??dd\currentdescription\??dd\c!number\endcsname}
+\ifx\preparednumber\undefined \let\preparednumber\empty \fi
+
\def\special@@descriptionhandler[#1]#2#3%
{\strut
\doifelse{\descriptionparameter\c!number}\v!no
diff --git a/Master/texmf-dist/tex/context/base/core-fig.tex b/Master/texmf-dist/tex/context/base/core-fig.tex
index f8d58e03838..2719d5677e6 100644
--- a/Master/texmf-dist/tex/context/base/core-fig.tex
+++ b/Master/texmf-dist/tex/context/base/core-fig.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=core-fig,
-%D version=1997.03.31,
+%D version=2006.08.26, % overhaul of 1997.03.31
%D title=\CONTEXT\ Core Macros,
%D subtitle=Figure Inclusion,
%D author=Hans Hagen,
@@ -11,136 +11,105 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% error in calculations : .25% (too much: 1.5pt over full page)
-%
-% this module will be reimplemented(read: cleaned up)
+% todo: directory : system -> \allinputpaths
+
+%D It may be that some functionality got lost. If it concerns
+%D defined features, let me know and it will be sorted out.
\writestatus{loading}{Context Core Macros / Figure Inclusion}
-\unprotect
+%D This is a reimplementation of the original module, which
+%D over time had evolved into a pretty complex whole. This
+%D was partly due to the fact that we needed to handle many
+%D formats, deal with substitute graphics, handle fallbacks
+%D and driver specifics (objects), etc. In the meantime we
+%D have more clever backends, moved away from texutil to
+%D rlxtools, can use runtime or betweentime runs etc. Also,
+%D more memory permits a cleaner implementation. Time to
+%D move on. We can now also assume that scaling is available.
+%D
+%D Another mess that can go is the llx/lly handling since
+%D drivers now automatically can determine such things.
-% tex, tmp, mov and avi will become part of the fuzzy
-% graphics and also behandled by special drivers; the
-% current support is hackery
-
-% figurefilemode checken
-% zowieso alles checken
-% movie scanner
-
-%D Scanning for illustrations is automated to the max. Right
-%D from the beginning \CONTEXT\ supported figure inclusion
-%D using a dedicated figure directory file. Apart from the fact
-%D that such a file enables us to include graphics that cannot
-%D be parsed by \TEX\ for dimensions, by using this file we can
-%D also quite easily generate figure directories. Only when
-%D \PDFTEX\ started offering \PDF\ inclusion, I felt the need
-%D to automate dimension detection to a higher degree.
-%D Fortunately \TEXUTIL\ can scan more types now as well as
-%D that we can run \TEXUTIL\ from within \TEX.
+%D Messages 3 and 5 needs to be translated!
+
+\unprotect
\startmessages dutch library: figures
title: figuren
1: figuur -- is niet te vinden
2: figuur -- wordt niet preset
- 3: maten van figuur -- geleend van --
+ 3: maten van -- worden extern vastgesteld
4: maten van -- geladen uit figuurfile zelf
- 5: maten van -- geladen uit figuurfile --
- 6: maten van -- berekend door TeXUtil
- 7: figuurfile -- moet opnieuw worden aangemaakt
+ 5: maten van -- zijn onbekend
+ 6: maten van -- berekend door rlxtools
8: figuurobject -- wordt opnieuw gebruikt
- 9: figuur -- wordt niet afgehandeld
- 10: figuur -- heeft geen afmetingen
- 11: invoegen bron --
\stopmessages
\startmessages english library: figures
title: figures
1: figure -- can not be found
2: figure -- is not preset
- 3: dimensions of figure -- borrowed from --
+ 3: dimensions of -- are determined externally
4: dimensions of -- loaded from figurefile itself
- 5: dimensions of -- loaded from figurefile --
- 6: dimensions of -- calculated by TeXUtil
- 7: you have to regenerate figure file --
+ 5: dimensions of -- are unknown
+ 6: dimensions of -- calculated by rlxtools
8: figureobject -- is reused
- 9: figure -- is not handled
- 10: figure -- has zero dimensions
- 11: including resource --
\stopmessages
\startmessages german library: figures
title: Abbildungen
1: Abbildung -- kann nicht gefunden werden
2: Abbildung -- wird nicht erstellt
- 3: Dimensionen von -- uebernommen von --
+ 3: dimensions of -- are determined externally
4: Dimensionen von -- geladen aus der Abbildungsdatei selbst
- 5: Dimensionen von -- geladen aus Abbildungsdatei --
- 6: Dimensionen von -- ausgerechnet durch TeXUtil
- 7: Sie muessen eine neue Abbildungsdatei -- erstellen
+ 5: Dimensions of -- are unknown
+ 6: Dimensionen von -- ausgerechnet durch rlxtools
8: Abbildungobjekt -- wurde wiederverwandt
- 9: Abbildung -- wird nicht unterstuetzt
- 10: figure -- has zero dimensions
- 11: including resource --
\stopmessages
\startmessages czech library: figures
title: obrazy
1: obraz -- nelze nalezt
2: obraz -- nepritomen
- 3: dimenze obrazu -- vypujceny od --
+ 3: dimensions of -- are determined externally
4: dimenze obrazu -- nacteny primo z jeho souboru
- 5: dimenze obrazu -- nacteny ze souboru obrazu --
- 6: dimenze obrazu -- spocteny programem TeXUtil
- 7: musite znovu vygenerovat soubor obrazu --
+ 5: dimensions of -- are unknown
+ 6: dimenze obrazu -- spocteny programem rlxtools
8: obrazovy objekt -- je znovu pouzit
- 9: figure -- is not handled
- 10: figure -- has zero dimensions
- 11: including resource --
\stopmessages
\startmessages italian library: figures
title: figure
1: figura -- non trovata
2: la figura -- non è preimpostata
- 3: dimensioni della figura -- prese da --
+ 3: dimensions of -- are determined externally
4: dimensioni di -- caricate dal file di immagini stesso
- 5: dimensioni di -- caricate dal file di immagini --
- 6: dimensioni di -- calcolate da TeXUtil
- 7: bisogna rigenerare il file di immagini --
+ 5: dimensions of -- are unknown
+ 6: dimensioni di -- calcolate da rlxtools
8: oggetto-figura -- riutilizzato
- 9: figura -- non gestita
- 10: la figura -- ha dimensioni nulle
- 11: including resource --
\stopmessages
\startmessages romanian library: figures
title: figuri
1: figura -- nu poate fi gasita
2: figura -- nu este presetata
- 3: dimensiunea figurii -- se imprumuta din --
+ 3: dimensions of -- are determined externally
4: dimensiunea figurii -- se incarca din fisierul insusi
- 5: dimensiunea figurii -- se incarca din fisierul --
- 6: dimensiunea figurii -- este calculata de TeXutil
- 7: trebuie sa refaceti fisierul imagine --
+ 5: dimensions of -- are unknown
+ 6: dimensiunea figurii -- este calculata de rlxtools
8: obiectul figura -- este refolosit
- 9: sufixul -- din figura -- nu este folosit
- 10: figura -- are dimensiuni nule
- 11: including resource --
\stopmessages
\startmessages french library: figures
title: figures
1: la figure -- ne peut être trouvée
2: la figure -- n'est pas pré-sélectionnée
- 3: les dimensions de la figure -- adaptées à partir de --
+ 3: dimensions of -- are determined externally
4: les dimensions de -- chargées implicitement à partir du fichier de figure
- 5: les dimensions de -- chargées à partir du fichier de figure --
- 6: les dimensions de -- calculées par TeXUtil
- 7: regénérer le fichier de figure --
+ 5: dimensions of -- are unknown
+ 6: les dimensions de -- calculées par rlxtools
8: figureobject -- est réutilisé
- 9: la figure -- n'est pas manipulée
- 10: la figure -- a des dimensions nulles
- 11: inclusion de la ressource --
\stopmessages
%D Due to the mere fact that \DVI|/|\PDF\ drivers differ in their
@@ -153,10 +122,15 @@
%D dimensions. Whatever we calculate, the results will come
%D available in the next registers.
-\newcount \figxsca
-\newcount \figysca
-\newdimen \fighei
-\newdimen \figwid
+\letempty \@@DriverImageBox
+\letempty \@@DriverImageOptions
+\letempty \@@DriverImageWidth
+\letempty \@@DriverImageHeight
+\letempty \@@DriverImageFile
+\letempty \@@DriverImageLabel
+\letempty \@@DriverImageType
+\letempty \@@DriverImageMethod
+\letempty \@@DriverImagePage
%D Because looking for dimensions can take many steps (locating
%D the figure, maybe on more directories, scanning the figure
@@ -167,863 +141,350 @@
%D we can set a switch and get some information on what takes
%D place.
-\newif\iftraceexternalfigures % \traceexternalfigurestrue
-
-\let\traceexternalfigures \traceexternalfigurestrue
-
-%D Another switch tells \CONTEXT\ to locate and calculate a
-%D figure, but does not actually insert it. Especially when we
-%D use \PDFTEX\ this saves a lot of time on trialruns. (Keep
-%D in mind that \PDFTEX\ is both a \TEX\ pre|| and postprocessor.)
-
-\newif\ifskipexternalfigures % \skipexternalfigurestrue
+\newif\iftraceexternalfigures
-%newif\ifsplitexternalfigures
+\let\traceexternalfigures\traceexternalfigurestrue
-%D A last switch inhibits running \TEXUTIL. Lets do it when
-%D possible.
-
-\newif\ifrunutilityfile % \runutilityfiletrue
-\newif\ifconsultutilityfile \consultutilityfiletrue
-
-%D When I ever decide to change the format of the figure
-%D directory file that \TEXUTIL\ produces, the next number
-%D needs to be changed.
-
-\edef\figureversion{1996.06.01}
-
-%D We keep track of the current state by setting a variable
-%D which value is related to the method that provided the
-%D dimensions.
-
-\chardef\figurefilemode=0
-
-%D The next values are set:
-%D
-%D \startitemize[packed]
-%D \sym 0 the dimensions are not found
-%D \sym 1 the dimensions are not preset at all
-%D \sym 2 the dimensions are taken from other
-%D \sym 3 the dimensions are taken from figure
-%D \sym 4 the dimensions are taken from texutil.tuf
-%D \sym 5 the dimensions are generated by texutil.tmp
-%D \stopitemize
-%D
-%D In our search for the right file, that is, when no
-%D filetype is specified, we scan for the next set of files.
-%D As one can see, we prefer outlines over bitmaps.
-
-\def\figuretypes{\c!eps,\c!mps,\c!pdf,\c!svg,\c!svg z,\c!png,\c!jpg,\c!tif} % ,\c!tex,\c!tmp} % \c!mov
-
-%D Instead of using a comma separated list, we could have use a
-%D faster alternative, but the current implementation is not
-%D that slow either.
-%D
-%D Sorry for those who want to understand every bit, but I
-%D will only sparse comment on the next macros. These macros
-%D evolved out of the original macros and thereby lost all of
-%D their beauty.
-%D
-%D We save the progess state in a macro. The main reason for
-%D this is that otherwise the log would end up intermingled
-%D with \TEX's hard coded file loading messages and launching
-%D \TEXUTIL.
-
-\def\@@eftrace#1%
+\def\doshowfigurestate
{\iftraceexternalfigures
- \edef\externalfigurelog{\externalfigurelog[#1]\space}%
- \fi}
-
-\let\@@efcurrenttype\empty
-\let\@@efcurrentpath\empty
-\let\@@efcurrentfile\empty
-
-% \def\analyzefigurefiles
-% {\let\externalfigurelog\empty
-% \let\@@efcurrenttype\empty
-% \let\@@efcurrentpath\empty
-% \let\@@efcurrentfile\empty
-% \doanalyzefigurefiles\doanalyzefigurefilesA
-% \doanalyzefigurefiles\doanalyzefigurefilesB
-% \doanalyzefigurefiles\doanalyzefigurefilesC}
-%
-% but, we also want to support direct paths, like e:/....
-
-\def\redoanalyzefigurefiles#1%
- {\ifcase\figurestatus
- \def\@@efcurrenttype{#1}%
- \dododoanalyzefigurefiles\empty
- \fi}
-
-\def\analyzefigurefiles
- {\let\externalfigurelog\empty
- \let\@@efcurrenttype\empty
- \let\@@efcurrentpath\empty
- \let\@@efcurrentfile\empty
- % empty path list if hard coded path
- \doanalyzefigurefiles\doanalyzefigurefilesA
- \doanalyzefigurefiles\doanalyzefigurefilesB
- \doanalyzefigurefiles\doanalyzefigurefilesC
- % new, permits rather raw names like e:/....
-\ifx\@@effilepath\empty
- % we don't want a global search (happens with empty path)
-\else
- \@@eftrace{checking filepath "\@@effilepath"}%
- \let\dodoanalyzefigurefiles\redoanalyzefigurefiles
- \doanalyzefigurefiles\doanalyzefigurefilesA
- \doanalyzefigurefiles\doanalyzefigurefilesB
- \doanalyzefigurefiles\doanalyzefigurefilesC
-\fi}
-
-%D The previous macro suggests that there are three main
-%D methods applied. First we pass over all types and
-%D directories specified and as soon as we find a suitable
-%D candidate, we try to find its dimensions. When we cannot in
-%D any way find the dimensions, directly, using the utility
-%D file, or using \TEXUTIL\ directly, we revert to the second
-%D method, and make a pass over all utility files. The last
-%D method scans the utility files for files with the same name,
-%D but different type.
-
-\let\figurepathlist\empty
-
-\def\doanalyzefigurefiles#1%
- {\let\dodododoanalyzefigurefiles#1%
- \processcommacommand[\@@eftype]\dodoanalyzefigurefiles}
-
-\def\dodoanalyzefigurefiles#1%
- {\ifcase\figurestatus
- \def\@@efcurrenttype{#1}%
- \processcommacommand[\figurepathlist]\dododoanalyzefigurefiles
- \fi}
-
-\def\dododoanalyzefigurefiles#1% todo: use the \applied ones, less messy
- {\ifcase\figurestatus
- \def\@@efcurrentpath{#1}%
- \sanitizefilename#1\to\@@efcurrentpath
- \@@eftrace{checking path "\@@efcurrentpath"}%
- \doiffileinsertionsupportedelse\@@efcurrenttype
- {\assignfullfilename{\@@efcurrentpath}{\@@effilename.\figureextension{\@@efcurrenttype}}\to\@@efcurrentfile
- \dodododoanalyzefigurefiles}
- \donothing
+ \expandafter\writestatus\expandafter\m!figures
+ \else
+ \expandafter\gobbleoneargument
\fi}
-%D Here is our first method: we scan the file directly, parse
-%D the utility file next, and finaly run \TEXUTIL. The latter
-%D two of course only take place when the first scan fails.
-
-\def\doanalyzefigurefilesA
- {\ifcase\figurestatus
- \@@eftrace{locating \@@efcurrentfile\space as \@@efcurrenttype}%
- \doiffileelse\@@efcurrentfile
- {\getfiguredimensionsA
- \getfiguredimensionsB
- \getfiguredimensionsC}
- \donothing
+\def\doshowfiguremessage
+ {\iftraceexternalfigures
+ \expandafter\gobbletwoarguments
+ \else
+ \expandafter\showmessage\expandafter\m!figures
\fi}
-%D It is possible to let \TEX\ determine the dimensions itself.
-%D The next macro shows how such a test is implemented. The
-%D special driver \type {supp-tpd} shows some more.
-
-%D The check on extension prevents problems when drivers are
-%D not loaded well, in which case the tex one comes first.
-%D
-%D Should be a special!
-
-% never change the vsize / hsize here, is taken from env
+%D Another switch tells \CONTEXT\ to locate and calculate a
+%D figure, but does not actually insert it. Especially when we
+%D use \PDFTEX\ this saves a lot of time on trialruns. (Keep
+%D in mind that \PDFTEX\ is both a \TEX\ pre|| and postprocessor.)
-\def\dogetfiguresizetex#1#2#3#4#5#6% file pagina ...
- {\doifinsetelse\@@effiletype{\c!tex,\c!tmp}
- {\ifx\@@efcurrentpath\empty\executedfalse\else\executedtrue\fi}
- \executedfalse
- \ifexecuted
- \global\setbox\foundexternalfigure\vbox
- {\insidefloattrue
- \forgetall
- \blank[\v!disable]% niet meer weg !
- \startreadingfile
- \readfile{#1}\donothing\donothing
- \stopreadingfile
- \endgraf
- \removelastskip}%
- \global\setbox\foundexternalfigure\hbox
- {\raise\dp\foundexternalfigure\box\foundexternalfigure}%
- #3\zeropoint
- #4\zeropoint
- #5\wd\foundexternalfigure
- #6\ht\foundexternalfigure
- \else
- \@@eftrace{ignored}%
- \fi}
+\newif\ifskipexternalfigures % can be set elsewhere
-\let\dogetfiguresizetmp\dogetfiguresizetex
+% \newif\ifrunutilityfile
+% \newif\ifconsultutilityfile
+%
+% Let's save two hash entries:
-%D Here we start scanning the other types:
+\let\runutilityfiletrue \relax \let\runutilityfilefalse \relax
+\let\consultutilityfiletrue\relax \let\consultutilityfilefalse\relax
-% TODO: svg, get figuresize from file, but when not supported by
-% backend, don't use it yet (else backend will force replacement).
+%D The basic setup.
-\def\@@dogetfiguresize{dogetfiguresize}
+\def\setupexternalfigures
+ {\dosingleempty\dosetupexternalfigures}
-\def\getfiguredimensionsA
- {\ifcase\figurestatus
- \@@eftrace{analyzing \@@efcurrentfile\space on \@@efcurrentpath\space as \@@efcurrenttype}%
- \!!widthb\zeropoint % ?
- \doifdefinedelse{\@@dogetfiguresize\@@efcurrenttype}
- {\executedtrue
- \getvalue{\@@dogetfiguresize\@@efcurrenttype}%
- \@@efcurrentfile\@@efpage
- \!!widtha\!!heighta\!!widthb\!!heightb}
- \executedfalse
- \ifexecuted
- \donetrue
- \ifdim\!!widtha=\zeropoint\relax\ifdim\!!heighta=\zeropoint\relax
- \ifdim\!!widthb=\zeropoint\relax\ifdim\!!heightb=\zeropoint\relax
- \showmessage\m!figures{10}\@@efcurrentfile
- \@@eftrace{zero}%
- \donefalse
- \fi\fi
- \fi\fi
- \doifelse\@@efcurrenttype\c!mps
- {\ifcase\EPScreator
- \executedfalse
- \else
- % zero width mp graphic can be useful -)
- \fi}
- {\ifdone
- % non zero dimensions
- \else
- % zero dimensions
- \executedfalse
- \fi}%
- \fi
- \ifexecuted
- \chardef\figurestatus\plusthree
- \doifelse\@@efcurrenttype\c!eps
- {\ifcase\EPScreator
- \@@eftrace{found}%
- \else
- \let\@@efcurrenttype\c!mps
- \@@eftrace{mps found}%
- \fi}
- {\@@eftrace{found}}%
- \geteparameters % e !
- [\??ep]
- [\c!x=\the\!!widtha,\c!y=\the\!!heighta,
- \c!w=\the\!!widthb,\c!h=\the\!!heightb]%
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile
- \else
- \@@eftrace{not found}%
- \fi
- \fi}
+\def\dosetupexternalfigures[#1]%
+ {\getparameters[\??ef][#1]% local settings
+ \getparameters[\??ex][#1]% global settings
+ \setfigurepathlist} % the path may be used elsewhere too (as in x-res-04)
-\def\dogetfiguresizepdf#1#2#3#4#5#6%
- {\dogetPDFmediabox{#1}{#3}{#4}{#5}{#6}}
-
-\def\dogetfiguresizeeps#1#2#3#4#5#6%
- {\dogetEPSboundingbox{#1}{#3}{#4}{#5}{#6}}
-
-\def\dogetfiguresizemps
- {\dogetfiguresizeeps}
-
-\def\dogetfiguresizesvg#1#2#3#4#5#6%
- {\doifelse\@@effiletype\c!svg\executedtrue\executedfalse
- \ifexecuted
- #3\zeropoint
- #4\zeropoint
- \startnointerference
- \startXMLignore
- \defineXMLcommand[svg][width=100,height=75]
-% {\global\dimen1=\XMLpar{svg}{width}{0}\onebasepoint
-% \global\dimen3=\XMLpar{svg}{height}{0}\onebasepoint
- {\doifdimensionelse{\XMLop{width}}
- {\global\dimen1=\XMLop{width}}
- {\global\dimen1=\XMLop{width}\onebasepoint}%
- \doifdimensionelse{\XMLop{width}}
- {\global\dimen3=\XMLop{height}}
- {\global\dimen3=\XMLop{height}\onebasepoint}%
- \endinput}%
- \processXMLfilegrouped{#1}%
- \stopXMLignore
- \stopnointerference
- #5=\dimen1\relax
- #6=\dimen3\relax
- \else
- \@@eftrace{ignored}%
- \fi}
+%D Intermediate, private.
-\def\getfiguredimensionsB
- {\ifcase\figurestatus\ifcase\figurefilemode\else
-\doifsomething\@@efcurrentpath
-{%
- \assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
- \edef\@@effilenametype{\@@effilename.\@@efcurrenttype}%
- \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilenametype}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureA
- \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}%
-}%
- \fi\fi}
-
-\def\presetfigureA[#1][#2]%
- {\ifcase\figurestatus
- \@EA\DOIF\@EA{\@@effilenametype}{#1} % hm, tzt ook nog eens met pad/naam
- {\getparameters[\??ep][#2]%
- \ExpandBothAfter\doif\@@epe\@@efcurrenttype
- {\chardef\figurestatus\plusfour
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile}}%
- \else
- \endinput
- \fi}
+\newdimen\determinedfigurewidth
+\newdimen\determinedfigureheight
-\def\getfiguredimensionsC
- {\ifconsultutilityfile \ifrunutilityfile
- \ifcase\figurestatus\ifcase\figurefilemode\else
- \doifsomething\@@efcurrentpath
- {\doifnotinset\@@effiletype{\c!tex,\c!tmp}
- {\doiffileelse\@@efcurrentfile
- {\edef\@@effilenametype{\@@effilename.\@@efcurrenttype}%
- \@@eftrace{running texutil on \@@effilenametype}%
- \def\@@efloadname{\f!utilityfilename.\f!temporaryextension}%
- \executesystemcommand{texutil --fig --out=\@@efloadname\space\@@effilenametype}%
- \@@eftrace{analyzing \@@efloadname\space on \@@effilenametype}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureB
- \readsetfile{.}\@@efloadname\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}}
- {}}}%
- \fi\fi
- \fi\fi}
-
-\def\presetfigureB[#1][#2]%
- {\getparameters[\??ep][#2]%
- \chardef\figurestatus=6 % ??????????????????
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile}
-
-%D The second pass over types and directories uses the
-%D utilility files.
-
-\def\doanalyzefigurefilesB
- {\ifconsultutilityfile\ifcase\figurestatus\ifcase\figurefilemode\else
- \doifsomething\@@efcurrentpath
- {\assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
- \edef\@@effilenametype{\@@effilename.\figureextension{\@@efcurrenttype}}%
- \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilenametype}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureC
- \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}}%
- \fi\fi\fi}
+\let\naturalfigureheight\!!zeropoint
+\let\naturalfigurewidth \!!zeropoint
-\def\presetfigureC[#1][#2]%
- {\ifcase\figurestatus
- \@EA\DOIF\@EA{\@@effilenametype}{#1}
- {\getparameters[\??ep][#2]%
- \doif\@@epe\@@efcurrenttype
- {\chardef\figurestatus\plusfour
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile}}%
- \else
- \endinput
- \fi}
+\def\defaultfigurewidth {8\lineheight}
+\def\defaultfigureheight{6\lineheight}
-%D The last and third pass mainly differs from the second in
-%D being more tolerant.
+\def\defaultfigurepathsignal{(\v!default)}
-\def\doanalyzefigurefilesC
- {\ifconsultutilityfile\ifcase\figurestatus\ifcase\figurefilemode\else
- \doifsomething\@@efcurrentpath
- {\assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
- \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilename.* surrogate}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureD
- \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}}%
- \fi\fi\fi}
+\def\checknaturalfiguredimensions
+ {\edef\naturalfigurewidth{\the\dimexpr\ifzeropt\determinedfigurewidth
+ \defaultfigurewidth \else\determinedfigurewidth \fi\relax}%
+ \edef\naturalfigureheight{\the\dimexpr\ifzeropt\determinedfigureheight
+ \defaultfigureheight\else\determinedfigureheight\fi\relax}}
-\def\presetfigureD[#1][#2]%
- {\ifcase\figurestatus
- \@EA\DOIFINSTRINGELSE\@EA{\@@effilename.}{#1}
- {\getparameters[\??ep][#2]%
- \ExpandBothAfter\doifinsetelse\@@epe\@@efcurrenttype
- {\chardef\figurestatus4
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile}%
- \donothing}
- \donothing
- \else
- \endinput
- \fi}
+%D Locating figures. Dilemma: we do support eps and svg parsing but drivers
+%D don't always support it.
-%D While loading the utility file (often \type {texutil.tuf})
-%D the next command (when present) aborts reading when the
-%D versions don't match.
+\def\figuretypes{\c!mps,\c!pdf,\c!eps,\c!svg,\c!svg z,\c!png,\c!tif,jb2,\c!jpg}
-\def\thisisfigureversion#1%
- {\doifnot\figureversion{#1}
- {\showmessage\m!figures7\@@efloadname
- \endinput}}
+\def\supportedfiguretypes{\figuretypes}
-%D Some files, take for instance movies, cannot easilly be
-%D parsed on dimensions, that is, not yet. Although the current
-%D mechanism has no problems with this, as long as the user
-%D specified width and height reflect the right aspect ratio.
-%D Nevertheless, when one does not want any scanning done, one
-%D can disable \type{preset}. When no preset is needed, we only
-%D locate the file.
+\def\checksupportedfiguretypes
+ {\begingroup
+ \global\let\supportedfiguretypes\empty
+ \def\docommand##1%
+ {\doiffileinsertionsupportedelse{##1}
+ {\doglobal\addtocommalist{##1}\supportedfiguretypes}
+ \donothing}%
+ \processcommacommand[\figuretypes]\docommand
+ \gdef\checksupportedfiguretypes{\let\figuretypes\supportedfiguretypes}%
+ \endgroup
+ \checksupportedfiguretypes}
+
+%D The next box is used to store the graphic. It's globally assigned.
-\def\locatepresetfigurefiles
- {\processcommacommand[\@@eftype]\dolocatepresetfigurefiles}
+\newbox\foundexternalfigure
-\def\dolocatepresetfigurefiles#1%
- {\def\@@efcurrenttype{#1}%
- \processcommacommand[\figurepathlist]\dodolocatepresetfigurefiles}
+\chardef\figurestatus\zerocount % nothing found
-\def\dodolocatepresetfigurefiles#1%
- {\ifcase\figurestatus
- \doiffileinsertionsupportedelse\@@efcurrenttype
- {\assignfullfilename{#1}{\@@effilename.\figureextension{\@@efcurrenttype}}\to\@@efcurrentfile
- \@@eftrace{only searching for \@@efcurrentfile}%
- \doiffileelse\@@efcurrentfile
- {\chardef\figurestatus\plusone
- \let\@@eftype\@@efcurrenttype
- \let\@@effullname\@@efcurrentfile}%
- \donothing}
- \donothing
- \fi}
+\def\noffigurepages{\nofinsertpages}
-%D Here we locate the to-be converted images (if needed).
+%D Variables.
-\def\locatefigureconversionfile
- {\processcommacommand[\figurepathlist]\dolocatefigureconversionfile}
+\newtoks\everyexternalfigureresets
-\def\dolocatefigureconversionfile#1%
- {\ifcase\figurestatus
- \sanitizefilename#1\to\@@efconversionpath
- \assignfullfilename{\@@efconversionpath}{\@@efconversionfile.\@@efconversiontype}\to\@@efconversionfull
- \@@eftrace{searching for original \@@efconversionfull}%
- \doiffileelse\@@efconversionfull{\chardef\figurestatus\plusone}\donothing
- \fi}
+\def\resetfigurevariables
+ {\the\everyexternalfigureresets}
-%D All these macros are in some way called by the macro \type
-%D {\analyzefigurefiles}, which in turn is called by the next
-%D macro.
-
-% bools gebruiken
-
-\def\setnaturalfiguresize
- {\doifsomething\@@efwidth
- {\global\figwid\@@efwidth}%
- \doifsomething\@@efheight
- {\global\fighei\@@efheight}%
- \doifsomething\@@efscale
- {\figxsca\@@efscale
- \figysca\@@efscale}%
- \doifsomething\@@efxscale
- {\figxsca\@@efxscale}%
- \doifsomething\@@efyscale
- {\figxsca\@@efyscale}}
-
-\def\setfactorfiguresize
- {\doifinsetelse\@@effactor{\v!max,\v!fit,\v!broad}
- {\doapplyfiguresize
- \ifdim\@@epw>\@@eph\relax
- \docalculatefigurenorm\figwid\@@effactor\@@efmaxwidth\hsize\@@efhsize
- \docalculatefigurescales\figwid\@@epw\fighei\@@eph
- \else
- \docalculatefigurenorm\fighei\@@effactor\@@efmaxheight\figurevsize\@@efvsize
- \docalculatefigurescales\fighei\@@eph\figwid\@@epw
- \fi
- \!!doneatrue}
- {\doifinsetelse\@@efhfactor{\v!max,\v!fit,\v!broad}
- {\doapplyfiguresize
- \docalculatefigurenorm\fighei\@@efhfactor\@@efmaxheight\figurevsize\@@efvsize
- \docalculatefigurescales\fighei\@@eph\figwid\@@epw
- \!!doneatrue}
- {\doifinsetelse\@@efwfactor{\v!max,\v!fit,\v!broad}
- {\doapplyfiguresize
- \docalculatefigurenorm\figwid\@@efwfactor\@@efmaxwidth\hsize\@@efhsize
- \docalculatefigurescales\figwid\@@epw\fighei\@@eph
- \!!doneatrue} % max ???
- {\docalculatefigurenorm\fighei\@@effactor \@@efheight \textheight\@@efvsize
- \docalculatefigurenorm\fighei\@@efhfactor\@@efheight \textheight\@@efvsize
- \docalculatefigurenorm\figwid\@@efwfactor\@@efwidth\hsize\hsize
- \!!doneafalse}}}%
- \if!!donea
- \ifdim\figwid>\@@efhsize\relax
- \global\fighei\zeropoint
- \global\figwid\@@efhsize
- \else\ifdim\fighei>\@@efvsize\relax
- \global\fighei\@@efvsize
- \global\figwid\zeropoint
- \fi\fi
- \fi}
+%D Example usage:
-\def\setscalefiguresize
- {\doifsomething{\@@efscale\@@efxscale\@@efxscale}
- {\doapplyfigurescale\figwid\@@epw\figxsca\@@efxscale
- \doapplyfigurescale\fighei\@@eph\figysca\@@efyscale
- \global\figwid\zeropoint
- \global\fighei\zeropoint
- \doifelsenothing\@@efmaxwidth
- {\doifsomething\@@efmaxheight
- {\ifdim\@@eph>\@@efmaxheight
- \global\fighei\@@efmaxheight
- \fi}}
- {\ifdim\@@epw>\@@efmaxwidth
- \global\figwid\@@efmaxwidth
- \fi}}}
-
-\let\@@efgrid\empty
-
-\def\dosetdimensionfiguresize#1#2#3%
- {#1\relax
- \doifsomething\@@efmaxwidth {\ifdim\figwid>\@@efmaxwidth \global\figwid\@@efmaxwidth #2\relax\fi}%
- \doifsomething\@@efmaxheight{\ifdim\fighei>\@@efmaxheight\global\fighei\@@efmaxheight#3\relax\fi}}
-
-\def\setdimensionfiguresize
- {\ifdim\figwid>\zeropoint\relax
- \ifdim\fighei>\zeropoint\relax
- \dosetdimensionfiguresize
- {\docalculatefigurescale\fighei\@@eph\figysca
- \docalculatefigurescale\figwid\@@epw\figxsca}%
- {\docalculatefigurescale\fighei\@@eph\figysca
- \docalculatefigurescale\figwid\@@epw\figxsca}%
- {\docalculatefigurescale\fighei\@@eph\figysca
- \docalculatefigurescale\figwid\@@epw\figxsca}%
- \else
- \dosetdimensionfiguresize
- {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
- {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
- {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
- \fi
- \else
- \ifdim\fighei>\zeropoint\relax
- \dosetdimensionfiguresize
- {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
- {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
- {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
- \else
- \dosetdimensionfiguresize
- {\doapplyfigurescale\figwid\@@epw\figxsca\@@efxscale
- \doapplyfigurescale\fighei\@@eph\figysca\@@efyscale}%
- {\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
- {\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
- \fi
+\appendtoks
+ \global\let\externalfigurelog\empty
+\to\everyexternalfigureresets
+
+%D Intermediate, private
+
+\def\resetprivatefigurevariables
+ {\let \wantedfigurefull \empty
+ \let \wantedfigurepath \empty
+ \let \wantedfigurename \empty
+ \let \wantedfigurebase \empty
+ \let \wantedfiguretype \empty
+ \let \wantedfigurefullname \empty
+ \let \wantedfiguretypespec \empty
+ \let \wantedfiguremethod \empty
+ \let \wantedfigurepage \empty
+ \let \wantedfigureoptions \empty
+ \let \wantedfigureconversion\empty
+ \let \wantedfigureprefix \empty
+ \let \wantedfiguretypelist \figuretypes
+ \let \figurepathlist \empty
+ \chardef \figurestatus \zerocount
+ \let \expandedfigurename \empty
+ \global\let \analyzedfigurewidth \!!zeropoint % set by indentifying code
+ \global\let \analyzedfigureheight \!!zeropoint % set by indentifying code
+ \global\setbox\foundexternalfigure \emptybox
+ \def \frozenfigurestamp {\externalfigurestamp}} % no edef
+
+\resetprivatefigurevariables
+
+\appendtoks
+ \resetprivatefigurevariables
+\to\everyexternalfigureresets
+
+%D Private/public.
+
+\def\resetpublicfigurevariables
+ {\let\figurewidth \!!zeropoint
+ \let\figureheight \!!zeropoint
+ \let\figurenaturalwidth \!!zeropoint
+ \let\figurenaturalheight \!!zeropoint
+ \let\figurelabel \empty
+ \let\figurefileoriginal \empty
+ \let\figurefileoptions \empty
+ \let\figurefilename \empty
+ \let\figurefiletype \empty
+ \let\figurefilepage \!!zerocount
+ \let\figurefileconversion\empty
+ \let\figurefileprefix \empty
+ \let\figurefilepath \empty
+ \let\figurefilecache \empty}
+
+\resetpublicfigurevariables
+
+\appendtoks
+ \resetpublicfigurevariables
+\to\everyexternalfigureresets
+
+\newcounter\figurenestinglevel
+
+\def\pushpublicfigurevariables
+ {\ifcase\figurenestinglevel\else
+ \doshowfigurestate{variables : push}%
+ \globalpushmacro\figurewidth
+ \globalpushmacro\figureheight
+ \globalpushmacro\figurenaturalwidth
+ \globalpushmacro\figurenaturalheight
+ \globalpushmacro\figurelabel
+ \globalpushmacro\figurefileoriginal
+ \globalpushmacro\figurefileoptions
+ \globalpushmacro\figurefilename
+ \globalpushmacro\figurefiletype
+ \globalpushmacro\figurefilepage
+ \globalpushmacro\figurefileconversion
+ \globalpushmacro\figurefileprefix
+ \globalpushmacro\figurefilepath
+ \globalpushmacro\figurefilecache
\fi}
-\def\setupexternalfigures
- {\dosingleempty\dosetupexternalfigures}
-
-\def\dosetupexternalfigures[#1]% needs a good clean up
- {\getparameters[\??ex][#1]%
- \getparameters[\??ef][#1]% dangerous for figs with backgrounds
- \checkfiguresettings
- \doifelsenothing\@@exlocation % fig file paths
- {\scratchcounter\plusthree}
- {\doifelsenothing\@@exfile % tuf file paths
- {\scratchcounter\plusthree}
- {\scratchcounter\zerocount
- \ExpandBothAfter\doifinset\v!local\@@exlocation
- {\advance\scratchcounter\plusone}%
- \ExpandBothAfter\doifinset\v!global\@@exlocation
- {\advance\scratchcounter\plustwo}}}%
- \chardef\figurefilemode\scratchcounter\relax
- \ifcase\figurefilemode
- \let\figurepathlist\f!currentpath
- \or % lokaal
- \let\figurepathlist\f!currentpath
- \or % globaal
- \let\figurepathlist\@@exdirectory
- \or % lokaal,globaal / non empty gebied
- % was:
- % \edef\figurepathlist{\f!currentpath\ifx\@@exdirectory\empty\else,\@@exdirectory\fi}%
- % but test is to weak (can be empty \allinputpaths)
- \doifelsenothing\@@exdirectory
- {\edef\figurepathlist{\f!currentpath}}%
- {\edef\figurepathlist{\f!currentpath,\@@exdirectory}}%
- \fi
- \ExpandBothAfter\doifinset\v!default\@@exlocation
- {\edef\figurepathlist{\figurepathlist,}}% default tex path search
- \ifx\@@exfile\empty
- \chardef\figurefilemode\zerocount
+\def\poppublicfigurevariables
+ {\ifcase\figurenestinglevel\else
+ \doshowfigurestate{variables : pop}%
+ \globalpopmacro\figurefilecache
+ \globalpopmacro\figurefilepath
+ \globalpopmacro\figurefileprefix
+ \globalpopmacro\figurefileconversion
+ \globalpopmacro\figurefilepage
+ \globalpopmacro\figurefiletype
+ \globalpopmacro\figurefilename
+ \globalpopmacro\figurefileoptions
+ \globalpopmacro\figurefileoriginal
+ \globalpopmacro\figurelabel
+ \globalpopmacro\figurenaturalheight
+ \globalpopmacro\figurenaturalwidth
+ \globalpopmacro\figureheight
+ \globalpopmacro\figurewidth
+ \fi}
+
+\def\setpublicfigurevariables % todo: type vs typespec
+ {\xdef\figurewidth {\the\wd\foundexternalfigure}%
+ \xdef\figureheight {\the\ht\foundexternalfigure}%
+ \xdef\figurenaturalwidth {\naturalfigurewidth}%
+ \xdef\figurenaturalheight {\naturalfigureheight}%
+ \xdef\figurelabel {\wantedfigurelabel}%
+ \xdef\figurefilepath {\wantedfigurepath}%
+ \xdef\figurefilename {\wantedfigurename}%
+ \xdef\figurefiletype {\wantedfiguretypespec}%
+ \xdef\figurefilepage {\wantedfigurepage}%
+ \xdef\figurefileoptions {\wantedfigureoptions}%
+ \xdef\figurefileconversion{\wantedfigureconversion}%
+ \xdef\figurefilecache {\wantedconversioncache}%
+ \xdef\figurefileprefix {\wantedconversionprefix}%
+ \xdef\figurefileoriginal {\wantedconversionname}%
+ \xdef\figurefullname {\wantedfigurepath/\wantedfigurename.\wantedfiguretypespec}%
+ \ifcase\figurestatus
+ \let\figurefiletype\empty % ?
\fi}
-%D The next one is for instance used in symbols:
+\def\setpublicfigurescalevariables
+ {\edef\figurescalewidth {\finalscaleboxwidth }%
+ \edef\figurescaleheight {\finalscaleboxheight}%
+ \edef\figurescalexscale {\finalscaleboxxscale}%
+ \edef\figurescaleyscale {\finalscaleboxyscale}}
-\def\resetexternalfigures
- {\setupexternalfigures
- [\c!option=,\c!maxwidth=,\c!maxheight=,
- %\c!splitcolor=,% needed ?
- \c!foregroundcolor=,\c!color=,
- %\c!conversion=,\c!prefix=,
- \c!frame=\v!off,\c!background=]}
+\def\resetpublicfigurescalevariables
+ {\let\figurescalewidth \!!zeropoint
+ \let\figurescaleheight \!!zeropoint
+ \let\figurescalexscale \!!plusone
+ \let\figurescaleyscale \!!plusone}
-%D Since we only need to reset some parameters, we can
-%D better use a faster alternative:
+\resetpublicfigurescalevariables
-\def\resetexternalfigures
- {\getparameters[\??ef]
- [\c!option=,\c!maxwidth=,\c!maxheight=,
- %\c!splitcolor=,% needed ?
- \c!foregroundcolor=,\c!color=,
- %\c!conversion=,\c!prefix=,
- \c!frame=\v!off,\c!background=]}
+\appendtoks
+ \resetpublicfigurescalevariables
+\to \everyexternalfigureresets
+%D The next one is for instance used in symbols. Since
+%D we only need to reset some parameters, we can
+%D better use the fast alternative:
+%D
+%D \starttyping
+%D \def\resetexternalfigures
+%D {\getparameters[\??ef]
+%D [\c!option=,\c!maxwidth=,\c!maxheight=,
+%D \c!foregroundcolor=,\c!color=,
+%D %\c!conversion=,\c!prefix=,\c!splitcolor=,
+%D \c!frame=\v!off,\c!background=]}
+%D \stoptyping
+%D
%D This one dropped the runtime of the \MAPS\ bibliography
%D from over 110 seconds down to less than 105 seconds. The
%D tremendously faster (but uglier) implementation is:
\def\resetexternalfigures
- {\let\@@efoption \empty
- \let\@@efmaxwidth \empty
- \let\@@efmaxheight \empty
+ {\let\@@efoption \empty % \let\@@efprefix\empty
+ \let\@@efmaxwidth \empty % \let\@@efcache \empty
+ \let\@@efmaxheight \empty % \let\@@efframe \v!off
\let\@@efforegroundcolor\empty
\let\@@efcolor \empty
\let\@@efconversion \empty
- %\let\@@efprefix \empty
- %\let\@@efcache \empty
- %\let\@@efframe \v!off
\let\@@efbackground \empty}
-% The following code will move:
+%D The following code will move:
\appendtoks \resetexternalfigures \to \everyoverlay
\appendtoks \resetexternalfigures \to \everybeforepagebody % not really needed
-
%appendtoks \resetexternalfigures \to \everysymbol
-\def\docalculatefigurenorm#1#2#3#4#5%
- {\processaction
- [#2]
- [ \v!max=>\global#1=#4\relax,
- \v!fit=>\global#1=#5\relax,
- \v!broad=>\global#1=#5\relax
- \global\advance #1 -4\@@exbodyfont\relax,
- \s!default=>\doifsomething{#3}{\global#1=#3\relax},
- \s!unknown=>\global#1=\@@exbodyfont\relax
- \global\divide#1 \!!ten\relax
- \global\multiply#1 #2\relax]}
-
-\beginTEX
-
- \def\docalculatefigurescales#1#2#3#4%
- {\dimen0=#1\relax % #1 = new 1-value
- \dimen2=#2\relax % #2 = old 1-value
- \divide\dimen2 \plusthousand
- \divide\dimen0 \dimen2
- \figxsca\dimen0 % x scale
- \figysca\dimen0 % y scale
- \dimen2=#4\relax % #4 = old 2-value
- \divide\dimen2 \plusthousand
- \multiply\dimen2 \dimen0
- #3=\dimen2 } % #3 = new 2-value
-
- \def\docalculatefigurescale#1#2#3%
- {\dimen0=#1\relax % #1 = new value
- \dimen2=#2\relax % #2 = old value
- \divide\dimen2 \plusthousand
- \divide\dimen0 \dimen2
- #3=\dimen0 } % #3 = schaal
-
-% \def\doapplyfigurescale#1#2#3%
-% {\global#1=#2\relax
-% \ifcase0\@@efscale\relax % beter: doifnum...
-% #3=\plusthousand
-% \else
-% #3=\@@efscale
-% \fi\relax % important !
-% \ifnum#3=\plusthousand\else
-% \global\divide #1 \plusthousand
-% \global\multiply#1 #3\relax
-% \fi}
-
- \def\doapplyfigurescale#1#2#3#4%
- {\global#1=#2\relax
- \ifcase0#4\relax % @@ef.scale kan empty zijn
- \ifcase0\@@efscale\relax % @@efscale kan empty zijn
- #3=\plusthousand
- \else
- #3=\@@efscale
- \fi
- \else
- #3=#4%
- \fi
- \ifnum#3=\plusthousand\else
- \global\divide #1 \plusthousand
- \global\multiply#1 #3\relax
- \fi}
-
-\endTEX
-
-% test extensively, more precise since one pass double precission
-
-\beginETEX \dimexpr
-
- % todo: use \relax instead of ()
-
- \def\docalculatefigurescales#1#2#3#4%
- {\scratchdimen\dimexpr(#1/\dimexpr(#2/\plusthousand))%
- \figxsca\scratchdimen
- \figysca\figxsca
- #3\dimexpr(\figxsca\dimexpr(#4/\plusthousand))}
-
- \def\docalculatefigurescale#1#2#3%
- {#3\dimexpr(#1/\dimexpr(#2/\plusthousand))}
-
-% \def\doapplyfigurescale#1#2#3%
-% {% #3=\ifnum0\number\@@efscale=\zerocount\plusthousand\else\@@efscale\fi
-% \ifcase0\@@efscale\relax % @@efscale kan empty zijn
-% #3=\plusthousand
-% \else
-% #3=\@@efscale
-% \fi\relax % important !
-% \global#1\ifnum#3=\plusthousand#2\else\dimexpr(#3\dimexpr(#2/\plusthousand))\fi
-% \relax}
-
- \def\doapplyfigurescale#1#2#3#4% todo: also #5 being sx/sy (\ifdim0#5=0pt ...)
- {\ifcase0#4\relax % @@ef.scale kan empty zijn
- \ifcase0\@@efscale\relax % @@efscale kan empty zijn
- #3=\plusthousand
- \else
- #3=\@@efscale
- \fi
- \else
- #3=#4%
- \fi
- \relax % important !
- \global#1\ifnum#3=\plusthousand#2\else\dimexpr#3\dimexpr#2/\plusthousand\relax\relax\fi
- \relax}
-
-\endETEX
-
-\newdimen\figurevsize % we cannot manipulate any global vsize !
-
-\def\doapplyfiguresize
- {\doifelsenothing\@@efmaxheight
- {\figurevsize\textheight
- \ifinner
- \figurevsize \vsize % \textheight =\vsize
- \scratchdimen\vsize % \scratchdimen=\textheight
- \else\ifinsidefloat
- \figurevsize \vsize % \textheight =\vsize
- \scratchdimen\vsize % \scratchdimen=\textheight
- \else\ifinpagebody
- \figurevsize \vsize % \textheight =\vsize
- \scratchdimen\vsize % \scratchdimen=\textheight
- \else % hm, there should be an option to force this
- \ifdim\pagegoal<\maxdimen
- \ifdim\pagetotal<\pagegoal
- \scratchdimen\pagegoal
- \advance\scratchdimen -\pagetotal
- \else
- \scratchdimen\figurevsize % \textheight
- \fi
- \else
- \scratchdimen\figurevsize % \textheight
- \fi
- \fi\fi\fi}
- {\figurevsize\@@efmaxheight}%
- \doifelsenothing\@@efheight
- {\edef\@@efvsize{\the\scratchdimen}}
- {\let\@@efvsize\@@efheight}%
- \doifelsenothing\@@efwidth
- {\edef\@@efhsize{\the\hsize}}
- {\let\@@efhsize\@@efwidth}}
-
-% \def\convertfigureinsertscale#1#2#3#4%
-% {\scratchdimen#1\relax
-% \ifnum#3=\plusthousand\else % better 1000 100 10 ranges, evt round 2sp
-% \divide\scratchdimen \plusthousand
-% \multiply\scratchdimen #3\relax
-% \fi
-% \scratchdimen-\scratchdimen % beter hier - dan in driver
-% \edef#2{\the\scratchdimen}% oeps, \the vergeten
-% \scratchdimen#3\points
-% \divide\scratchdimen \!!ten
-% \edef#4{\withoutpt\the\scratchdimen}}
-%
-% more obscure but better:
-
-\def\convertfigureinsertscale#1#2#3#4%
- {\scratchdimen#1\relax
- \ifnum#3=\plusthousand
- % == scale 1
- \else
- % better 1000 100 10 ranges, evt round 2sp
- \divide\scratchdimen \plusthousand
- \multiply\scratchdimen #3\relax
- \fi
- \scratchdimen-\scratchdimen % beter hier - dan in driver
- \edef#2{\the\scratchdimen}%
- \scratchcounter#3\relax
- \ifnum\scratchcounter>\plustenthousand
- \divide\scratchcounter \!!ten
- \scratchdimen\the\scratchcounter\points
- \else
- \scratchdimen\the\scratchcounter\points
- \divide\scratchdimen \!!ten
- \fi
- \edef#4{\withoutpt\the\scratchdimen}}
-
-\newbox\foundexternalfigure
-
-% \def\presetundefinedfigure#1%
-% {\let\@@eftype #1%
-% \let\@@effiletype #1%
-% \let\@@efobject \v!no
-% \let\@@efpreset \v!no
-% \ifx\@@efwidth\empty
-% \def\@@efwidth{8\lineheight}% 4cm
-% \fi
-% \ifx\@@efheight\empty
-% \def\@@efheight{6\lineheight}% 3cm
-% \fi}
-
-% \def\presetfiguremov{\presetundefinedfigure\c!mov}
-% \def\presetfigureavi{\presetundefinedfigure\c!avi}
-
-\def\presetundefinedfigure#1#2%
- {\let\@@eftype #2%
- \let\@@effiletype#2%
- \let\@@efobject \v!no
- \ifcase#1\or
- \let\@@efpreset\v!no
- \ifx\@@efwidth\empty\def\@@efwidth{8\lineheight}\fi
- \ifx\@@efwidth\empty\def\@@efwidth{6\lineheight}\fi
- \fi}
-
-\def\presetfiguresvg{\presetundefinedfigure\zerocount\c!svg}
-\def\presetfiguremov{\presetundefinedfigure\plusone \c!mov}
-\def\presetfigureavi{\presetundefinedfigure\plusone \c!avi}
-
-% The page number (frame) is passed as first option.
+%D We need this one for bookkeeping:
\newcounter\forcedMPSobject % better something \every<type>
-%D We have arrived at one of the main macros, the one that
-%D tries to analyze the figure, preloads it when possible, and
-%D scales is according to the specifications. This macro is
-%D quite unreadable, for which I appologize. The main
-%D complication is that we have to catch all kind of border
-%D cases, like \METAPOST\ graphics and buffers.
+%D Features:
+
+% converted -> prefix, suffix
+% alternative -> other suffix
+% buffer -> prefix
+
+%D Still messy:
+
+\newtoks\everyfiguretypepresets
+
+\def\presetfiguretypeprocessing
+ {\the\everyfiguretypepresets}
+
+\def\presetspecialfigure#1%
+ {\doif\wantedfiguretype{#1}%
+ {\let\@@efobject\v!no
+ \let\@@efpreset\v!no
+ \ifx\@@efwidth \empty\def\@@efwidth {\defaultfigurewidth }\fi
+ \ifx\@@efheight\empty\def\@@efheight{\defaultfigureheight}\fi}}
+
+\appendtoks
+ \presetspecialfigure\c!mov
+ \presetspecialfigure\c!avi
+\to \everyfiguretypepresets
+
+\def\checkformpsfigurefiles % to be checked
+ {\doif\wantedfigurename{mprun}
+ {\doshowfigurestate{type check : forcing mps (mprun)}%
+ \doifnotinstring{^\bufferprefix}{^\wantedfigurename}
+ {\edef\wantedfigurename{\bufferprefix\wantedfigurename}}%
+ \let\wantedfiguremethod \c!mps
+ \let\wantedfiguretypespec\c!mps}%
+ \doifnumberelse\wantedfiguretype
+ {\doshowfigurestate{type check : forcing mps (number)}%
+ \let\wantedfiguremethod \c!mps
+ \let\wantedfiguretypespec\c!mps}
+ \donothing
+ \doif\wantedfiguretypespec\c!mps
+ {\let\wantedfiguretypelist\wantedfiguretypespec
+ \ifcase\EPSspecial\else\ifinobject\else
+ \doglobal\increment\forcedMPSobject
+ \edef\externalfigurestamp{\c!mps::\forcedMPSobject}%
+ \let\@@efobject\v!yes
+ \fi\fi}}
+
+\appendtoks
+ \checkformpsfigurefiles
+\to \everyfiguretypepresets
+
+\def\checkfortexfigurefiles % to be checked (brrr: c!) / brrr: eftype
+ {\doifinset\wantedfiguretype{\c!tex,\c!tmp}
+ {\let\wantedfiguretypespec \wantedfiguretype}%
+ \doifinset\wantedfiguretypespec{\c!tex,\c!tmp,\v!buffer}
+ {\doshowfigurestate{type check : forcing tex (\wantedfiguretypespec)}%
+ \let\wantedfiguretypelist\wantedfiguretypespec
+ \let\wantedfiguremethod \c!tex
+ \let\@@efobject\v!no
+ \doifnothing\wantedfiguretype{\let\wantedfiguretype\c!tmp}%
+ % there can be a non buffer \jobname.tmp (made by texexec)
+ \doifnotinstring{^\bufferprefix}{^\wantedfigurename}
+ {\edef\wantedfigurename{\bufferprefix\wantedfigurename}}}}
+
+\appendtoks
+ \checkfortexfigurefiles
+\to \everyfiguretypepresets
+
+\def\checkforunknownfigurefiles
+ {\doifnothing\wantedfiguretype
+ {\dogetcommacommandelement\plusone\from\@@eftype\to\commalistelement
+ \edef\wantedfigurefullname{\wantedfigurename.\commalistelement}}}
+
+\appendtoks
+ \checkforunknownfigurefiles
+\to \everyfiguretypepresets
% note * : this is needed because reusable graphics
% combined with funny page aspect aspect ratio's can lead to
@@ -1033,509 +494,364 @@
% where the second one inherited some characteristics from
% the factor=max one some 30 pages back. Sigh.
-% This macro will be cleaned up when the tuf format has
-% become replaced by its xml counterpart; for that I first
-% need to patch texutil.
-
-\def\checkfiguresettings
- {\doifsomething\@@eflines
- {\scratchdimen\@@eflines\lineheight
- \edef\@@efheight{\the\scratchdimen}}}
+\chardef\splitexternalfigure\zerocount % 0 nosplit 1 split/yes 2 split/no
-\chardef\splitexternalfigure=0 % 0 nosplit 1 split/yes 2 split/no
-
-\newif\ifgridfigure
-
-% the preset for mov/avi should move to the driver
-%
-% this whole mess needs a clean up anyway
-
-\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- {\dontcomplain
- \setupexternalfigures
- \the\externalfigureresets % hook, see resource libraries
- \global\figwid\zeropoint \figxsca\plusone % see note *
- \global\fighei\zeropoint \figysca\plusone % see note *
- \global\setbox\foundexternalfigure\box\voidb@x
- % get rid of active / and : as well as expand for [\get...] cases
- \sanitizefilename#3\to\expandedfigurename
- % nil path search in case of path spec
- \expanded{\checkfilename{\expandedfigurename}}%
- \ifcase\kindoffile\else \let\figurepathlist\empty \fi
-% \greedysplitstring\expandedfigurename\at.\to\@@effilename\and\@@effiletype
-\splitfilename\expandedfigurename
-\let\@@effilepath\splitoffpath
-\let\@@effilename\splitoffname
-\let\@@effiletype\splitofftype
-\ifcase\splitoffkind\let\@@effilepath\empty\fi
- \doifelse\@@effilename{mprun}
- {\edef\@@effilepref{\bufferprefix}}
- {\let \@@effilepref\empty}%
- \edef\@@effilename{\@@effilepref\@@effilename}%
-\ifx\@@effilepath\empty\else
-% \addtocommalist\@@effilepath\figurepathlist
- \edef\@@effilename{\@@effilepath/\@@effilename}%
-\fi
- \restorecatcodes % recently added; we presume local use
- \def\@@eflabel{#2}%
- \global\let\externalfigurelog\empty
- \iftraceexternalfigures
- \showmessage\m!figures{11}\expandedfigurename
- \fi
- \getparameters
- [\??ep]
- [\c!e=\s!unknown,
- %\c!w=15\bodyfontsize,\c!h=10\bodyfontsize,
- \c!w=8\lineheight,\c!h=6\lineheight,
- \c!x=\!!zeropoint,\c!y=\!!zeropoint,
- \c!t=,\c!s=,\c!a=,\c!f=\@@effilename]%
- \getparameters
- [\??ef]
- [\c!type=\s!unknown,\c!method=\@@eftype,\c!symbol=\v!no,
- \c!object=\@@exobject,\c!preset=\v!yes,\c!split=,\c!size=,
- \c!page=0,\c!controls=\v!no,\c!preview=\v!no,\c!repeat=\v!no,
- \c!maxwidth=\@@exmaxwidth,\c!maxheight=\@@exmaxheight,
- \c!scale=,\c!xscale=,\c!yscale=,\c!width=,\c!height=,\c!display=,\c!lines=,\c!grid=,
- %\c!foregroundcolor=,
- \c!color=,\c!conversion=\@@exconversion,\c!prefix=\@@exprefix,\c!cache=\@@excache,
- \c!factor=,\c!hfactor=,\c!wfactor=]%
- % make into an installable list
- \doifnothing\@@efconversion
- {\doif\@@effiletype\c!mov\presetfiguremov
- \doif\@@effiletype\c!avi\presetfigureavi
- \doif\@@effiletype\c!svg\presetfiguresvg}%
- #1[#4][#5][#6]%
- % prefix in runs > 1
- \doifsomething\@@efconversion % added, forgotten
- {\doifnotmode{\systemmodeprefix\v!first}
- {\doifsomething\@@efprefix{\edef\@@effilename{\@@efprefix\@@effilename}}%
- \let\@@effiletype\empty}}% beware, walks over the whole suffixlist
- % new, somehow needed when \textwidth is used:
- \doifsomething\@@efmaxwidth {\freezedimenmacro\@@efmaxwidth }%
- \doifsomething\@@efmaxheight{\freezedimenmacro\@@efmaxheight}%
- % lines -> height
- \checkfiguresettings
- % new
- \doifinsetelse\@@efsize{mediabox,cropbox,artbox,bleedbox,trimbox}
- {\let\@@DriverImageBox\@@efsize}%
- {\let\@@DriverImageBox\empty}%
- % new, color separation
+\def\checkfigurecolorsettings
+ {% seperation, seldom used
\doifseparatingcolorselse
{\let\@@efforegroundcolor\empty
\doifelsenothing\@@efsplit
- {\chardef\splitexternalfigure0}
+ {\chardef\splitexternalfigure\zerocount}
{\doifcolorchannelelse\@@efsplit
- {\let\@@efobject\v!no % ?
- \chardef\splitexternalfigure1}
- {\chardef\splitexternalfigure2}}}
- {\chardef\splitexternalfigure0}%
- \relax % ends \chardef
- % new, fake color in gray bitmaps
+ {\let\@@efobject\v!no % why?
+ \chardef\splitexternalfigure\plusone}
+ {\chardef\splitexternalfigure\plustwo}}}
+ {\chardef\splitexternalfigure\zerocount}%
+ % fake color in gray bitmaps, assumes that
+ % a transparent color is used
\doifsomething\@@efforegroundcolor
- {\getparameters[\??ef]
- [\c!background={\v!foreground,\v!color},
- \c!backgroundcolor=\@@efforegroundcolor]}%
+ {\def\@@efbackground{\v!foreground,\v!color}%
+ \def\@@efbackgroundcolor{\@@efforegroundcolor}}%
\doifsomething\@@efcolor
{\doifcolorelse\@@efcolor
{\checkpredefinedcolor[\@@efcolor]%
\doregisterfigurecolor\@@efcolor}}%
- \donothing
- %
- \doif\@@efreset\v!yes\resetexternalfigures
- % todo: nop when conversion
- \doif\@@eftype \c!mov\presetfiguremov
- \doif\@@eftype \c!avi\presetfigureavi
- \doif\@@eftype \c!svg\presetfiguresvg
- % hack
- \doif\@@efmethod\c!mov{\doifsomething\@@effiletype{\presetundefinedfigure1\@@effiletype}}%
- \doif\@@efmethod\c!svg{\doifsomething\@@effiletype{\presetundefinedfigure0\@@effiletype}}%
- %
- \doif\@@eftype\v!buffer
- {\ifx\@@effiletype\empty
- \let\@@effiletype\c!tmp
- \fi
- \let\@@eftype\c!tex}%
- \@EA\doifnumberelse\@EA{\@@effiletype}% new, test first
- {\let\@@eftype\c!mps}
- {\processaction
- [\@@effiletype]
- [ \c!tex=>\let\@@eftype\c!tex, % check
- \c!tmp=>\let\@@eftype\c!tex % check
- \edef\@@effilepref{\bufferprefix}%
- \edef\@@effilename{\@@effilepref\@@effilename},
- % todo: nop when conversion
- \c!avi=>\presetfigureavi,
- \c!mov=>\presetfiguremov,
- \c!svg=>\presetfiguresvg]}%
- \edef\figuretypes{\figuretypes,\c!tex}%
- \ifx\@@eftype\c!tex
- % Since tex code can have positional stuff and worse,
- % we want to avoid interference with how objects end
- % up in files, therefore:
- \let\@@efobject\v!no
- \fi
- \edef\@@efobjectname{\@@effilename-\@@eftype-\@@effiletype-\@@efpage}% will be configurable
- \doifelse\@@efobject\v!no
- \donefalse
- {\doifspecialavailableelse\dostartscaling
- {\doifobjectssupportedelse
- {\doifobjectfoundelse{FIG}\@@efobjectname\donetrue\donefalse}
- \donefalse}
- \donefalse}%
- % too strict:
- % \doifparentfileelse\@@effilename
- % {\@EA\removefromcommalist\@EA{\jobsuffix}\figuretypes
- % \let\@@effiletype\empty
- % \showmessage\m!figures9\@@effilename
- % \donefalse}
- % \donothing
- % ok, but catcode problems with jobfilesuffix
- \doifparentfileelse\@@effilename
- {\@EA\removefromcommalist\@EA{\jobsuffix }\figuretypes
- \@EA\removefromcommalist\@EA{\jobfilesuffix}\figuretypes}%
- \donothing
- % so we get:
- \doifparentfileelse\@@effilename
- {\removefromcommalist{pdf}\figuretypes
- \removefromcommalist{tex}\figuretypes}%
- \donothing
- \ifdone
- \getobjectdimensions{FIG}\@@efobjectname
- \geteparameters % e !
- [\??ep]
- [\c!x=\!!zeropoint,\c!y=\!!zeropoint,
- \c!w=\objectwidth,\c!h=\objectheight]%
- \chardef\figurestatus=5
- \edef\@@effullname{\@@effilepref\expandedfigurename}%
- \else
- \doifelse{#2}\s!figurepreset
- {\def\figureextension##1{\@@effiletype}%
- \edef\@@effullname{\@@effilepref\expandedfigurename}}%
- {\ifx\@@effiletype\empty
- \dogetcommacommandelement1\from\@@eftype\to\commalistelement
- \edef\@@effullname{\@@effilename.\commalistelement}%
- \def\figureextension##1{##1}%
- \else
- \@EA\doifnumberelse\@EA{\@@effiletype}
- {\let\@@eftype\c!mps}\donothing
- \edef\@@effullname{\@@effilename.\@@effiletype}%
- \def\figureextension##1{\@@effiletype}%
+ \donothing}
+
+\def\setextrafiguredriveroptions
+ {\let\@@DriverImageOptions\empty
+ \doifsomething\@@efpage {\addtocommalist\@@efpage \@@DriverImageOptions}%
+ \doif \@@efpreview \v!yes{\addtocommalist\v!preview \@@DriverImageOptions}%
+ \doif \@@efcontrols\v!yes{\addtocommalist\v!controls\@@DriverImageOptions}%
+ \doif \@@efrepeat \v!yes{\addtocommalist\v!repeat \@@DriverImageOptions}%
+ \doifinsetelse\@@efsize{mediabox,cropbox,artbox,bleedbox,trimbox}
+ {\let \@@DriverImageBox \@@efsize}%
+ {\doifinsetelse\@@efsize{media,crop,art,bleed,trim}
+ {\edef\@@DriverImageBox{\@@efsize box}}%
+ {\let \@@DriverImageBox \empty}}%
+ \let\wantedfigureoptions\@@DriverImageOptions}
+
+\def\checkiffigureobjectpresent
+ {\doifnot\@@efobject\v!no
+ {\doifobjectssupportedelse
+ {\doifobjectfoundelse{FIG}\externalfigurestamp
+ {\doshowfigurestate{object found : \externalfigurestamp}%
+ \getobjectdimensions{FIG}\externalfigurestamp
+ \edef\frozenfigurestamp{\externalfigurestamp}%
+ \xdef\analyzedfigurewidth {\the\dimexpr\objectwidth \relax}%
+ \xdef\analyzedfigureheight{\the\dimexpr\objectheight\relax}%
+ \setanalyzedfiguredimensions\plusone}
+ {\doshowfigurestate{unknown object: \externalfigurestamp}}}
+ {}}}
+
+\def\checkifknownfigureobjectpresent
+ {\ifx\wantedfiguretype\empty
+ \let\savedwantedfiguretype\wantedfiguretype
+ \def\docommand##1%
+ {\ifcase\figurestatus
+ \edef\wantedfiguretype{##1}%
+ \checkiffigureobjectpresent
\fi}%
- % begin prelocate to be converted image
- \let\@@efconversionpath\empty
- \let\@@efconversionfile\@@effilename
- \let\@@efconversiontype\@@effiletype
- \doifmodeelse{\systemmodeprefix\v!first}
- {\doifelsenothing\@@efconversion\donefalse\donetrue}%
- {\donefalse}%
- \ifdone
- \chardef\figurestatus\zerocount
- \locatefigureconversionfile
- \chardef\figurestatus\zerocount
+ \processcommacommand[\figuretypes]\docommand
+ \ifcase\figurestatus
+ \let\wantedfiguretype\savedwantedfiguretype
+ \fi
+ \fi}
+
+\def\checkforfigurefile
+ {\ifcase\figurestatus
+ \ifconditional\externalfigureflush
+ \analyzefigurefiles
+ \fi
+ \fi}
+
+% \def\externalfigurestamp
+% {\wantedfigurename
+% -\ifx\wantedfiguretype\empty\wantedfiguretypespec\else\wantedfiguretype\fi
+% -\wantedfiguretypespec
+% -\wantedfigurepage}
+
+\def\externalfigurestamp % needs \edef'd macros!
+ {\wantedfigurename
+ \ifx\wantedfiguretype\empty\else
+ \ifx\wantedfiguretype\s!unknown\else
+ -\wantedfiguretype
\fi
- % end
- \doifelse\@@efpreset\v!no
- {\doifelse\@@eftype\s!unknown
- {\chardef\figurestatus\zerocount
- \let\@@eftype\figuretypes
- \locatepresetfigurefiles}
- {\chardef\figurestatus\plusone}}
- {\doifelse\@@eftype\s!unknown
- {\let\@@eftype\figuretypes}
- {\@EA\removefromcommalist\@EA{\@@eftype}\figuretypes
- \edef\@@eftype{\ifx\@@eftype\empty\else\@@eftype,\fi\figuretypes}}%
- \ifx\@@effiletype\empty\else
- \ExpandBothAfter\doifinsetelse\@@effiletype\@@eftype
- {\@EA\removefromcommalist\@EA{\@@effiletype}\@@eftype
- \edef\@@eftype{\@@effiletype,\@@eftype}}%
- \donothing
- \fi
- \doifelse{#2}\s!figurepreset
- {\chardef\figurestatus\plusfour
- \assignfullfilename\f!currentpath\@@exfile\to\@@efloadname
- \let\@@eftype\@@epe}
- {\chardef\figurestatus\zerocount
- \ifconditional\externalfigureflush
- \analyzefigurefiles
- \fi}}%
- \let\@@epe\@@eftype
- \edef\@@effiletype{\figureextension{\@@eftype}}% dirty trick
- \global\figwid\zeropoint \figxsca\plusone
- \global\fighei\zeropoint \figysca\plusone
- \doif\v!frame\@@exoption
- {\let\@@efframe\v!on}%
\fi
- \ifcase\figurestatus
+ \ifx\wantedfiguretypespec\empty\else
+ \ifx\wantedfiguretypespec\s!unknown\else
+ \ifx\wantedfiguretypespec\wantedfiguretype\else
+ -\wantedfiguretypespec
+ \fi
+ \fi
+ \fi
+ \ifnum\wantedfigurepage>\zeropoint
+ -\wantedfigurepage
+ \fi}
+
+\def\checkfigurerenderingoptions
+ {\ifcase\figurestatus
\let\@@efframe\v!on
- \let\@@efobject\v!no
- \showmessage\m!figures1\@@effilename
- \or
- \showmessage\m!figures2\@@effullname
- \or
- \showmessage\m!figures3{\@@effullname,\@@eflenttype}%
+ \fi
+ \doif\@@exoption\v!frame
+ {\let\@@efframe\v!on}%
+ \doif\@@exoption\v!empty
+ {\skipexternalfigurestrue
+ \let\@@efframe\v!off}}
+
+\newtoks\externalfigurepostprocessors
+
+% \def\resetfigureusersettings
+% {\getparameters % % % hm, can be faster, like the reset
+% [\??ef]
+% [\c!type=\s!unknown,\c!method=,\c!label=,\c!symbol=\v!no,%\c!foregroundcolor=,
+% \c!object=\@@exobject,\c!preset=\v!yes,\c!split=,\c!size=,
+% \c!page=0,\c!controls=\v!no,\c!preview=\v!no,\c!repeat=\v!no,
+% \c!maxwidth=\@@exmaxwidth,\c!maxheight=\@@exmaxheight,\c!sx=1,\c!sy=1,
+% \c!scale=,\c!xscale=,\c!yscale=,\c!width=,\c!height=,\c!display=,\c!lines=,\c!grid=,
+% \c!color=,\c!conversion=\@@exconversion,\c!prefix=\@@exprefix,\c!cache=\@@excache,
+% \c!factor=,\c!hfactor=,\c!wfactor=]}
+
+\def\resetfigureusersettings
+ {\let\@@eftype \s!unknown \let\@@efmethod \empty \let\@@efpreset\v!yes
+ \let\@@eflabel \empty \let\@@efsize \empty \let\@@efpage \!!zerocount
+ \let\@@efobject \@@exobject \let\@@efdisplay \empty
+ \let\@@efsplit \empty \let\@@efcolor \empty \let\@@efsymbol\v!no
+ \let\@@efcontrols \v!no \let\@@efpreview \v!no \let\@@efrepeat\v!no
+ \let\@@efhfactor \empty \let\@@efwfactor \empty \let\@@effactor\empty
+ \let\@@efmaxwidth \@@exmaxwidth \let\@@efmaxheight\@@exmaxheight
+ \let\@@efxscale \empty \let\@@efyscale \empty \let\@@efscale \empty
+ \let\@@efsx \!!plusone \let\@@efsy \!!plusone
+ \let\@@efwidth \empty \let\@@efheight \empty
+ \let\@@eflines \empty \let\@@efgrid \empty
+ \let\@@efconversion\@@exconversion \let\@@efprefix \@@exprefix \let\@@efcache \@@excache}
+
+%D Types and Methods are a bit history. Anyhow, user scan use the
+%D type to force the handler. So, what to do with the method. We can
+%D use that one to force a handler with a given suffix, so when no
+%D type is given, but a suffix is part of the name, the method will
+%D determine the handler.
+
+\def\checkfigureusersettings
+ {\doif\@@efreset\v!yes\resetexternalfigures
+ \doifelsenothing\@@eflabel
+ {\doifnothing\wantedfigurelabel{\let\wantedfigurelabel\wantedfigurename}}%
+ {\let\wantedfigurelabel\@@eflabel}%
+ \doifsomething\@@eftype
+ {\doifnot\@@eftype\s!unknown
+ {\edef\wantedfiguretypespec{\@@eftype}
+ \let\wantedfiguremethod\wantedfiguretypespec}}%
+ \doifnothing\wantedfigurepage % can be set by plug in
+ {\let\wantedfigurepage\@@efpage}%
+ \doif\wantedfigurepage\empty
+ {\let\wantedfigurepage\!!zerocount}% 0 is signal !
+ \doifsomething\@@efmethod % rather untested misusage of the remapper
+ {\doifsomething\wantedfiguretype
+ {\definegraphictypesynonym[\wantedfiguretype][\@@method]}}}
+
+% #1 is now obsolete
+
+\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]% \cmd label filename parent_id preset current
+ {\doshowfigurestate{begin}%
+ \dontcomplain
+ % let's limit the search, which means that e.g. svg has to be given explicitly
+ \checksupportedfiguretypes
+ % recently added; we presume local use
+ \restorecatcodes
+ % collected resets (token list)
+ \resetfigurevariables
+ % analyze filename and set wanted variables
+ \analyzefigurefilename{#3}{#2}%
+ \doanalyzefiguredimensionsfromfile
+ % handle user settings
+ \resetfigureusersettings
+ \dosetefparameters{#4}{#5}{#6}%
+ \checkfigureusersettings
+ \checkfigurecolorsettings
+ % adapt settings based on suffix and/or type
+ \presetfiguretypeprocessing
+ % now we really start
+ \checkiffigureobjectpresent % first guess, we may not yet know the typespec
+ \checkifknownfigureobjectpresent
+ \checkforconvertedfigure
+ \checkforfigurefile
+ \checkiffigureobjectpresent % to be sure, in case we now know the typespec
+ \checkfigurerenderingoptions % was later, moved here
+ \checknaturalfiguredimensions % inherit from global values and/or fallbacks
+ % by now we know what we're dealing with (put in box and scale)
+ \setextrafiguredriveroptions
+ \prepackageexternalfigureobject
+ % set public variables in case postprocessing needs them
+ \pushpublicfigurevariables
+ \setpublicfigurevariables
+ \setpublicfigureconversionvariables
+ \setpublicfigurescalevariables
+ % package final graphic, only now we can apply backgrounds and such
+ \doglobal\increment\figurenestinglevel
+ \finishexternalfigure
+ \doglobal\decrement\figurenestinglevel
+ % restore variables
+ \poppublicfigurevariables
+ \doshowfigurestate{end}}
+
+%D Figure objects.
+
+\def\setfigureobject
+ {\doshowfigurestate{object set : \externalfigurestamp}%
+ \setobject{FIG}\externalfigurestamp}
+
+% \def\getfigureobject
+% {\doshowfigurestate{object used : \externalfigurestamp}%
+% \getobject{FIG}\externalfigurestamp}
+
+\def\getfigureobject
+ {\doshowfigurestate{object used : \frozenfigurestamp}%
+ \getobject{FIG}\frozenfigurestamp}
+
+\def\prepackageexternalfigureobject
+ {\ifcase\figurestatus
+ \doshowfiguremessage1\expandedfigurename
+ \doshowfigurestate{state : figure not found (\expandedfigurename)}%
+ \global\setbox\foundexternalfigure\naturalvbox
+ {\doscalebox\??ef{\blackrule[\c!width=\naturalfigurewidth,\c!height=\naturalfigureheight]}}%
\or
- \showmessage\m!figures4\@@effullname
+ \doshowfiguremessage8\expandedfigurename
+ \doshowfigurestate{state : reusing existing figure}%
+ \global\setbox\foundexternalfigure\naturalvbox
+ {\doscalebox\??ef{\dowithfigure{\getfigureobject}}}%
+ \xdef\noffigurepages{\number\getvalue{\externalfigurestamp\c!n}}%
\or
- \showmessage\m!figures5{\@@effullname,\@@efloadname}%
- \or % no message
- \doifnot\@@efsymbol\v!yes{\showmessage\m!figures8\@@effullname}%
- \fi
- \ifdim\@@epw=\zeropoint \chardef\figurestatus\plusone \fi
- \ifdim\@@eph=\zeropoint \chardef\figurestatus\plusone \fi
- \global\gridfigurefalse
- \ifnum\figurestatus=1 % unknown dimensions, take width or height or scale
- \setnaturalfiguresize
- \xdef\naturalfigurewidth {\the\figwid}%
- \xdef\naturalfigureheight{\the\fighei}%
- \let\@@efframe\v!off
+ \doshowfiguremessage2\expandedfigurename
+ \doshowfigurestate{state : using special figure}%
+ \setbox\scratchbox\naturalvbox % make a dummy
+ {\doscalebox\??ef{\blackrule[\c!width=\naturalfigurewidth,\c!height=\naturalfigureheight]}}%
+ \global\setbox\foundexternalfigure\naturalvbox to \finalscaleboxheight
+ {\vfill
+ \hsize\finalscaleboxwidth
+ \dowithfigure{\insertscaledfiguredriverdata}}%
+ \xdef\noffigurepages{\number\nofinsertpages}%
\else
- \global\let\naturalfigurewidth\@@epw
- \global\let\naturalfigureheight\@@eph
- \setfactorfiguresize
- \setscalefiguresize
- \setdimensionfiguresize
- \processaction
- [\@@efgrid]
- [ \v!yes=>\getnoflines\fighei
- \edef\@@efheight{\the\noflines\lineheight}%
- \global\gridfiguretrue,
- \v!height=>\getrawnoflines\fighei
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen\strutdepth
- \edef\@@efheight{\the\scratchdimen}%
- \global\gridfiguretrue,
- \v!depth=>\getrawnoflines\fighei
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\strutdepth
- \edef\@@efheight{\the\scratchdimen}%
- \global\gridfiguretrue,
- \v!halfline=>\getrawnoflines\fighei
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen+.5\lineheight
- \edef\@@efheight{\the\scratchdimen}%
- \global\gridfiguretrue,
- \v!fit=>\getrawnoflines\fighei
- \edef\@@efheight{\the\noflines\lineheight}%
- \global\gridfiguretrue]%
- \ifgridfigure
- \setfactorfiguresize
- \setscalefiguresize
- \setdimensionfiguresize
+ \ifdim\naturalfigurewidth>\zeropoint
+ \ifnum\figurestatus>9
+ \doshowfiguremessage3\expandedfigurename
+ \else
+ \doshowfiguremessage4\expandedfigurename
+ \fi
+ \else
+ \doshowfiguremessage5\expandedfigurename
+ \fi
+ \doshowfigurestate{state : using found figure}% 3=self 4=rlx
+ \doifelse\@@efobject\v!no
+ {\donefalse}
+ {\doifobjectssupportedelse\donetrue\donefalse}%
+ \ifdone
+ % make an object and use it
+ \packageexternalfigureobject
+ \setfigureobject\vbox{\box\foundexternalfigure}%
+ \setxvalue{\externalfigurestamp\c!n}{\number\nofinsertpages}%
+ \global\setbox\foundexternalfigure\naturalvbox
+ {\doscalebox\??ef{\dowithfigure{\getfigureobject}}}%
+ \xdef\noffigurepages{\number\getvalue{\externalfigurestamp\c!n}}%
+ \else
+ % maybe a tex figure
+ \global\setbox\foundexternalfigure\naturalvbox
+ {\doscalebox\??ef{\dowithfigure{\box\foundexternalfigure}}}%
+ \xdef\noffigurepages{\number\nofinsertpages}%
\fi
\fi
- \convertfigureinsertscale\@@epx\figx\figxsca\scax
- \convertfigureinsertscale\@@epy\figy\figysca\scay
- \iftraceexternalfigures
- \message
- {\externalfigurelog
- [\@@effullname:
- t={\@@eftype}\space m={\@@efmethod}\space l=\@@eflabel\space
- w=\number\figwid\space h=\number\fighei\space
- \c!sx=\scax\space\c!sy=\scay\space
- ox=\figx\space oy=\figy]}%
- \fi
- \doif\v!empty\@@exoption
- {\skipexternalfigurestrue
- \let\@@efframe\v!off}% ? ?
- \doifelsenothing\@@efpage % NIEUW ??
- {\let\@@efoptions\empty}
- {\let\@@efoptions\@@efpage}%
- \doif\@@efpreview \v!yes{\addtocommalist\v!preview \@@efoptions}%
- \doif\@@efcontrols\v!yes{\addtocommalist\v!controls\@@efoptions}%
- \doif\@@efrepeat \v!yes{\addtocommalist\v!repeat \@@efoptions}%
- \doif\@@eftype\c!mps
- {\ifcase\EPSspecial\else\ifinobject\else
- \@@eftrace{special mps, object forced}%
- \doglobal\increment\forcedMPSobject
- \edef\@@efobjectname{\c!mps::\forcedMPSobject}%
- \let\@@efobject\v!yes
- \fi\fi}%
- \global\let\lastfigureobjectname\@@efobjectname
- \doifelse\@@efobject\v!no
- \donefalse
- {\doifobjectssupportedelse\donetrue\donefalse}%
- % this (for the moment) conveniently maps onto pdf which saves mapping
- \ifdone
- \doifobjectfoundelse{FIG}\@@efobjectname
- \donothing
- {\bgroup % to be cleaned up
- \figwid\@@epw % local ?
- \fighei\@@eph % local ?
- \scratchdimen\@@epx\scratchdimen-\scratchdimen
- \edef\@@epx{\the\scratchdimen}%
- \scratchdimen\@@epy\scratchdimen-\scratchdimen
- \edef\@@epy{\the\scratchdimen}%
- %\scratchdimen\@@epw\edef\@@epw{\the\scratchdimen}%
- %\scratchdimen\@@eph\edef\@@eph{\the\scratchdimen}%
- \setbox0\vbox to \fighei
- {\vfill
- \ifdim\wd\foundexternalfigure=\zeropoint
- \doinsertfile
- {\@@eftype,\@@efmethod}{\@@effullname,\@@eflabel}
- {100}{100}\@@epx\@@epy\@@epw\@@eph\@@efoptions
- \else\ifskipexternalfigures
- \ruledhbox
- {\backgroundline
- [\@@efsplitcolor]{\fakebox\foundexternalfigure}}%
- \else
- \box\foundexternalfigure
- \fi\fi}%
- \wd0=\figwid
- \setobject{FIG}\@@efobjectname\vbox{\box0}%
- \setxvalue{\@@efobjectname\c!n}{\number\nofinsertpages}%
- \egroup}%
- \fi
- \xdef\figurewidth {\the\figwid}%
- \xdef\figureheight{\the\fighei}%
- \global\setbox\foundexternalfigure\naturalvbox to \fighei
+ \global\wd\foundexternalfigure\finalscaleboxwidth
+ \global\ht\foundexternalfigure\finalscaleboxheight
+ \global\let\lastfigureobjectname\externalfigurestamp
+ \doresetobjects} % clean up driver left overs
+
+\def\packageexternalfigureobject
+ {\global\setbox\foundexternalfigure\vbox to \naturalfigureheight
{\vfill
- \hsize\figwid
- \ifdone
- \scratchdimen\scax\points\divide\scratchdimen \plushundred
- \edef\scax{\withoutpt\the\scratchdimen}%
- \scratchdimen\scay\points\divide\scratchdimen \plushundred
- \edef\scay{\withoutpt\the\scratchdimen}%
- %\scale[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
- \doscalenextbox\scax\scay\figwid\fighei{\dowithfigure{\getobject{FIG}{\@@efobjectname}}}%
- \xdef\noffigurepages{\number\getvalue{\@@efobjectname\c!n}}%
- \else\ifdim\wd\foundexternalfigure=\zeropoint
- \dowithfigure
- {\doinsertfile
- {\@@eftype,\@@efmethod}{\@@effullname,\@@eflabel}
- \scax\scay\figx\figy\figwid\fighei\@@efoptions}%
- \xdef\noffigurepages{\number\nofinsertpages}%
+ \ifdim\wd\foundexternalfigure=\zeropoint
+ \setextrafiguredriveroptions
+ \insertunscaledfiguredriverdata
+ \else\ifskipexternalfigures
+ \ruledhbox{\backgroundline[\@@efsplitcolor]{\fakebox\foundexternalfigure}}%
\else
- \scratchdimen\scax\points\divide\scratchdimen \plushundred
- \edef\scax{\withoutpt\the\scratchdimen}%
- \scratchdimen\scay\points\divide\scratchdimen \plushundred
- \edef\scay{\withoutpt\the\scratchdimen}%
- %\scale[\c!sx=\scax,\c!sy=\scay]{\dowithfigure{\box\foundexternalfigure}}%
- \doscalenextbox\scax\scay\figwid\fighei{\dowithfigure{\box\foundexternalfigure}}%
- \xdef\noffigurepages{\number\nofinsertpages}%
- \fi\fi
- \global\let\appliedfigurexscale\scax
- \global\let\appliedfigureyscale\scay}%
-\doresetobjects % clean up driver left overs
- \global\wd\foundexternalfigure\figwid
- \finalizeexternalfigure{#2}{\expandedfigurename}}
-
-\def\doscalenextbox#1#2#3#4% for the moment here, faster
- {\bgroup
- \dowithnextbox
- {\dontshowcomposition
- \setbox\nextbox\hbox
- {\smashbox\nextbox
- \dostartscaling#1#2\flushnextbox\dostopscaling}%
- \nextboxwd#3%
- \nextboxht#4%
- \nextboxdp\zeropoint
- \flushnextbox
- \egroup}
- \hbox}
-
-\let\figurelabel \empty
-\let\figurefilename\empty
-\let\figurefiletype\empty
-\let\figurefilepage\empty
-\let\figurefilepath\empty
-
-\def\finalizeexternalfigure#1#2%
- {\globalpushmacro\figurewidth
- \globalpushmacro\figureheight
- \globalpushmacro\figurelabel
- \globalpushmacro\figurefilename
- \globalpushmacro\figurefiletype
- \globalpushmacro\figurefilepage
- \globalpushmacro\figurefileconversion
- \globalpushmacro\figurefileprefix
- \globalpushmacro\figurefilepath
- \globalpushmacro\figurefilecache
- \xdef\figurewidth {\the\figwid}%
- \xdef\figureheight {\the\fighei}%
- \xdef\figurelabel {#1}%
- \xdef\figurefilename {#2}%
- \xdef\figurefiletype {\@@eftype}%
- \xdef\figurefilepage {\@@efpage}%
- \xdef\figurefileconversion{\@@efconversion}%
- \xdef\figurefileprefix {\@@efprefix}%
- \xdef\figurefilepath {\@@efcurrentpath}%
- \xdef\figurefilecache {\@@efcache}%
- \doifmodeelse{\systemmodeprefix\v!first}
- {\let\figurefullname\figurefilename}%
- {\def\figurefullname{\figurefileprefix\figurefilename}}% no \edef
- \global\setbox\foundexternalfigure\vbox
+ \box\foundexternalfigure
+ \fi\fi}%
+ \wd\foundexternalfigure\naturalfigurewidth
+ \ht\foundexternalfigure\naturalfigureheight}
+
+\def\finishexternalfigure % here we use \figurevariables
+ {\global\setbox\foundexternalfigure\vbox
{\forgetall
\ifcase\figurestatus
- \resetsystemmode\v!figure
- \let\figurefiletype\empty
+ \resetsystemmode\v!figure % todo, also: \v!resource
\else
- \setsystemmode \v!figure % beter resource
+ \setsystemmode \v!figure % todo, also: \v!resource
\fi
-% begin force convertable image into file
-\doifmode{\systemmodeprefix\v!first}{\doifsomething\@@efconversion
- {% needs to be sorted out
- \ifx\@@efconversionpath\undefined\else\let\figurefilepath\@@efconversionpath\fi % needed for welzorg etc
- \ifx\@@efconversionfile\undefined\else\let\figurefilename\@@efconversionfile\fi
- \ifx\@@efconversiontype\undefined\else\let\figurefiletype\@@efconversiontype\fi}}%
-% end
-\ifconditional\externalfigureflush
- \ifconditional\externalfigurelevel % probably background
- \ifskipexternalfigures
- % nothing
- \fakebox\foundexternalfigure
- \else\ifcase\figurestatus
- % nothing
- \else\ifnum\splitexternalfigure=2\else
- \the\externalfigurepostprocessors
- \box\foundexternalfigure
- \fi\fi\fi
+ \ifconditional\externalfigureflush
+ \ifconditional\externalfigurelevel % probably background
+ \ifskipexternalfigures
+ % nothing
+ \fakebox\foundexternalfigure
+ \else\ifcase\figurestatus
+ % nothing
+ \else\ifnum\splitexternalfigure=\plustwo\else
+ \the\externalfigurepostprocessors
+ \box\foundexternalfigure
+ \fi\fi\fi
+ \else
+ \iftrialtypesetting \else \feedbackexternalfigure \fi
+ \settrue\externalfigurelevel
+ \ifskipexternalfigures
+ \ifcase\figurestatus
+ \externalfigurereplacement\figurelabel\figurefilename{unknown}%
+ \else
+ \externalfigurereplacement\figurelabel\figurefullname{skipped}%
+ \fi
+ \else\ifcase\figurestatus
+ \externalfigurereplacement\figurelabel\figurefilename{unknown}%
+ \else\ifnum\splitexternalfigure=\plustwo
+ \backgroundline[\@@efsplitcolor]{\fakebox\foundexternalfigure}%
+ \else
+ \the\externalfigurepostprocessors
+ \doifelse\@@efreset\v!yes
+ {\wd\foundexternalfigure\figurewidth
+ \ht\foundexternalfigure\figureheight
+ \dp\foundexternalfigure\zeropoint
+ \box\foundexternalfigure}
+ {\localframed % should also be applied to high res !
+ [\??ef]
+ [\c!offset=\v!overlay,
+ \c!width=\figurewidth,
+ \c!height=\figureheight]
+ {\vfilll
+ \ifnum\splitexternalfigure=\plusone
+ % hm, eigenlijk in dit geval achtergrondkleur
+ \hidesplitcolorfalse % really needed
+ \backgroundline[\@@efsplitcolor]{\box\foundexternalfigure}%
+ \else % = 0, no split mode
+ \box\foundexternalfigure
+ \fi}}%
+ \fi\fi\fi
+ \fi
\else
+ % maybe also \the\externalfigurepostprocessors
\iftrialtypesetting \else \feedbackexternalfigure \fi
- \settrue\externalfigurelevel
- \ifskipexternalfigures
- \externalfigurereplacement\figurelabel\figurefullname{skipped}%
- \else\ifcase\figurestatus
- \externalfigurereplacement\figurelabel\figurefullname{unknown}%
- \else\ifnum\splitexternalfigure=2
- \backgroundline[\@@efsplitcolor]
- {\fakebox\foundexternalfigure}%
- \else
- \the\externalfigurepostprocessors
- \doifelse\@@efreset\v!yes
- {\ht\foundexternalfigure\figureheight
- \dp\foundexternalfigure\zeropoint
- \wd\foundexternalfigure\figurewidth
- \box\foundexternalfigure}
- {\localframed % should also be applied to high res !
- [\??ef]
- [\c!offset=\v!overlay,
- \c!width=\figurewidth,
- \c!height=\figureheight]
- {\vfilll
- \ifnum\splitexternalfigure=1
- % hm, eigenlijk in dit geval achtergrondkleur
- \hidesplitcolorfalse % really needed
- \backgroundline[\@@efsplitcolor]
- {\box\foundexternalfigure}%
- \else % = 0, no split mode
- \box\foundexternalfigure
- \fi}}%
- \fi\fi\fi
- \fi
-\else
- % maybe also \the\externalfigurepostprocessors
- \iftrialtypesetting \else \feedbackexternalfigure \fi
-\fi}%
- \globalpopmacro\figurefilecache
- \globalpopmacro\figurefilepath
- \globalpopmacro\figurefileprefix
- \globalpopmacro\figurefileconversion
- \globalpopmacro\figurefilepage
- \globalpopmacro\figurefiletype
- \globalpopmacro\figurefilename
- \globalpopmacro\figurelabel
- \globalpopmacro\figureheight
- \globalpopmacro\figurewidth}
+ \fi}}
+
+\def\insertfiguredriverdata#1#2%
+ {\edef\@@DriverImageWidth {\the\dimexpr#1\relax}%
+ \edef\@@DriverImageHeight{\the\dimexpr#2\relax}%
+ \let \@@DriverImageFile \wantedfigurefullname
+ \let \@@DriverImageType \wantedfiguretypespec
+ \let \@@DriverImageMethod \wantedfiguremethod
+ \let \@@DriverImageLabel \wantedfigurelabel
+ \let \@@DriverImagePage \wantedfigurepage
+ \doinsertfile}
+
+\def\insertunscaledfiguredriverdata
+ {\insertfiguredriverdata\naturalfigurewidth\naturalfigureheight}
+
+\def\insertscaledfiguredriverdata
+ {\insertfiguredriverdata\finalscaleboxwidth\finalscaleboxheight}
\def\externalfigurereplacement#1#2#3%
{\setupcolors
@@ -1546,8 +862,6 @@
\c!height=\figureheight,
\c!background=\v!screen,
\c!backgroundscreen=.8,
- %\c!frame=\ifincolor\v!off\else\v!on\fi]
- %\c!frame=\ifincolor\@@efframe\else\v!on\fi]}%
\c!frame=\@@efframe]}%
{\tt\tfxx \nohyphens
name: \expanded{\verbatimstring{#1}}\\%
@@ -1555,8 +869,11 @@
state: \expanded{\verbatimstring{#3}}}}
\def\externalfigureplaceholder#1#2#3%
- {\localframed[\??ef]
- [\c!width=#2,\c!height=#3,\c!frame=\v!on]%
+ {\localframed
+ [\??ef]
+ [\c!width=#2,
+ \c!height=#3,
+ \c!frame=\v!on]%
{\tt\tfxx \nohyphens
name: \expanded{\verbatimstring{#1}}\\%
state: \expanded{\verbatimstring{placeholder}}}}
@@ -1570,23 +887,70 @@
\externalfigure[#1][#2][#3]% or \doexternalfigure
\egroup}
-\newtoks\externalfigureresets
-\newtoks\externalfigurepostprocessors
-
\let\feedbackexternalfigure\relax % \gobblefourarguments
+\let\dowithfigure \relax
+
+%D Conversion stuff:
+
+\newcount\nofconversionfigures
+
+\def\resetwantedconversionvariables
+ {\let\wantedconversionpath \empty % these point to the to be converted graphic
+ \let\wantedconversionname \empty
+ \let\wantedconversiontype \empty
+ \let\wantedconversioncache \empty
+ \let\wantedconversionprefix\empty}
+
+\resetwantedconversionvariables
-\gdef\appliedfigurexscale{1}
-\gdef\appliedfigureyscale{1}
+\def\checkforconvertedfigure
+ {\ifcase\figurestatus
+ \resetwantedconversionvariables
+ \doifsomething\@@efconversion
+ {\global\advance\nofconversionfigures\plusone
+ \edef\wantedfigureconversion{\@@efconversion}%
+ \edef\wantedconversioncache {\@@efcache}%
+ \edef\wantedconversionprefix{\@@efprefix}%
+ \doshowfigurestate{checking paths : \figurepathlist}%
+ \processcommacommand[\figurepathlist]\dolocatefigureconversionfile
+ \ifcase\figurestatus
+ \doshowfigurestate{remark : no conversion file found}%
+ \else
+ \doshowfigurestate{remark : conversion file found}%
+ \chardef\figurestatus\zerocount
+ \fi
+ \let\wantedconversionname\wantedfigurename
+ \edef\wantedfigurename{\wantedconversionprefix\wantedfigurename}%
+ \ifx\wantedconversioncache\empty
+ \let \wantedfigurepath \wantedconversionpath
+ \else
+ \edef\wantedfigurepath{\wantedconversionpath/\@@efcache}%
+ \fi
+ \let\wantedfiguretype \empty
+ \let\wantedfiguretypelist\figuretypes % hm, why needed
+ \doshowfigurestate{conversion path : \wantedconversionpath}%
+ \doshowfigurestate{conversion name : \wantedconversionname}}%
+ \fi}
-% will go internal
+\def\dolocatefigureconversionfile#1%
+ {\ifcase\figurestatus
+ \setwantedfigurefullname{#1}\wantedfigurename\wantedfiguretype
+ \doshowfigurestate{locating original : \wantedfigurefullname}%
+ \doiffile\wantedfigurefullname
+ {\def\wantedconversionpath{#1}%
+ \let\wantedconversionname\wantedfigurename
+ \let\wantedconversiontype\wantedfiguretype
+ \chardef\figurestatus\plusfive}%
+ \fi}
-\def\appliedfigurefilename {\@@effilename}
-\def\appliedfigurefilepath {\@@efcurrentpath}
-\def\appliedfigureshortname {\@@efcurrentpath/\@@effilename}
-\def\appliedfigurefullname {\@@efcurrentfile}
-\def\appliedfigureidentifier{\@@efobjectname}
-\def\appliedfigureoptions {\@@efoption}
-\def\appliedfigurefilesuffix{\figureextension{\@@efcurrenttype}}
+\def\setpublicfigureconversionvariables % also prefix, cache
+ {\doifsomething\@@efconversion
+ {\doifmode{\systemmodeprefix\v!first}
+ {\let\figurefilepath\wantedconversionpath
+ \let\figurefilename\wantedconversionname
+ \let\figurefiletype\wantedconversiontype
+ \let\figurefileconversion\wantedfigureconversion
+ \def\figurefullname{\wantedconversionpath/\wantedconversionname.\wantedconversiontype}}}}
%D In \PDF\ one can specify an alternative graphic. This means
%D that for instance a low resolution graphic can be used for
@@ -1609,25 +973,18 @@
\doifnot\@@efobject\v!no
{\doifobjectssupportedelse
{\doifspecialavailableelse\doregisterfigure
- {\bgroup
- #1[#4][#5][#6]%
+ {\doshowfigurestate{screen alternative : start}%
+ \bgroup
+ \dosetefparameters{#4}{#5}{#6}%
\doregisterfigure{FIG}{\lastfigureobjectname}%
\let\@@ef@@scherm\@@efdisplay
\calculateexternalfigure[#1][\@@ef@@scherm][\@@ef@@scherm][#4,\c!display=][#5][#6]%
+ \doshowfigurestate{screen alternative : stop}%
\egroup}
{}}
{}}%
\fi}
-\let\dowithfigure\relax
-
-\let\naturalfigureheight=\!!zeropoint
-\let\naturalfigurewidth =\!!zeropoint
-\let\figureheight =\!!zeropoint
-\let\figurewidth =\!!zeropoint
-
-\def\noffigurepages{\nofinsertpages}
-
\def\getfiguredimensions
{\dodoubleempty\dogetfiguredimensions}
@@ -1646,6 +1003,304 @@
{\dogetfiguredimensions[#1][#2]%
\doresetobjects}
+%D Size determination.
+%D
+%D An analyzer must set the following dimensions (global macros):
+%D
+%D \starttyping
+%D \analyzedfigurewidth
+%D \analyzedfigureheight
+%D \stoptyping
+%D
+%D And afterwards, when succeeded, call:
+%D
+%D \starttyping
+%D \setanalyzedfiguredimensions{number>=10}
+%D \stoptyping
+%D
+%D Numbers upto 9 are reserved for special purposes:
+%D
+%D \starttabulate
+%D \NC 0 \NC not found \NC \NR
+%D \NC 1 \NC object (will be reused) \NC \NR
+%D \NC 2 \NC found but no dimensions (e.g. special annotation) \NC \NR
+%D \stoptabulate
+
+\let\doanalyzefiguredimensionsfromfile\relax % hook for figuredatabase
+\let\doanalyzefiguredimensionsinternal\relax
+\let\doanalyzefiguredimensionsexternal\relax % hook for rli support (see later)
+\let\doanalyzefiguredimensionsfallback\relax
+
+\def\doanalyzefiguredimensions
+ {\doiffileinsertionsupportedelse\wantedfiguretypespec
+ {\doiffileelse\wantedfigurefullname
+ {\doshowfigurestate{analyzing : \wantedfigurefullname}%
+ \doanalyzefiguredimensionsinternal
+ \doanalyzefiguredimensionsexternal
+ \doanalyzefiguredimensionsfallback}
+ {\doshowfigurestate{not found : \wantedfigurefullname}}}
+ {}}
+
+\def\setanalyzedfiguredimensions#1%
+ {\ifdim\analyzedfigurewidth>\zeropoint
+ \ifdim\analyzedfigureheight>\zeropoint
+ \determinedfigurewidth \analyzedfigurewidth
+ \determinedfigureheight\analyzedfigureheight
+ \chardef\figurestatus #1\relax
+ \doshowfigurestate{dimensions :
+ \the\dimexpr\analyzedfigurewidth\relax\space x\space
+ \the\dimexpr\analyzedfigureheight\relax}%
+ \else
+ \determinedfigurewidth \zeropoint
+ \determinedfigureheight\zeropoint
+ \chardef\figurestatus \zerocount
+ \fi
+ \else
+ \determinedfigurewidth \zeropoint
+ \determinedfigureheight\zeropoint
+ \chardef\figurestatus \zerocount
+ \fi}
+
+%D We can remap types. This is to be dealt with in the driver files.
+
+\def\definegraphictypesynonym
+ {\dodoubleargument\dodefinegraphictypesynonym}
+
+\def\dodefinegraphictypesynonym[#1][#2]%
+ {\setvalue{\??ef:\??ex:#1}{#2}}
+
+\def\truegraphictype#1%
+ {\ifcsname\??ef:\??ex:#1\endcsname
+ \expandafter\truegraphictype\csname\??ef:\??ex:#1\endcsname\else#1%
+ \fi}
+
+\definegraphictypesynonym[epdf] [pdf]
+\definegraphictypesynonym[jpeg] [jpg]
+\definegraphictypesynonym[jbig] [jb2]
+\definegraphictypesynonym[jbig2][jb2]
+\definegraphictypesynonym[jbg] [jb2]
+
+%D The self method (mostly used) uses the driver.
+
+% todo: when zero width mps, ok
+%
+% analyzer must set the analyzed dimensions
+
+\def\doanalyzefiguredimensionsinternal
+ {\ifcase\figurestatus
+ \let\@@DriverImageFile\wantedfigurefullname
+ \let\@@DriverImagePage\wantedfigurepage
+ \let\@@DriverImageType\wantedfiguretypespec
+ % use internal when available, otherwise try driver (\dogetfiguresize)
+ \executeifdefined{dogetfiguresize\wantedfiguretypespec}\dogetfiguresize
+ \setanalyzedfiguredimensions\!!ten
+ \fi}
+
+%D The tex method.
+
+\def\dogetfiguresizetex
+ {\ifcase\figurestatus
+ \global\setbox\foundexternalfigure\vbox
+ {\insidefloattrue
+ \forgetall
+ \blank[\v!disable]% niet meer weg !
+ \startreadingfile
+ \readfile\wantedfigurefullname \donothing \donothing
+ \stopreadingfile
+ \endgraf
+ \removelastskip}%
+ \global\setbox\foundexternalfigure\hbox
+ {\raise\dp\foundexternalfigure\box\foundexternalfigure}%
+ \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
+ \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}%
+ \fi}
+
+\let\dogetfiguresizetmp \dogetfiguresizetex
+\let\dogetfiguresizebuffer\dogetfiguresizetex
+
+%D The eps, mps and svg files are read directly.
+
+\def\dogetfiguresizeeps
+ {\dogetEPSboundingbox\wantedfigurefullname\!!widtha\!!heighta\!!widthb\!!heightb
+ \xdef\analyzedfigurewidth {\the\!!widthb}%
+ \xdef\analyzedfigureheight{\the\!!heightb}}
+
+\let\dogetfiguresizemps\dogetfiguresizeeps
+
+\def\dogetfiguresizesvg
+ {\doifinset\wantedfiguretypespec{\c!svg}
+ {\startnointerference
+ \startXMLignore
+ \defineXMLcommand[svg][width=100,height=75]
+ {\doifdimensionelse{\XMLop{width}}
+ {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{width}\relax}}
+ {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{width}\onebasepoint\relax}}%
+ \doifdimensionelse{\XMLop{height}}
+ {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{height}\relax}}
+ {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{height}\onebasepoint\relax}}%
+ \endinput}%
+ \processXMLfilegrouped\wantedfigurefullname
+ \stopXMLignore
+ \stopnointerference}}
+
+%D Do some checking on the filename.
+
+\newconditional \figurefileisqualified
+
+\def\setfigurepathlist
+ {\let\figurepathlist\empty
+ \expanded{\doifinset{\v!global }{\@@exlocation}}
+ {\let\figurepathlist\@@exdirectory}%
+ \expanded{\doifinset{\v!local }{\@@exlocation}}
+ {\prependtocommalist\f!currentpath\figurepathlist}%
+ \expanded{\doifinset{\v!default}{\@@exlocation}}
+ {\appendtocommalist\defaultfigurepathsignal\figurepathlist}}
+
+\def\analyzefigurefilename#1#2%
+ {\sanitizefilename#1\to\expandedfigurename
+ \expanded{\checkfilename{\expandedfigurename}}%
+ \ifcase\kindoffile
+ \splitfigurefilename
+ \ifcase\splitoffkind
+ \let\wantedfigurepath\empty % no . either
+ \setfigurepathlist
+ \setfalse\figurefileisqualified
+ \else
+ \splitfigurefilename
+ \let\figurepathlist\wantedfigurepath
+ \let\wantedfigurepath\empty
+ \settrue\figurefileisqualified
+ \fi
+ \else % fully qualified
+ \splitfigurefilename
+ \let\figurepathlist\wantedfigurepath
+ \let\wantedfigurepath\empty
+ \settrue\figurefileisqualified
+ \fi
+ \ifx\figurepathlist\empty
+ \let\figurepathlist\defaultfigurepathsignal % will prepend no path
+ \fi
+ \doifelsenothing\wantedfiguretype
+ {\doifparentfileelse\wantedfigurename
+ {\@EA\removefromcommalist\@EA{\jobsuffix }\wantedfiguretypelist
+ \@EA\removefromcommalist\@EA{\jobfilesuffix}\wantedfiguretypelist}
+ {}}
+ {\let\wantedfiguretypelist\empty
+ \let\wantedfiguretypespec\wantedfiguretype}%
+ \edef\wantedfigurelabel{#2}%
+ \doshowfigurestate{type check : \ifx\wantedfiguretypelist\empty forced type \wantedfiguretypespec\else\wantedfiguretypelist\fi}%
+ \doshowfigurestate{file specs : \wantedfigurefull\space [\wantedfigurepath] [\wantedfigurename] [\wantedfiguretype]}%
+ \doshowfigurestate{file type : \ifconditional\figurefileisqualified qualified\else simple\fi}}
+
+% \def\setwantedfigurefullname#1#2#3% path name spec
+% {\edef\wantedfiguretypespec{#3}%
+% \doifelse{#1}\defaultfigurepathsignal % default is actually empty i.e. system lookup
+% {\edef\wantedfigurefullname {#2.\wantedfiguretypespec}}
+% {\edef\wantedfigurefullname{#1/#2.\wantedfiguretypespec}}%
+% }
+
+\def\setwantedfigurefullname#1#2#3% path name spec
+ {\ifx\wantedfiguremethod\empty
+ % the either explicit or gambled typespec determines the method
+ \edef\wantedfiguretypespec{#3}%
+ \doifelse{#1}\defaultfigurepathsignal
+ {\edef\wantedfigurefullname {#2.\wantedfiguretypespec}}
+ {\edef\wantedfigurefullname{#1/#2.\wantedfiguretypespec}}%
+ \else\ifx\wantedfiguretype\empty %
+ % the typespec (probably the same as the method) determines the suffix
+ \doifelse{#1}\defaultfigurepathsignal
+ {\edef\wantedfigurefullname {#2.\wantedfiguretypespec}}
+ {\edef\wantedfigurefullname{#1/#2.\wantedfiguretypespec}}%
+ \let\wantedfiguretypespec\wantedfiguremethod
+ \else
+ % the given suffix is used
+ \let\wantedfiguretypespec\wantedfiguremethod
+ \doifelse{#1}\defaultfigurepathsignal
+ {\edef\wantedfigurefullname {#2.\wantedfiguretype}}
+ {\edef\wantedfigurefullname{#1/#2.\wantedfiguretype}}%
+ \fi\fi}
+
+\def\splitfigurefilename
+ {\splitfilename\expandedfigurename
+ \let\wantedfigurefull\splitofffull
+ \let\wantedfigurepath\splitoffpath
+ \let\wantedfigurename\splitoffname
+ \let\wantedfigurebase\splitoffbase
+ \let\wantedfiguretype\splitofftype}
+
+\def\analyzefigurefiles
+ {\ifconditional\figurefileisqualified
+ \ifx\wantedfiguretype\empty
+ \doshowfigurestate{locating : unknown type}%
+ \doanalyzeunknownfiguretype
+ \else
+ % this file or none
+ \doshowfigurestate{locating : known type}%
+ \doanalyzequalifiedfigure
+ \fi
+ \else
+ \ifx\wantedfiguretype\empty
+ % locate best fit / check support
+ \doshowfigurestate{locating : best fit}%
+ \doanalyzeunknownfiguretype
+ \else
+ % only check on paths
+ \doshowfigurestate{locating : known types}%
+ \doanalyzeknownfiguretype
+ \fi
+ \fi}
+
+\def\doanalyzequalifiedfigure
+ {\let\wantedfigurefullname\wantedfigurefull
+ \let\wantedfiguretypespec\wantedfiguretype
+ \doshowfigurestate{forced type : \wantedfiguretype}%
+ \doshowfigurestate{identifying : \wantedfigurefullname}%
+ \doanalyzefiguredimensions}
+
+\def\doanalyzeknownfiguretype
+ {\doshowfigurestate{using paths : \figurepathlist}%
+ \doshowfigurestate{known type : \wantedfiguretype}%
+ \doshowfigurestate{identifying : \wantedfigurename}%
+ \let\wantedfiguretypespec\wantedfiguretype
+ \processcommacommand[\figurepathlist]\dodoanalyzeknownfiguretype}
+
+\def\dodoanalyzeknownfiguretype#1% path
+ {\ifcase\figurestatus
+ \setwantedfigurefullname{#1}\wantedfigurename\wantedfiguretype
+ \doanalyzefiguredimensions
+ \fi}
+
+\def\doanalyzeunknownfiguretype
+ {\doshowfigurestate{using paths : \figurepathlist}%
+ \doshowfigurestate{using types : \wantedfiguretypelist}%
+ \doshowfigurestate{identifying : \wantedfigurename}%
+ \processcommacommand[\wantedfiguretypelist]\dodoanalyzeunknownfiguretype}
+
+\def\dodoanalyzeunknownfiguretype#1%
+ {\processcommacommand[\figurepathlist]{\dododoanalyzeunknownfiguretype{#1}}}
+
+\def\dododoanalyzeunknownfiguretype#1#2% type path
+ {\ifcase\figurestatus
+ \setwantedfigurefullname{#2}\wantedfigurename{#1}% path spec
+ \doanalyzefiguredimensions
+ \fi}
+
+%D Some files, take for instance movies, cannot easilly be
+%D parsed on dimensions, that is, not yet. Although the current
+%D mechanism has no problems with this, as long as the user
+%D specified width and height reflect the right aspect ratio.
+%D Nevertheless, when one does not want any scanning done, one
+%D can disable \type{preset}. When no preset is needed, we only
+%D locate the file.
+
+\def\doanalyzefiguredimensionsfallback
+ {\ifcase\figurestatus
+ \doshowfigurestate{warning : assuming adaptive figure}%
+ \xdef\analyzedfigurewidth {\the\dimexpr\@@efwidth +\zeropoint\relax}%
+ \xdef\analyzedfigureheight{\the\dimexpr\@@efheight+\zeropoint\relax}%
+ \setanalyzedfiguredimensions\plustwo
+ \fi}
+
\presetlocalframed[\??ef]
\newconditional\externalfigurelevel % true=background false=normal
@@ -1654,17 +1309,14 @@
\setfalse\externalfigurelevel
\settrue \externalfigureflush
-\def\doplaceexternalfigure % used direct and indirect
- {\dosixtupleempty\dodoplaceexternalfigure}
-
-\def\dodoplaceexternalfigure[#1][#2][#3][#4][#5][#6]%
- {\doifsomething{#3}% catches \defineexternalfigure dummies
+\def\doplaceexternalfigure[#1][#2][#3][#4][#5]%
+ {\doifsomething{#2}% catches \defineexternalfigure dummies
{\bgroup
-\pushmacro\textunderscore
+ \pushmacro\textunderscore
\edef\textunderscore{\string_}% brrr, temp hack, still needed?
- \calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- \calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]%
-\popmacro\textunderscore
+ \calculateexternalfigure [][#1][#2][#3][#4][#5]% [] is dummy dwcomp
+ \calculateexternalscreenfigure[][#1][#2][#3][#4][#5]% [] is dummy dwcomp
+ \popmacro\textunderscore
\box\foundexternalfigure
\egroup}}
@@ -1680,25 +1332,14 @@
%
% \defineexternalfigure[name][settings]
-\def\dodefineexternalfigure[#1][#2]%
- {\setvalue{\??ef\??ef#1}%
- {\doplaceexternalfigure[\dopresetfigure][#1][][#2][]}}
-
\def\defineexternalfigure
{\dodoubleargument\dodefineexternalfigure}
-\def\getexternalfigure#1%
- {\getvalue{\??ef\??ef#1}}
-
-\def\dopresetfigure[#1][#2][#3]%
- {\getparameters[\??ef][#1,#3]%
- \getparameters[\??ep][#2]}
+\def\dodefineexternalfigure[#1][#2]%
+ {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][][][#2]}}
-\def\doprecopfigure[#1][#2][#3]%
- {\def\doplaceexternalfigure[##1][##2][##3][##4][##5]%
- {\getparameters[\??ef][##4,#2,#3]%
- \getparameters[\??ep][##5]}%
- \getvalue{\??ef\??ef#1}}
+\def\getexternalfigure#1% efef has 4 args already and take an 5th
+ {\wait} % OBSOLETE
% \useexternalfigure[alpha][koe]
% \useexternalfigure[beta] [koe] [breedte=1cm]
@@ -1714,36 +1355,63 @@
% 4cm breed: \externalfigure[beta] [breedte=4cm] \par
% 5cm breed: \externalfigure[gamma][breedte=5cm] \par
-\def\dosetuseexternalfigure[#1][#2][#3][#4]%
- {\doifassignmentelse{#3}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\dopresetfigure][#1][#2][#3][#4]}}
- {\doifelsenothing{#3} % catch [1][2][leeg][leeg]
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\dopresetfigure][#1][#2][#3][#4]}}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[\doprecopfigure][#1][#2][#3][#4]}}}%
- \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}} % upward compatible
+% \defineexternalfigure[a][width=10cm]
+% \defineexternalfigure[b][width=5cm]
+% \externalfigure[cow][a]
+% \externalfigure[cow][b][height=8cm]
-\def\douseexternalfigure[#1][#2]%[#3][#4]%
- {\doifelsenothing{#1}
- {\doifsomething{#2}
- {\dosetuseexternalfigure[#2][#2]}} %[#3][#4]}}
- {\doifelsenothing{#2}
- {\dosetuseexternalfigure[#1][#1]} %[#3][#4]}
- {\dosetuseexternalfigure[#1][#2]}}} %[#3][#4]}}}
+% \useexternalfigure[x][cow][width=10cm,height=1cm]
+% \externalfigure[x]
+% \externalfigure[x][width=3cm]
+
+\def\useexternalfigure
+ {\doquadrupleempty\douseexternalfigure}
+
+% [label] [filename]
+% [label] [filename] [parent]
+% [label] [filename] [parent] [settings]
+% [label] [filename] [settings]
\def\useexternalfigure
{\doquadrupleempty\douseexternalfigure}
+\def\douseexternalfigure[#1][#2][#3][#4]%
+ {\doifelsenothing{#1}
+ {\doifsomething{#2}
+ {\doifassignmentelse{#3}
+ {\setvalue{\??ef\??ef#2}{\doplaceexternalfigure[#2][#2][#3][#4]}}
+ {\setvalue{\??ef\??ef#2}{\doplaceexternalfigure[#2][#2][][#4]}}}}
+ {\doifelsenothing{#2}
+ {\doifassignmentelse{#3}
+ {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#1][][#3]}}
+ {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#1][#3][#4]}}}
+ {\doifassignmentelse{#3}
+ {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][][#3]}}
+ {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][#3][#4]}}}}}
+
+\def\dosetefparameters#1#2#3% parent_id use_settings current_settings
+ {\doifelsenothing{#1} % inherit from parent
+ {\getparameters[\??ef][#2,#3]}
+ {\doifdefinedelse{\??ef\??ef#1}
+ {\pushmacro\doplaceexternalfigure
+ \def\doplaceexternalfigure[##1][##2][##3][##4]{\getparameters[\??ef][##4,#2,#3]}%
+ \getvalue{\??ef\??ef#1}%
+ \popmacro\doplaceexternalfigure}
+ {\getparameters[\??ef][#2,#3]}}}
+
\unexpanded\def\externalfigure
{\dotripleempty\doexternalfigure}
-\def\doexternalfigure[#1][#2][#3]%
+\def\doexternalfigure[#1][#2][#3]% [label][file][settings] | [file][settings] | [file][parent][settings]
{\bgroup
\doifelsenothing{#1}
- {\framed[\c!width=8\lineheight,\c!height=6\lineheight]{external\\figure}}
+ {\framed[\c!width=\defaultfigurewidth,\c!height=\defaultfigureheight]{external\\figure}}
{\doifundefinedelse{\??ef\??ef#1}
{\useexternalfigure[\s!dummy][#1][#2][#3]%
- \getexternalfigure{\s!dummy}[#3]}
- {\getexternalfigure{#1}[#2]}}%
+ \getvalue{\??ef\??ef\s!dummy}[]} % [] is dummy arg 5
+ {\doifassignmentelse{#2}
+ {\getvalue{\??ef\??ef#1}[#2]}%
+ {\getvalue{\??ef\??ef#1}[#3]}}}%
\globallet\currentresourcecomment\empty
\egroup}
@@ -1754,127 +1422,10 @@
{\long\gdef\currentresourcecomment{#1}}
\let\currentresourcecomment\empty
-
-%D Two alternatives, more settings needed.
-
-\def\showexternalfigurea
- {\bgroup
- \dontcomplain
- \def\presetfigure[##1][##2]%
- {\getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][]
- {}
- {\hbox
- {\externalfigure[##1][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize][##2]%
- \tfskip
- \framed[\c!width=\figurewidth,\c!height=\figureheight]{}}}%
- {\tt\tfa\expanded{\asciistr{##1}}}%
- \blank
- \tfx
- \def\docommando####1%
- {\beforesplitstring####1\at=\to\asciia
- \aftersplitstring ####1\at=\to\asciib
- \convertcommand\asciib\to\asciib
- \doifsomething\asciib
- {\hsmash{\hbox to .75em{\asciia\hss}: \asciib}\endgraf}}%
- \processcommalist[##2]\docommando
- \strut
- \endgraf
- \getvalue{\e!stop\v!figure\e!text}}%
- \pushendofline
- \readjobfile\@@exfile\donothing\donothing
- \popendofline
- \egroup}
-
-\def\showexternalfigureb % instelbaar maken
- {\bgroup
- \def\total{5}%
- \globalletempty\allfigures
- \doglobal\newcounter\figurecounter
- \dontcomplain
- \def\docommando##1{##1&}%
- \def\figurecaptions%
- {\crcr
- \noalign{\nobreak\vskip.5em}%
- \@EA\globalprocesscommalist\@EA[\allfigures]\docommando
- \globalletempty\allfigures
- \crcr
- \noalign{\vskip1em\goodbreak}}%
- \def\presetfigure[##1][##2]%
- {\vbox
- {\divide\hsize \total
- \advance\hsize -1em
- \externalfigure
- [##1]
- [\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize][##2]}%
- \doglobal\addtocommalist{##1}\allfigures
- %\getvalue{\s!figurepreset}%
- \doglobal\increment\figurecounter
- \ifnum\figurecounter=\total
- \doglobal\newcounter\figurecounter
- \def\next{\figurecaptions}%
- \else
- \def\next{&}%
- \fi
- \next}%
- \pushendofline
- \tabskip\zeropoint \!!plus 1fill
- \halign to \hsize
- {&\hss##\hss\cr\readjobfile\@@exfile\donothing\donothing\crcr
- \figurecaptions}
- \popendofline
- \egroup}
-
-\def\showexternalfigurec
- {\bgroup
- \def\presetfigure[##1][##2]{\expanded{\pagefigure[##1][\c!size=\@@exsize]}}% else loop
- \pushendofline
- \readjobfile\@@exfile\donothing\donothing
- \popendofline
- \egroup}
-
-\def\showexternalfigured % to be documented; this one builds a dimension file for
- {\bgroup % metapost/metafun
- \immediate\openout\scratchwrite=mpfigs.mp
- \def\presetfigure[##1][##2]%
- {\getfiguredimensionsonly[##1]% \pagefigure[##1]%
- \immediate\write\scratchwrite
- {registerfigure("##1",\figurewidth,\figureheight);}}
- \pushendofline
- \readjobfile\@@exfile\donothing\donothing
- \popendofline
- \immediate\closeout\scratchwrite
- \egroup}
-
-\def\startpagefigure
- {\dodoubleempty\dostartpagefigure}
-
-\def\dostartpagefigure[#1][#2]%
- {\bgroup
- \getparameters[\??ex][\c!offset=\v!overlay,#2]%
- \startTEXpage[\c!offset=\@@exoffset]%
- \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic
-
-\def\stoppagefigure
- {\stopTEXpage
- \egroup}
-
-\def\pagefigure
- {\dodoubleempty\dopagefigure}
-
-\def\dopagefigure[#1][#2]%
- {\dostartpagefigure[#1][#2]\stoppagefigure}
-
-% \starttext \pagefigure[two.1] \stoptext
-
-\def\doshowexternalfigures[#1]%
- {\bgroup
- \setupcolors[\c!state=\v!start]% to prevent mps color conversion
- \getparameters[\??ex][\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]%
- \getvalue{\strippedcsname\showexternalfigure\@@exalternative}%
- \egroup}
-
-\def\showexternalfigures
- {\dosingleempty\doshowexternalfigures}
+
+\def\showexternalfigures % maybe run time command is better, but no core-run, unless figs-run ...
+ {%\writestatus\m!systems{for \string\showexternalfigures\space see \truefilename{x-res-20}.tex}
+ \usemodule[res-20]\showexternalfigures} % so for the moment we do it this way
\def\overlayfigure#1%
{\externalfigure[#1][\c!width=\overlaywidth,\c!height=\overlayheight]}
@@ -1968,7 +1519,7 @@
\newbox\colorbarbox
\def\makecolorbar[#1]%
- {\def\docommando##1%
+ {\def\docommand##1%
{\color[##1]
{\blackrule
[\c!width=2em,
@@ -1977,7 +1528,7 @@
\endgraf}%
\global\setbox\colorbarbox\vbox
{\forgetall
- \processcommalist[#1]\docommando}%
+ \processcommalist[#1]\docommand}%
\global\setbox\colorbarbox\vbox
{\hskip2em\box\colorbarbox}%
\global\wd\colorbarbox\zeropoint}
@@ -1990,15 +1541,11 @@
\calculateefsteps
\startpositioning
\def\referring(##1,##2)##3(##4,##5)##6[##7]%
- {\position(##1,##2)
- {\efgoto(##4,##5){\@@exframes}[##7]}}%
+ {\position(##1,##2){\efgoto(##4,##5){\@@exframes}[##7]}}%
\def\marking(##1,##2)##3(##4,##5)##6[##7]%
- {\position(##1,##2)
- {\efthisis(##4,##5){\@@exframes}[##7]}}%
- \def\remark%
- {\efnocomment}%
- \def\colorbar##1[##2]%
- {}%
+ {\position(##1,##2){\efthisis(##4,##5){\@@exframes}[##7]}}%
+ \def\remark{\efnocomment}%
+ \def\colorbar##1[##2]{}%
\position(0,0){\box0}%
\linewidth\onepoint
\setuppositioning
@@ -2010,10 +1557,8 @@
\def\referring(##1,##2)##3(##4,##5)##6[##7]%
{}%
\let\marking\referring
- \def\remark%
- {\efcomment\v!no}%
- \def\colorbar##1[##2]%
- {\makecolorbar[##2]}%
+ \def\remark{\efcomment\v!no}%
+ \def\colorbar##1[##2]{\makecolorbar[##2]}%
\ignorespaces#4%
\stoppositioning
\box\colorbarbox}}
@@ -2025,7 +1570,7 @@
{\let\@@exframes\v!off}%
\setvalue{\??ef\??ef#1}%
{\dosingleempty{\placestartfigure[#1][#2][#3]#4\placestopfigure}}%
- \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
+ }% no longer \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
% De onderstaande macro mag niet zondermeer worden aangepast
% en is afgestemd op gebruik in de handleiding.
@@ -2035,14 +1580,10 @@
\setbox0\hbox
{\useexternalfigure[\s!dummy][#2][\c!wfactor=\v!max]%
\externalfigure[\s!dummy]}%
- \def\referring
- {\efmark}%
- \def\marking
- {\efmark}%
- \def\remark
- {\efcomment\v!yes}%
- \def\colorbar##1[##2]%
- {}%
+ \def\referring{\efmark}%
+ \def\marking{\efmark}%
+ \def\remark{\efcomment\v!yes}%
+ \def\colorbar##1[##2]{}%
\efreference\zerocount
\setbox0\vbox
{\hsize240pt
@@ -2071,14 +1612,10 @@
\stoppositioning
\vfill}%
\efreference\zerocount
- \def\referring%
- {\eftext{$\rightarrow$}}%
- \def\marking%
- {\eftext{$\leftarrow$}}%
- \def\remark%
- {\efnocomment}%
- \def\colorbar##1[##2]%
- {}%
+ \def\referring{\eftext{$\rightarrow$}}%
+ \def\marking{\eftext{$\leftarrow$}}%
+ \def\remark{\efnocomment}%
+ \def\colorbar##1[##2]{}%
\setbox2\vbox
{{\tfa\doifelsenothing{#1}{#2}{#1}}
\blank
@@ -2098,12 +1635,12 @@
\def\dodostartfigure[#1][#2][#3]#4\stopfigure
{\doifelse\v!test\@@exoption
{\teststartfigure[#1][#2][#3]#4\teststopfigure
- \let\@@exframes\v!on}
- {\let\@@exframes\v!off}%
+ \let\@@exframe\v!on}
+ {\let\@@exframe\v!off}%
\setvalue{\??ef\??ef#1}%
{\def\next{\placestartfigure[#1][#2][#3]#4\placestopfigure}%
\dosingleempty\next}%
- \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
+ }% no longer: \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
\long\def\dostartfigure#1%
{\dotripleargument\dodostartfigure#1\stopfigure}
@@ -2111,118 +1648,6 @@
\def\startfigure
{\grabuntil{\e!stop\v!figure}\dostartfigure}
-%D \macros
-%D {clip, setupclipping}
-%D
-%D Although related to figures, clipping can be applied to
-%D arbitrary content. We can use \METAPOST\ to provide a non
-%D rectangular clipping path.
-%D
-%D \starttyping
-%D \startMPclip{fun}
-%D clip currentpicture to fullcircle
-%D shifted (.5,.5) xscaled \width yscaled \height ;
-%D \stopMPclip
-%D \stoptyping
-%D
-%D We get a rectangular piece of the figure when we say:
-%D
-%D \starttyping
-%D \clip[x=2,y=1]{\externalfigure[photo]}
-%D \stoptyping
-%D
-%D When we want to clip to the oval we defined a few lines ago,
-%D we say:
-%D
-%D \starttyping
-%D \clip[nx=1,ny=1,x=1,y=1,mp=fun]{\externalfigure[photo]}
-%D \stoptyping
-%D
-%D The general characteristics of clipping can be set up with
-%D
-%D \showsetup{setupclipping}
-
-\def\doclip[#1]% nb top->bottom left->right
- {\bgroup
- \getparameters[\??cp][#1]%
- \doifelse\@@cpstate\v!start\dodoclip{\egroup\hbox}}
-
-\def\dodoclip
- {\dowithnextbox
- {\ifdim\@@cpwidth>\zeropoint
- \!!dimena\@@cpwidth
- \!!dimenc\@@cphoffset
- \else
- \!!dimena\nextboxwd
- \divide\!!dimena \@@cpnx
- \!!dimenc\@@cpx\!!dimena
- \advance\!!dimenc -\!!dimena
- \!!dimena\@@cpsx\!!dimena
- \fi
- \relax % sure
- \ifdim\@@cpheight>\zeropoint
- \!!dimenb\@@cpheight
- \!!dimend\nextboxht
- \advance\!!dimend -\@@cpvoffset
- \advance\!!dimend -\!!dimenb
- \else
- \!!dimenb\nextboxht
- \divide\!!dimenb \@@cpny
- \!!dimend-\@@cpy\!!dimenb
- \advance\!!dimend -\@@cpsy\!!dimenb
- \advance\!!dimend \!!dimenb
- \!!dimenb\@@cpsy\!!dimenb
- \advance\!!dimend \nextboxht
- \fi
- \setbox\nextbox\hbox % old
- {\advance\!!dimenc -\@@cpleftoffset % new !
- \advance\!!dimend -\@@cpbottomoffset % new ! % - added
- \hskip-\!!dimenc\lower\!!dimend\flushnextbox}% old
- \nextboxwd\zeropoint
- \nextboxht\zeropoint
- \nextboxdp\zeropoint
- \setbox\nextbox\hbox
- {\advance\!!dimena \@@cpleftoffset % new !
- \advance\!!dimena \@@cprightoffset % new !
- \advance\!!dimenb \@@cpbottomoffset % new !
- \advance\!!dimenb \@@cptopoffset % new !
- \dostartclipping\@@cpmp\!!dimena\!!dimenb % old
- \flushnextbox
- \dostopclipping}%
- \setbox\nextbox\hbox % new !
- {\!!dimena-\@@cpleftoffset % new !
- \!!dimenb \@@cpbottomoffset % new ! % - removed
- \hskip\!!dimena\lower\!!dimenb\flushnextbox}% new !
- \nextboxwd\!!dimena
- \nextboxht\!!dimenb
- \nextboxdp\zeropoint
- \flushnextbox
- \egroup}%
- \hbox}
-
-%D \startbuffer
-%D \startuseMPgraphic{test}
-%D path p ; p := fullcircle scaled 4cm ;
-%D draw p withpen pencircle scaled 1cm ;
-%D setbounds currentpicture to boundingbox p ;
-%D \stopuseMPgraphic
-%D
-%D \hbox to \hsize \bgroup
-%D \hss
-%D \ruledhbox{\useMPgraphic{test}}%
-%D \hss
-%D \ruledhbox{\clip{\useMPgraphic{test}}}%
-%D \hss
-%D \egroup
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\def\clip{\dosingleempty\doclip}
-
-\def\setupclipping
- {\dodoubleargument\getparameters[\??cp]}
-
%D defining sound tracks:
%D
%D \starttyping
@@ -2320,7 +1745,7 @@
\setupexternalfigures
[\c!option=,
- \c!object=\v!yes,
+ \c!object=\v!yes, % we only check for no
\c!reset=\v!no,
\c!maxwidth=\@@efwidth,
\c!maxheight=\@@efheight,
@@ -2346,20 +1771,4 @@
\useexternalfigure
[buffer] [\jobname] [\c!type=\v!buffer,\c!object=\v!no]
-\setupclipping
- [\c!state=\v!start,
- \c!n=1, % was 2
- \c!nx=\@@cpn,\c!x=1,\c!sx=1,
- \c!ny=\@@cpn,\c!y=1,\c!sy=1,
- \c!width=\!!zeropoint,
- \c!height=\!!zeropoint,
- \c!hoffset=\!!zeropoint,
- \c!voffset=\!!zeropoint,
- \c!offset=\zeropoint,
- \c!leftoffset=\@@cpoffset, % \zeropoint,
- \c!rightoffset=\@@cpoffset, % \zeropoint,
- \c!topoffset=\@@cpoffset, % \zeropoint,
- \c!bottomoffset=\@@cpoffset, % \zeropoint,
- \c!mp=]
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-fld.tex b/Master/texmf-dist/tex/context/base/core-fld.tex
index 4262bbdd210..595a9188fee 100644
--- a/Master/texmf-dist/tex/context/base/core-fld.tex
+++ b/Master/texmf-dist/tex/context/base/core-fld.tex
@@ -373,8 +373,8 @@
%D \def\getmainfieldkids#1%
%D {\let\@@DriverFieldKids\empty
%D \ifdefinemainfield
-%D \definerawpasslist{fld:#1}% runtime defined by system
-%D \moverawpasslist{fld:#1}\@@DriverFieldKids
+%D \definetwopasslist{fld:#1}% runtime defined by system
+%D \getnamedtwopassdatalist{fld:#1}\@@DriverFieldKids
%D \fi}
%D \stoptyping
%D
@@ -385,11 +385,7 @@
%D
%D \def\setmainfieldkid#1#2%
%D {\doglobal\increment\nofmainfieldkids
-%D \immediatewriteutilitycommand
-%D {\twopassentry%
-%D {fld:#1}%
-%D {\nofmainfieldkids}%
-%D {#2}}}
+%D \savetwopassdata{fld:#1}{\nofmainfieldkids}{#2}}
%D \stoptyping
%D
%D The trade of of this mechanism is that for each cloned or
@@ -552,19 +548,19 @@
\setfield{#1}{#2}{}{}{#4,\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\SavedFieldDefault}%
\fi
%
- \def\docommando##1%
+ \def\docommand##1%
{\doifelse{##1}\SavedFieldDefault
{\def\@@DriverFieldDefault{##1}}%
{\let\@@DriverFieldDefault\empty}%
\setfield{##1}{#2}{#1}{}{}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\@@DriverFieldDefault}}%
% when opt works
-% \def\docommando##1%
+% \def\docommand##1%
% {\@EA\beforesplitstring##1\at=>\to\FieldValue
% \doifelse\FieldValue\SavedFieldDefault
% {\let\@@DriverFieldDefault\FieldValue}%
% {\let\@@DriverFieldDefault\empty}%
% \setfield\FieldValue{#2}{#1}{}{}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\@@DriverFieldDefault}}%
- \processcommalist[#4]\docommando
+ \processcommalist[#4]\docommand
\else
\writestatus\m!fields{pass values too}%
\fi}
@@ -574,7 +570,7 @@
\def\dodefinesubfield[#1][#2][#3]% for the moment only radio ones
{\ifsecondargument
- \def\docommando##1%
+ \def\docommand##1%
{\getfield{##1}%
\ifx\@@DriverFieldType\empty
\writestatus\m!fields{unknown field ##1}% to do
@@ -587,7 +583,7 @@
{\def\@@DriverFieldValues{#3}}%
\changefield{##1}%
\fi}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\else
\writestatus\m!fields{pass fieldname, setupgroup, values and default}%
\fi}
@@ -600,9 +596,9 @@
\writestatus\m!fields{unknown field #1}%
\else
\let\@@DriverFieldMode\fieldparentmode
- %\def\docommando##1{\addtocommalist{##1}\@@DriverFieldKids}%
- \def\docommando##1{\appendtocommalist{##1}\@@DriverFieldKids}%
- \processcommalist[#2]\docommando
+ %\def\docommand##1{\addtocommalist{##1}\@@DriverFieldKids}%
+ \def\docommand##1{\appendtocommalist{##1}\@@DriverFieldKids}%
+ \processcommalist[#2]\docommand
\changefield{#1}%
\let\@@DriverFieldAutoParent\@@DriverFieldAuto
\def\@@DriverFieldParent{#1}%
@@ -613,12 +609,12 @@
\def\@@DriverFieldAuto{0}%
\doifsomething{#3}{\edef\@@DriverFieldGroup{#3}}%
\doifsomething{#4}{\edef\@@DriverFieldValues{#4}}%
- \def\docommando##1%
+ \def\docommand##1%
{\ifcase\@@DriverFieldAutoParent\else
\setmainfieldkid{\@@DriverFieldParent}{##1}%
\fi
\changefield{##1}}%
- \processcommalist[#2]\docommando
+ \processcommalist[#2]\docommand
\fi
\fi
\else
@@ -636,9 +632,9 @@
\writestatus\m!fields{unknown field #1}%
\else
\let\@@DriverFieldMode\fieldparentmode
- %\def\docommando##1{\addtocommalist{##1}\@@DriverFieldKids}%
- \def\docommando##1{\appendtocommalist{##1}\@@DriverFieldKids}%
- \processcommalist[#2]\docommando
+ %\def\docommand##1{\addtocommalist{##1}\@@DriverFieldKids}%
+ \def\docommand##1{\appendtocommalist{##1}\@@DriverFieldKids}%
+ \processcommalist[#2]\docommand
\changefield{#1}%
\let\@@DriverFieldAutoParent\@@DriverFieldAuto
\def\@@DriverFieldParent{#1}%
@@ -647,12 +643,12 @@
\let\@@DriverFieldMode\fieldcopymode
\def\@@DriverFieldFree{0}%
\def\@@DriverFieldAuto{0}%
- \def\docommando##1%
+ \def\docommand##1%
{\ifcase\@@DriverFieldAutoParent\else
\setmainfieldkid{\@@DriverFieldParent}{##1}%
\fi
\changefield{##1}}%
- \processcommalist[#2]\docommando
+ \processcommalist[#2]\docommand
\fi
\fi
\else
@@ -753,19 +749,19 @@
\def\dosetupfield[#1][#2][#3][#4][#5]%
{\iffifthargument
- \def\docommando##1{\dodosetupfield[##1][#2][#3][#4][#5]}%
- \processcommalist[#1]\docommando
+ \def\docommand##1{\dodosetupfield[##1][#2][#3][#4][#5]}%
+ \processcommalist[#1]\docommand
\else\ifthirdargument
- \def\docommando##1{\dodosetupfield[##1][#2][][][#3]}%
- \processcommalist[#1]\docommando
+ \def\docommand##1{\dodosetupfield[##1][#2][][][#3]}%
+ \processcommalist[#1]\docommand
\else\ifsecondargument
\doifelse{#2}\v!reset
- {\def\docommando##1{\donosetupfield[#1][][][][]}}
- {\def\docommando##1{\dodosetupfield[##1][][][][#2]}}%
- \processcommalist[#1]\docommando
+ {\def\docommand##1{\donosetupfield[#1][][][][]}}
+ {\def\docommand##1{\dodosetupfield[##1][][][][#2]}}%
+ \processcommalist[#1]\docommand
\else\iffirstargument
- \def\docommando##1{\dodosetupfield[##1][][][][]}%
- \processcommalist[#1]\docommando
+ \def\docommand##1{\dodosetupfield[##1][][][][]}%
+ \processcommalist[#1]\docommand
\else
\writestatus\m!fields{provide either 1, 2, 3 or 5 arguments}%
\fi\fi\fi\fi}
diff --git a/Master/texmf-dist/tex/context/base/core-fnt.tex b/Master/texmf-dist/tex/context/base/core-fnt.tex
index dc6b8153d03..dea5d35713d 100644
--- a/Master/texmf-dist/tex/context/base/core-fnt.tex
+++ b/Master/texmf-dist/tex/context/base/core-fnt.tex
@@ -491,9 +491,9 @@
\def\betweenunderbarwords
{\bgroup
- \setbox0\hbox{\dodounderbar{\hskip\fontdimen2\font}}%
+ \setbox0\hbox{\dodounderbar{\hskip\interwordspace}}%
\nobreak
- \hskip\zeropoint\!!minus\fontdimen4\font
+ \hskip\zeropoint\!!minus\interwordshrink
\discretionary{}{}{\box0}%
\egroup}
@@ -548,9 +548,9 @@
\def\betweenoverstrikewords
{\bgroup
- \setbox0\hbox{\dooverstrike{\hskip\fontdimen2\font}}%
+ \setbox0\hbox{\dooverstrike{\hskip\interwordspace}}%
\nobreak
- \hskip\zeropoint\!!minus\fontdimen4\font
+ \hskip\zeropoint\!!minus\interwordshrink
\discretionary{}{}{\box0}%
\egroup}
@@ -613,10 +613,10 @@
\tx
\fi}
-\def\dohighlow#1#2#3#4#5%
+\def\dohighlow#1#2#3#4#5% todo, named fontdimens
{\dontleavehmode
\bgroup
- \scratchdimen\ifdim\fontdimen5\textfont2=1ex\fontdimen#2\textfont2\else#3ex\fi
+ \scratchdimen\ifdim\fontexheight\textfont2=1ex #2\textfont2\else #3ex\fi
\advance\scratchdimen #4ex
\kern.1ex
\setbox\scratchbox\hbox{#1\scratchdimen\hbox{\dodohighlow#5}}%
@@ -625,14 +625,14 @@
\box\scratchbox
\egroup}
-\unexpanded\def\high{\dohighlow\raise{14}{.86}{0}}
-\unexpanded\def\low {\dohighlow\lower{16}{.48}{0}}
+\unexpanded\def\high{\dohighlow\raise\mathsupnormal{.86}{0}}
+\unexpanded\def\low {\dohighlow\lower\mathsubnormal{.48}{0}}
% \unexpanded\def\lohi#1#2%
% {\dontleavehmode
% \hbox
-% {\setbox4=\hbox{\dohighlow\lower{16}{.48}{.1}{#1}}%
-% \setbox6=\hbox{\dohighlow\raise{14}{.86}{.1}{#2}}%
+% {\setbox4=\hbox{\dohighlow\lower\mathsubnormal{.48}{.1}{#1}}%
+% \setbox6=\hbox{\dohighlow\raise\mathsupnormal{.86}{.1}{#2}}%
% \ifdim\wd4<\wd6
% \wd4=\zeropoint\box4\box6
% \else
@@ -645,8 +645,8 @@
\def\dolohi[#1]#2#3%
{\dontleavehmode
\hbox
- {\setbox4\hbox{\dohighlow\lower{16}{.48}{.1}{#2}}%
- \setbox6\hbox{\dohighlow\raise{14}{.86}{.1}{#3}}%
+ {\setbox4\hbox{\dohighlow\lower\mathsubnormal{.48}{.1}{#2}}%
+ \setbox6\hbox{\dohighlow\raise\mathsupnormal{.86}{.1}{#3}}%
\doif{#1}{\v!left}
{\ifdim\wd4<\wd6
\setbox4\hbox to \wd6{\hss\box4}%
diff --git a/Master/texmf-dist/tex/context/base/core-grd.tex b/Master/texmf-dist/tex/context/base/core-grd.tex
index ec196af1e04..a1167cebc88 100644
--- a/Master/texmf-dist/tex/context/base/core-grd.tex
+++ b/Master/texmf-dist/tex/context/base/core-grd.tex
@@ -625,11 +625,7 @@
\dowithnextbox
{\blank[\v!line]\snaptogrid\vbox{\flushnextbox}\blank[\v!line]}
\vbox\bgroup
- \let\setdisplayskips\relax
- \abovedisplayskip\zeropoint
- \abovedisplayshortskip\zeropoint
- \belowdisplayskip\zeropoint
- \belowdisplayshortskip\zeropoint
+ \forgetdisplayskips
\@EA\let\@EA\next
\fi}
@@ -763,15 +759,19 @@
\fi}
\chardef\gridboxlinenomode\plusone
+\chardef\gridboxlinemode \plusone % 0:nothing 1:all 2:lines 3:frame
+
+\def\gridboxvbox {\ifcase\gridboxlinemode\vbox\or\ruledvbox\or\vbox\or\ruledvbox\else\ruledvbox\fi}
+\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\testrulewidth}
\def\setgridbox#1#2#3%
- {\setbox#1\ruledvbox to #3 % given size
+ {\setbox#1\gridboxvbox to #3 % given size
{\forgetall
\resetteststrut
\offinterlineskip
\hsize#2%
\baselinerulefalse
- \ruledvbox % calculated size
+ \gridboxvbox % calculated size
{\getrawnoflines{#3}% \getnoflines{#3}%
\vskip\topskip
\vskip-\strutht
@@ -789,9 +789,9 @@
\hskip.2\bodyfontsize}%
\fi
\vrule
- \!!height .5\testrulewidth
- \!!depth .5\testrulewidth
- \!!width \scratchdimen
+ \!!height \gridboxwidth
+ \!!depth \gridboxwidth
+ \!!width \scratchdimen
\par}}
\vfill}}
@@ -867,41 +867,15 @@
%D after={\blank[halfline]}]
%D \stoptyping
-\newif\iffuzzysnapdone
-\newif\iffuzzysnapping
-\newif\iffuzzysnapped
-
-\chardef\fuzzysnappedleft=0 % ==1 when fuzzybegin still open
-
+\newif \iffuzzyvskip
+\newif \iffuzzysnapdone
+\newif \iffuzzysnapping
+\newif \iffuzzysnapped
+\chardef \fuzzysnappedleft=0 % ==1 when fuzzybegin still open
\newpersistentmark\fuzzymark % (!)
-\newcount\fuzzymarker
-\newbox\fuzzysnapbox
-\newbox\fuzzysnapsplit
-
-%\def\dosyncfuzzyvskip
-% {\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint
-% \bgroup
-% \endgraf
-% \forgetall
-% \verticalstrut
-% \kern-\struttotal
-% \kern-\lineheight
-% \nobreak
-% \vskip\lineheight
-% \egroup
-% \fi\fi\fi}
-
-%\def\fuzzyvskip#1%
-% {\iffuzzysnapdone
-% \endfuzzysnapping
-% \vskip#1\relax
-% \dosyncfuzzyvskip % NEW
-% \global\fuzzysnapdonefalse
-% \else
-% \vskip#1\relax
-% \beginfuzzysnapping
-% \global\fuzzysnapdonetrue
-% \fi}
+\newcount \fuzzymarker
+\newbox \fuzzysnapbox
+\newbox \fuzzysnapsplit
\def\dosyncfuzzyvskip
{\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint
diff --git a/Master/texmf-dist/tex/context/base/core-hlp.tex b/Master/texmf-dist/tex/context/base/core-hlp.tex
index a5653f88f74..46b469b68dd 100644
--- a/Master/texmf-dist/tex/context/base/core-hlp.tex
+++ b/Master/texmf-dist/tex/context/base/core-hlp.tex
@@ -81,11 +81,7 @@
\def\dosetpagehelpdata#1%
{\doglobal\increment\nofhelpdataentries
- \writeutilitycommand
- {\twopassentry%
- {hlp:\realfolio}%
- {\nofhelpdataentries}%
- {#1}}}
+ \savetwopassdata{hlp:\realfolio}{\nofhelpdataentries}{#1}}
\setvalue{\e!start\v!helptext}[#1]%
{\iflocation
diff --git a/Master/texmf-dist/tex/context/base/core-int.tex b/Master/texmf-dist/tex/context/base/core-int.tex
index b4bcd4c5f86..428df8e0805 100644
--- a/Master/texmf-dist/tex/context/base/core-int.tex
+++ b/Master/texmf-dist/tex/context/base/core-int.tex
@@ -202,13 +202,7 @@
\else
\edef\nextlink {0\getvalue{\s!link:#1:l}}%
\fi
- \edef\writelink
- {\writeutilitycommand
- {\twopassentry
- {\s!link:#1}%
- {\numberoflinks}%
- {\noexpand\realfolio}}}%
- \writelink
+ \lazysavetwopassdata{\s!link:#1}{\numberoflinks}{\noexpand\realfolio}%
\ifnum\noflinks<2
\locationfalse
\fi
@@ -264,13 +258,7 @@
{0\iftwopassdatafound\twopassdata\else\lastlink\fi}%
\setxvalue{\s!link:#1:}%
{\firstlink:\lastlink:\noflinks:\currentlink:\nextlink}%
- \edef\writelink
- {\writeutilitycommand
- {\twopassentry
- {\s!link:#1}%
- {\numberoflinks}%
- {\noexpand\realfolio}}}%
- \writelink
+ \lazysavetwopassdata{\s!link:#1}{\numberoflinks}{\noexpand\realfolio}%
\ifnum\noflinks<2
\locationfalse
\fi
@@ -421,8 +409,8 @@
\showmessage\m!interactions1{\withoutpt\the\!!widtha,\withoutpt\the\!!heighta}}%
% needs to be split: dimensions for each page
% and mode per document and only once !
- \dosetupscreen \rugoffset\kopoffset\!!widtha\!!heighta{\the\!!counte}%
- \dosetupcropbox\rugoffset\kopoffset\!!widtha\!!heighta
+ \dosetupscreen \backoffset\topoffset\!!widtha\!!heighta{\the\!!counte}%
+ \dosetupcropbox\backoffset\topoffset\!!widtha\!!heighta
\egroup}
\def\dosetupinteractionscreen[#1]%
@@ -528,12 +516,12 @@
\def\doprocessbookmarks[#1]#2%
{\let\dolistelement#2\relax
\scratchcounter\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\advance\scratchcounter \plusone
\getlistlevel[##1]\listlevel{\the\scratchcounter}%
\setxvalue{\@@bookcount\the\scratchcounter}{1}%
\setxvalue{\@@booklevel##1}{\listlevel}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\setxvalue{\@@bookcount0}{1}%
\global\chardef\currentbookmarklevel\zerocount
\global\chardef\previousbookmarklevel\zerocount
@@ -572,9 +560,9 @@
\global\chardef\previousbookmarklevel\currentbookmarklevel}
\def\getbookmarklevelcount
- {\@EA\def\@EA\docommando\@EA[\@EA##\@EA1\@EA/\bookmarktag:##2/##3]%
+ {\@EA\def\@EA\docommand\@EA[\@EA##\@EA1\@EA/\bookmarktag:##2/##3]%
{\def\bookmarklevelcount{##2}}%
- \@EA\@EA\@EA\docommando\@EA\@EA\@EA[\@EA\bookmarklevellist\@EA/\bookmarktag:0/]}
+ \@EA\@EA\@EA\docommand\@EA\@EA\@EA[\@EA\bookmarklevellist\@EA/\bookmarktag:0/]}
\def\dodoputbookmarkelement#1#2#3#4#5#6%
{\doifelsenothing{#1}
@@ -666,9 +654,8 @@
{\doifelse{#3}{}
{\letvalue{\??am##1\c!obstruction}\empty}
{\edef\interactieblokkade{\getvalue{\??am##1\c!obstruction}}
- \def\docommando####1%
- {#1{####1}{\interactieblokkade}}% #1 = \remove or \add
- \processcommalist[#3]\docommando
+ \def\docommand####1{#1{####1}{\interactieblokkade}}% #1 = \remove or \add
+ \processcommalist[#3]\docommand
\setevalue{\??am##1\c!obstruction}{\interactieblokkade}}}%
\processcommalist[#2]\dododisableinteractionmenu}
@@ -1004,7 +991,7 @@
{\ifdim#2>\zeropoint % new
\dimen2\zeropoint
\setbox0\hbox
- {\def\docommando##1%
+ {\def\docommand##1%
{\doifnotvalue{\??am##1\c!state}\v!none
{\hskip\dimen2
\setbox2\hbox to #2
@@ -1015,7 +1002,7 @@
{\dimen2=\getvalue{\??am##1\c!distance}}%
\box2}}%
\startinteraction
- \processcommacommand[\getvalue{\??am#1}]\docommando
+ \processcommacommand[\getvalue{\??am#1}]\docommand
\stopinteraction}%
\wd0=#2\relax
\box0\relax
@@ -1025,7 +1012,7 @@
{\ifdim#2>\zeropoint % new
\dimen2\zeropoint
\setbox0\vbox
- {\def\docommando##1%
+ {\def\docommand##1%
{\doifnotvalue{\??am##1\c!state}\v!none
{\vskip\dimen2
\setbox2\vbox to #2
@@ -1038,7 +1025,7 @@
{\dimen2=\getvalue{\??am##1\c!distance}}%
\box2}}%
\startinteraction
- \processcommacommand[\getvalue{\??am#1}]\docommando
+ \processcommacommand[\getvalue{\??am#1}]\docommand
\stopinteraction}%
\ht0=#2\relax
\dp0\zeropoint
@@ -1124,7 +1111,7 @@
\fi
\egroup}
-\unprotected\def\includemenu[#1]%
+\def\includemenu[#1]%
{\doifvalue{\??am#1\c!state}\v!local
{\bgroup
\letvalue{\??am#1\c!state}\v!start
@@ -1194,8 +1181,8 @@
{\extendedmenufalse\dointeractionmenu{#1}{#2}}}
\def\dodosetupinteractionmenu[#1][#2]%
- {\def\docommando##1{\getparameters[\??am##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??am##1][#2]}%
+ \processcommalist[#1]\docommand}
\setvalue{\??am\??am\v!yes }{0}
\setvalue{\??am\??am\v!empty}{1}
@@ -1866,14 +1853,10 @@
\def\dofollowprofile#1[#2]%
{\iflocation
\hbox
- {\dostartgoto
- \data
- {\dolocationattributes\??ia\c!style\c!color{#1\presetgoto}}%
- \start
- \dostartgotoprofile\buttonwidth\buttonheight{#2}%
- \stop
- \dostopgotoprofile
- \dostopgoto}%
+ {\dohandlegoto
+ {\dolocationattributes\??ia\c!style\c!color{#1\presetgoto}}%
+ {\dostartgotoprofile\buttonwidth\buttonheight{#2}}%
+ {\dostopgotoprofile}}%
\else
{#1}%
\fi}
@@ -1900,24 +1883,20 @@
% het begin (start) en een voor het eind (stop). Nu staat
% alles in een lijst.
-\definetwopasslist{\s!profile}
+\definetwopasslist\s!profile
\newcounter\currentprofile
\def\dosetprofilepage%
{\doglobal\increment\currentprofile
- \edef\docommando%
- {\writeutilitycommand%
- {\twopassentry%
- {\s!profile}%
- {\currentprofile}%
- {\noexpand\realfolio}}}%
- \docommando}
+ \lazysavetwopassdata{\s!profile}{\currentprofile}{\noexpand\realfolio}}
\def\dogetprofilepage%
{\gettwopassdata{\s!profile}%
\let\profilepage=\twopassdata}
+% is this stuff used at all
+
\newcounter\versionlevel
\newcounter\versionorder
@@ -1930,37 +1909,24 @@
\def\dosetupversions[#1]%
{\getparameters[\??ve][#1]
- \stripcharacter.\from\@@venumber\to\minimumversion
- \setversion}
+ \stripcharacter.\from\@@venumber\to\minimumversion}
-\def\setupversions%
+\def\setupversions
{\dosingleargument\dosetupversions}
-\definetwopasslist{\s!versionbegin}
-\definetwopasslist{\s!versionend}
+\definetwopasslist\s!versionbegin
+\definetwopasslist\s!versionend
-\def\actualprofile{}
+\let\actualprofile\empty
-\def\doresetpageversion%
- {\edef\docommando%
- {\writeutilitycommand%
- {\twopassentry%
- {\s!versionend}%
- {\versionorder}%
- {\noexpand\realfolio}}}%
- \docommando}
+\def\doresetpageversion
+ {\lazysavetwopassdata{\s!versionend}{\versionorder}{\noexpand\realfolio}}
\def\dosetpageversion#1%
{\recentversiontrue
\doglobal\increment\versionorder\relax
- \edef\docommando%
- {\writeutilitycommand%
- {\twopassentry%
- {\s!versionbegin}%
- {\versionorder}%
- {\noexpand\realfolio}}}%
- \docommando
- \let\resetpageversion=\doresetpageversion}
+ \lazysavetwopassdata{\s!versionbegin}{\versionorder}{\noexpand\realfolio}%
+ \let\resetpageversion\doresetpageversion}
\def\recentcontributions{}
@@ -1972,18 +1938,10 @@
\iftwopassdatafound
\!!countb\twopassdata\relax
\doglobal\increment\versionorder\relax
- \writeutilitycommand%
- {\twopassentry%
- {\s!versionbegin}%
- {\versionorder}%
- {\the\!!counta}}%
- \writeutilitycommand%
- {\twopassentry%
- {\s!versionend}%
- {\versionorder}%
- {\the\!!countb}}%
- \for\teller=\!!counta\to\!!countb\step1\do%
- {\@EA\doglobal\@EA\addtocommalist\@EA{\teller}{\recentcontributions}}%
+ \savetwopassdata{\s!versionbegin}{\versionorder}{\the\!!counta}%
+ \savetwopassdata{\s!versionend }{\versionorder}{\the\!!countb}%
+ \dostepwiserecurse\!!counta\!!countb\plusone
+ {\@EA\doglobal\@EA\addtocommalist\@EA{\recurselevel}{\recentcontributions}}%
\let\next\checkrecentcontributions
\else
\let\next\relax
@@ -1993,14 +1951,14 @@
\fi
\next}
-\def\docheckpageversion%
+\def\docheckpageversion
{\ExpandBothAfter\doifinsetelse{\realfolio}{\recentcontributions}
- {\geselecteerdtrue}%
- {\geselecteerdfalse}}
+ {\pageselectedtrue}%
+ {\pageselectedfalse}}
-\let\setpageversion = \gobbleoneargument
-\let\resetpageversion = \relax
-\let\checkpageversion = \relax
+\let\setpageversion \gobbleoneargument
+\let\resetpageversion \relax
+\let\checkpageversion \relax
\def\complexstartversion[#1]%
{\bgroup
@@ -2027,7 +1985,7 @@
\definecomplexorsimpleempty\startversion
-\def\stopversion%
+\def\stopversion
{\stopprofile
\doglobal\decrement\versionlevel
\ifnum\versionlevel<\zerocount
@@ -2037,20 +1995,6 @@
\egroup
\fi}
-\bgroup
-\catcode`@=\active
-\gdef\setversion%
- {\catcode`@=\active % we can't use \@@active here
- \long\def@##1##2 %
- {\ifx##1+%
- \startversion[##2]%
- \else\ifx##1-%
- \stopversion
- \else
- \oldatcharacter##1##2 %
- \fi\fi}}
-\egroup
-
\def\markversion
{\showmessage\m!versions2\empty
\let\setpageversion\dosetpageversion
@@ -2062,8 +2006,7 @@
\showmessage\m!versions3\recentcontributions
\let\setpageversio\gobbleoneargument
\let\resetpageversion\relax
- \let\checkpageversion\docheckpageversion
- \setversion}
+ \let\checkpageversion\docheckpageversion}
\def\dodefineversion[#1][#2]%
{\setvalue{\c!versie!!#1}{#2}%
@@ -2076,9 +2019,9 @@
{\followprofile}
\def\followprofileversion#1[#2][#3]%
- {\def\docommando##1%
+ {\def\docommand##1%
{\defineprofile[#2#3][##1]}%
- \processcommacommand[\getvalue{\c!versie!!#3}]\docommando
+ \processcommacommand[\getvalue{\c!versie!!#3}]\docommand
\followprofile#1[#2#3]}
\newcounter\currentpagetransition
@@ -2239,16 +2182,16 @@
{\bgroup
\doifelse\@@ccstate\v!start
{\dopreparecommentaar{#1}{#2}%
- \long\def\docommando##1%
+ \long\def\docommand##1%
{\global\setbox\commentbox\frozenhbox
{\hbox to \zeropoint
{\struttedbox{\tbox{\dodocomment{##1}}}\hss}%
\hskip\ifvoid\commentbox\@@ccmargin\else\@@ccdistance\fi
\box\commentbox}%
\egroup}}%
- {\long\def\docommando##1%
+ {\long\def\docommand##1%
{\egroup}}%
- \grabuntil{\e!stop\v!comment}\docommando}
+ \grabuntil{\e!stop\v!comment}\docommand}
\letvalue{\e!stop\v!comment}\relax % handy for \expanded{...}
@@ -2411,16 +2354,16 @@
\ifsecondargument
\setupinteractionmenu
[#1][\c!unknownreference=\v!yes,\c!samepage=\v!yes]%
- \def\docommando##1%
+ \def\docommand##1%
{\registermenucommand{\menubutton[#1]{##1}[#2:##1]}}%
\else
- \def\docommando##1%
+ \def\docommand##1%
{\registermenucommand
{\button
[\c!unknownreference=\v!yes,\c!samepage=\v!yes]
{##1}[#1:##1]}}%
\fi
- \handletokens abcdefghijklmnopqrstuvwxyz\with\docommando % moet anders
+ \handletokens abcdefghijklmnopqrstuvwxyz\with\docommand % moet anders
\egroup}
\def\registermenubuttons
diff --git a/Master/texmf-dist/tex/context/base/core-itm.tex b/Master/texmf-dist/tex/context/base/core-itm.tex
index d495011f1b2..364501f23a3 100644
--- a/Master/texmf-dist/tex/context/base/core-itm.tex
+++ b/Master/texmf-dist/tex/context/base/core-itm.tex
@@ -108,11 +108,7 @@
\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
\def\dolistreference
- {\immediatewriteutilitycommand
- {\twopassentry
- {\s!list}%
- {\currentlist}%
- {\currentlist:\noflistelements}}}
+ {\savetaggedtwopassdata{\s!list}{\currentlist}{\currentlist}{\noflistelements}}
\def\initializeitemgroupslevel#1%
{\ifundefined{\@@globalitemsymbol{#1}}%
@@ -258,8 +254,8 @@
\popmacro\currentitemgroup}
\def\dosetupitemgroup[#1][#2][#3][#4]%
- {\def\docommando##1{\dodosetupitemgroup[##1][#2][#3][#4]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\dodosetupitemgroup[##1][#2][#3][#4]}%
+ \processcommalist[#1]\docommand}
\def\setupitemgroup
{\doquadrupleempty\dosetupitemgroup}
@@ -289,13 +285,13 @@
\def\unknownitemsymbol{?}
-\def\setitemmark#1% % en pas op: resets \docommando
+\def\setitemmark#1% % en pas op: resets \docommand
{\doifsymboldefinedelse{#1}
{\edef\currentitemsymbol{#1}%
\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
\setgvalue{\@@localitemsymbol \itemlevel}{\unknownitemsymbol}%
\def\listitem{\symbol[\currentitemsymbol]}%
- \let\@@opsymbol\empty}% \let\docommando\gobbleoneargument}
+ \let\@@opsymbol\empty}% \let\docommand\gobbleoneargument}
{\doifconversiondefinedelse{#1}
{\edef\currentitemsymbol{#1}%
\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
@@ -311,7 +307,7 @@
\getvalue{\@@localitemsymbol\itemlevel}\tempsymbol
\getitemparameter\itemlevel
{\ifconditional\textlistitem\c!righttext\else\c!right\fi}}%
- \let\@@opsymbol\empty}%\let\docommando\gobbleoneargument}
+ \let\@@opsymbol\empty}%\let\docommand\gobbleoneargument}
{}}}
\def\calculatelistwidth#1#2% distance deals with 'broad'
@@ -366,6 +362,66 @@
\let\startcollectitems\relax
\let\stopcollectitems \relax
+%D A nice example of a plugin:
+%D
+%D \startbuffer
+%D \startitemize[a,random,packed]
+%D \startitem first \stopitem \startitem second \stopitem
+%D \startitem third \stopitem \startitem fourth \stopitem
+%D \stopitemize
+%D
+%D \startitemize[a,random,packed]
+%D \startitem first \stopitem \startitem second \stopitem
+%D \startitem third \stopitem \startitem fourth \stopitem
+%D \stopitemize
+%D
+%D \startitemize[a,packed]
+%D \startitem first \stopitem \startitem second \stopitem
+%D \startitem third \stopitem \startitem fourth \stopitem
+%D \stopitemize
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+% better collectitems als conditional and a real plugin mechanism (some day)
+
+\@EA\long\@EA\def\@EA\collectitemgroupitem\@EA#\@EA1\csname\e!stop\v!item\endcsname
+ {\increment\itemcollectcounter
+ \long\setvalue{\v!item*\itemcollectcounter}{\item#1\par}}
+
+\def\flushcollecteditems
+ {\ifconditional\randomizeitems
+ \getrandomnumber\itemcollectcounternow\plusone\itemcollectcounter
+ \else
+ \increment\itemcollectcounternow
+ \fi
+ \doifdefined{\v!item*\itemcollectcounternow}
+ {\getvalue{\v!item*\itemcollectcounternow}%
+ \letbeundefined{\v!item*\itemcollectcounternow}%
+ \increment\itemcollectcounterdone}%
+ \ifnum\itemcollectcounterdone<\itemcollectcounter\relax
+ \expandafter\flushcollecteditems
+ \fi}
+
+\def\stopcollectitems
+ {\ifconditional\randomizeitems
+ \newcounter\itemcollectcounterdone
+ \ifnum\itemcollectcounter>\zerocount
+ \@EAEAEA\flushcollecteditems
+ \fi
+ \fi}
+
+\def\startcollectitems
+ {\ifconditional\randomizeitems
+ \newcounter\itemcollectcounter
+ \letvalue{\e!start\v!item}\collectitemgroupitem
+ \fi}
+
+%D End of plugin.
+
+\ifx\startcolumns\undefined \def\startcolumns[#1]{} \fi
+\ifx\stopcolumns \undefined \let\stopcolumns\relax \fi
+
\def\redostartitemgroup[#1][#2]%
{\setfalse\inlinelistitem % new, no indent (leftskip)
\setfalse\concatnextitem % new, concat
@@ -409,10 +465,10 @@
\global\setitemparameter\itemlevel\v!continue
{\dosetupitemgroupconstant[\itemlevel][#1]%
\dosetupitemgroupvariable[\itemlevel][#2]}}%
- \def\docommando##1% \setitemmark resets \docommando
+ \def\docommand##1% \setitemmark resets \docommand
{\doifnot{##1}{0}{\setitemmark{##1}}}%
- % \processcommalist[#1,\@@opsymbol]\docommando
- \processcommalist[#1]\docommando}% ** preset sequence or provided sequence
+ % \processcommalist[#1,\@@opsymbol]\docommand
+ \processcommalist[#1]\docommand}% ** preset sequence or provided sequence
% moved to here, after settings
\ifnum\itemlevel=\plusone % NIEUW
\doadaptleftskip {\getitemparameter1\c!margin}%
@@ -565,6 +621,7 @@
\itemgroupitem}
\appendtoks \let\item \itemgroupitem \to \itemgroupcommands
+%appendtoks \letvalue\v!item \itemgroupitem \to \itemgroupcommands
\appendtoks \let\itm \itemgroupitem \to \itemgroupcommands
\appendtoks \let\but \itemgroupbutton \to \itemgroupcommands
\appendtoks \let\nop \itemgroupdummy \to \itemgroupcommands
@@ -577,18 +634,14 @@
% todo : \startitem .. \stopitem
-% quick hack ...
-
-\def\v!item{item}
-
\appendtoks
- \letvalue{\e!start\v!item}\itemgroupitem
- \letvalue{\e!stop \v!item}\endgraf
+ \letvalue{\e!start\v!item}\itemgroupitem
+ \letvalue{\e!stop \v!item}\endgraf
\to \itemgroupcommands
\appendtoks
- \setvalue{\e!start\v!head}#1{\itemgrouphead#1\par}%
- \letvalue{\e!stop \v!head}\endgraf
+ \setvalue{\e!start\v!head}#1{\itemgrouphead#1\par}%
+ \letvalue{\e!stop \v!head}\endgraf
\to \itemgroupcommands
% \startitemize
@@ -659,9 +712,9 @@
% \ignorespaces
\increment\noflistelements
\ifnum\itemcolumndepth=\zerocount \ifconditional\optimizelistitem
- \ifnum\noflistelements=\plusone % tgv bv kolommen/nesting
- \findtwopassdata\s!list{\noflists:}% % wordt soms de volgorde
- \fi % verstoord, vandaar \find
+ \ifnum\noflistelements=\plusone % tgv bv kolommen/nesting
+ \findtwopassdata\s!list{\noflists}% % wordt soms de volgorde
+ \fi % verstoord, vandaar \find
\iftwopassdatafound
\ifcase0\twopassdata\relax \twopassdatafoundfalse \fi
\fi
@@ -720,7 +773,7 @@
\calculatelistwidth\itemlevel{\dimen0}%
\fi
\ifconditional\textlistitem
- \hbox{\ifconditional\sublistitem+\fi\box8\hskip\fontdimen2\font}\nobreak
+ \hbox{\ifconditional\sublistitem+\fi\box8\hskip\interwordspace}\nobreak
\else\ifconditional\inlinelistitem
\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}%
\else\ifconditional\txtlistitem
@@ -828,7 +881,12 @@
\fi
\fi
\else
+\ifconditional\inlinelistitem
+% \removeunwantedspaces\hskip\interwordspace\!!plus\emwidth\relax % new per 2006/10/20
+ \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20
+\else
\getitemparameter\itemlevel\c!inbetween
+\fi
\fi
\ifconditional\concatnextitem % new, concat
\vskip-\lastskip % new, concat
@@ -852,6 +910,7 @@
\egroup}}%
\strut % added 11-08-99
\setfalse\concatnextitem % new, concat
+ \nobreak % else problems with intext items
\hskip\itemsignal % new, concat
\getitemparameter\itemlevel\c!command} % \defaultitemcommand
diff --git a/Master/texmf-dist/tex/context/base/core-job.tex b/Master/texmf-dist/tex/context/base/core-job.tex
index 03d91f5a45e..d1b766392a5 100644
--- a/Master/texmf-dist/tex/context/base/core-job.tex
+++ b/Master/texmf-dist/tex/context/base/core-job.tex
@@ -60,12 +60,12 @@
\def\next{\processlocalfile\readlocfile}%
\else
\let\filepath\empty
- \def\docommando##1%
+ \def\docommand##1%
{\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\filepath{##1}}\donefalse
\ifdone\expandafter\quitcommalist\fi}%
\doifparentfileelse{#1} % new
- {\processcommacommand [\allinputpaths]\docommando}
- {\processcommacommand[.,\allinputpaths]\docommando}%
+ {\processcommacommand [\allinputpaths]\docommand}
+ {\processcommacommand[.,\allinputpaths]\docommand}%
\ifx\filepath\empty
\def\next{\processlocalfile\readlocfile}% fall back ../../..
\else
@@ -79,10 +79,10 @@
\@EA\secondoftwoarguments
\else
\let\filepath\empty
- \def\docommando##1%
+ \def\docommand##1%
{\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\filepath{##1}}\donefalse
\ifdone\expandafter\quitcommalist\fi}%
- \processcommacommand[.,\allinputpaths]\docommando
+ \processcommacommand[.,\allinputpaths]\docommand
\ifx\filepath\empty
\@EAEAEA\secondoftwoarguments
\else
@@ -93,67 +93,53 @@
\let\allinputpaths\empty
% \def\usepath[#1]%
-% {\def\docommando##1%
+% {\def\docommand##1%
% {\doifelse{##1}\v!reset
% {\let\allinputpaths\empty}
% {\addtocommalist{##1}\allinputpaths}}%
-% \processcommalist[#1]\docommando}
+% \processcommalist[#1]\docommand}
%
% \def\usesubpath[#1]% new, see webschrift for usage
% {\ifx\allinputpaths\empty
% \edef\allinputpaths{#1}%
% \else
-% \def\docommando##1%
-% {\def\dodocommando####1{\addtocommalist{##1/####1}\allinputpaths}%
-% \processcommalist[#1]\dodocommando}%
-% \processcommacommand[\allinputpaths]\docommando
+% \def\docommand##1%
+% {\def\dodocommand####1{\addtocommalist{##1/####1}\allinputpaths}%
+% \processcommalist[#1]\dodocommand}%
+% \processcommacommand[\allinputpaths]\docommand
% \fi}
%
% the following alternatives permit ../{name} i.e. braces
\def\usepath[#1]%
- {\def\docommando##1%
+ {\def\docommand##1%
{\doifelse{##1}\v!reset
{\let\allinputpaths\empty}
{\sanitizefilename#1\to\ascii
\convertcommand\ascii\to\ascii
\addtocommalist\ascii\allinputpaths}}%
- \processcommalist[#1]\docommando}
+ \processcommalist[#1]\docommand}
\def\usesubpath[#1]% test for a real long time, permits ../{name} i.e. braces
{\ifx\allinputpaths\empty
\sanitizefilename#1\to\allinputpaths
\else
- \def\docommando##1%
- {\def\dodocommando####1%
+ \def\docommand##1%
+ {\def\dodocommand####1%
{\sanitizefilename####1\to\ascii
\convertcommand\ascii\to\ascii
\addtocommalist{##1/\ascii}\allinputpaths}%
- \processcommalist[#1]\dodocommando}%
- \processcommacommand[\allinputpaths]\docommando
+ \processcommalist[#1]\dodocommand}%
+ \processcommacommand[\allinputpaths]\docommand
\fi}
\def\registerfileinfo[#1#2]#3% geen \showmessage ?
{\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}%
- % \pdfliteral{\letterpercent #1#2 file #3 at line \the\inputlineno}%
\immediatewriteutility{f #1 {#3}}}
\ifx\preloadfonts \undefined \let\preloadfonts \relax \fi
\ifx\preloadspecials\undefined \let\preloadspecials\relax \fi
-% \def\loadsystemfiles
-% {\reportprotectionstate
-% \readsysfile\f!newfilename
-% {\showmessage\m!systems2\f!newfilename}\donothing
-% \readsysfile\f!oldfilename
-% {\showmessage\m!systems2\f!oldfilename}\donothing
-% \readsysfile\f!filfilename
-% {\showmessage\m!systems2\f!filfilename}\donothing
-% \readsysfile\f!sysfilename
-% {\showmessage\m!systems2\f!sysfilename}\donothing}
-%
-% test \@@svgebied
-
\def\loadallsystemfiles#1#2%
{\ifx\@@svdirectory\empty
\readsysfile{#1}{\showmessage\m!systems2{#1}}{#2}%
@@ -167,46 +153,28 @@
\def\loadsystemfiles
{\reportprotectionstate
- \readsysfile\f!newfilename
- {\showmessage\m!systems2\f!newfilename}%
- \donothing
- \readsysfile\f!oldfilename
- {\showmessage\m!systems2\f!oldfilename}%
- \donothing
+ \readsysfile\f!newfilename{\showmessage\m!systems2\f!newfilename}\donothing
+ \readsysfile\f!oldfilename{\showmessage\m!systems2\f!oldfilename}\donothing
\loadallsystemfiles\f!filfilename
\donothing
\loadallsystemfiles\f!sysfilename
{\loadallsystemfiles{\f!sysfilename.rme}\donothing % new, fall back
- \doglobal\appendtoks
- \bgroup
- \disableXML
- \loadallsystemfiles\f!errfilename\donothing
- \egroup
+ \doglobal\appendtoks % brrr better \setcatcodetable\ctxcatcodes % % test
+ \bgroup\disableXML\loadallsystemfiles\f!errfilename\donothing\egroup
\to\everygoodbye}}
- %\loadallsystemfiles\f!modfilename
- % \donothing}
-
%D Loading of \type {cont-usr.tex} (edited by the user)
%D and \type {cont-fmt.tex} (generated by texexec).
\def\loaduserspecifications
- {\readsysfile\f!usrfilename
- {\showmessage\m!systems2\f!usrfilename}\donothing
- \readjobfile\f!fmtfilename
- {\showmessage\m!systems2\f!fmtfilename}\donothing}
+ {\readsysfile\f!usrfilename{\showmessage\m!systems2\f!usrfilename}\donothing
+ \readjobfile\f!fmtfilename{\showmessage\m!systems2\f!fmtfilename}\donothing}
%D We don't want multiple jobfiles to interfere.
-\bgroup
-\catcode`\%=\@@other
-\xdef\texcommentsymbol{%}
-\egroup
-
\def\loadoptionfile
{\readjobfile{\jobname.\f!optionextension}
{\showmessage\m!systems2{\jobname.\f!optionextension}}%
- %{\showmessage\m!systems2{\jobname.\f!optionextension}}}
{\writestatus\m!systems {no \jobname.\f!optionextension}}}
% \newevery \everyjob \EveryJob
@@ -273,8 +241,6 @@
\expandafter\finalend
\fi}
-\let\normalend\end
-
\def\finalend
{\ifnum\textlevel>\zerocount \else
\the\everybye
@@ -312,19 +278,18 @@
{\doexecutefile{#1}}
\def\useenvironment[#1]% maybe commalist
- {\environment #1 }
+ {\environment #1 \relax}
-\def\environment #1 % at outermost level only
- {\def\startenvironment ##1 {}%
+\def\environment #1 % at outermost level only (load only once)
+ {\pushmacro\startenvironment
+ \pushmacro\stopenvironment
+ \def\startenvironment ##1 {}%
\let\stopenvironment\relax
- % why not \doexecutefile ?
- \registerfileinfo[begin]{#1}%
- \dostarttextfile{#1}%
\startreadingfile
- \processfile{#1}% was : \readlocfile{#1}{}{}
+ \doexecutefileonce{#1}
\stopreadingfile
- \dostoptextfile
- \registerfileinfo[end]{#1}}
+ \popmacro\stopenvironment
+ \popmacro\startenvironment}
\def\component #1 % at outermost level only
{\dostarttextfile{#1}%
@@ -447,10 +412,10 @@
\setvalue{\e!start\v!localenvironment}[#1]%
{\let\loadedlocalenvironments\empty
- \def\docommando##1%
+ \def\docommand##1%
{\beforesplitstring##1\at.\to\someevironment
\fullexpandoneargafter\addtocommalist\someevironment\loadedlocalenvironments}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\fullexpandtwoargsafter\doifcommonelse % no longer next needed
{\currentproject,\currentproduct,%
\currentcomponent,\currentenvironment}
@@ -460,10 +425,6 @@
\setvalue{\v!localenvironment}#1 {\doexecutefileonce{#1}}
-% Het <pagina>-karakter (FormFeed), wordt omgezet in \par
-
-\catcode`\^^L=\@@endofline
-
% NOT TOEVOEGEN: \the\everytrace
\neverypar=\emptytoks
@@ -478,10 +439,6 @@
% \appendtoks \flushnotes \to \everydisplay
% \appendtoks \adjustsidefloatdisplaylines \to \everydisplay
-
-%D Better here than in supp-mps:
-
-\def\executesystemcommand{\immediate\write18}
% soon, when pdftex 1.22 is out in the field:
diff --git a/Master/texmf-dist/tex/context/base/core-lme.tex b/Master/texmf-dist/tex/context/base/core-lme.tex
new file mode 100644
index 00000000000..d8c99d8c781
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-lme.tex
@@ -0,0 +1,55 @@
+%D \module
+%D [ file=core-lme,
+%D version=2006.08.14,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=LAst Minute Extensions,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Core Macros / Last Minute Extensions}
+
+%D Things that depend on too much other things.
+
+\unprotect
+
+%D Probably obsolete, depends on \type {\checksidefloat}. May disappear.
+
+\def\checkframedtext
+ {\ifinsidefloat
+ \localhsize\hsize
+ \else\ifdim\sidefloatvsize>\zeropoint % will be proper handle
+ % \strut % rather clean way to invoke the sidefloat OTR
+ % \setbox0=\lastbox % and get the widths set, so from now on we
+ % \setlocalhsize % can have framed texts alongside sidefloats
+ \checksidefloat
+ \setlocalhsize
+ \else
+ \localhsize\hsize
+ \fi\fi}
+
+%D For my eyes only:
+
+\newcount\nofprofiled
+
+\def\profilemacro#1%
+ {\nofprofiled\zerocount
+ \letvalue{\string#1\string#1}#1%
+ \appendtoks
+ \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}%
+ \to \everystoptext
+ \unexpanded\def#1%
+ {\global\advance\nofprofiled\plusone
+ \csname\string#1\string#1\endcsname}}
+
+%D Some plain goodies, they may be moved to \type {m-plain.tex} some day.
+
+\ifx\hang \undefined \def\hang {\hangindent\parindent} \fi
+\ifx\textindent\undefined \def\textindent#1{\indent\llap{#1\enspace}\ignorespaces} \fi
+\ifx\narrower \undefined \def\narrower {\advance\leftskip \parindent\advance\rightskip\parindent} \fi
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-lnt.tex b/Master/texmf-dist/tex/context/base/core-lnt.tex
index b19019bb825..29e8a97f066 100644
--- a/Master/texmf-dist/tex/context/base/core-lnt.tex
+++ b/Master/texmf-dist/tex/context/base/core-lnt.tex
@@ -50,7 +50,7 @@
\hsize\zeropoint
\hss
\vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
- {\blue\vl}%
+ {\color[blue]{\vl}}%
\vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
\hss}%
\prewordbreak
diff --git a/Master/texmf-dist/tex/context/base/core-lst.tex b/Master/texmf-dist/tex/context/base/core-lst.tex
index 8029d4fe15b..359e9b8ceb5 100644
--- a/Master/texmf-dist/tex/context/base/core-lst.tex
+++ b/Master/texmf-dist/tex/context/base/core-lst.tex
@@ -1118,9 +1118,9 @@
\def\showremaininglistlength
{\bgroup
\ifnum\listlengthcounter>\plusone
- \scratchdimen\pagetotal
\setbox\scratchbox\vbox
{\@@llbefore\par\horizontalstrut\par\horizontalstrut\par\@@llafter}%
+ \scratchdimen\pagetotal
\advance\scratchdimen \ht\scratchbox
\advance\scratchdimen \dp\scratchbox
\ifdim\scratchdimen>\pagegoal
diff --git a/Master/texmf-dist/tex/context/base/core-ltb.tex b/Master/texmf-dist/tex/context/base/core-ltb.tex
index 209f5434e81..74ae342101d 100644
--- a/Master/texmf-dist/tex/context/base/core-ltb.tex
+++ b/Master/texmf-dist/tex/context/base/core-ltb.tex
@@ -472,11 +472,11 @@
\globallet\noflinetablecolumns\!!zerocount
\globallet\noflinetableparts\!!zerocount
\!!counta\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\doglobal\increment\noflinetableparts
\advance\!!counta##1%
\setxvalue{\??le::\noflinetableparts}{\the\!!counta}}%
- \processcommacommand[\linetableparameter\c!n]\docommando
+ \processcommacommand[\linetableparameter\c!n]\docommand
\initializetableboxes\noflinetableparts
\ifcase\linetablerepeat
\globallet\linetablepart\!!plusone
diff --git a/Master/texmf-dist/tex/context/base/core-mar.tex b/Master/texmf-dist/tex/context/base/core-mar.tex
index 257c3dc4cc0..2051102f2cd 100644
--- a/Master/texmf-dist/tex/context/base/core-mar.tex
+++ b/Master/texmf-dist/tex/context/base/core-mar.tex
@@ -71,8 +71,8 @@
{\dosingleargument\doresetmarking}
\def\dosetupmarking[#1][#2]%
- {\def\docommando##1{\getparameters[\??mk##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??mk##1][#2]}%
+ \processcommalist[#1]\docommand}
\def\setupmarking
{\dodoubleargument\dosetupmarking}
diff --git a/Master/texmf-dist/tex/context/base/core-mat.tex b/Master/texmf-dist/tex/context/base/core-mat.tex
index 72a620973bb..0a75bfcf617 100644
--- a/Master/texmf-dist/tex/context/base/core-mat.tex
+++ b/Master/texmf-dist/tex/context/base/core-mat.tex
@@ -131,19 +131,6 @@
\def\belowdisplayshortskipsize% obsolete
{\displayskipsize\displayshortskipfactor\displayshortskipgluefactor}
-\def\setdisplayskip#1#2#3% obsolete
- {#1=#2\relax
- \advance#1 -\parskip
- \advance#1 -#3\relax}
-
-\def\setdisplayskips % obsolete
- {\setdisplayskip\abovedisplayskip \abovedisplayskipsize \zeropoint
- \setdisplayskip\belowdisplayskip \belowdisplayskipsize \zeropoint
- \setdisplayskip\abovedisplayshortskip\abovedisplayshortskipsize\baselineskip
- \setdisplayskip\belowdisplayshortskip\belowdisplayshortskipsize\baselineskip}
-
-% so far for unused stuff
-
\def\forgetdisplayskips % to do
{\abovedisplayskip \zeropoint
\belowdisplayskip \zeropoint
@@ -350,7 +337,6 @@
\freezedimenmacro\rightdisplaymargin
\freezedimenmacro\predisplaysizethreshhold
\forgetdisplayskips
- \let\setdisplayskips\relax
\ifoptimizedisplayspacing
\ifdim\lastlinewidth>\zeropoint
\abovedisplayshortskip-\strutht\relax
@@ -380,55 +366,13 @@
\nonoindentation
\dochecknextindentation{\??fm\currentformula}%
\egroup
+ \hangafter\minusone % added for side floats
+ \hangindent\zeropoint % added for side floats
\setfalse\handleformulanumber
\dorechecknextindentation} % here ?
\newif\ifinformula
-% \def\startdisplaymath
-% {\ifgridsnapping
-% \beforedisplayspace
-% \snapmathtogrid\vbox
-% \bgroup
-% \informulatrue
-% %\forgetall % breaks side floats
-% \else
-% \bgroup
-% \informulatrue
-% %\forgetall % otherwise backgrounds fail
-% \ifdim\lastskip<\zeropoint\else
-% \par
-% \ifvmode \ifdim\parskip>\zeropoint\relax
-% \vskip-\parskip
-% \fi \fi
-% \fi
-% \doif\displaygridcorrection{-\v!boven}{\kern-\strutht}% new, currently only option/default
-% \beforedisplayspace
-% \par
-% \ifvmode
-% \verticalstrut
-% \vskip-\struttotal
-% \vskip-\baselineskip
-% \fi
-% \fi
-% $$\setdisplaydimensions
-% \setpredisplaysize\lastlinewidth
-% \startinnermath}
-
-% \def\stopdisplaymath
-% {\stopinnermath
-% $$%
-% \ifgridsnapping
-% \egroup
-% \afterdisplayspace
-% \else
-% \par\ifvmode\ifdim\parskip>\zeropoint\vskip-\parskip\fi\fi
-% \afterdisplayspace
-% \egroup
-% \fi
-% \globallet\displaylinecorrection\empty
-% \gdef\displaygridcorrection{\displaygridsnapping}}
-
\def\startdisplaymath
{\ifgridsnapping
\beforedisplayspace
@@ -503,17 +447,6 @@
\def\moveformula
{\dosingleempty\domoveformula}
-% \def\domoveformula[#1]% brr gaat mogelijk fout
-% {\ifgridsnapping
-% \iffirstargument
-% \xdef\displaygridcorrection{#1}%
-% \else
-% \gdef\displaygridcorrection{-\v!boven}% handy with short preline
-% \fi
-% \else
-% \gdef\displaygridcorrection{\displaygridsnapping}%
-% \fi}
-
\def\domoveformula[#1]% brr gaat mogelijk fout
{\iffirstargument
\xdef\displaygridcorrection{#1}%
@@ -596,6 +529,85 @@
{\setfalse\incrementformulanumber
\dodoubleempty\doplaceformula}
+%D \macros
+%D {setupsubformulas, startsubformulas}
+%D
+%D New code (by Aditya Mahajan / cleaned up by HH, please check):
+
+% \setupsubformulas[conversion=romannumerals]
+%
+% \placeformula
+% \startsubformulas[Maxwell]
+% \startformulas
+% \startformula \startalign
+% \NC \nabla\cdot\bf E \NC = \frac{\rho}{\varepsilon_0} \NR[Maxwell 1]
+% \NC \nabla\times\bf E \NC = - \frac{\partial\bf B}{\partial t} \NR[Maxwell II]
+% \stopalign \stopformula
+% \startformula \startalign
+% \NC \nabla\cdot \bf B \NC = 0 \NR[Maxwell III]
+% \NC \nabla\times\bf B \NC = \mu_0{\bf j}+\varepsilon_0\mu_0\frac{\partial\bf E}{\partial t} \NR[Maxwell IV]
+% \stopalign \stopformula
+% \stopformulas
+% \stopsubformulas
+%
+% Maxwell : \in [Maxwell] and II : \in [Maxwell II]
+
+\def\setupsubformulas
+ {\dodoubleargument\getparameters[\??fn]}
+
+\definenumber[\v!formula*]
+
+\def\subformulaconversion % #1
+ {\getnumber[\v!formula*]\@@fnseparator\convertnumber\@@fnconversion} % #1
+
+\defineconversion[\v!subformula][\subformulaconversion]
+
+\def\startsubformulas
+ {\dosingleempty\dostartsubformulas}
+
+\def\dostartsubformulas[#1]%
+ {\incrementnumber[\v!formula]%
+ \makesectionnumber[\v!formula]%
+ \doflushformulalistentry{\composedsectionnumber}%
+ \doifsomething{#1}{\rawreference\s!for{#1}\composedsectionnumber}%
+ \expanded{\setupnumber
+ [\v!formula*]
+ [\c!start={\rawnumber[\v!formula]},
+ \c!way=\@@fmway,
+ \c!conversion=\@@fmconversion]}%
+ \bgroup
+ \savenumber[\v!formula]%
+ \setupformulas
+ [\c!conversion=\v!subformula,
+ \c!way=\v!by\v!text]%
+ \resetnumber
+ [\v!formula]}
+
+\def\stopsubformulas
+ {\restorenumber[\v!formula]%
+ \egroup
+ \resetlastlinewidth
+ \nonoindentation
+ \dochecknextindentation\??fn
+ \dorechecknextindentation} % here ?
+
+%D Named subformulas
+
+\def\startnamedsubformulas
+ {\dosingleempty\dostartnamedsubformulas}
+
+\def\dostartnamedsubformulas[#1]#2%
+ {\setformulalistentry{#2}%
+ \startsubformulas[#1]}
+
+\def\stopnamedsubformulas
+ {\stopsubformulas}
+
+\setupsubformulas
+ [\c!conversion=\v!character,
+ \c!separator=\@@fmseparator,
+ \c!indentnext=\@@fmindentnext]
+
%D Experimental goodie:
%D
%D \startbuffer
@@ -630,32 +642,6 @@
%D The implementation of placement is a bit ugly:
-% \def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
-% {\def\redoplaceformula
-% {\bgroup\def\dostartformula####1{\relax}%
-% \ifx\next\bgroup
-% \@EA\moreplaceformula % [ref]{}
-% \else
-% \expandafter\convertargument\e!start\to\asciiA % actually, \next's meaning is \dostartformula
-% \expandafter\convertargument\next \to\asciiB
-% \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
-% {\egroup \@EA\dodoplaceformula}% [ref]\start
-% {\egroup \@EA\dispplaceformula}% [ref]$$
-% \fi[#1]{}}%
-% \futurelet\next\redoplaceformula}
-%
-% \long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces
-% {\def\redoplaceformula
-% {\expandafter\convertargument\e!start\to\asciiA
-% \expandafter\convertargument\next \to\asciiB
-% \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
-% {\egroup \dodoplaceformula}% [ref]\start
-% {\egroup \dispplaceformula}% [ref]$$
-% [#1]{#3}}%
-% \futurelet\next\redoplaceformula#4}
-%
-% BEGIN OF PATCH (CORE-MAT.TEX)
-
\def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
{\def\redoplaceformula
{\bgroup
@@ -683,27 +669,30 @@
[#1]{#3}}%
\futurelet\next\redoplaceformula#4}
-% END OF PATCH
-
\def\startformulas#1\stopformulas % new / to be internationalized
{\bgroup
\forgetdisplayskips
\startdisplaymath
\setlocalhsize
- \long\def\startformula##1\stopformula{\advance\scratchcounter\plusone}%
- \scratchcounter\zerocount #1% preroll
- \divide \hsize \scratchcounter
+ \long\def\startformula##1\stopformula
+ {\advance\scratchcounter\plusone}%
+ \scratchcounter\zerocount
+ #1% preroll
+ \ifcase\scratchcounter\else
+ \divide \hsize \scratchcounter
+ \fi
\hbox to \localhsize \bgroup
\hss
\def\normalstartformula{\vskip-\strutdepth$$}% i hate this
- \def\normalstartformula{\vskip-\strutdepth$$}% i hate this
\def\normalstopformula {$$}%
- \def\startformula{$\vcenter\bgroup\normalstartformula}%
- \def\stopformula {\normalstopformula\egroup$\hss}%
+ \def\startformula {$\vcenter\bgroup\normalstartformula}%
+ \def\stopformula {\normalstopformula\egroup$\hss}%
#1%
\egroup
\stopdisplaymath
- \egroup}
+ \egroup
+ \hangafter\minusone % added for side floats
+ \hangindent\zeropoint} % added for side floats
\def\dispplaceformula[#1]#2$$#3$$%
{\dodoplaceformula[#1]{#2}\dostartformula{}#3\dostopformula}
@@ -783,38 +772,6 @@
\def\mathhbox
{\iftracemath\ruledhbox\else\hbox\fi}
-% \def\startmathbox#1#2%
-% {\hsize\displaywidth
-% \global\let\@eqno \empty \def\eqno {\gdef\@eqno }%
-% \global\let\@leqno\empty \def\leqno{\gdef\@leqno}%
-% % added
-% \let\normalreqno\eqno
-% \let\normalleqno\leqno
-% % added
-% \doplaceformulanumber
-% \mathhbox to \displaywidth\bgroup
-% \mathinnerstrut
-% $\displaystyle
-% \ifx\@leqno\empty\else \ifcase#2
-% \rlap{\@leqno}%
-% \else
-% \@leqno\hskip\formulaparameter\c!distance
-% \fi \fi
-% #1}
-
-% \def\stopmathbox#1#2%
-% {$#1%
-% \ifx\@eqno\empty\else \ifcase#2
-% \llap{\@eqno}%
-% \else
-% \hskip\formulaparameter\c!distance\@eqno
-% \fi \fi
-% \egroup}
-
-% \defineinnermathhandler\v!right {\startmathbox\empty1}{\stopmathbox\hfill0}
-% \defineinnermathhandler\v!left {\startmathbox\hfill0}{\stopmathbox\empty1}
-% \defineinnermathhandler\v!middle{\startmathbox\hfill0}{\stopmathbox\hfill0}
-
\chardef\mathraggedstatus=0 % normal left center right
\chardef\mathnumberstatus=0 % nothing normal shift_right
\let\mathnumbercorrection\!!zeropoint
@@ -896,9 +853,12 @@
\fi
\egroup}
-\defineinnermathhandler\v!left {\startmathbox\plusone }{\stopmathbox}
-\defineinnermathhandler\v!middle{\startmathbox\plustwo }{\stopmathbox}
-\defineinnermathhandler\v!right {\startmathbox\plusthree}{\stopmathbox}
+\defineinnermathhandler\v!left {\startmathbox\plusone }{\stopmathbox}
+\defineinnermathhandler\v!middle {\startmathbox\plustwo }{\stopmathbox}
+\defineinnermathhandler\v!right {\startmathbox\plusthree}{\stopmathbox}
+\defineinnermathhandler\v!flushleft {\startmathbox\plusthree}{\stopmathbox}
+\defineinnermathhandler\v!center {\startmathbox\plustwo }{\stopmathbox}
+\defineinnermathhandler\v!flushright{\startmathbox\plusone }{\stopmathbox}
%D [The examples below are in english and don't process in the
%D documentation style, which will be english some day.]
@@ -1074,18 +1034,6 @@
\appendtoks \advance\supersubmode \plusone \to \everysupersub
-% \def\dodosuper#1{\normalsuper{\the\everysupersub#1}}
-% \def\dodosuber#1{\normalsuber{\the\everysupersub#1}}
-%
-% \def\dosuper{\ifx\next\bgroup\expandafter\dodosuper\else\normalsuper\fi}
-% \def\dosuber{\ifx\next\bgroup\expandafter\dodosuber\else\normalsuber\fi}
-%
-% \def\super{\futurelet\next\dosuper}
-% \def\suber{\futurelet\next\dosuber}
-%
-% \def\super#1{\normalsuper{\the\everysupersub#1}}
-% \def\suber#1{\normalsuber{\the\everysupersub#1}}
-
\appendtoks
\gridsupsubstyle
\to \everysupersub
@@ -1221,13 +1169,6 @@
\newconditional\halfcrazymathlines % \settrue\halfcrazymathlines
\newconditional\crazymathsnapping % \settrue\crazymathsnapping
-% \appendtoks
-% \doifelse\@@mtgrid\v!ja
-% {\settrue \crazymathsnapping }{\setfalse\crazymathsnapping}%
-% \doifelse\@@mtstap\v!halveregel
-% {\settrue \halfcrazymathlines}{\setfalse\halfcrazymathlines}%
-% \to \everysetuptextformulas
-
\appendtoks
\doifelse\@@mtgrid\v!yes \settrue\setfalse\crazymathsnapping
\doifelse\@@mtstep\v!halfline\settrue\setfalse\halfcrazymathlines
@@ -1313,13 +1254,13 @@
{\incolortrue\localcolortrue
\backgroundline[gray]{\showstruts\strut\flushnextbox}}%
\fi
- \def\docommando##1%
+ \def\docommand##1%
{\doif{##1}-{\settrue \halfcrazymathlines}%
\doif{##1}+{\setfalse\halfcrazymathlines}%
\doif{##1}={\!!doneatrue}%
\doif{##1}<{\!!donedtrue}%
\doif{##1}>{\!!doneetrue}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\if!!doneb
\if!!donec \else
\setfalse\halfcrazymathlines
@@ -1457,8 +1398,7 @@
\crazymathindent
\iftracegridsnapping
\setbox\scratchbox\hbox
- {\incolortrue\localcolortrue\blue
- \ruledhbox{\box\scratchbox}}%
+ {\incolortrue\localcolortrue\color[blue]{\ruledhbox{\box\scratchbox}}}%
\fi
\box\scratchbox
\endgraf
@@ -1678,17 +1618,6 @@
\def\mathineqalign#1{$\forgetalign\displaystyle{{}#1{}}$}
\def\textineqalign#1{$\forgetalign#1$}
-% \def\eqalign#1% why no halign here, probably because of displaywidth
-% {\!!toksa{\strut\hfil$\displaystyle{##}$}%
-% \!!toksb{&$\displaystyle{{}##{}}$\hfil}%
-% \!!toksc\emptytoks
-% \buildeqalign
-% \null\,\vcenter
-% {\openup.25\bodyfontsize% was: \openup\jot
-% \mathsurround\zeropoint
-% \expandafter \ialign \expandafter {\the\scratchtoks\crcr#1\crcr}%
-% }\,}
-
\def\eqalign#1% why no halign here, probably because of displaywidth
{\null\,\vcenter
{\openup.25\bodyfontsize% was: \openup\jot
@@ -1700,22 +1629,6 @@
\chardef\eqalignmode\plusone
-% \def\preparereqalignno
-% {\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
-% \!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
-% \!!toksc{\hfil\tabskip\centering&\llap{\span\textineqalign{##}}\tabskip\zeropoint}%
-% \buildeqalign
-% \presetdisplaymath
-% \tabskip\centering}
-
-% \def\prepareleqalignno
-% {\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
-% \!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
-% \!!toksc{\hfil\tabskip\centering&\kern-\displaywidth\rlap{\span\textineqalign{##}}\tabskip\displaywidth}%
-% \buildeqalign
-% \presetdisplaymath
-% \tabskip\centering}
-
\def\preparereqalignno
{\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
\!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
@@ -1759,17 +1672,6 @@
\halign \ifcase\eqalignmode \or to \displaywidth \fi \@EA {\the\scratchtoks\crcr#2\crcr}%
\finishalignno}
-% \def\dobothaligneqalignno#1%
-% {\ifmmode
-% \displ@y % \let\doplaceformulanumber\relax % strange hack
-% \vcenter\bgroup
-% \def\finishalignno{\crcr\egroup\egroup}%
-% \else
-% \def\finishalignno{\crcr\egroup}%
-% \fi
-% #1%
-% \halign \ifcase\eqalignmode \or to \displaywidth \fi \@EA \bgroup\the\scratchtoks\crcr}
-
\def\mrlap#1%
{\setbox\scratchbox\hbox{#1}%
\ifdim\wd\scratchbox>\mathnumbercorrection
@@ -1852,13 +1754,6 @@
\def\dodoalignNC
{\gdef\doalignNC##1{&##1}}
-% \def\doalignNR[#1][#2]%
-% {\doifsomething{#1}
-% {\doifelse{#1}{+}
-% {\doformulanumber[][#2][]{}}
-% {\doformulanumber[#1][#2][]{}}}%
-% \crcr}
-
\def\doalignNR[#1][#2]%
{\donestedformulanumber{#1}{#2}\crcr}
@@ -1909,13 +1804,6 @@
\definemathalignment[align] % default case (this is what amstex users expect)
\definemathalignment[\v!mathalignment] % prefered case (this is cleaner, less clashing)
-% \def\startsplit
-% {\startalign[*]} % no number by default
-%
-% \def\stopsplit
-% {&\doalignNR[+][]\crcr % for a number on last line
-% \stopalign}
-
%D \startbuffer
%D \placeformula \startformula \eqalignno {
%D a &= b & \formulanumber \cr
@@ -2283,22 +2171,86 @@
\def\dodomatrixNC
{\gdef\domatrixNC{\endmath&}}
+\def\installmathmatrixhandler#1#2%
+ {\setvalue{\??mx:#1}{#2}}
+
+% First alternative:
+%
+% \def\processlowhighmathmatrix#1%
+% {\def\mathmatrixleft
+% {\setbox\nextbox}
+% \def\mathmatrixright
+% {#1.5\dimexpr\nextboxdp-\nextboxht\relax
+% \hbox{$\mathmatrixparameter\c!left
+% \vcenter{\unvbox\nextbox}%
+% \mathmatrixparameter\c!right$}}%
+% \let\mathmatrixbox\vbox}
+%
+% \installmathmatrixhandler\v!high {\processlowhighmathmatrix\raise}
+% \installmathmatrixhandler\v!low {\processlowhighmathmatrix\lower}
+%
+% \installmathmatrixhandler\v!top {\processlowhighmathmatrix\raise}
+% \installmathmatrixhandler\v!bottom{\processlowhighmathmatrix\lower}
+%
+% \installmathmatrixhandler\v!lohi
+% {\def\mathmatrixleft {\mathmatrixparameter\c!left}%
+% \def\mathmatrixright{\mathmatrixparameter\c!right}%
+% \let\mathmatrixbox\vcenter}
+%
+% An alternative
+%
+% \let\mathmatrixleft \empty
+% \let\mathmatrixright\empty
+%
+% \def\processlowhighmathmatrix#1%
+% {\dowithnextbox
+% {#1.5\dimexpr\nextboxdp-\nextboxht\relax
+% \hbox{$\mathmatrixparameter\c!left
+% \vcenter{\unvbox\nextbox}%
+% \mathmatrixparameter\c!right$}}%
+% \vbox}
+%
+% \def\processlohimathmatrix
+% {\dowithnextbox
+% {\mathmatrixparameter\c!left
+% \vcenter{\unvbox\nextbox}%
+% \mathmatrixparameter\c!right}%
+% \vbox}
+%
+% \installmathmatrixhandler\v!high {\def\mathmatrixbox{\processlowhighmathmatrix\raise}}
+% \installmathmatrixhandler\v!low {\def\mathmatrixbox{\processlowhighmathmatrix\lower}}
+% \installmathmatrixhandler\v!top {\def\mathmatrixbox{\processlowhighmathmatrix\raise}}
+% \installmathmatrixhandler\v!bottom{\def\mathmatrixbox{\processlowhighmathmatrix\lower}}
+% \installmathmatrixhandler\v!lohi {\let\mathmatrixbox \processlohimathmatrix}
+%
+% Final version
+
+\let\mathmatrixleft \empty % experimental hook
+\let\mathmatrixright\empty % experimental hook
+
+\def\processlowhighmathmatrix#1#2%
+ {\dowithnextbox
+ {\scratchdimen\dimexpr(\nextboxdp-\nextboxht)/2 \ifcase#2\or+\mathaxisheight\textfont2\fi\relax
+ \ifcase#1\relax\or\lower\scratchdimen\or\or\raise\scratchdimen\fi
+ \hbox{$\mathmatrixparameter\c!left
+ \vcenter{\unvbox\nextbox}%
+ \mathmatrixparameter\c!right$}}%
+ \vbox}
+
+\installmathmatrixhandler\v!top {\def\mathmatrixbox{\processlowhighmathmatrix\plusthree\plusone }}
+\installmathmatrixhandler\v!high {\def\mathmatrixbox{\processlowhighmathmatrix\plusthree\zerocount}}
+\installmathmatrixhandler\v!lohi {\def\mathmatrixbox{\processlowhighmathmatrix\plustwo \zerocount}}
+\installmathmatrixhandler\v!low {\def\mathmatrixbox{\processlowhighmathmatrix\plusone \zerocount}}
+\installmathmatrixhandler\v!bottom{\def\mathmatrixbox{\processlowhighmathmatrix\plusone \plusone }}
+
\def\dostartmathmatrix[#1][#2]%
{\begingroup
\edef\currentmathmatrix{#1}%
\doifassignmentelse{#2}{\setupmathmatrix[#1][#2]}\donothing
\null
- \mathmatrixparameter\c!left
- \processaction
- [\mathmatrixparameter\c!location]
- [ \v!high=>\let\vchbox\vtop,
- \v!low=>\let\vchbox\vbox,
- \v!lohi=>\let\vchbox\vcenter,
- \v!top=>\let\vchbox\vtop,
- \v!bottom=>\let\vchbox\vbox,
- \s!default=>\let\vchbox\vcenter,
- \s!unknown=>\let\vchbox\vcenter]%
- \vchbox\bgroup
+ \executeifdefined{\??mx:\mathmatrixparameter\c!location}{\getvalue{\??mx:\v!lohi}}%
+ \mathmatrixleft
+ \mathmatrixbox\bgroup
\pushmacro\domatrixNC
\let\endmath\relax
\def\NC{\domatrixNC}%
@@ -2322,7 +2274,7 @@
\egroup
\popmacro\domatrixNC
\egroup
- \mathmatrixparameter\c!right
+ \mathmatrixright
\endgroup}
%D \startbuffer
@@ -2402,21 +2354,62 @@
%D \typebuffer \getbuffer
%D \macros
+%D {startmatrices}
+%D
+%D Just a handy keystroke safer:
+
+\def\startmatrices
+ {\begingroup
+ \setupmathmatrix}
+
+\def\stopmatrices
+ {\endgroup}
+
+%D \startbuffer
+%D \startformula
+%D \startmatrix[left={\left(},right={\right)}]
+%D \NC A \NC B \NR \NC C \NC D \NR
+%D \stopmatrix
+%D =
+%D \startmatrix[left={\left(},right={\right)},location=low]
+%D \NC A \NC B \NR \NC C \NC D \NR
+%D \stopmatrix
+%D =
+%D \startmatrix[left={\left(},right={\right)},location=high]
+%D \NC A \NC B \NR \NC C \NC D \NR
+%D \stopmatrix
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \startformula
+%D \startmatrices[left={\left(},right={\right)}]
+%D \startmatrix
+%D \NC A \NC B \NR \NC C \NC D \NR
+%D \stopmatrix
+%D =
+%D \startmatrix[location=bottom]
+%D \NC A \NC B \NR \NC C \NC D \NR
+%D \stopmatrix
+%D =
+%D \startmatrix[location=top]
+%D \NC A \NC B \NR \NC C \NC D \NR
+%D \stopmatrix
+%D \stopmatrices
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D \macros
%D {startintertext}
%D
%D Preliminary feature:
%D
%D {\em example code}
-% \def\startintertext#1\stopintertext
-% {\noalign{\dointertext{#1}}\NR}
-
-% \unexpanded\def\dointertext#1%
-% {\penalty\postdisplaypenalty
-% \afterdisplayspace % the matching \before... is not needed
-% \vbox{\forgetall\noindent#1\par}%
-% \penalty\postdisplaypenalty}
-
\def\startintertext#1\stopintertext
{\noalign{\dointertext{#1}}}
@@ -2542,26 +2535,31 @@
\def\dofrac#1#2#3{\relax\mathematics{{{#1{#2}}\over{#1{#3}}}}}
-\def\frac {\dofrac\mathstyle}
-\def\xfrac #1#2{\begingroup
- \let\xfrac\xxfrac
- \dofrac\scriptstyle{#1}{#2}%
- \endgroup}
-\def\xxfrac#1#2{\begingroup
- \dofrac\scriptscriptstyle{#1}{#2}%
- \endgroup}
+\unexpanded\def\frac
+ {\dofrac\mathstyle}
+
+\unexpanded\def\xfrac#1#2%
+ {\begingroup
+ \let\xfrac\xxfrac
+ \dofrac\scriptstyle{#1}{#2}%
+ \endgroup}
+
+\unexpanded\def\xxfrac#1#2%
+ {\begingroup
+ \dofrac\scriptscriptstyle{#1}{#2}%
+ \endgroup}
%D The \type {xx} variant looks still ugly, so maybe it's
%D best to say:
-\def\xxfrac#1#2{\begingroup
- \dofrac\scriptscriptstyle
- {#1}{\raise.25ex\hbox{$\scriptscriptstyle#2$}}%
- \endgroup}
+\unexpanded\def\xxfrac#1#2%
+ {\begingroup
+ \dofrac\scriptscriptstyle{#1}{\raise.25ex\hbox{$\scriptscriptstyle#2$}}%
+ \endgroup}
%D Something low level for scientific calculator notation:
-\def\scinot#1#2%
+\unexpanded\def\scinot#1#2%
{#1\times10^{#2}}
%D The next macro, \type {\ch}, is \PPCHTEX\ aware. In
@@ -2572,7 +2570,7 @@
\let\mathstyle\relax
\fi
-\def\ch#1%
+\unexpanded\def\ch#1%
{\ifx\@@chemicalletter\undefined
\mathstyle{\rm#1}%
\else
diff --git a/Master/texmf-dist/tex/context/base/core-mis.tex b/Master/texmf-dist/tex/context/base/core-mis.tex
index 0b103243656..e47c69be151 100644
--- a/Master/texmf-dist/tex/context/base/core-mis.tex
+++ b/Master/texmf-dist/tex/context/base/core-mis.tex
@@ -84,6 +84,7 @@
\appendtoks \def\ { }\to\simplifiedcommands
\appendtoks \def\type#1{\string\\\strippedcsname#1}\to\simplifiedcommands
+\appendtoks \def\tex#1{\string\\#1}\to\simplifiedcommands
\appendtoks \def\TeX{TeX}\to\simplifiedcommands
\appendtoks \def\ConTeXt{ConTeXt}\to\simplifiedcommands
\appendtoks \def\MetaPost{MetaPost}\to\simplifiedcommands
@@ -109,7 +110,7 @@
{\scratchdimen#1%
\divide\scratchdimen \nofitems
\!!counta\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\advance\!!counta \plusone
\processaction
[\@@isalign]
@@ -125,7 +126,7 @@
\def\veritems#1#2% #1=breedte #2=commandos
{\scratchdimen#1%
- \def\docommando##1%
+ \def\docommand##1%
{\ifdim\scratchdimen<\zeropoint % the - was a signal
\hbox to -\scratchdimen{\hss\strut##1}%
\else\ifdim\scratchdimen>\zeropoint
@@ -151,11 +152,11 @@
{\edef\nofitems{\@@isn}}%
\setbox0\hbox
{\doitems \@@iswidth
- {\processcommalist[#1]\docommando}}%
+ {\processcommalist[#1]\docommand}}%
\setbox2\hbox
{\doitems \@@isbulletbreedte
{\dorecurse\nofitems
- {\docommando{\strut\doitembullet\recurselevel}}}}}
+ {\docommand{\strut\doitembullet\recurselevel}}}}}
\def\dostartitems#1#2#3%
{\let\doitems#2%
@@ -298,9 +299,9 @@
% {\getparameters[\??al#1\recurselevel][#3]}}
% {\ConvertToConstant\doifelse{#3}{}
% {\getparameters[\??al#1][#2]}
-% {\def\docommando##1%
+% {\def\docommand##1%
% {\getparameters[\??al#1##1][#3]}%
-% \processcommalist[#2]\docommando}}}
+% \processcommalist[#2]\docommand}}}
%
% \def\setupparagraphs
% {\dotripleempty\dosetupparagraphs}
@@ -689,16 +690,16 @@
\def\setsubscripts
{\beginlatexmathmodehack
\def\dosetsubscript##1##2##3%
- {\dimen0=##3\fontdimen5##2%
+ {\dimen0=##3\fontexheight##2%
\setxvalue{@@\string##1\string##2}{\the##1##2\relax}%
##1##2=\dimen0\relax}%
\def\dodosetsubscript##1##2%
{\dosetsubscript{##1}{\textfont2}{##2}%
\dosetsubscript{##1}{\scriptfont2}{##2}%
\dosetsubscript{##1}{\scriptscriptfont2}{##2}}%
- %\dodosetsubscript{\fontdimen14}{?}%
- \dodosetsubscript{\fontdimen16}{.7}%
- \dodosetsubscript{\fontdimen17}{.7}%
+ %dodosetsubscript\mathsupnormal {?}%
+ \dodosetsubscript\mathsubnormal {.7}%
+ \dodosetsubscript\mathsubcombined{.7}%
\global\loweredsubscriptstrue
\endlatexmathmodehack}
@@ -712,9 +713,9 @@
{\doresetsubscript{##1}{\textfont2}%
\doresetsubscript{##1}{\scriptfont2}%
\doresetsubscript{##1}{\scriptscriptfont2}}%
- %\dodoresetsubscript{\fontdimen14}%
- \dodoresetsubscript{\fontdimen16}%
- \dodoresetsubscript{\fontdimen17}%
+ %dodoresetsubscript\mathsupnormal
+ \dodoresetsubscript\mathsubnormal
+ \dodoresetsubscript\mathsubcombined
\global\loweredsubscriptsfalse
\endlatexmathmodehack
\fi}
@@ -743,7 +744,7 @@
\unexpanded\def\bedrag#1%
{\strut\hbox\bgroup
- \let\normalfixedspace~%
+ \let\normalfixedspace\nonbreakablespace
\doifelsenothing{#1}
{\bedragempty}
{\bedragprefix\digits{#1}\bedragsuffix}%
@@ -839,11 +840,7 @@
\setuphyphenmark
[\c!sign=\composedhyphen]
-\installdiscretionaries || \@@kpsign
-
-% will become:
-%
-% \installdiscretionaries || \composedhyphen
+\def\defaultdiscretionaryhyphen{\@@kpsign}
\def\composedhyphen
{\discretionary
@@ -994,100 +991,6 @@
[\c!middlespeech]
[\leftboundarycharacter\c!middlespeech{speech}]
-% has been replaced by delimitedtext
-%
-% \def\leftquotationmark
-% {\setbox\scratchbox\hbox{\symbol[\c!leftquotation]}%
-% \doif\@@cilocation\v!margin{\hskip-\wd\scratchbox}%
-% \box\scratchbox}
-%
-% \def\rightquotationmark
-% {\hsmash{\symbol[\c!rightquotation]}}
-%
-% \newsignal\quotationsignal
-%
-% \def\setupquote
-% {\dodoubleargument\getparameters[\??ci]}
-%
-% \def\startquotation
-% {\bgroup\dosingleempty\dostartquotation}
-%
-% \def\dostartquotation[#1]%
-% {\@@cibefore
-% \doifelsenothing{#1}
-% {\let\dostopquotation\relax}
-% {\startnarrower[#1]%
-% \let\dostopquotation\stopnarrower}%
-% \dostartattributes\??ci\c!style\c!color\empty
-% \leftquotationmark
-% \ignorespaces}
-%
-% \def\stopquotation
-% {\removeunwantedspaces
-% \removelastskip
-% \rightquotationmark
-% \dostopattributes
-% \dostopquotation
-% \@@ciafter
-% \egroup}
-%
-% \def\dohandlequotation#1#2%
-% {\ifdim\lastskip=\quotationsignal
-% \unskip\hskip\hspaceamount\currentlanguage{interquotation}% hardcoded
-% \else
-% #2%
-% \fi
-% \ifhmode % else funny pagebeaks
-% \penalty\!!tenthousand\hskip\zeropoint % == \prewordbreak
-% \fi
-% \strut % new, needed below
-% \symbol[#1]%
-% \penalty\!!tenthousand\hskip\quotationsignal} % +- \prewordbreak
-%
-% \def\handlequotation#1%
-% {\dohandlequotation{#1}\relax}
-%
-% \unexpanded\def\quotation
-% {\groupedcommand
-% {\dohandlequotation\c!leftquotation \relax}
-% {\dohandlequotation\c!rightquotation\removelastskip}}
-%
-% \unexpanded\def\quote
-% {\doifelse\@@cistyle\v!normal\doquotedcite\doattributedcite}
-%
-% \def\doquotedcite
-% {\groupedcommand
-% {\dohandlequotation\c!leftquote \relax}
-% {\dohandlequotation\c!rightquote\removelastskip}}
-%
-% \def\doattributedcite
-% {\groupedcommand
-% {\dostartattributes\??ci\c!style\c!color}
-% {\dostopattributes}}
-
-%D The previous one fails in \placefloat[left]{}{}, so instead
-%D we use the next alternative, where the first one is handled
-%D outside group. Watch the strut.
-
-% has been replaced by delimitedtext
-%
-% \unexpanded\def\quotation
-% {\dohandlequotation\c!leftquotation\relax
-% \groupedcommand \donothing
-% {\dohandlequotation\c!rightquotation\removelastskip}}
-%
-% \def\doquotedcite
-% {\dohandlequotation\c!leftquote\relax
-% \groupedcommand \donothing
-% {\dohandlequotation\c!rightquote\removelastskip}}
-%
-% \setupquote
-% [\c!location=\v!margin,
-% \c!style=\v!normal,
-% \c!color=,
-% \c!before=\startnarrower,
-% \c!after=\stopnarrower]
-
\appendtoks\def\quotation#1{"#1"}\to\simplifiedcommands
\appendtoks\def\quote #1{'#1'}\to\simplifiedcommands
@@ -1098,50 +1001,17 @@
%D feature could be build on top of it. The speech opening and
%D closing symbols are defined per language. Italian is an
%D example of a language that has them set.
-
-% has been be replaced by delimitedtext
-%
-% \newcounter\speechlevel \newconditional\insidespeech
-%
-% \def\startspeech
-% {\doglobal\increment\speechlevel\relax
-% \dohandlequotation\c!leftspeech\relax
-% \global\settrue\insidespeech
-% \ignorespaces}
-%
-% \def\stopspeech
-% {\dohandlequotation\c!rightspeech\removelastskip
-% \doglobal\decrement\speechlevel\relax
-% \ifcase\speechlevel\relax \global\setfalse\insidespeech \fi}
-%
-% \def\dohandlespeech % indirect since called in everypar
-% {\relax % still needed?
-% \ifcase\speechlevel\or\dodohandlespeech\fi}
-%
-% \def\dodohandlespeech
-% {\ifconditional\insidespeech
-% \dohandlequotation\c!middlespeech\relax
-% \else
-% \global\settrue\insidespeech
-% \fi}
-%
-% \unexpanded\def\speech
-% {\doglobal\increment\speechlevel\relax
-% \dohandlequotation\c!leftspeech\relax
-% \groupedcommand \ignorespaces
-% {\dohandlequotation\c!rightspeech\removelastskip
-% \doglobal\decrement\speechlevel\relax}}
-
-% \appendtoks \dohandlespeech \to \everypar
% this will replace the quotation and speed definitions
\newsignal\delimitedtextsignal
-\def\delimitedtextparameter#1%
- {\csname\??ci
- \ifundefined{\??ci\currentdelimitedtext#1}\else\currentdelimitedtext\fi
- #1\endcsname}
+\let\currentdelimitedtext\s!unknown
+
+\def\delimitedtextparameter#1% will be sped up
+ {\executeifdefined{\??ci\currentdelimitedtext:\csname\??ci\currentdelimitedtext\c!level\endcsname#1}%
+ {\executeifdefined{\??ci\currentdelimitedtext#1}%
+ {\executeifdefined{\??ci#1}\empty}}}
\def\definedelimitedtext
{\dodoubleempty\dodefinedelimitedtext}
@@ -1174,17 +1044,19 @@
\doifsomething{#1}
{\unexpanded\setvalue{#1}{\delimitedtext[#1]}%
\setvalue{\e!start#1}{\startdelimitedtext[#1]}%
- \setvalue{\e!stop#1}{\stopdelimitedtext}}}
+ \setvalue{\e!stop #1}{\stopdelimitedtext}}}
\def\setupdelimitedtext
- {\dodoubleargument\dosetupdelimitedtext}
+ {\dotripleargument\dosetupdelimitedtext}
-\def\dosetupdelimitedtext[#1][#2]%
- {\ifsecondargument
+\def\dosetupdelimitedtext[#1][#2][#3]% #2 = optional level
+ {\ifthirdargument
+ \getparameters[\??ci#1:#2][#3]%
+ \else\ifsecondargument
\getparameters[\??ci#1][#2]%
\else
\getparameters[\??ci][#1]%
- \fi}
+ \fi\fi}
\def\dorepeatdelimitedtext
{\relax\ifcase\delimitedtextparameter\c!level\else
@@ -1195,10 +1067,10 @@
\def\startdelimitedtext[#1]%
{\bgroup
- \def\currentdelimitedtext{#1}%
+ \pushdelimitedtext{#1}%
\doifelse{\delimitedtextparameter\c!method}\s!font
- {\doglobal\decrementvalue{\??ci\currentdelimitedtext\c!level}%
- \def\dostopdelimitedtext{\removeunwantedspaces\ignoredelimitedtext\c!right}%
+ {\def\dostopdelimitedtext
+ {\removeunwantedspaces\ignoredelimitedtext\c!right}%
\ignoredelimitedtext\c!left\ignorespaces}
{\doifelse{\delimitedtextparameter\c!repeat}\v!yes
{\let\dohandlerepeatdelimitedtext\dorepeatdelimitedtext}%
@@ -1225,7 +1097,6 @@
\dochecknextindentation{\??ci\currentdelimitedtext}%
\dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color\empty
\leftdelimitedtextmark
- \doglobal\incrementvalue{\??ci\currentdelimitedtext\c!level}%
\ignorespaces}
\def\dostopdelimitedtextpar
@@ -1251,12 +1122,20 @@
\def\stopdelimitedtext
{\dostopdelimitedtext
- \doglobal\decrementvalue{\??ci\currentdelimitedtext\c!level}%
+ \popdelimitedtext
\egroup}
-\def\delimitedtext[#1]%
+\def\pushdelimitedtext#1%
{\pushmacro\currentdelimitedtext
\def\currentdelimitedtext{#1}%
+ \doglobal\incrementvalue{\??ci\currentdelimitedtext\c!level}}
+
+\def\popdelimitedtext
+ {\doglobal\decrementvalue{\??ci\currentdelimitedtext\c!level}%
+ \popmacro\currentdelimitedtext}
+
+\def\delimitedtext[#1]%
+ {\pushdelimitedtext{#1}%
\doifelse{\delimitedtextparameter\c!method}\s!font
{\dofontdrivendelimited}
{\doifinsetelse{\delimitedtextparameter\c!location}{\v!paragraph,\v!margin}%
@@ -1305,7 +1184,8 @@
{\dohandledelimitedtext\c!left\relax
\groupedcommand
\donothing
- {\dohandledelimitedtext\c!right\removelastskip}}
+ {\dohandledelimitedtext\c!right\removelastskip
+ \popdelimitedtext}}
\unexpanded\def\dodelimitedtexttxt
{\doifelse{\delimitedtextparameter\c!style}\v!normal
@@ -1317,25 +1197,29 @@
\donothing
{\dohandledelimitedtext\c!right
\removelastskip
- \popmacro\currentdelimitedtext}}
+ \popdelimitedtext}}
\def\doattributeddelimited
{\groupedcommand
{\dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color}
{\dostopattributes
- \popmacro\currentdelimitedtext}}
-
-% \def\dofontdrivendelimited#1% thanks to Taco for sorting out the kerning interference
-% {\languageparameter{\c!left\currentdelimitedtext}%
-% #1% sorry, no verbatim support
-% \languageparameter{\c!right\currentdelimitedtext}%
-% \popmacro\currentdelimitedtext}
+ \popdelimitedtext}}
\def\dofontdrivendelimited
{\simplegroupedcommand
{\languageparameter{\c!left\currentdelimitedtext}}
{\languageparameter{\c!right\currentdelimitedtext}%
- \popmacro\currentdelimitedtext}}
+ \popdelimitedtext}}
+
+% testcase for nesting:
+%
+% \quotation{... \quotation{...} ...}
+% \startquotation ... \startquotation... \quotation{...} \stopquotation\space ...\stopquotation
+% \setupdelimitedtext[quotation][1][left=(,right=)]
+% \setupdelimitedtext[quotation][2][left={[},right={]}]
+% \setupdelimitedtext[quotation][3][left=\{,right=\}]
+% \quotation{... \quotation{...} ...}
+% \startquotation ... \startquotation... \quotation{...} \stopquotation\space ...\stopquotation
\definedelimitedtext
[\v!quotation]
@@ -1377,6 +1261,8 @@
% seldom used, move from kernel to run time module
+\ifx\tfx\undefined \let\tfx\relax \fi
+
\def\basegrid
{\dosingleempty\dobasegrid}
@@ -2053,6 +1939,8 @@
\global\resetsystemmode{pairedbox}%
\to \everyinsidefloat
+% todo: \startcombination \startcomb \stopcomb ...
+
\newcount\horcombination % counter
\newcount\totcombination
@@ -2085,6 +1973,11 @@
{\bgroup % so we can grab a group
\dodoubleempty\dostartcombination}
+% \startcombination {alpha} {a} {beta} {b} \stopcombination
+% \startcombination[2*1] {alpha} {a} {beta} {b} \stopcombination
+% \startcombination[1*2] {alpha} {a} {beta} {b} \stopcombination
+% \startcombination[2] {alpha} {a} {beta} {b} \stopcombination
+
\def\dostartcombination[#1][#2]%
{\global\setsystemmode{combination}%
\doifnothing{#1}\firstargumentfalse % to be sure (when called in macros)
@@ -2092,12 +1985,15 @@
\ifsecondargument
\def\currentcombination{#1}%
\edef\currentcombinationspec{#2*1*}%
- \else
- \doifinstringelse{*}{#1}
+ \else % better : \doifcombinationelse ... \??co#1\c!location
+ \doifinstringelse{*}{#1}
{\let\currentcombination\empty
\edef\currentcombinationspec{#1*1*}}
- {\def\currentcombination{#1}%
- \edef\currentcombinationspec{2*1*}}%
+ {\doifnumberelse{#1}
+ {\let\currentcombination\empty
+ \edef\currentcombinationspec{#1*1*}}
+ {\def\currentcombination{#1}%
+ \edef\currentcombinationspec{2*1*}}}%
\fi
\forgetall
\doifelse{\combinationparameter\c!height}\v!fit
@@ -2118,9 +2014,9 @@
{\halign}{\halign to \combinationparameter\c!width}%
\bgroup&%
%\hfil##\hfil% now : location={left,top}
- \ExpandBothAfter\doifnotinset\v!left{\combinationparameter\c!location}\hfil
+ \expanded{\doifnotinset{\v!left}{\combinationparameter\c!location}}\hfil
##%
- \ExpandBothAfter\doifnotinset\v!right{\combinationparameter\c!location}\hfil
+ \expanded{\doifnotinset{\v!right}{\combinationparameter\c!location}}\hfil
&\tabskip\zeropoint \!!plus 1fill##\cr
\docombination}
@@ -2246,8 +2142,7 @@
{\vbox
{\forgetall % \setupwhitespace[\v!none]%
\let\next\vbox
- \ExpandFirstAfter\processallactionsinset
- [\combinationparameter\c!location]
+ \expanded{\processallactionsinset[\combinationparameter\c!location]}
[ \v!top=>\let\next\depthonlybox, % \tbox,
\v!middle=>\let\next\halfwaybox]%
\next{\copy0}%
@@ -2383,23 +2278,7 @@
\resetlocalfloats
\egroup}}
-% does not work
-%
-% \def\plaatsondernaastelkaar#1#2%
-% {\bgroup
-% \def\doplaatsondernaastelkaar%
-% {#2\cr\omit\bgroup#2%
-% \aftergroup#2%
-% \aftergroup\cr
-% \aftergroup\egroup
-% \aftergroup\egroup
-% \let\next=}%
-% #1\bgroup##\cr
-% \omit\bgroup#2%
-% \aftergroup\doplaatsondernaastelkaar
-% \let\next=}
-
-\def\plaatsondernaastelkaar#1#2%
+\def\placerelativetoeachother#1#2%
{\bgroup
\dowithnextbox
{\bgroup
@@ -2412,12 +2291,11 @@
\hbox}
\hbox}
-\def\placeontopofeachother
- {\plaatsondernaastelkaar\halign\hss}
-
-\def\placesidebyside
- {\plaatsondernaastelkaar\valign\vss}
+\def\placeontopofeachother{\placerelativetoeachother\halign\hss}
+\def\placesidebyside {\placerelativetoeachother\valign\vss}
+% this will be replaced or go away, never used
+
\def\douseexternalfiles[#1][#2]%
{\getparameters
[\??fi#1]
@@ -2479,83 +2357,6 @@
%D
%D \typebuffer \getbuffer
-% \presetlocalframed[\??ro]
-%
-% \def\setuprotate
-% {\dodoubleargument\getparameters[\??ro]}
-%
-% \def\dorotatebox#1% {angle} \hbox/\vbox/\vtop
-% {\bgroup
-% \hbox\bgroup % compatibility hack
-% \dowithnextbox
-% {\edef\@@rorotation{#1}%
-% \setbox\nextbox\vbox{\flushnextbox}%
-% \dostoprotate
-% \egroup}}
-%
-% \def\dodostoprotate#1#2#3#4#5#6%
-% {\dontshowcomposition
-% \scratchdimen\nextboxht\advance\scratchdimen\nextboxdp
-% \doif\@@rolocation\v!high
-% {\setbox\nextbox\vbox{\hbox{\raise\nextboxdp\flushnextbox}}}%
-% \setbox\nextbox\vbox to #1
-% {#2\relax
-% \hbox to #4
-% {#5\relax % \number removes leading spaces too
-% \edef\@@rorotation{\number\@@rorotation}%
-% \doifelsenothing\@@rorotation
-% {\dostartrotation{90}}
-% {\dostartrotation{\@@rorotation}}%
-% \nextboxwd\zeropoint
-% \nextboxht\zeropoint
-% %\nextboxdp\zeropoint
-% \flushnextbox
-% \dostoprotation
-% #6}
-% #3}%
-% \nextboxdp\zeropoint
-% \flushnextbox
-% \egroup}
-%
-% \def\dostoprotate
-% {\!!counta\@@rorotation
-% \divide\!!counta 90
-% \ifcase\!!counta
-% \dodostoprotate\nextboxht\relax\vfill\nextboxwd\relax\hfill
-% \or
-% %\dodostoprotate\nextboxwd\vfill\relax\nextboxht\relax\hfill
-% \dodostoprotate\nextboxwd\vfill\relax\scratchdimen\relax\hfill
-% \or
-% \dodostoprotate\nextboxht\vfill\relax\nextboxwd\hfill\relax
-% \or
-% %\dodostoprotate\nextboxwd\relax\vfill\nextboxht\hfill\relax
-% \dodostoprotate\nextboxwd\relax\vfill\scratchdimen\hfill\relax
-% \or
-% \dodostoprotate\nextboxht\relax\vfill\nextboxwd\relax\hfill
-% \else
-% \def\@@rotation{90}%
-% \dodostoprotate\nextboxht\relax\vfill\nextboxwd\relax\hfill
-% \fi}
-%
-% \def\complexrotate[#1]%
-% {\dowithnextbox
-% {\getparameters[\??ro][#1]%
-% \dostoprotate}%
-% \vbox\localframed[\??ro][#1]}
-%
-% \unexpanded\def\rotate % \bgroup: \rotate kan argument zijn
-% {\bgroup\complexorsimpleempty\rotate}
-%
-% \setuprotate
-% [\c!rotation=90,
-% \c!width=\v!fit,
-% \c!height=\v!fit,
-% \c!offset=\v!overlay,
-% \c!frame=\v!off]
-
-% The previous implementation is replaced by one that supports
-% rotation over arbitrary angles.
-%
% When we rotate over arbitrary angles, we need to relocate the
% resulting box because rotation brings that box onto the negative
% axis. The calculations (mostly sin and cosine) need to be tuned for
@@ -2768,97 +2569,6 @@
% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high] {\ruledhbox{\bfb (high)}}}}}
% \stoplinecorrection}
-% scale
-
-\def\doscalelikeafigure % quite dirty and potential interference possible
- {\doifsomething{\@@xyscale\@@xyxscale\@@xyyscale
- \@@xyfactor\@@xyhfactor\@@xywfactor
- \@@xywidth\@@xyheight\@@xylines}
- {\let \@@efscale \@@xyscale
- \let \@@efxscale \@@xyxscale
- \let \@@efyscale \@@xyyscale
- \let \@@effactor \@@xyfactor
- \let \@@efwfactor\@@xywfactor
- \let \@@efhfactor\@@xyhfactor
- \let \@@efwidth \@@xywidth
- \let \@@efheight \@@xyheight
- \let \@@eflines \@@xylines
- \let \@@efgrid \@@xygrid
- \let \@@epx \!!zeropoint
- \let \@@epy \!!zeropoint
- \edef\@@epw {\the\nextboxwd}%
- \edef\@@eph {\the\nextboxht}%
- \figwid\zeropoint \figxsca\plusone % see note * (core-fig)
- \fighei\zeropoint \figysca\plusone % see note * (core-fig)
- \checkfiguresettings
- \setfactorfiguresize
- \setscalefiguresize
- \setdimensionfiguresize
- \convertfigureinsertscale\@@epx\figx\figxsca\scax
- \convertfigureinsertscale\@@epy\figy\figysca\scay
- \scratchdimen\scax\points \divide\scratchdimen \plushundred
- \edef\@@xysx{\withoutpt\the\scratchdimen}%
- \scratchdimen\scay\points \divide\scratchdimen \plushundred
- \edef\@@xysy{\withoutpt\the\scratchdimen}}}
-
-\def\doscale[#1]% todo: xscale/yscale
- {\bgroup
- \forgetall
- \getparameters
- [\??xy]
- [\c!scale=,\c!xscale=,\c!yscale=,\c!width=,\c!height=,\c!lines=,
- \c!factor=,\c!hfactor=,\c!wfactor=,\c!grid=,
- \c!sx=1,\c!sy=1,#1]%
- \dowithnextbox
- {\dontshowcomposition
- \ifdim\nextboxht>\zeropoint \ifdim\nextboxwd>\zeropoint
- \doscalelikeafigure
- \dimen0=\@@xysy\nextboxht
- \dimen2=\@@xysy\nextboxdp
- \dimen4=\@@xysx\nextboxwd
- \dimen6=\dimen0\advance\dimen6 \dimen2
-% \setbox\nextbox\vbox to \dimen6
-% {\nextboxht\zeropoint
-% \nextboxdp\zeropoint
-% \vfill % erbij
-% \dostartscaling\@@xysx\@@xysy\flushnextbox\dostopscaling}%
- \setbox\nextbox\hbox
- {\smashbox\nextbox
- \dostartscaling\@@xysx\@@xysy\flushnextbox\dostopscaling}%
- \nextboxht\dimen0
- \nextboxdp\dimen2
- \nextboxwd\dimen4
- \fi \fi
- \flushnextbox
- \egroup}
- \hbox}
-
-\def\scale
- {\dosingleempty\doscale}
-
-% mirror
-
-\def\domirrorbox % \hbox/\vbox/\vtop
- {\bgroup
- \dowithnextbox
- {\dontshowcomposition
- \scratchdimen\nextboxwd
- % better use an hbox (if no \forgetall, leftskip etc may creep in)
- %\setbox\nextbox\vbox{\forgetall\dostartmirroring\hskip-\nextboxwd\flushnextbox\dostopmirroring}%
- \setbox\nextbox\hbox{\dostartmirroring\hskip-\nextboxwd\flushnextbox\dostopmirroring}%
- \nextboxwd\scratchdimen
- \flushnextbox
- \egroup}}
-
-\def\mirror
- {\domirrorbox\hbox}
-
-%\setbox0=\hbox{gans}
-%
-%\ruledhbox{\copy0 \schaal[sx=2,sy=2]{\copy0}}
-%
-%\spiegel{\ruledhbox{\copy0 \schaal{\box0}}}
-
% to be used in some other places! todo!
%
% divides \hsize in fractions, will be made a bit more
@@ -2995,7 +2705,7 @@
\else
\let\serializedcommalist\empty
\scratchcounter\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\advance\scratchcounter \plusone
\ifnum\scratchcounter=\plusone
\scratchtoks{\handlecommalistsentence{##1}}%
@@ -3006,7 +2716,7 @@
\appendtoks\labeltext{and-1}\handlecommalistsentence{##1}\to\scratchtoks
\fi
\fi}%
- \processcommacommand[#1]\docommando
+ \processcommacommand[#1]\docommand
\edef\serializedcommalist{\the\scratchtoks}%
\fi
\serializedcommalist
@@ -3018,4 +2728,45 @@
\setuplabeltext [\s!en] [and-1=\textcomma\ , and-2=\textcomma\ and ]
\setuplabeltext [\s!de] [and-1=\textcomma\ , and-2= und ]
+%D \macros
+%D {\somekindoftab}
+%D
+%D This macro can be used to create tabs:
+%D
+%D \starttyping
+%D \setupheadertexts[{\somekindoftab[alternative=horizontal]{\framed{\realfolio}}}]
+%D \setuptexttexts [{\somekindoftab[alternative=vertical] {\framed{\realfolio}}}]
+%D
+%D \starttext
+%D \showframe \dorecurse{10}{test\page}
+%D \stoptext
+%D \stoptyping
+
+\def\somekindoftab
+ {\dosingleempty\dosomekindoftab}
+
+\def\dosomekindoftab[#1]%
+ {\bgroup
+ \getparameters[xx]
+ [\c!alternative=\v!vertical,
+ \c!width=\textwidth,\c!height=\textheight,
+ \c!n=\lastpage,\c!m=\realpageno,
+ #1]%
+ \doifelse\xxalternative\v!vertical
+ {\dodosomekindoftab\vbox\vskip\xxheight}
+ {\dodosomekindoftab\hbox\hskip\xxwidth }}
+
+\def\dodosomekindoftab#1#2#3#4%
+ {#1 to #3 \bgroup
+ \forgetall
+ \ifnum\xxm>\plusone
+ #2\zeropoint \!!plus \the\numexpr\xxm -1\relax fill\relax
+ \fi
+ #4%
+ \ifnum\xxm<\xxn\relax
+ #2\zeropoint \!!plus \the\numexpr\xxn-\xxm\relax fill\relax
+ \fi
+ \egroup
+ \egroup}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-nav.tex b/Master/texmf-dist/tex/context/base/core-nav.tex
index a55022d7766..2457d735c8a 100644
--- a/Master/texmf-dist/tex/context/base/core-nav.tex
+++ b/Master/texmf-dist/tex/context/base/core-nav.tex
@@ -176,7 +176,7 @@
\def\flushdriverresources
{\ifvoid\driverresources\else\box\driverresources\fi}
-\def\dostartgoto\data#1\start#2\stop#3\dostopgoto
+\def\dohandlegoto#1#2#3%
{\ifsecondaryreference
\bgroup\setbox0\hbox{#2#3}\egroup
\else
diff --git a/Master/texmf-dist/tex/context/base/core-new.tex b/Master/texmf-dist/tex/context/base/core-new.tex
index d5de7d91ae0..35dfe48509f 100644
--- a/Master/texmf-dist/tex/context/base/core-new.tex
+++ b/Master/texmf-dist/tex/context/base/core-new.tex
@@ -15,56 +15,13 @@
\unprotect
-% \def\setups
-% {\dosingleargument\dosetups}
-%
-% \def\dosetups[#1]%
-% {\iffirstargument
-% \def\next{\dodosetups{#1}}%
-% \else
-% \let\next\dodosetups
-% \fi
-% \next}
-%
-% \def\dodosetups#1%
-% {\processcommalist[#1]\dododosetups}
-%
-% \def\dododosetups#1%
-% {\getvalue{\??su#1}}
-%
-% \def\doifsetupselse#1%
-% {\doifdefinedelse{\??su#1}}
-%
-% \long\@EA\def\csname\e!start\v!instellingen\endcsname#1 %
-% {\bgroup
-% \catcode`\^^M=\@@ignore
-% \xdostartsetups{#1}}
-%
-% \expanded
-% {\long\noexpand\def\noexpand\xdostartsetups##1##2\csname\e!stop\v!instellingen\endcsname
-% {\endgroup
-% \long\noexpand\setvalue{\??su##1}{##2}}}
-%
-% \def\startsetups % for international purposes
-% {\begingroup\doifnextcharelse[{\startsetupsA\stopsetups}{\startsetupsB\stopsetups}}
-%
-% \def\startlocalsetups % for nested purposes
-% {\begingroup\doifnextcharelse[{\startsetupsA\stoplocalsetups}{\startsetupsB\stoplocalsetups}}
-%
-% \def\startsetupsA#1[#2]%
-% {\catcode`\^^M=\@@ignore
-% \dostartsetups#1{#2}}
-%
-% \def\startsetupsB#1#2 % space delimited
-% {\startsetupsA#1[#2]}%
-%
-% \long\def\dostartsetups#1#2% watch out: not \grabuntil
-% {\dograbuntil#1{\endgroup\long\setvalue{\??su#2}}}
-
% todo : \startsetups[name][XML] \setups[name][XML]
% todo: \doglobal
+\let\startsetups\relax % to please dep checker
+\let\stopsetups \relax % to please dep checker
+
\expanded
{\long\def\@EA\noexpand\csname\e!start\v!setups\endcsname
{\begingroup\noexpand\doifnextcharelse[%
@@ -86,8 +43,12 @@
\def\dosetupsB[#1]{\cleanuplabel{#1}\processcommacommand[\cleanlabel]\dosetups} % [..]
\def\dosetupsC[#1]{\cleanuplabel{#1}\dosetups\cleanlabel} % [..]
+% \def\dosetups#1% the grid option will be extended to other main modes
+% {\executeifdefined{\??su\ifgridsnapping\v!grid\fi:#1}{\csname\??su:#1\endcsname}\empty}
+
\def\dosetups#1% the grid option will be extended to other main modes
- {\executeifdefined{\??su\ifgridsnapping\v!grid\fi:#1}{\csname\??su:#1\endcsname}\empty}
+ {\executeifdefined{\??su\ifgridsnapping\v!grid\fi:#1}
+ {\executeifdefined{\??su :#1}\empty}}
\let\directsetup\dosetups
@@ -144,22 +105,6 @@
% \ifundefined{\??su\ifgridsnapping\v!grid\fi:#1}#1\else\ifgridsnapping\v!grid\fi%
% #1}}
-% new
-%
-% \startnointerference
-% all kind of code
-% \stopnointerference
-
-\newbox\nointerferencebox
-
-\def\startnointerference
- {\setbox\nointerferencebox\vbox
- \bgroup}
-
-\def\stopnointerference
- {\egroup
- \setbox\nointerferencebox\box\voidb@x}
-
%D new and beta
% \def\defineshortcut
@@ -324,37 +269,5 @@
\def\doifnotenv {\doifnotvariable \s!environment}
\def\env {\getvariable \s!environment}
\def\envvar {\getvariabledefault\s!environment}
-
-\bgroup % some day this will go away
-
-% actually we should handle all discretionaries here
-
-\gdef\cleanedupcolon{:} \catcode`:=\@@active
-
-\gdef\cleanuplabel#1%
- {\begingroup\let:\cleanedupcolon
- \xdef\cleanlabel{#1}%
- \endgroup}
-
-\gdef\cleanupprefixedlabel#1#2%
- {\begingroup\let:\cleanedupcolon
- \xdef\cleanprefix{#1}%
- \xdef\cleanlabel {#2}%
- \endgroup}
-
-\gdef\protectlabels
- {\let:\cleanedupcolon}
-
-\global\def\blabelgroup {\begingroup \let:\cleanedupcolon}
-\global\let\elabelgroup \endgroup
-
-\gdef\labelcsname
- {\begingroup\let:\cleanedupcolon
- \expandafter\endgroup\csname}
-
-\gdef\labelvalue#1%
- {\labelcsname#1\endcsname}
-
-\egroup
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-not.tex b/Master/texmf-dist/tex/context/base/core-not.tex
index 30f40012bb9..1d764e412b7 100644
--- a/Master/texmf-dist/tex/context/base/core-not.tex
+++ b/Master/texmf-dist/tex/context/base/core-not.tex
@@ -948,6 +948,11 @@
\fi \fi
\fi \fi}
+%D For old times sake:
+
+\def\flushfootnotes {\flushnotes}
+\def\doflushfootnotes{\doflushnotes}
+
%D This is a nasty and new secondary footnote flusher. It
%D can be hooked into \type {\everypar} like:
%D
diff --git a/Master/texmf-dist/tex/context/base/core-ntb.tex b/Master/texmf-dist/tex/context/base/core-ntb.tex
index 4e7f0d8a4cd..75c3b55405e 100644
--- a/Master/texmf-dist/tex/context/base/core-ntb.tex
+++ b/Master/texmf-dist/tex/context/base/core-ntb.tex
@@ -110,7 +110,9 @@
\def\@@tblprefix{tbl:} \let\@@rawtblprefix\@@tblprefix
-%D This should be done more efficient:
+%D This should be done more efficient: soon
+
+% \let as well as \expandafter\edef's
\def\settbltag#1#2#3{\setevalue{\@@tblprefix#1:#2:s}{#3}} % \number#3
\def\settblcol#1#2#3{\setevalue{\@@tblprefix#1:#2:c}{#3}}
@@ -253,54 +255,85 @@
\let\setupTBLsection\relax
+% \setupTABLE [y] [first][background=color,backgroundcolor=blue,frame=off,bottomframe=on,topframe=on,framecolor=white]
+% \setupTABLE [first][first][backgroundcorner=2,corner=10,frame=on]
+% \setupTABLE [last] [first][backgroundcorner=4,corner=12,frame=on]
+
+% \setupTABLE [row] [each] [background=color,backgroundcolor=blue,frame=on,framecolor=white]
+% \setupTABLE [first][2] [corner=8]
+% \setupTABLE [last] [2] [corner=5]
+% \setupTABLE [first][last] [corner=7]
+% \setupTABLE [last] [last] [corner=6]
+
+% \startTEXpage
+% \bTABLE[frame=off,align=middle]
+% \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR
+% \bTR \bTD first \eTD \bTD second \eTD \bTD third \eTD \eTR
+% \bTR \bTD alpha \eTD \bTD beta \eTD \bTD gamma \eTD \eTR
+% \eTABLE
+% \stopTEXpage
+
\def\setupTBLcell#1#2% cell over col over row
{\setupTBLsection % already forgotten
\edef\positiverow{\number#1}%
\edef\positivecol{\number#2}%
- \scratchcounter-\maximumrow\advance\scratchcounter#1\advance\scratchcounter\minusone
- \edef\negativerow{\number\scratchcounter}%
- \scratchcounter-\maximumcol\advance\scratchcounter#2\advance\scratchcounter\minusone
- \edef\negativecol{\number\scratchcounter}%
- \getvalue{\@@tblprefix\v!each\v!each}%
- \getvalue{\@@tblprefix\c!y\v!each}%
- \getvalue{\@@tblprefix\c!x\v!each}%
- \getvalue{\@@tblprefix\c!y\v!oddeven\positiverow}%
- \getvalue{\@@tblprefix\c!x\v!oddeven\positivecol}%
- \getvalue{\@@tblprefix\c!x\v!oddeven\positivecol\c!y\v!oddeven\positiverow}%
+ \edef\negativerow{\the\numexpr-\maximumrow+#1+\minusone\relax}%
+ \edef\negativecol{\the\numexpr-\maximumcol+#2+\minusone\relax}%
+ % each each
+ \csname\@@tblprefix\c!x\v!each\c!y\v!each\endcsname
+ \csname\@@tblprefix\c!y\v!each\endcsname
+ \csname\@@tblprefix\c!x\v!each\endcsname
+ % odd even
+ \csname\@@tblprefix\c!y\v!oddeven\positiverow\endcsname
+ \csname\@@tblprefix\c!x\v!oddeven\positivecol\endcsname
+ \csname\@@tblprefix\c!x\v!oddeven\positivecol\c!y\v!oddeven\positiverow\endcsname
+ % row/col number combinations
+ \executeifdefined{\@@tblprefix\c!y\positiverow}\donothing
+ \executeifdefined{\@@tblprefix\c!y\negativerow}\donothing
+ \csname\@@tbl\@@tbl\c!extras\endcsname
+ \letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
+ \executeifdefined{\@@tblprefix\c!x\positivecol}\donothing
+ \executeifdefined{\@@tblprefix\c!x\negativecol}\donothing
+ \csname\@@tbl\@@tbl\c!extras\endcsname
+ \letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
+ % first/last combinations
\ifnum\positiverow=\plusone
- \getvalue{\@@tblprefix\c!y\v!first}%
+ \csname\@@tblprefix\c!y\v!first\endcsname
\executeifdefined{\@@tblprefix\c!x\positivecol\c!y\v!first}\donothing
\fi
\ifnum\positivecol=\plusone
- \getvalue{\@@tblprefix\c!x\v!first}%
+ \csname\@@tblprefix\c!x\v!first\endcsname
\executeifdefined{\@@tblprefix\c!x\v!first\c!y\positiverow}\donothing
\fi
\ifnum\positiverow=\maximumrow\relax
- \getvalue{\@@tblprefix\c!y\v!last}%
+ \csname\@@tblprefix\c!y\v!last\endcsname
\executeifdefined{\@@tblprefix\c!x\positivecol\c!y\v!last}\donothing
\fi
\ifnum\positivecol=\maximumcol\relax
- \getvalue{\@@tblprefix\c!x\v!last}%
+ \csname\@@tblprefix\c!x\v!last\endcsname
\executeifdefined{\@@tblprefix\c!x\v!last\c!y\positiverow}\donothing
\fi
- \ifnum\positiverow=\maximumrow\relax\ifnum\positivecol=\maximumcol\relax
- \getvalue{\@@tblprefix\c!x\v!last\c!y\v!last}%
+ \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\maximumcol\relax
+ \csname\@@tblprefix\c!x\v!last\c!y\v!last\endcsname
\fi\fi
\ifnum\positiverow=\plusone \ifnum\positivecol=\plusone
- \getvalue{\@@tblprefix\c!x\v!first\c!y\v!first}%
+ \csname\@@tblprefix\c!x\v!first\c!y\v!first\endcsname
\fi\fi
+ \ifnum\positiverow=\plusone \ifnum\positivecol=\maximumcol\relax
+ \csname\@@tblprefix\c!x\v!last\c!y\v!first\endcsname
+ \fi\fi
+ \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\plusone
+ \csname\@@tblprefix\c!x\v!first\c!y\v!last\endcsname
+ \fi\fi
+ % header things
\ifnum#1>\noftblhdnxlines\else
- \executeifdefined{\@@tblprefix\v!header\v!each}\donothing
+ \executeifdefined{\@@tblprefix\v!header\v!each }\donothing
\executeifdefined{\@@tblprefix\v!header\positivecol}\donothing
\fi
- \executeifdefined{\@@tblprefix\c!y\positiverow}\donothing
- \executeifdefined{\@@tblprefix\c!y\negativerow}\donothing
- \getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
- \executeifdefined{\@@tblprefix\c!x\positivecol}\donothing
- \executeifdefined{\@@tblprefix\c!x\negativecol}\donothing
- \getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
+ % explicit cells
\executeifdefined{\@@tblprefix\c!x\positivecol\c!y\positiverow}\donothing
\executeifdefined{\@@tblprefix\c!x\negativecol\c!y\negativerow}\donothing
+ % done
\global\letcscsname\@@tblsplitafter\csname\@@tbl\@@tbl\c!after\endcsname
\relax}
diff --git a/Master/texmf-dist/tex/context/base/core-num.tex b/Master/texmf-dist/tex/context/base/core-num.tex
index 2747ea5e74e..442333acf48 100644
--- a/Master/texmf-dist/tex/context/base/core-num.tex
+++ b/Master/texmf-dist/tex/context/base/core-num.tex
@@ -26,7 +26,7 @@
% \convertednumber[name] % getnumber
% \savenumber[name]
% \restorenumber[name]
-% \convertednumner[name]
+% \convertednumber[name]
% \rawnumber[name]
% private (defined in core-sec.tex)
diff --git a/Master/texmf-dist/tex/context/base/core-obj.mkii b/Master/texmf-dist/tex/context/base/core-obj.mkii
new file mode 100644
index 00000000000..efc16655591
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-obj.mkii
@@ -0,0 +1,74 @@
+%D \module
+%D [ file=core-obj,
+%D version=1998.01.15,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Object Handling,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\def\checkobjectreferences
+ {\startnointerference
+ \protectlabels
+ \doutilities{objectreferences}\jobname\empty\relax\relax
+ \global\let\checkobjectreferences\relax
+ \stopnointerference}
+
+\def\setobjectreferences
+ {\def\objectreference##1##2##3##4%
+ {\ifundefined{\r!driver##1::##2}%
+ \setxvalue{\r!driver##1::##2}{{##3}{##4}}%
+ \else
+ \showmessage\m!references{31}{[##1 ##2=>##3/##4]}%
+ \fi}}
+
+\def\resetobjectreferences
+ {\let\objectreference\gobblefourarguments}
+
+\resetobjectreferences
+
+\def\mkregisterobjectreference#1#2#3%
+ {\checkobjectreferences
+ \blabelgroup
+ \expanded{\writeutilitycommand{\noexpand\objectreference{#1}{#2}{#3}{\noexpand\realfolio}}}%
+ \setxvalue{\r!driver#1::#2}{{#3}{\noexpand\realfolio}}%
+ \elabelgroup}
+
+\def\mkoverloadobjectreference#1#2#3%
+ {\checkobjectreferences
+ \blabelgroup
+ \setxvalue{\r!driver#1::#2}{{#3}{\noexpand\realfolio}}%
+ \elabelgroup}
+
+\def\dodogetobjectreference#1#2#3#4#5%
+ {\checkobjectreferences
+ \blabelgroup
+ \ifundefined{\r!driver#3::#4}%
+ \showmessage\m!references{30}{[#3 #4=>#3/#4]}%
+ \xdef#5{#2{#3}{#4}}%
+ \else
+ \xdef#5{\@EAEAEA#1\csname\r!driver#3::#4\endcsname}%
+ \fi
+ \elabelgroup}
+
+\def\mkgetobjectreference
+ {\dodogetobjectreference\firstoftwoarguments\defaultobjectreference}
+
+\def\mkgetobjectreferencepage
+ {\dodogetobjectreference\secondoftwoarguments\defaultobjectpage}
+
+\def\mkifobjectreferencefoundelse#1#2%
+ {\checkobjectreferences
+ \blabelgroup \ifcsname\r!driver#1::#2\endcsname
+ \elabelgroup \expandafter\firstoftwoarguments
+ \else
+ \elabelgroup \expandafter\secondoftwoarguments
+ \fi}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-obj.tex b/Master/texmf-dist/tex/context/base/core-obj.tex
index d9e51911c4a..8741c396855 100644
--- a/Master/texmf-dist/tex/context/base/core-obj.tex
+++ b/Master/texmf-dist/tex/context/base/core-obj.tex
@@ -271,63 +271,24 @@
\objectreferenced
-\def\checkobjectreferences
- {\startnointerference
- \protectlabels
- \doutilities{objectreferences}\jobname\empty\relax\relax
- \global\let\checkobjectreferences\relax
- \stopnointerference}
-
-\def\setobjectreferences
- {\def\objectreference##1##2##3##4%
- {\ifundefined{\r!driver##1::##2}%
- \setxvalue{\r!driver##1::##2}{{##3}{##4}}%
- \else
- \showmessage\m!references{31}{[##1 ##2=>##3/##4]}%
- \fi}}
-
-\def\resetobjectreferences
- {\let\objectreference\gobblefourarguments}
-
-\resetobjectreferences
-
-\def\dosetobjectreference#1#2#3%
- {\checkobjectreferences
- \blabelgroup
- \ifcase\crossreferenceobject
+% no undefined test ! ! ! ! (pdftex fails on undefined objects)
+
+\def\dosetobjectreference
+ {\ifcase\crossreferenceobject
\objectreferenced
+ \expandafter\mkoverloadobjectreference
\else
- \edef\dowritereference
- {\writeutilitycommand{\objectreference{#1}{#2}{#3}{\noexpand\realfolio}}}%
- \dowritereference
- \fi
- %\ifundefined{\r!driver#1::#2}% could have been be replaced !
- \setxvalue{\r!driver#1::#2}{{#3}{\noexpand\realfolio}}%
- %\fi % so no test ! ! ! ! (pdftex fails on undefined objects)
- \elabelgroup}
+ \expandafter\mkregisterobjectreference
+ \fi}
\def\dosetdriverreference
{\driverreferenced\dosetobjectreference}
-\def\defaultobjectreference#1#2{0}
+\def\defaultobjectreference#1#2{0} % driver dependent
\def\defaultobjectpage #1#2{\realfolio}
-\def\dodogetobjectreference#1#2#3#4#5%
- {\checkobjectreferences
- \blabelgroup
- \ifundefined{\r!driver#3::#4}%
- \showmessage\m!references{30}{[#3 #4=>#3/#4]}%
- \xdef#5{#2{#3}{#4}}%
- \else
- \xdef#5{\@EAEAEA#1\csname\r!driver#3::#4\endcsname}%
- \fi
- \elabelgroup}
-
-\def\dogetobjectreference
- {\dodogetobjectreference\firstoftwoarguments\defaultobjectreference}
-
-\def\dogetobjectreferencepage
- {\dodogetobjectreference\secondoftwoarguments\defaultobjectpage}
+\def\dogetobjectreference {\mkgetobjectreference}
+\def\dogetobjectreferencepage{\mkgetobjectreferencepage}
\def\setobject {\driverreferenced\dosetobject1}
\def\settightobject{\driverreferenced\dosetobject0}
@@ -343,27 +304,6 @@
%D \doifobjectreferencefoundelse{class}{object}{do then}{do else}
%D \stoptyping
-\beginTEX
-
-\def\doifobjectfoundelse#1#2%
- {\blabelgroup \@EA\ifx\csname\r!object#1::#2\endcsname\relax
- \elabelgroup \expandafter\secondoftwoarguments
- \else
- \elabelgroup \expandafter\firstoftwoarguments
- \fi}
-
-\def\doifobjectreferencefoundelse#1#2%
- {\checkobjectreferences
- \blabelgroup \@EA\ifx\csname\r!driver#1::#2\endcsname\relax
- \elabelgroup \expandafter\secondoftwoarguments
- \else
- \elabelgroup \expandafter\firstoftwoarguments
- \fi}
-
-\endTEX
-
-\beginETEX
-
\def\doifobjectfoundelse#1#2%
{\blabelgroup \ifcsname\r!object#1::#2\endcsname
\elabelgroup \expandafter\firstoftwoarguments
@@ -371,15 +311,7 @@
\elabelgroup \expandafter\secondoftwoarguments
\fi}
-\def\doifobjectreferencefoundelse#1#2%
- {\checkobjectreferences
- \blabelgroup \ifcsname\r!driver#1::#2\endcsname
- \elabelgroup \expandafter\firstoftwoarguments
- \else
- \elabelgroup \expandafter\secondoftwoarguments
- \fi}
-
-\endETEX
+\def\doifobjectreferencefoundelse{\mkifobjectreferencefoundelse}
%D \macros
%D {doifobjectssupportedelse}
@@ -410,4 +342,8 @@
%D support objects while we still want to be able to use the
%D \DVI\ output.
+%D Plugin code:
+
+\loadmarkfile{core-obj}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-par.tex b/Master/texmf-dist/tex/context/base/core-par.tex
index 66c3ad85098..403aeca6f22 100644
--- a/Master/texmf-dist/tex/context/base/core-par.tex
+++ b/Master/texmf-dist/tex/context/base/core-par.tex
@@ -103,7 +103,7 @@
\setgvalue{\paragraphprefix\totalnofparagraphs}{#1}%
\else
\setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}%
- \fi}
+ \fi}
\long\def\directskipparagraph#1%
{\doglobal\increment\totalnofparagraphs
@@ -114,14 +114,14 @@
\ifx#1\undefined
\let#1\relax
\fi
- \convertargument#1\to\asciiA
- \convertargument{ }\to\asciiB % lege regel
+ \convertargument#1\to\asciia
+ \convertargument{ }\to\asciib % lege regel
\def\dopushparagraph##1\par
- {\convertargument##1\to\asciiC
- \doifelse\asciiC\asciiA
+ {\convertargument##1\to\asciic
+ \doifelse\asciic\asciia
{#1}
- {\doifsomething\asciiC % lege paragraaf
- {\doifnot\asciiC\asciiB
+ {\doifsomething\asciic % lege paragraaf
+ {\doifnot\asciic\asciib
{\directpushparagraph{#1}}}%
\dopushparagraph}}%
\dopushparagraph}
diff --git a/Master/texmf-dist/tex/context/base/core-pgr.tex b/Master/texmf-dist/tex/context/base/core-pgr.tex
index ea47363a744..22015fb3e03 100644
--- a/Master/texmf-dist/tex/context/base/core-pgr.tex
+++ b/Master/texmf-dist/tex/context/base/core-pgr.tex
@@ -21,55 +21,37 @@
% in the future, the depth of tail will reflect page depth
-\def\textanchor{text:\realfolio}
-
\ifx\textheight\undefined \def\textheight{\vsize} \fi
-\def\placepositionanchors % todo : depth pagebox
- {\ifpositioning
- \setbox\scratchbox\vbox to \textheight
- {\simpletopskipcorrection
- \hbox{\strut\dopositionaction\headanchor}%
- \vfill
- \hbox{\strut\dopositionaction\tailanchor}}%
- \dp\scratchbox\zeropoint
- \wd\scratchbox\makeupwidth % not \zeropoint, else wrong text backgrounds
- \hpos\textanchor{\box\scratchbox}%
- \else
- \vskip\textheight
- \fi}
-
-%D The first version of this module implemented head and tail
-%D anchors. Currently we stick to just one anchor and derive
-%D the head and tail anchors from this one.
+%D The next macros so some housekeeping.
+\def\pageanchor{page:0}
+\def\textanchor{text:\realfolio}
\def\headanchor{head:\realfolio} % virtual position
\def\tailanchor{tail:\realfolio} % virtual position
-\def\presetpositionanchors% compatibility hack (still needed?)
- {\ifpositioning
- \dopresetpositionanchors
- \fi}
+%D Anchors:
-\def\dopresetpositionanchors
+\def\dopresetpositionanchors % also mkii
{\bgroup
\!!dimena\ifdim\topskip>\strutht\topskip\else\strutht\fi
- \!!dimenb\MPy\textanchor
- \!!dimenc\!!dimenb
- \advance\!!dimenb \MPh\textanchor % space is essential
- \advance\!!dimenb -\!!dimena
- \advance\!!dimenc \strutdp
+ \!!dimenb\dimexpr\MPy\textanchor+\MPh\textanchor-\!!dimena\relax
+ \!!dimenc\dimexpr\MPy\textanchor+\strutdp\relax
\!!dimend\MPx\textanchor
\!!dimene\MPw\textanchor
- \setxvalue{\POSprefix\headanchor}%
- {\realfolio,\withoutpt\the\!!dimend,\withoutpt\the\!!dimenb,%
- \withoutpt\the\!!dimene,\withoutpt\the\!!dimena,\withoutpt\the\strutdp}%
- \setxvalue{\POSprefix\tailanchor}%
- {\realfolio,\withoutpt\the\!!dimend,\withoutpt\the\!!dimenc,%
- \withoutpt\the\!!dimene,\withoutpt\the\strutht,\withoutpt\the\strutdp}%
- %\showanchor\textanchor\showanchor\headanchor\showanchor\tailanchor\wait
+ \replacepospxywhd\headanchor\realfolio\!!dimend\!!dimenb\!!dimene\!!dimena\strutdp
+ \replacepospxywhd\tailanchor\realfolio\!!dimend\!!dimenc\!!dimene\strutht \strutdp
\egroup}
+\def\presetpositionanchors% compatibility hack (still needed?)
+ {\ifpositioning
+ \dopresetpositionanchors
+ \fi}
+
+%D The first version of this module implemented head and tail
+%D anchors. Currently we stick to just one anchor and derive
+%D the head and tail anchors from this one.
+
\def\showanchor#1%
{\expanded{\writestatus{#1}
{\MPp{#1}\string|\MPx{#1}\string|\MPy{#1}\string|%
@@ -79,6 +61,31 @@
\appendtoks \presetpositionanchors \to \beforeeverypage
\appendtoks \presetpositionanchors \to \aftereverypage
+
+% todo: change with each page size change
+
+\def\registerpageposition#1% this one is flushed first !
+ {\ifpositioning\ifcase\realpageno\or
+ \ifdim\printpaperheight=\paperheight\else
+ \ifdim\printpaperwidth=\paperwidth\else
+ \setbox#1\hbox{\hpos\pageanchor{\box#1}}%
+ \fi
+ \fi
+ \fi\fi}
+
+\def\placepositionanchors % todo : depth pagebox
+ {\ifpositioning
+ \setbox\scratchbox\vbox to \textheight
+ {\simpletopskipcorrection
+ \hbox{\strut\dopositionaction\headanchor}%
+ \vfill
+ \hbox{\strut\dopositionaction\tailanchor}}%
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\makeupwidth % not \zeropoint, else wrong text backgrounds
+ \hpos\textanchor{\box\scratchbox}%
+ \else
+ \vskip\textheight
+ \fi}
%D \macros
%D {positionoverlay,startpositionoverlay}
@@ -258,6 +265,8 @@
{\long\setgvalue{MPG:#1}% tag list mpcode
{\useMPpositiongraphic{#1}{#2}{#3}}}
+\let\stopMPpositiongraphic\relax
+
\def\prepareMPpositionvariables
{\ifundefined{\@@meta self}\setvalue{\@@meta self}{\currentposition}\fi
\ifundefined{\@@meta from}\setvalue{\@@meta from}{\currentposition}\fi}
@@ -342,6 +351,8 @@
\long\def\startMPpositionmethod#1#2\stopMPpositionmethod
{\long\setgvalue{MPM:#1}{#2}} % todo: var list here
+\let\stopMPpositionmethod\relax
+
%D Simple one position graphics.
\def\setMPpositiongraphic
@@ -519,35 +530,6 @@
% snap_multi_par_tops := false ;
\stopuseMPgraphic
-% \startMPpositionmethod{mpos:par}
-% \doifpositionelse{w:\MPvar{self}}
-% {\startMPpositiongraphic{mpos:par}%
-% {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
-% initialize_area_par(\MPpos{b:\MPvar{self}},
-% \MPpos{e:\MPvar{self}},
-% \MPpos{w:\MPvar{self}}) ;
-% \includeMPgraphic{mpos:par:setup} ;
-% \includeMPgraphic{mpos:par:extra} ;
-% \includeMPgraphic{\MPvar{mp}} ; % \includeMPgraphic{mpos:par:shape} ;
-% anchor_par(\MPanchor{b:\MPvar{self}}) ;
-% \stopMPpositiongraphic}
-% {\startMPpositiongraphic{mpos:par}%
-% {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
-% initialize_par(\MPpos{b:\MPvar{self}},
-% \MPpos{e:\MPvar{self}},
-% \MPpos{text:\realfolio},
-% \MPpos{p:\MPparcounter},
-% \MPvv {p:\MPparcounter}{0,0,0,0,0,0}) ;
-% \includeMPgraphic{mpos:par:setup} ;
-% \includeMPgraphic{mpos:par:extra} ;
-% \includeMPgraphic{\MPvar{mp}} ; % \includeMPgraphic{mpos:par:shape} ;
-% anchor_par(\MPanchor{b:\MPvar{self}}) ;
-% \stopMPpositiongraphic}%
-% \MPpositiongraphic{mpos:par}{}%
-% \stopMPpositionmethod
-
-%D Less readable but shorter.
-
\ifx\MPparcounter\undefined \newcounter\MPparcounter \fi
\def\MPself {\MPvar{self}}
@@ -578,7 +560,7 @@
\MPpos\MPeself,
\MPpos\textanchor,
\MPpos\MPparanchor,
- \MPvv \MPparanchor{0,0,0,0,0,0}) ;
+ \MPvv \MPparanchor{0pt,0pt,0pt,0pt,0,0pt}) ;
\includeMPgraphic{mpos:par:setup} ;
\includeMPgraphic{mpos:par:extra} ;
\includeMPgraphic{\MPvar{mp}} ;
@@ -603,7 +585,7 @@
\includeMPgraphic{mpos:par:setup} ;
\includeMPgraphic{mpos:par:extra} ;
prepare_multi_pars(\MPpos\MPbself,\MPpos\MPeself,\MPpos\MPwself,
- \MPpos\MPparanchor,\MPvv\MPparanchor{0,0,0,0,0,0}) ;
+ \MPpos\MPparanchor,\MPvv\MPparanchor{0pt,0pt,0pt,0pt,0,0pt}) ;
relocate_multipars(-\MPxy\MPanchorid) ; % inside layerpos
\includeMPgraphic{\MPvar{mp}} ;
\stopMPpositiongraphic
@@ -1264,7 +1246,7 @@
%D The next hack make sure that margin texts near faulty
%D strutted lines are handled ok.
-\newif\ifrepositionmarginbox % \repositionmarginboxtrue
+\newif\ifrepositionmarginbox \repositionmarginboxtrue
\newcounter\currentmarginpos
@@ -1285,29 +1267,83 @@
% \vadjust{\box#1}%
% \egroup}
-\def\dopositionmarginbox#1% how about page boundaries !
+% \def\dopositionmarginbox#1% how about page boundaries !
+% {\bgroup
+% \ifrepositionmarginbox
+% \doglobal\increment\currentmarginpos
+% \setposition{\s!margin:\currentmarginpos}%
+% \scratchdimen\MPy{\s!margin:\currentmarginpos}%
+% \doglobal\increment\currentmarginpos
+% \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
+% \advance\scratchdimen -\strutdp
+% % new
+% \setbox#1\hbox
+% {\hskip-\MPx{\s!margin:\currentmarginpos}%
+% \hskip\MPx{head:\realfolio}%
+% \box#1}%
+% % so far
+% \setbox#1\hbox
+% {\setposition{\s!margin:\currentmarginpos}%
+% \raise\scratchdimen\box#1}%
+% \dp#1\zeropoint
+% \ht#1\zeropoint
+% \fi
+% \graphicvadjust{\box#1}%
+% \egroup}
+
+\def\dopositionmarginbox#1%
{\bgroup
\ifrepositionmarginbox
\doglobal\increment\currentmarginpos
\setposition{\s!margin:\currentmarginpos}%
- \scratchdimen\MPy{\s!margin:\currentmarginpos}%
- \doglobal\increment\currentmarginpos
- \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
- \advance\scratchdimen -\strutdp
- % new
- \setbox#1\hbox
- {\hskip-\MPx{\s!margin:\currentmarginpos}%
- \hskip\MPx{head:\realfolio}%
- \box#1}%
- % so far
- \setbox#1\hbox
- {\setposition{\s!margin:\currentmarginpos}%
- \raise\scratchdimen\box#1}%
+ \ifcase\marginrepositionmethod
+ % nothing
+ \or
+ % nothing
+ \or
+ % stack / page check yet untested
+% \scratchcounter\MPp{\s!margin:\currentmarginpos}\relax
+ \scratchdimen\MPy{\s!margin:\currentmarginpos}%
+ \doglobal\increment\currentmarginpos
+ \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
+ \advance\scratchdimen -\strutdp
+% \ifnum\scratchcounter=\MPp{\s!margin:\currentmarginpos}\relax
+ % new
+ \setbox#1\hbox
+ {\hskip-\MPx{\s!margin:\currentmarginpos}%
+ \hskip\MPx{head:\realfolio}%
+ \box#1}%
+ % so far
+ \setbox#1\hbox
+ {\setposition{\s!margin:\currentmarginpos}%
+ \raise\scratchdimen\box#1}%
+% \fi
+ \or
+ % move up
+ \ifnum\MPp{p:\parposcounter}=\MPp{\s!margin:\currentmarginpos}\relax
+ \scratchdimen\dimexpr\MPy{p:\parposcounter}-\MPy{\s!margin:\currentmarginpos}\relax
+ \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}%
+ \fi
+ \or
+ % move up, assume end of par
+ \ifnum\MPp{p:\parposcounter}=\MPp{\s!margin:\currentmarginpos}\relax
+ \getnoflines\margincontentheight
+ \advance\noflines\minusone
+ \scratchdimen\noflines\lineheight
+ \else
+ \scratchdimen\dimexpr\MPy{p:\parposcounter}-\MPy{\s!margin:\currentmarginpos}\relax
+ \fi
+ \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}%
+ \fi
\dp#1\zeropoint
\ht#1\zeropoint
\fi
\graphicvadjust{\box#1}%
\egroup}
+
+\chardef\marginrepositionmethod\plusone % sidemethod
+\chardef\margincontentmethod \plusthree % textmethod % beware: 1 = old method
+\chardef\marginpagecheckmethod \plusone % splitmethod
%D For a right menu, a sequence of calls to \type
%D {right_menu_button} is generated.
@@ -1384,16 +1420,16 @@
{\doglobal\appendtoks\dodododoGSC[#1:#2]\to\posXCtoks\NC}
\def\dodoGSC[#1]%
- {\def\docommando##1{\dododoGSC[##1:##1]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\dododoGSC[##1:##1]}%
+ \processcommalist[#1]\docommand}
\def\dodododoGFC[#1:#2:#3]%
{\remappositionframed{#2}{\tbPOSprefix#1}%
\bpos{\tbPOSprefix#1}}
\def\dododoGFC[#1]%
- {\def\docommando##1{\dodododoGFC[##1:##1]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\dodododoGFC[##1:##1]}%
+ \processcommalist[#1]\docommand}
\def\dodoGFC[#1]%
{\doglobal\appendtoks\dododoGFC[#1]\to\posXCtoks\NC}
@@ -1402,8 +1438,8 @@
{\epos{\tbPOSprefix#1}}
\def\dodododoGTC[#1]%
- {\def\docommando##1{\dododododoGTC[##1:##1]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\dododododoGTC[##1:##1]}%
+ \processcommalist[#1]\docommand}
\def\dododoGTC[#1]%
{\doglobal\appendtoks\dodododoGTC[#1]\to\posXCtoks}
diff --git a/Master/texmf-dist/tex/context/base/core-pos.mkii b/Master/texmf-dist/tex/context/base/core-pos.mkii
new file mode 100644
index 00000000000..754673cfa30
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-pos.mkii
@@ -0,0 +1,184 @@
+%D \module
+%D [ file=core-pos,
+%D version=1999.08.01,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Positioning Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D A unique prefix used for storing data.
+
+\def\POSprefix{POS::}
+
+%D Reading form the utility file.
+
+\def\pxypos {\pospxy} % obsolete
+\def\pxyposwhd {\pospxywhd} % obsolete
+\def\pxyposplus{\pospxyplus} % obsolete
+
+\def\resetpositions
+ {\let\pospxy \gobblefourarguments
+ \let\pospxywhd \gobblesevenarguments
+ \let\pospxyplus\gobbleeightarguments}
+
+\def\setpositions
+ {\let\pospxy \setpospxy
+ \let\pospxywhd \setpospxywhd
+ \let\pospxyplus\setpospxyplus}
+
+%D We need to initialize.
+
+\resetpositions
+
+\addutilityreset{positions}
+
+%D Core set macros:
+
+\def\setpospxy#1#2#3#4%
+ {\@EA\xdef\csname\POSprefix#1\endcsname
+ {\number#2,%
+ \the\dimexpr#3\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax,%
+ \the\dimexpr#4\ifnum\positionanchormode=\plusone-\MPy\pageanchor\fi\relax}}
+
+\def\setpospxywhd#1#2#3#4#5#6#7%
+ {\@EA\xdef\csname\POSprefix#1\endcsname
+ {\number#2,%
+ \the\dimexpr#3\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax,%
+ \the\dimexpr#4\ifnum\positionanchormode=\plusone-\MPy\pageanchor\fi\relax,%
+ \the\dimexpr#5\relax,%
+ \the\dimexpr#6\relax,%
+ \the\dimexpr#7\relax}}
+
+\def\setpospxyplus#1#2#3#4#5#6#7#8%
+ {\@EA\xdef\csname\POSprefix#1\endcsname
+ {\number#2,%
+ \the\dimexpr#3\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax,%
+ \the\dimexpr#4\ifnum\positionanchormode=\plusone-\MPy\pageanchor\fi\relax,%
+ \the\dimexpr#5\relax,%
+ \the\dimexpr#6\relax,%
+ \the\dimexpr#7\relax,%
+ #8}}
+
+%D Sometimes we want to trick the position handler a bit:
+
+\def\replacepospxywhd#1#2#3#4#5#6#7%
+ {\@EA\xdef\csname\POSprefix#1\endcsname
+ {\number#2,%
+ \the\dimexpr#3\relax,%
+ \the\dimexpr#4\relax,%
+ \the\dimexpr#5\relax,%
+ \the\dimexpr#6\relax,%
+ \the\dimexpr#7\relax}}
+
+%D Writing to the utility file.
+
+\def\dolazysaveposition#1#2#3#4% tag page x y
+ {\expanded{\writeutilitycommand{\noexpand\pospxy
+ {#1}{#2}{#3}{#4}}}}
+
+\def\dolazysavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
+ {\expanded{\writeutilitycommand{\noexpand\pospxywhd
+ {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
+
+\def\dolazysavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
+ {\expanded{\writeutilitycommand{\noexpand\pospxyplus
+ {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
+
+\def\dosaveposition#1#2#3#4% tag page x y
+ {\expanded{\immediatewriteutilitycommand{\noexpand\pospxy
+ {#1}{#2}{#3}{#4}}}}
+
+\def\dosavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
+ {\expanded{\immediatewriteutilitycommand{\noexpand\pospxywhd
+ {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
+
+\def\dosavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
+ {\expanded{\immediatewriteutilitycommand{\noexpand\pospxyplus
+ {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
+
+\def\MPp {\doMPxyhdwlr\doMPp }
+\def\MPx {\doMPxyhdwlr\doMPx }
+\def\MPy {\doMPxyhdwlr\doMPy }
+\def\MPw {\doMPxyhdwlr\doMPw }
+\def\MPh {\doMPxyhdwlr\doMPh }
+\def\MPd {\doMPxyhdwlr\doMPd }
+\def\MPxy {\doMPxyhdwlr\doMPxy }
+\def\MPll {\doMPxyhdwlr\doMPll }
+\def\MPlr {\doMPxyhdwlr\doMPlr }
+\def\MPur {\doMPxyhdwlr\doMPur }
+\def\MPul {\doMPxyhdwlr\doMPul }
+\def\MPpos{\doMPxyhdwlr\doMPpos}
+
+\def\doMPp #1,#2,#3,#4,#5,#6,#7\relax{#1}
+\def\doMPx #1,#2,#3,#4,#5,#6,#7\relax{#2}
+\def\doMPy #1,#2,#3,#4,#5,#6,#7\relax{#3}
+\def\doMPw #1,#2,#3,#4,#5,#6,#7\relax{#4}
+\def\doMPh #1,#2,#3,#4,#5,#6,#7\relax{#5}
+\def\doMPd #1,#2,#3,#4,#5,#6,#7\relax{#6}
+\def\doMPxy #1,#2,#3,#4,#5,#6,#7\relax{(#2,#3)}
+\def\doMPll #1,#2,#3,#4,#5,#6,#7\relax{(#2,#3-#6)}
+\def\doMPlr #1,#2,#3,#4,#5,#6,#7\relax{(#2+#4,#3-#6)}
+\def\doMPur #1,#2,#3,#4,#5,#6,#7\relax{(#2+#4,#3+#5)}
+\def\doMPul #1,#2,#3,#4,#5,#6,#7\relax{(#2,#3+#5)}
+\def\doMPpos#1,#2,#3,#4,#5,#6,#7\relax{#1,#2,#3,#4,#5,#6}
+
+\def\doMPxyhdwlr#1#2%
+ {\ifcsname\POSprefix#2\endcsname
+ \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,0pt,0pt,0pt,0pt\relax
+ \else
+ #10,0pt,0pt,0pt,0pt,0pt,0pt\relax
+ \fi}
+
+% \def\doMPxyhdwlr#1#2% evt kan \s!unknown leeg zijn
+% {\@EA\@EA\@EA#1\csname\POSprefix
+% \ifcsname\POSprefix#2\endcsname#2\else\s!unknown\fi\endcsname
+% ,0pt,0pt,0pt,0pt\relax}
+%
+% \setvalue{\POSprefix\s!unknown}{0,0pt,0pt}
+
+\def\MPplus {\MPdoplus\doMPplus}
+\def\MPrest#1{\MPdoplus\doMPrest{#1}{}}
+
+\def\MPdoplus#1#2#3#4%
+ {\ifcsname\POSprefix#2\endcsname
+ \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,,,,,,,,,\relax{#3}%
+ \else
+ #4%
+ \fi}
+
+\def\doMPplus#1,#2,#3,#4,#5,#6,%
+ {\dodoMPplus}
+
+\def\dodoMPplus#1,#2,#3,#4,#5,#6,#7,#8\relax#9%
+ {\ifcase#9\or#1\or#2\or#3\or#4\or#5\or#6\or#7\else\dododoMPplus#8\relax{#9}\fi}
+
+\def\dododoMPplus#1,#2,#3,#4,#5,#6,#7,#8\relax#9%
+ {\ifcase#9\or\or\or\or\or\or\or\or#1\or#2\or#3\or#4\or#5\or#6\or#7\fi}
+
+\def\doMPrest#1,#2,#3,#4,#5,#6,#7,,#8\relax#9%
+ {#7}
+
+%D Testing:
+
+\def\doifpositionelse#1%
+ {\ifcsname\POSprefix#1\endcsname
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
+%D Copying:
+
+\def\copyposition#1#2%
+ {\ifcsname\POSprefix#2\endcsname
+ \global\@EA\let\csname\POSprefix#1\@EA\endcsname\csname\POSprefix#2\endcsname
+ \fi}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-pos.tex b/Master/texmf-dist/tex/context/base/core-pos.tex
index 0324e522c1d..6b0e103fddb 100644
--- a/Master/texmf-dist/tex/context/base/core-pos.tex
+++ b/Master/texmf-dist/tex/context/base/core-pos.tex
@@ -86,37 +86,15 @@
%D \dosetpositionplus {identifier} {width} {height} {depth} {list}
%D \dosetpositionpapersize {width} {height}
%D \stoptyping
-%D
-%D Either directly, when using \PDFTEX, or by means of a
-%D postprocessor, when using \DVI\ output, these end up in the
-%D utility file as:
-%D
-%D \starttyping
-%D \pospxy {identifier} {page} {x} {y}
-%D \pospxywhd {identifier} {page} {x} {y} {w} {h} {d}
-%D \pospxylist {identifier} {page} {x} {y} {w} {h} {d} {list}
-%D \stoptyping
-%D
-%D This means that we have to provide both a utility set and
-%D reset macro for positions.
-\def\POSprefix{POS::}
-
-\def\pxypos {\pospxy} % obsolete
-\def\pxyposwhd {\pospxywhd} % obsolete
-\def\pxyposplus{\pospxyplus} % obsolete
-
-\def\resetpositions
- {\let\pospxy \gobblefourarguments
- \let\pospxywhd \gobblesevenarguments
- \let\pospxyplus\gobbleeightarguments}
+\newbox\positionbox
+\newif \ifpositioning
-\def\setpositions
- {\let\pospxy \setpospxy
- \let\pospxywhd \setpospxywhd
- \let\pospxyplus\setpospxyplus}
+\def\POSprefix{POS::}
-\addutilityreset{positions}
+\let\setpospx \gobblefourarguments % suppress errors with mkii tuo file
+\let\setpospxywhd \gobblesevenarguments % suppress errors with mkii tuo file
+\let\setpospxyplus\gobbleeightarguments % suppress errors with mkii tuo file
%D This is real tricky! The page anchor is applied to the
%D page box and therefore flushed first. So, when present, it
@@ -125,69 +103,15 @@
\chardef\positionanchormode=0 % don't relocate page origin
\chardef\positionanchormode=1 % relocate page origin once
-\def\pageanchor{page:0}
-
-% todo: change with each page size change
+%D The core set macros.
-\def\registerpageposition#1% this one is flushed first !
- {\ifpositioning\ifcase\realpageno\or
- \ifdim\printpaperheight=\paperheight\else
- \ifdim\printpaperwidth=\paperwidth\else
- \setbox#1\hbox{\hpos\pageanchor{\box#1}}%
- \fi
- \fi
- \fi\fi}
-
-\def\setpospxy#1#2#3#4%
- {\dosetpositionnm\@@posp{#2}%
- \dosetpositionxy\@@posx{#3}\MPx
- \dosetpositionxy\@@posy{#4}\MPy
- \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy}}
-
-\def\setpospxywhd#1#2#3#4#5#6#7%
- {\dosetpositionnm\@@posp{#2}%
- \dosetpositionxy\@@posx{#3}\MPx
- \dosetpositionxy\@@posy{#4}\MPy
- \dosetpositionpt\@@posw{#5}%
- \dosetpositionpt\@@posh{#6}%
- \dosetpositionpt\@@posd{#7}%
- \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}}
-
-\def\setpospxyplus#1#2#3#4#5#6#7#8%
- {\dosetpositionnm\@@posp{#2}%
- \dosetpositionxy\@@posx{#3}\MPx
- \dosetpositionxy\@@posy{#4}\MPy
- \dosetpositionpt\@@posw{#5}%
- \dosetpositionpt\@@posh{#6}%
- \dosetpositionpt\@@posd{#7}%
- \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd,#8}}
+\let\pospxy \gobblefourarguments
+\let\pospxywhd \gobblesevenarguments
+\let\pospxyplus\gobbleeightarguments
%D Sometimes we want to trick the position handler a bit:
-\def\replacepospxywhd#1#2#3#4#5#6#7%
- {\begingroup
- \nosetpositionnm\@@posp{#2}%
- \nosetpositionpt\@@posx{#3}%
- \nosetpositionpt\@@posy{#4}%
- \nosetpositionpt\@@posw{#5}%
- \nosetpositionpt\@@posh{#6}%
- \nosetpositionpt\@@posd{#7}%
- \@EA\xdef\csname\POSprefix#1\endcsname{\@@posp,\@@posx,\@@posy,\@@posw,\@@posh,\@@posd}%
- \endgroup}
-
-% slower, as many tokens, etc:
-%
-% \def\replacepospxywhd#1#2#3#4#5#6#7%
-% {\begingroup
-% \let\dosetpositionnm\nosetpositionnm
-% \let\dosetpositionpt\nosetpositionpt
-% \let\dosetpositionxy\nosetpositionpt
-% \setpospxywhd{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
-% \endgroup}
-
-%D We need to initialize.
-
-\resetpositions
+\let\replacepospxywhd\gobbleeightarguments
%D For postprocessing purposes, we save the number of
%D positions.
@@ -221,35 +145,6 @@
\localpositioningfalse
\to \everypagebody
-%D We save positionional information without dimensions, which
-%D saves some bytes. The conversion too saves some bytes, but
-%D is primarily needed because we want to pass those values to
-%D \METAPOST\ too.
-
-\def\dosetpositionpt#1#2%
- {\scratchdimen\number#2\scaledpoint
- \xdef#1{\withoutpt\the\scratchdimen}}
-
-\def\dosetpositionnm#1#2%
- {\xdef#1{\number#2}}
-
-\def\dosetpositionxy#1#2#3% todo: scaled points
- {\scratchdimen\number#2\scaledpoint
- \ifcase\positionanchormode\or
- \advance\scratchdimen-#3\pageanchor
- \fi
- \xdef#1{\withoutpt\the\scratchdimen}}
-
-\def\nosetpositionnm#1#2{\xdef#1{\number#2}}
-\def\nosetpositionpt#1#2{\scratchdimen#2\xdef#1{\withoutpt\the\scratchdimen}}
-
-\beginETEX \dimexpr
-
- \def\dosetpositionpt#1#2{\xdef#1{\withoutpt\the\dimexpr(\number#2\scaledpoint)}}
- \def\nosetpositionpt#1#2{\xdef#1{\withoutpt\the\dimexpr(#2)}}
-
-\endETEX
-
\def\checkpositions
{\startnointerference
\protectlabels
@@ -268,29 +163,12 @@
%D method is implemented in a special driver. If needed, the
%D driver can fall back on the following macros.
-\def\dolazysaveposition#1#2#3#4% tag page x y
- {\expanded{\writeutilitycommand{\noexpand\pospxy
- {#1}{#2}{#3}{#4}}}}
-
-\def\dolazysavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
- {\expanded{\writeutilitycommand{\noexpand\pospxywhd
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
-
-\def\dolazysavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
- {\expanded{\writeutilitycommand{\noexpand\pospxyplus
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
-
-\def\dosaveposition#1#2#3#4% tag page x y
- {\expanded{\immediatewriteutilitycommand{\noexpand\pospxy
- {#1}{#2}{#3}{#4}}}}
-
-\def\dosavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
- {\expanded{\immediatewriteutilitycommand{\noexpand\pospxywhd
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
-
-\def\dosavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
- {\expanded{\immediatewriteutilitycommand{\noexpand\pospxyplus
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
+\let\dolazysaveposition \gobblefourarguments % tag page x y
+\let\dolazysavepositionwhd \gobblesevenarguments % tag page x y w h d
+\let\dolazysavepositionplus\gobbleeightarguments % tag page x y w h d list
+\let\dosaveposition \gobblefourarguments % tag page x y
+\let\dosavepositionwhd \gobblesevenarguments % tag page x y w h d
+\let\dosavepositionplus \gobbleeightarguments % tag page x y w h d list
%D \macros
%D {MPp, MPx, MPy, MPw, MPh, MPd,
@@ -299,57 +177,18 @@
%D Access to the positional information is provided by macros
%D with short names that are clearly meant for \METAPOST.
-\def\MPp {\doMPxyhdwlr\doMPp }
-\def\MPx {\doMPxyhdwlr\doMPx }
-\def\MPy {\doMPxyhdwlr\doMPy }
-\def\MPw {\doMPxyhdwlr\doMPw }
-\def\MPh {\doMPxyhdwlr\doMPh }
-\def\MPd {\doMPxyhdwlr\doMPd }
-\def\MPxy {\doMPxyhdwlr\doMPxy }
-\def\MPll {\doMPxyhdwlr\doMPll }
-\def\MPlr {\doMPxyhdwlr\doMPlr }
-\def\MPur {\doMPxyhdwlr\doMPur }
-\def\MPul {\doMPxyhdwlr\doMPul }
-\def\MPpos{\doMPxyhdwlr\doMPpos}
-
-%D So \type {\MPx{identifier}} returns a position, specified
-%D in points. When unknown, \type {0pt} is returned. From the
-%D next definitions, we can see that some positions are
-%D expressions.
-
-\def\doMPp #1,#2,#3,#4,#5,#6,#7\relax{#1}
-\def\doMPx #1,#2,#3,#4,#5,#6,#7\relax{#2\s!pt}
-\def\doMPy #1,#2,#3,#4,#5,#6,#7\relax{#3\s!pt}
-\def\doMPw #1,#2,#3,#4,#5,#6,#7\relax{#4\s!pt}
-\def\doMPh #1,#2,#3,#4,#5,#6,#7\relax{#5\s!pt}
-\def\doMPd #1,#2,#3,#4,#5,#6,#7\relax{#6\s!pt}
-\def\doMPxy #1,#2,#3,#4,#5,#6,#7\relax{(#2\s!pt,#3\s!pt)}
-\def\doMPll #1,#2,#3,#4,#5,#6,#7\relax{(#2\s!pt,#3\s!pt-#6\s!pt)}
-\def\doMPlr #1,#2,#3,#4,#5,#6,#7\relax{(#2\s!pt+#4\s!pt,#3\s!pt-#6\s!pt)}
-\def\doMPur #1,#2,#3,#4,#5,#6,#7\relax{(#2\s!pt+#4\s!pt,#3\s!pt+#5\s!pt)}
-\def\doMPul #1,#2,#3,#4,#5,#6,#7\relax{(#2\s!pt,#3\s!pt+#5\s!pt)}
-\def\doMPpos#1,#2,#3,#4,#5,#6,#7\relax{#1,#2\s!pt,#3\s!pt,#4\s!pt,#5\s!pt,#6\s!pt}
-
-%D As said, we will default to zero (dimensions) when a
-%D position is unknown.
-
-\def\doMPxyhdwlr#1#2%
- {\ifundefined{\POSprefix#2}%
- #10,0,0,0,0,0,0\relax
- \else
- \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,0,0,0,0\relax
- \fi}
-
-\beginETEX
-
-\def\doMPxyhdwlr#1#2% evt kan \s!unknown leeg zijn
- {\@EA\@EA\@EA#1\csname\POSprefix
- \ifcsname\POSprefix#2\endcsname#2\else\s!unknown\fi\endcsname
- ,0,0,0,0\relax}
-
-\setvalue{\POSprefix\s!unknown}{0,0,0}
-
-\endETEX
+\let\MPp \!!zerocount
+\def\MPx \!!zeropoint
+\def\MPy \!!zeropoint
+\def\MPw \!!zeropoint
+\def\MPh \!!zeropoint
+\def\MPd \!!zeropoint
+\def\MPxy \!!zeropoint
+\def\MPll \!!zeropoint
+\def\MPlr \!!zeropoint
+\def\MPur \!!zeropoint
+\def\MPul \!!zeropoint
+\def\MPpos{\!!zerocount,\!!zeropoint,\!!zeropoint,\!!zeropoint,\!!zeropoint,\!!zeropoint}
%D \macros
%D {MPplus, MPrest, MPv, MPvv}
@@ -371,57 +210,23 @@
%D
%D The extra parameters are not treated.
-\def\MPplus {\MPdoplus\doMPplus} \let\MPv \MPplus
-\def\MPrest#1{\MPdoplus\doMPrest{#1}{}} \let\MPvv\MPrest
-
-\def\MPdoplus#1#2#3#4%
- {\ifundefined{\POSprefix#2}#4\else
- \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,,,,,,,,,\relax{#3}%
- \fi}
-
-% \beginETEX
-%
-% \def\MPdoplus#1#2#3#4%
-% {\ifcsname\POSprefix#2\endcsname
-% \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,,,,,,,,,\relax{#3}%
-% \else
-% #4%
-% \fi}
-%
-% \endETEX
-
-\def\doMPplus#1,#2,#3,#4,#5,#6,%
- {\dodoMPplus}
-
-\def\dodoMPplus#1,#2,#3,#4,#5,#6,#7,#8\relax#9%
- {\ifcase#9\or#1\or#2\or#3\or#4\or#5\or#6\or#7\else
- \dododoMPplus#8\relax{#9}\fi}
-
-\def\dododoMPplus#1,#2,#3,#4,#5,#6,#7,#8\relax#9%
- {\ifcase#9\or \or \or \or \or \or \or \or
- #1\or#2\or#3\or#4\or#5\or#6\or#7\fi}
-
-\def\doMPrest#1,#2,#3,#4,#5,#6,#7,,#8\relax#9%
- {#7}
-
-% We can now remap the normal whd onto this.
+\def\MPplus#1#2{\!!zerocount} \def\MPv {\MPplus}
+\def\MPrest#1#2{#2} \def\MPvv{\MPrest}
%D \macros
%D {MPanchor}
%D
%D For readability we define a few synonyms:
-\let\MPanchor\MPpos
+\def\MPanchor{\MPpos}
%D \macros
%D {POSp, POSx, POSy, POSh, POSd, POSw}
%D
%D and:
-\let\POSp\MPp \let\POSx\MPx \let\POSy\MPy
-\let\POSh\MPh \let\POSd\MPd \let\POSw\MPw
-
-\newbox\positionbox \newif\ifpositioning
+\def\POSp{\MPp} \def\POSx{\MPx} \def\POSy{\MPy}
+\def\POSh{\MPh} \def\POSd{\MPd} \def\POSw{\MPw}
%D There are two low level positioning macros. Both store the
%D position as well as execute an action associated with that
@@ -431,47 +236,11 @@
{\ifpositioning \else
\global\positioningtrue
\dosetpositionpapersize
- {\number\printpaperwidth}%
- {\number\printpaperheight }%
+ {\printpaperwidth }%
+ {\printpaperheight}%
\fi
\doglobal\increment\currentpositions}
-% \def\setposition#1%
-% {\initializenextposition
-% \dosetposition{#1}%
-% \dopositionaction{#1}}
-%
-% \def\setpositionbox#1%
-% {\dowithnextbox
-% {\hbox to \nextboxwd
-% {\initializenextposition
-% \def\currentposition{#1}%
-% \dosetpositionwhd \currentposition
-% {\number\nextboxwd}%
-% {\number\nextboxht}%
-% {\number\nextboxdp}%
-% \traceposstring\llap\green{\currentposition>}%
-% \setbox\positionbox\flushnextbox
-% \dopositionaction\currentposition
-% \box\positionbox
-% \hss}}}
-%
-% \def\setpositionplus#1#2%
-% {\dowithnextbox
-% {\hbox to \nextboxwd
-% {\initializenextposition
-% \def\currentposition{#1}%
-% \dosetpositionplus \currentposition
-% {\number\nextboxwd}%
-% {\number\nextboxht}%
-% {\number\nextboxdp}%
-% {#2}%
-% \traceposstring\rlap\magenta{<\currentposition}%
-% \setbox\positionbox\flushnextbox
-% \dopositionaction\currentposition
-% \box\positionbox
-% \hss}}}
-
\def\setpositiononly#1%
{\iftrialtypesetting
% nothing
@@ -498,9 +267,9 @@
\hbox
{\def\currentposition{#1}%
\dosetpositionwhd\currentposition
- {\number#2}%
- {\number#3}%
- {\number#4}%
+ {\the\dimexpr#2\relax}%
+ {\the\dimexpr#3\relax}%
+ {\the\dimexpr#4\relax}%
\traceposstring\llap\green{\currentposition>}%
\dopositionaction\currentposition
\hss}%
@@ -515,9 +284,9 @@
\hbox to \nextboxwd
{\edef\currentposition{#1}%
\dosetpositionwhd\currentposition
- {\number\nextboxwd}%
- {\number\nextboxht}%
- {\number\nextboxdp}%
+ {\the\nextboxwd}%
+ {\the\nextboxht}%
+ {\the\nextboxdp}%
\traceposstring\llap\green{\currentposition>}%
\setbox\positionbox\flushnextbox
\dopositionaction\currentposition
@@ -531,9 +300,9 @@
\hbox to \nextboxwd
{\edef\currentposition{#1}%
\dosetpositionplus\currentposition
- {\number#2}%
- {\number#3}%
- {\number#4}%
+ {\the\dimexpr#2\relax}%
+ {\the\dimexpr#3\relax}%
+ {\the\dimexpr#4\relax}%
{#5}%
\traceposstring\rlap\magenta{<\currentposition}%
\dopositionaction\currentposition
@@ -549,9 +318,9 @@
\hbox to \nextboxwd
{\edef\currentposition{#1}%
\dosetpositionplus\currentposition
- {\number\nextboxwd}%
- {\number\nextboxht}%
- {\number\nextboxdp}%
+ {\the\nextboxwd}%
+ {\the\nextboxht}%
+ {\the\nextboxdp}%
{#2}%
\traceposstring\rlap\magenta{<\currentposition}%
\setbox\positionbox\flushnextbox
@@ -637,15 +406,7 @@
%D
%D Again, this is a global action.
-\def\copyposition#1#2%
- {\bgroup
- %\edef\to {\POSprefix#1}%
- \edef\from{\POSprefix#2}%
- \ifundefined\from\else
- % \global\@EA\@EA\@EA\let\@EA\csname\@EA\to\@EA\endcsname\csname\from\endcsname
- \global\@EA\let\csname\POSprefix#1\@EA\endcsname\csname\from\endcsname
- \fi
- \egroup}
+\let\copyposition\gobbletwoarguments
%D The fact that handling positions is a two pass operation, is
%D one of the reasons why we need to be able to test for
@@ -655,15 +416,7 @@
%D \doifpositionelse {identifier} {found action} {not found action}
%D \stoptyping
-% \def\doifpositionelse#1%
-% {\doifdefinedelse{\POSprefix#1}}
-
-\def\doifpositionelse#1%
- {\ifundefined{\POSprefix#1}%
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
+\let\doifpositionelse\thirdofthreearguments
%D We have now arrived at a few macros that would make sense as
%D support macros, but ended up in the core.
@@ -754,9 +507,6 @@
\newif\ifpositioningpar
-\def\efficientdimen#1%
- {\the#1} % \ifdim#1=\zeropoint\string\!!zeropoint\else\the#1\fi}
-
% we can check for used entries, and if not, then not add one
\def\registerparoptions
@@ -779,15 +529,15 @@
\rightskip1\rightskip
\setpositiondataplus
{p:\parposcounter}% % identifier
- {\zeropoint}%
- {\strutht}%
- {\strutdp}%
- {\efficientdimen\hsize ,% 1
- \efficientdimen\leftskip ,% 2
- \efficientdimen\rightskip ,% 3
- \efficientdimen\hangindent,% 4
- \the\hangafter ,% 5
- \efficientdimen\parindent }% 6
+ {\the\zeropoint}%
+ {\the\strutht}%
+ {\the\strutdp}%
+ {\the\hsize ,% 1
+ \the\leftskip ,% 2
+ \the\rightskip ,% 3
+ \the\hangindent,% 4
+ \the\hangafter ,% 5 (num)
+ \the\parindent }% 6
%\normalhbox{\registerparsymbol}%
\registerparsymbol
\endgroup}
@@ -801,13 +551,14 @@
{\iftracepositions
\smashedhbox to \zeropoint
{\hss
- \blue
+ \startcolor[blue]%
\llap{\infofont\number\parposcounter}%
\scratchdimen\onepoint
\vrule
\!!width 4\scratchdimen
\!!height2\scratchdimen
\!!depth 2\scratchdimen
+ \stopcolor
\hss}%
\fi}
@@ -819,17 +570,24 @@
\def\@@nodeo{node:o:}
\def\@@nodep{node:p:}
+\def\doifelsenodelocation#1%
+ {\ifcsname\@@noden#1\endcsname
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
\def\nextnodelocation#1%
- {\pluscounter{\@@noden#1}}
+ {\ifcsname\@@noden#1\endcsname\pluscounter{\@@noden#1}\fi}
\def\newnodelocation#1%
- {\ifundefined{\@@noden#1}%
+ {\ifcsname\@@noden#1\endcsname
\setcounter{\@@noden#1}\zerocount
\letgvalue {\@@nodeo#1}\!!zerocount
\fi}
\def\tagnodelocation#1%
- {\xypos{\@@nodep#1:\countervalue{\@@noden#1}}}
+ {\ifcsname\@@noden#1\endcsname\xypos{\@@nodep#1:\countervalue{\@@noden#1}}\fi}
\def\getnodelocationp#1{\MPp{\@@nodep#1:\countervalue{\@@noden#1}}}
\def\getnodelocationx#1{\MPx{\@@nodep#1:\countervalue{\@@noden#1}}}
@@ -845,7 +603,9 @@
\chardef\nodelocationmode\plusone
\def\analyzenodelocation#1%
- {\doanalyzenodelocation{#1}{\getnodelocationn{#1}}\zerocount}
+ {\ifcsname\@@noden#1\endcsname
+ \doanalyzenodelocation{#1}{\getnodelocationn{#1}}\zerocount
+ \fi}
\def\doanalyzenodelocation#1#2#3% class n default
{\begingroup
@@ -906,13 +666,15 @@
\endgroup}
\unexpanded\def\shownodelocation#1%
- {\analyzenodelocation{#1}%
- (#1,%
- n:\getnodelocationn{#1},%
- p:\getnodelocationp{#1},%
- x:\getnodelocationx{#1},%
- y:\getnodelocationy{#1},%
- o:\getnodelocationo{#1})}
+ {\ifcsname\@@noden#1\endcsname
+ \analyzenodelocation{#1}%
+ (#1,%
+ n:\getnodelocationn{#1},%
+ p:\getnodelocationp{#1},%
+ x:\getnodelocationx{#1},%
+ y:\getnodelocationy{#1},%
+ o:\getnodelocationo{#1})%
+ \fi}
%D \macros
%D {doifoverlappingelse}
@@ -934,13 +696,13 @@
\edef\!!stringa{#1}\edef\!!stringb{#2}%
\ifnum\MPp\!!stringa=\MPp\!!stringb\relax
\!!dimena\MPx\!!stringa
- \!!dimenb\MPx\!!stringa\advance\!!dimenb \MPw\!!stringa
- \!!dimenc\MPy\!!stringa\advance\!!dimenc-\MPd\!!stringa
- \!!dimend\MPy\!!stringa\advance\!!dimend \MPh\!!stringa
+ \!!dimenb\dimexpr\MPx\!!stringa+\MPw\!!stringa\relax
+ \!!dimenc\dimexpr\MPy\!!stringa-\MPd\!!stringa\relax
+ \!!dimend\dimexpr\MPy\!!stringa+\MPh\!!stringa\relax
\!!dimene\MPx\!!stringb
- \!!dimenf\MPx\!!stringb\advance\!!dimenf \MPw\!!stringb
- \!!dimeng\MPy\!!stringb\advance\!!dimeng-\MPd\!!stringb
- \!!dimenh\MPy\!!stringb\advance\!!dimenh \MPh\!!stringb
+ \!!dimenf\dimexpr\MPx\!!stringb+\MPw\!!stringb\relax
+ \!!dimeng\dimexpr\MPy\!!stringb-\MPd\!!stringb\relax
+ \!!dimenh\dimexpr\MPy\!!stringb+\MPh\!!stringb\relax
\ifdim\overlappingmargin=\zeropoint\else
\advance\!!dimena-\overlappingmargin
\advance\!!dimenb+\overlappingmargin
@@ -998,13 +760,13 @@
\def\dodoifpositionsonsamepageelse#1#2#3#4%
{\bgroup
\scratchcounter#1\donefalse
- \def\docommando##1%
+ \def\docommand##1%
{\ifcase\scratchcounter
\scratchcounter\MPp{##1}\donetrue
\else
\ifnum\scratchcounter=\MPp{##1}\relax\else\donefalse\fi
\fi}%
- \rawprocesscommalist[#2]\docommando
+ \rawprocesscommalist[#2]\docommand
\ifdone\egroup#3\else\egroup#4\fi}
\def\doifpositionsonsamepageelse
@@ -1013,4 +775,16 @@
\def\doifpositionsonthispageelse#1#2#3%
{\dodoifpositionsonsamepageelse\realfolio}
+%D Plugins:
+
+\loadmarkfile{core-pos}
+
+\let\MPv \MPplus
+\let\MPvv \MPrest
+
+\let\MPanchor\MPpos
+
+\let\POSp\MPp \let\POSx\MPx \let\POSy\MPy
+\let\POSh\MPh \let\POSd\MPd \let\POSw\MPw
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-ref.tex b/Master/texmf-dist/tex/context/base/core-ref.tex
index 4a0c1a3ce12..9c6ad0f9ca9 100644
--- a/Master/texmf-dist/tex/context/base/core-ref.tex
+++ b/Master/texmf-dist/tex/context/base/core-ref.tex
@@ -222,7 +222,6 @@
{#3}%
\egroup}
-
%D As we can see, these macros depend on three other ones,
%D \type {\makesectionformat}, that generated \type
%D {\sectionformat}, \type {\pagenumber}. The not yet used
@@ -313,11 +312,12 @@
\ifx\lastreference\empty \else
\doiffirstreferenceoccurance\lastreference
{\thisisdestination{\referenceprefix\lastreference}}%
- \referentieinfo>\lastreference
- \edef\dododowritereference
- {\writeutilitycommand
- {\mainreference{\referenceprefix}{\lastreference}{#4}{#5}{#6}}}%
- \dododowritereference
+ \referenceinfo>\lastreference
+% \edef\dododowritereference
+% {\writeutilitycommand
+% {\mainreference{\referenceprefix}{\lastreference}{#4}{#5}{#6}}}%
+% \dododowritereference
+ \expanded{\writeutilitycommand{\noexpand\mainreference{\referenceprefix}{\lastreference}{#4}{#5}{#6}}}%
\fi
\egroup}
@@ -329,19 +329,6 @@
%D In practice this comes to giving \type {\mainreference} a
%D appropriate meaning and loading the utility file.
-% \def\setreferences
-% {\def\mainreference##1##2##3##4##5%
-% {\doifundefinedelse{\r!cross\fileprefix##1##2}
-% {\setglobalcrossreference{##1##2}{##3}{##4}{##5}}
-% {\showmessage\m!references{2}{[##1][##2],##4}}}}
-
-% \def\setreferences
-% {\the\everyreference % we're grouped anyway
-% \def\mainreference##1##2##3##4##5%
-% {\doifundefinedelse{\r!cross\fileprefix##1##2}
-% {\setglobalcrossreference{##1##2}{##3}{##4}{##5}}
-% {\ifcase0##4\else\showmessage\m!references{2}{[##1][##2],##4}\fi}}}
-
%D For a long time the only way to access an external file was
%D to use the file prefix (\type {somefile::}. However, when
%D you split up a document, redefining the references may be
@@ -359,48 +346,31 @@
\chardef\autocrossfilereferences=0
-% \def\setreferences % some day, filename will be stored in ref record
-% {\the\everyreference % we're grouped anyway
-% \def\mainreference##1##2##3##4##5%
-% {\doifundefinedelse{\r!cross\fileprefix##1##2}
-% {\ifcase\autocrossfilereferences
-% \setglobalcrossreference{##1##2}{##3}{##4}{##5}%
-% \or
-% \setglobalcrossreference{##1##2}{##3}{##4}{##5}%
-% \doifundefinedelse{\r!cross##1##2}
-% {\expanded{\definereference[##1##2][\fileprefix##1##2]}}
-% {\showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}}%
-% \or
-% \doifundefinedelse{\r!cross##1##2}
-% {\expanded{\definereference[##1##2][\noexpand\v!pagina(\fileprefix##4)]}}
-% {\showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}}%
-% \fi}
-% {\ifcase0##4\else
-% \showmessage\m!references2{[##1][##2],##4 (\currentutilityfilename)}%
-% \fi}}}
-
-% optimizing this one makes sense when we have docs with 10K
-% refs.
-
\def\setreferences% some day, filename will be stored in ref record
{\the\everyreference % we're grouped anyway
\def\mainreference##1##2##3##4##5% can be made faster by indirect calls
- {\ifundefined{\r!cross\fileprefix##1##2}% \ifcsname\r!cross\fileprefix##1##2\endcsname
+ {\ifcsname\r!cross\fileprefix##1##2\endcsname
+ \ifcase0##4\else
+ \showmessage\m!references2{[##1][##2],##4 (\currentutilityfilename)}%
+ \fi
+ \else
\ifcase\autocrossfilereferences
\setglobalcrossreference{##1##2}{##3}{##4}{##5}%
\or
\setglobalcrossreference{##1##2}{##3}{##4}{##5}%
- \doifundefinedelse{\r!cross##1##2}
- {\expanded{\definereference[##1##2][\fileprefix##1##2]}}
- {\showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}}%
+ \ifcsname\r!cross##1##2\endcsname
+ \showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}%
+ \else
+ \expanded{\definereference[##1##2][\fileprefix##1##2]}%
+ \fi
\or
- \doifundefinedelse{\r!cross##1##2}
- {\expanded{\definereference[##1##2][\noexpand\v!page(\fileprefix##4)]}}
- {\showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}}%
+ \ifcsname\r!cross##1##2\endcsname
+ \showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}%
+ \else
+ \expanded{\definereference[##1##2][\noexpand\v!page(\fileprefix##4)]}%
+ \fi
\fi
- \else\ifcase0##4\else
- \showmessage\m!references2{[##1][##2],##4 (\currentutilityfilename)}%
- \fi\fi}}
+ \fi}}
\def\resetreferences
{\let\mainreference\gobblefivearguments}
@@ -506,7 +476,7 @@
\def\setglobalcrossreference#1#2#3#4%
{\scratchtoks{#4}%
- \global\advance\crossreferenceorder 1
+ \global\advance\crossreferenceorder \plusone
\@EA\xdef\csname\r!cross\fileprefix#1\endcsname
{\rt!cross{#2}{#3}{\the\scratchtoks}{\the\crossreferenceorder}}}
@@ -516,17 +486,6 @@
\def\setglobalsystemreference#1#2#3%
{\@EA\xdef\csname\r!cross\fileprefix#2\endcsname{#1{#3}}}
-% Maybe I need this some day.
-
-% \def\copycrossreference#1#2#3% file from to
-% {\bgroup
-% \def\fileprefix{#1::}%
-% \def\rt!cross##1##2##3##4%
-% {\setxvalue{\r!cross\fileprefix#3}%
-% {\noexpand\rt!cross{##1}{##2}{##3}{##4}}}%
-% \getvalue{\r!cross\fileprefix#2}%
-% \egroup}
-
\def\copycrossreference#1#2#3% file from to / slow
{\bgroup
\doifelse{#1}{}
@@ -580,13 +539,6 @@
%D with four arguments and one with only two, we need a two
%D step filter.
-%\def\getreferenceelements#1%
-% {\edef\referenceelements{\getvalue{\r!cross\referenceprefix#1}}%
-% \expandafter\dogetreferenceelements\referenceelements{}{}{}{}}
-%
-%\def\getreferenceelements#1% only one level expansion permitted!
-% {\@EA\@EA\@EA\dogetreferenceelements\csname\r!cross\referenceprefix#1\endcsname{}{}{}{}}
-
\def\getreferenceelements#1% only one level expansion permitted!
{\@EA\@EA\@EA\dogetreferenceelements\csname\r!cross\referenceprefix#1\endcsname\empty\empty\empty\empty}
@@ -746,33 +698,8 @@
%D meaning of the original cross reference. In fact,
%D \type{\rt!cross} is toggled to \type{\rt!done}.
-% \def\doiffirstreferenceoccurance#1#2%
-% {\ifcheckduplicatereferences
-% \doifundefinedelse{\r!cross\referenceprefix#1}
-% {#2}
-% {\getreferenceelements{#1}%
-% \ifnum\currentreferencetype=\rt!cross
-% #2%
-% \bgroup
-% \def\rt!cross##1##2##3##4%
-% {\setgvalue{\r!cross\referenceprefix#1}%
-% {\rt!done{##1}{##2}{##3}{##4}}}%
-% \getvalue{\r!cross\referenceprefix#1}%
-% \egroup
-% \fi}%
-% \else
-% #2%
-% \fi}
-
\def\rt!crossdone#1#2#3#4{\rt!done{#1}{#2}{#3}{#4}}
-% \def\dohandleduplicatereference#1%
-% {\bgroup
-% \let\rt!cross\rt!crossdone
-% \@EA\xdef\csname\r!cross\referenceprefix#1\endcsname
-% {\csname\r!cross\referenceprefix#1\endcsname}%
-% \egroup}
-
\def\dohandleduplicatereference#1%
{\bgroup
\let\rt!cross\rt!crossdone
@@ -780,17 +707,6 @@
{\csname\r!cross\referenceprefix#1\endcsname}%
\egroup}
-% \def\checkfirstreferenceoccurance#1#2% etex
-% {\ifcsname\r!cross\referenceprefix#1\endcsname
-% \getreferenceelements{#1}%
-% \ifnum\currentreferencetype=\rt!cross
-% \dohandleduplicatereference{#1}%
-% #2%
-% \fi
-% \else
-% #2%
-% \fi}
-
\def\checkfirstreferenceoccurance#1#2% etex
{\@EA\ifx\csname\r!cross\referenceprefix#1\endcsname\relax % no ifcsname needed here
\predefinereference{#1}%
@@ -1274,7 +1190,7 @@
\fi}
\def\docheckglobalfilereference#1%
- {\ifundefined{\r!cross#1::\currentinnerreference}\else
+ {\ifcsname\r!cross#1::\currentinnerreference\endcsname
\def\currentouterreference{#1}%
\edef\currentfullreference%
{\currentouterreference::\currentinnerreference}%
@@ -1315,101 +1231,6 @@
% lijst, dan de chain doorlopen. Momenteel mag alleen laatste
% laatste undefined zijn, eigenlijk moet dat overal kunnen met
% 'geen' zonder melding. Is wel trager. Dus niet.
-%
-% \def\doifreferencefoundelse#1#2#3% \@EA niet nodig
-% {\doresetgotowhereever
-% \global\secondaryreferencefalse
-% {\the\everyreference\xdef\primaryreference{#1}}%
-% \global\nofsecondaryreferences=0
-% \def\dopreprocessreference##1,%
-% {\if]##1\else
-% \ifsecondaryreference
-% \ifenablereferencechains \iflocation
-% {\the\everyreference\xdef\secondaryreference{##1}}%
-% %\global\advance\nofsecondaryreferences by 1
-% \@EA\dodoifreferencefoundelse\@EA{\secondaryreference}
-% {\global\advance\nofsecondaryreferences by 1
-% #2}
-% {%\global\advance\nofsecondaryreferences by -1
-% \dostartnoto#3\dostopnoto}%
-% \fi \fi
-% \else
-% {\the\everyreference\xdef\primaryreference{##1}}%
-% \global\secondaryreferencetrue
-% \fi
-% \expandafter\dopreprocessreference
-% \fi}%
-% \dopreprocessreference#1,],%
-% \global\secondaryreferencefalse
-% \@EA\dodoifreferencefoundelse\@EA{\primaryreference}{#2}{#3}%
-% \doresetgotowhereever} % to prevent problems with direct goto's
-
-% \def\doifreferencefoundelse#1#2#3% REF \cs
-% {\checkreferences
-% \bgroup
-% \the\everyreference
-% \let\referenceprefix\empty
-% \expandreferences{#1}%
-% \egroup
-% \doresetgotowhereever
-% \global\nofsecondaryreferences 0
-% \ifcase\nofexpandedreferences\relax % #1 can be number -)
-% % no ref
-% \or
-% % one ref
-% \or
-% % two refs
-% \ifenablereferencechains \iflocation
-% \global\secondaryreferencetrue
-% \xdef\secondaryreference{\csname REF::2\endcsname}%
-% \bgroup
-% \let\unharmedreferenceprefix\referenceprefix
-% %\bgroup
-% \dodoifreferencefoundelse\secondaryreference
-% \global\nofsecondaryreferences 1
-% \ifreferencefound
-% #2%
-% \else
-% \dostartnoto#3\dostopnoto
-% \fi
-% %\egroup
-% \egroup
-% \fi \fi
-% \else
-% % more than two refs
-% \ifenablereferencechains \iflocation
-% \global\secondaryreferencetrue
-% \scratchcounter2
-% \loop
-% \xdef\secondaryreference{\csname REF::\number\scratchcounter\endcsname}%
-% \bgroup
-% \let\unharmedreferenceprefix\referenceprefix
-% %\bgroup
-% \dodoifreferencefoundelse\secondaryreference
-% \global\advance\nofsecondaryreferences 1
-% \ifreferencefound
-% #2%
-% \else
-% \global\advance\nofsecondaryreferences -1
-% \dostartnoto#3\dostopnoto
-% \fi
-% %\egroup
-% \egroup
-% \ifnum\scratchcounter<\nofexpandedreferences\relax
-% \advance\scratchcounter 1
-% \repeat
-% \fi \fi
-% \fi
-% \global\secondaryreferencefalse
-% \xdef\primaryreference{\csname REF::1\endcsname}%
-% \bgroup
-% \let\unharmedreferenceprefix\referenceprefix
-% %\bgroup
-% \dodoifreferencefoundelse\primaryreference
-% \ifreferencefound#2\else#3\fi
-% %\egroup
-% \egroup
-% \doresetgotowhereever} % to prevent problems with direct goto's
\def\doifreferencefoundelse#1#2#3% REF \cs / never more than one group (else \aftergroup usage problems)
{\checkreferences
@@ -1439,7 +1260,7 @@
\global\nofsecondaryreferences \plusone
#2%
\else
- \dostartnoto#3\dostopnoto
+ \dohandlenoto{#3}%
\fi
\egroup
\fi \fi
@@ -1459,7 +1280,7 @@
\global\advance\nofsecondaryreferences \plusone
#2%
\else
- \dostartnoto#3\dostopnoto
+ \dohandlenoto{#3}%
\fi
\egroup
\ifnum\scratchcounter<\nofexpandedreferences\relax
@@ -1494,20 +1315,20 @@
{\dodoifreferencefoundelse{#1}%
\ifreferencefound\@EA\firstoftwoarguments\else\@EA\secondoftwoarguments\fi}
-%D Somewhere else we will properly define \type {\dostartgoto};
+%D Somewhere else we will properly define \type {\dohandlegoto};
%D the noto alternative takes care of undefined references in
%D a sequence
-\ifx\dostartnoto\undefined
+\ifx\dohandlenoto\undefined
- \def\dostartnoto#1\dostopnoto
+ \def\dohandlenoto#1%
{\ifsecondaryreference\else{#1}\fi}
\fi
-\ifx\dostartgoto\undefined
+\ifx\dohandlegoto\undefined
- \def\dostartgoto\data#1\start#2\stop#3\dostopgoto
+ \def\dohandlegoto#1#2#3%
{\ifsecondaryreference\else{#1}\fi}
\fi
@@ -1523,10 +1344,11 @@
{\checkreferences
\bgroup
\edef\currentfullreference{#1}%
- \ifundefined{\r!cross\currentfullreference}%
- \global\referencefoundfalse #3%
- \else\getreferenceelements\currentfullreference
- \global\referencefoundtrue #2%
+ \ifcsname\r!cross\currentfullreference\endcsname
+ \getreferenceelements\currentfullreference
+ \global\referencefoundtrue#2%
+ \else
+ \global\referencefoundfalse#3%
\fi
\egroup}
@@ -1538,25 +1360,6 @@
%D \goto{some text}[prefix:reference]
%D \stoptyping
-%\def\docheckinnerreference%
-% {\global\let\predefinedreference=\currentinnerreference
-% \ifx\currentreferencearguments\empty
-% \doifdefinedelse{\r!cross\referenceprefix\currentfullreference}
-% {\global\referencefoundtrue}
-% {\let\referenceprefix\empty
-% \doifdefinedelse{\r!cross\currentfullreference}
-% {\global\referencefoundtrue}
-% {\global\referencefoundfalse}}%
-% \else % [SomeThing{with,me}]
-% \let\referenceprefix\empty
-% \doifdefinedelse{\r!cross\currentinnerreference}
-% {\global\referencefoundtrue}
-% {\global\referencefoundfalse}%
-% \fi
-% \doifpredefinedreferenceelse{\global\referencefoundfalse}{}}
-
-\beginETEX
-
\def\docheckinnerreference
{\global\let\predefinedreference\currentinnerreference
\ifx\currentreferencearguments\empty
@@ -1580,35 +1383,6 @@
\fi
\doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-\endETEX
-
-\beginTEX
-
-\def\docheckinnerreference
- {\global\let\predefinedreference\currentinnerreference
- \ifx\currentreferencearguments\empty
- \@EA\ifx\csname\r!cross\referenceprefix\currentfullreference\endcsname\relax
- \let\referenceprefix\empty
- \@EA\ifx\csname\r!cross\currentfullreference\endcsname\relax
- \global\referencefoundfalse
- \else
- \global\referencefoundtrue
- \fi
- \else
- \global\referencefoundtrue
- \fi
- \else % [SomeThing{with,me}]
- \let\referenceprefix\empty
- \@EA\ifx\csname\r!cross\currentinnerreference\endcsname\relax
- \global\referencefoundfalse
- \else
- \global\referencefoundtrue
- \fi
- \fi
- \doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-
-\endTEX
-
%D References to other files however are treated strict or
%D tolerant, depending on their loading and availability:
%D
@@ -1624,67 +1398,8 @@
%D \type{\setouterreference} as a signal that indeed references
%D are defined for the outer file.
-% \def\docheckouterreference%
-% {\let\referenceprefix=\empty
-% \let\unharmedreferenceprefix=\empty
-% \xdef\predefinedreference%
-% {\currentouterreference::\currentinnerreference}%
-% \ifx\innerreference\empty
-% \global\referencefoundtrue % no checking done
-% \else
-% \doifdefinedelse{\r!cross\currentouterreference::}
-% {\doifdefinedelse{\r!cross\currentfullreference}
-% {\global\referencefoundtrue}
-% {\global\referencefoundfalse}}
-% {\global\referencefoundtrue}% no checking done
-% \fi
-% \doifpredefinedreferenceelse{\global\referencefoundfalse}{}}
-
\newif\ifstrictouterreferences \strictouterreferencesfalse
-\beginTEX
-
-\def\dodocheckouterreference
- {\@EA\ifx\csname\specialREFidentifier\currentfullreference\endcsname\relax
- \ifstrictouterreferences
- \global\referencefoundfalse
- \else
- % already \global\referencefoundtrue % no checking done
- \fi
- \else
- \@EA\@EA\@EA\splitofffullreference\@EA\@EA\@EA % 1 level
- {\csname\specialREFidentifier\currentfullreference\endcsname}%
- \docheckouterreference
- \fi}
-
-\def\docheckouterreference
- {\let\referenceprefix\empty
- \let\unharmedreferenceprefix\empty
- \xdef\predefinedreference
- {\currentouterreference::\currentinnerreference}%
- \ifx\innerreference\empty
- \global\referencefoundtrue % no checking done
- \else
- \@EA\ifx\csname\r!cross\currentouterreference::\endcsname\relax
- \ifstrictouterreferences
- \global\referencefoundfalse
- \else
- \global\referencefoundtrue % no checking done
- \fi
- \else
- \ifcsname\r!cross\currentfullreference\endcsname
- \global\referencefoundtrue
- \else
- \dodocheckouterreference
- \fi
- \fi
- \fi
- \doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-
-\endTEX
-
-\beginETEX \ifcsname
-
\def\dodocheckouterreference
{\ifcsname\specialREFidentifier\currentfullreference\endcsname
\@EA\@EA\@EA\splitofffullreference\@EA\@EA\@EA % 1 level
@@ -1720,8 +1435,6 @@
\fi
\doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-\endETEX
-
%D Special references are only tested when some test routine is
%D defined.
@@ -1738,24 +1451,6 @@
%D An unknown reference is reported on the screen, in the log
%D file and, when enabled, in the left margin of the text.
-% \def\reportreferenceerror#1#2%
-% {\bgroup
-% \the\everyreference % cleanup : etc in french
-% \ifinpagebody\else
-% \doifconcepttracing
-% {\doifsomething{#2}
-% {\inleft
-% {\infofont
-% \scratchdimen\leftmarginwidth
-% \advance\scratchdimen -2em
-% \doboundtext{#2}\scratchdimen{..}->}}}%
-% \fi
-% \doifpredefinedreferenceelse
-% \donothing
-% {\predefinereference
-% \showmessage\m!references{#1}{[\unharmedreferenceprefix][#2]}}%
-% \egroup}
-
\def\reportreferenceerror#1#2%
{\bgroup
\the\everyreference % cleanup : etc in french
@@ -1794,16 +1489,6 @@
\let\predefinedreference\s!unknown
-% \def\predefinereference
-% {\setgvalue{\r!cross\predefinedreference}{\rt!cross{}{}{}{}}%
-% \setgvalue{\r!cross\unharmedreferenceprefix\predefinedreference}{\rt!cross{}{}{}{}}}
-
-% \def\dummypredefinedreference{\r!cross{}{}{}{}}
-%
-% \def\predefinereference
-% {\global\@EA\let\csname\r!cross\predefinedreference \endcsname\dummypredefinedreference
-% \global\@EA\let\csname\r!cross\unharmedreferenceprefix\endcsname\dummypredefinedreference} % bug!
-%
% we need to predefine in order to make dup checking possible (when no ref
% is defined yet)
@@ -1815,15 +1500,6 @@
%D Testing on existance then becomes:
-% \def\checkpredefinedreference#1#2#3#4% #3 can expand tricky
-% {{#1}{#2}{#4}}
-%
-% \def\doifpredefinedreferenceelse#1#2% \referenceprefix added
-% {\bgroup
-% \let\rt!cross\checkpredefinedreference
-% \doifelse{\getvalue{\r!cross\referenceprefix\predefinedreference}}{{}{}{}}
-% {\egroup#1}{\egroup#2}}
-
\def\doifpredefinedreferenceelse % \referenceprefix added
{\@EA\ifx\csname\r!cross\referenceprefix\predefinedreference\endcsname\dummypredefinedreference
\expandafter\firstoftwoarguments
@@ -1840,23 +1516,6 @@
%D
%D The second argument can be a comma seperated list.
-% this will be replaced by a more general mechanis
-
-% \def\doifreferencepermittedelse#1#2#3#4% ref set found notfound
-% {\doifreferencefoundelse{#1}
-% {\ifx\currentinnerreference\empty
-% \ifx\currentouterreference\empty
-% #3%
-% \else
-% \doifinstringelse{\currentouterreference::}{#2}{#4}{#3}%
-% \fi
-% \else\ifx\currentouterreference\empty
-% \doifinstringelse{\currentinnerreference}{#2}{#4}{#3}%
-% \else
-% \doifinstringelse{\currentouterreference::\currentinnerreference}{#2}{#4}{#3}%
-% \fi\fi}
-% {#4\unknownreference{#1}}}
-
\let\permittedreferences\empty
\def\doifreferencepermittedelse#1#2#3% ref found notfound
@@ -1930,11 +1589,7 @@
%D counterparts. A common component in these is:
%D
%D \starttyping
-%D \dostartgoto
-%D \data {..}
-%D \start {..}
-%D \stop {..}
-%D \dostopgoto
+%D \dohandlegoto{..}{..}{..}
%D \stoptyping
%D
%D Here data can be whatever needs highlighting, e.g. {\em
@@ -1951,15 +1606,10 @@
\ifusepagedestinations
\gotorealpage{#1}{#2}{#4}{#5}%
\else
- \dostartgoto
- \data
- {#5}%
- \start
- \the\everyreference % we are (have to be) grouped !
- \dostartgotolocation\buttonwidth\buttonheight{#1}{#2}{#3}{#4}%
- \stop
- \dostopgotolocation
- \dostopgoto
+ \dohandlegoto
+ {#5}%
+ {\the\everyreference\dostartgotolocation\buttonwidth\buttonheight{#1}{#2}{#3}{#4}}%
+ {\dostopgotolocation}%
\fi
\else
{#5}%
@@ -1967,14 +1617,10 @@
\def\gotorealpage#1#2#3#4% url file page data
{\iflocation
- \dostartgoto
- \data
- {#4}%
- \start
- \dostartgotorealpage\buttonwidth\buttonheight{#1}{#2}{#3}%
- \stop
- \dostopgotorealpage
- \dostopgoto
+ \dohandlegoto
+ {#4}%
+ {\dostartgotorealpage\buttonwidth\buttonheight{#1}{#2}{#3}}%
+ {\dostopgotorealpage}%
\else
{#4}%
\fi}
@@ -2062,6 +1708,16 @@
\thisisdestination{\s!aut\iftraceinternalreferences:#1\fi:\nextinternalreference}%
\fi}
+% beter:
+%
+% \def\thisisnextinternal#1%
+% {\iftrialtypesetting\else
+% \global\advance\locationcount \plusone
+% \ifinternalnamedreferences
+% \thisisdestination{\s!aut\iftraceinternalreferences:#1\fi:\nextinternalreference}%
+% \fi
+% \fi}
+
\def\gotonextinternal#1#2#3#4%
{\ifinternalnamedreferences
\gotodestination\empty\empty{\s!aut\iftraceinternalreferences:#1\fi:#2}{#3}{#4}%
@@ -2283,14 +1939,10 @@
\def\executecommand#1#2#3%
{\iflocation
- \dostartgoto
- \data
- {#3}%
- \start
- \dostartexecutecommand\buttonwidth\buttonheight{#1}{#2}%
- \stop
- \dostopexecutecommand
- \dostopgoto
+ \dohandlegoto
+ {#3}%
+ {\dostartexecutecommand\buttonwidth\buttonheight{#1}{#2}}%
+ {\dostopexecutecommand}%
\else
{#3}%
\fi}
@@ -2445,7 +2097,7 @@
\def\doref[#1][#2]%
{\ifsecondargument
\doifreferencefoundelse{#2}
- {\doifundefinedelse{reftype#1}{\reftypep}{\getvalue{reftype#1}}}
+ {\executeifdefined{reftype#1}\reftypep}
{\unknownreference{#2}\dummyreference}%
\else
\dummyreference
@@ -2494,7 +2146,7 @@
\dogotospace{\thecurrentsubtextreference}[#1]}
{\unknownreference{#1}\dummyreference}%
\@@rfright
- \referentieinfo{<}{#1}%
+ \referenceinfo{<}{#1}%
\egroup}
%D Typesetting the reference is a bit more complicated than one
@@ -2571,7 +2223,7 @@
% {\egroup\dosymbolreference{#1}{#2}[#3]}
% {\egroup\dowantedreference{#1}{#2}[#3]}}
% {\dounknownreference{#1}{#2}[#3]}%
-% \referentieinfo{<}{#3}%
+% \referenceinfo{<}{#3}%
% \egroup}
%D The previously discussed setup macro lets us specify the
@@ -2750,7 +2402,7 @@
% {#1}{#2}[#3]%
% \fi}
% {\dounknownreference{#1}{#2}[#3]}%
-% \referentieinfo<{#3}%
+% \referenceinfo<{#3}%
% \global\let\leftofreference \empty
% \global\let\rightofreference\empty
% \global\let\textofreference \empty
@@ -2786,7 +2438,7 @@
{#1}{#2}[#3]%
\fi}
{\dounknownreference{#1}{#2}[#3]}%
- \referentieinfo<{#3}%
+ \referenceinfo<{#3}%
\global\let\leftofreference \empty
\global\let\rightofreference\empty
\global\let\textofreference \empty
@@ -2816,7 +2468,7 @@
% {\dosymbolreference{}{}[#2]}
% {\dogotospace{#1}[#2]}}
% {\unknownreference{#2}#1}%
-% \referentieinfo{<}{#2}}
+% \referenceinfo{<}{#2}}
\def\dogoto#1[#2]%
{\dontleavehmode
@@ -2829,7 +2481,7 @@
{\dogotospace{#1}[#2]}}
{\unknownreference{#2}#1\relax}% \relax catches lookahead
\egroup
- \referentieinfo{<}{#2}}
+ \referenceinfo{<}{#2}}
\unexpanded\def\goto#1#2%
{\dogoto{#1}#2}
@@ -2883,7 +2535,7 @@
\doifreferencefoundelse{#2}
{\dogotofixed{#1}[#2]}
{\hbox{\unknownreference{#2}#1}}%
- \referentieinfo{<}{#2}%
+ \referenceinfo{<}{#2}%
\egroup}
%D An reference to another document can be specified as a file
@@ -3087,7 +2739,11 @@
\edef\otherfile{#2}}%
\def\setouterlocation#1%
- {\ifundefined{\v!file:::#1}%
+ {\ifcsname\v!file:::#1\endcsname
+ \let\doexternaldocument\setouterfilelocation % will change
+ \let\doexternalurl \setouterfilelocation % will change
+ \csname\v!file:::#1\endcsname
+ \else
\ifconditional\forceURLlocation
\edef\otherURL{#1}%
\let\otherfile\empty
@@ -3095,10 +2751,6 @@
\let\otherURL\empty
\edef\otherfile{#1}%
\fi
- \else
- \let\doexternaldocument\setouterfilelocation % will change
- \let\doexternalurl \setouterfilelocation % will change
- \csname\v!file:::#1\endcsname
\fi
\setfalse\forceURLlocation
\doifparentfileelse\otherfile
@@ -3144,19 +2796,19 @@
\egroup}
\def\redospecialfrom[#1::#2]%
- {\ifundefined{\v!file:::#1}%
- \tttf[#1]%
- \else
+ {\ifcsname\v!file:::#1\endcsname
\def\doexternaldocument##1##2##3{\goto{##3}[#1::#2]}%
\csname\v!file:::#1\endcsname
+ \else
+ \tttf[#1]%
\fi}
\def\nodospecialfrom[#1]%
- {\ifundefined{\v!file:::#1}%
- \tttf[#1]%
- \else
+ {\ifcsname\v!file:::#1\endcsname
\def\doexternaldocument##1##2##3{##3}% different than ^
\csname\v!file:::#1\endcsname
+ \else
+ \tttf[#1]%
\fi}
%D We also support:
@@ -3248,12 +2900,11 @@
\def\program#1[#2]%
{\bgroup
- \ifundefined{\v!program:::#2}%
- {\tttf[#2]}%
- \else
- \def\doprogram##1##2%
- {\goto{\doifelsenothing{#1}{##2}{#1}}[\v!program(#2)]}%
+ \ifcsname\v!program:::#2\endcsname
+ \def\doprogram##1##2{\goto{\doifelsenothing{#1}{##2}{#1}}[\v!program(#2)]}%
\csname\v!program:::#2\endcsname
+ \else
+ {\tttf[#2]}%
\fi
\egroup}
@@ -3262,20 +2913,17 @@
\definespeciallocation\v!program#1#2%
{\bgroup
\iflocation
- \doifdefinedelse{\v!program:::\currentreferenceoperation}
- {\def\doprogram##1##2{\def\@@programfile{##1}}%
- \getvalue{\v!program:::\currentreferenceoperation}}
- {\let\@@programfile\currentreferenceoperation}%
+ \ifcsname\v!program:::\currentreferenceoperation\endcsname
+ \def\doprogram##1##2{\def\@@programfile{##1}}%
+ \getvalue{\v!program:::\currentreferenceoperation}%
+ \else
+ \let\@@programfile\currentreferenceoperation
+ \fi
\convertcommand\@@programfile\to\ascii
- \dostartgoto
- \data
- {#2}%
- \start
- \dostartrunprogram\buttonwidth\buttonheight
- {\@@prdirectory\ascii}\currentreferencearguments
- \stop
- \dostoprunprogram
- \dostopgoto
+ \dohandlegoto
+ {#2}%
+ {\dostartrunprogram\buttonwidth\buttonheight{\@@prdirectory\ascii}\currentreferencearguments}%
+ {\dostoprunprogram}%
\else
{#2}%
\fi
@@ -3340,65 +2988,6 @@
%D Because we combine both methods, we have to take care of
%D the \type{file::page(n)} as well as \type{page(file::n)}.
-% \definespeciallocation\v!pagina#1#2%
-% {\iflocation
-% \ifx\currentouterreference\empty
-% \splitoffreference\currentreferenceoperation
-% \else
-% \let\currentinnerreference=\currentreferenceoperation
-% \fi
-% \ifx\currentouterreference\empty
-% \doifnonzeropositiveelse{\currentinnerreference}
-% {}
-% {\edef\currentinnerreference{1}}%
-% \gotorealpage\empty\empty\currentinnerreference{#2}%
-% \else
-% \setouterlocation\currentouterreference
-% \doifnonzeropositiveelse{\currentinnerreference}
-% {}
-% {\doifdefinedelse{\v!pagina:::\currentinnerreference}
-% {\edef\currentinnerreference{\getvalue{\v!pagina:::\currentinnerreference}}}
-% {\edef\currentinnerreference{1}}}%
-% \gotorealpage\otherURL\otherfile\currentinnerreference{#2}%
-% \fi
-% \else
-% {#2}%
-% \fi}
-
-% \definespeciallocation\v!pagina#1#2% page(n) page(+n) page(-n)
-% {\iflocation
-% \ifx\currentouterreference\empty
-% \splitoffreference\currentreferenceoperation
-% \else
-% \let\currentinnerreference\currentreferenceoperation
-% \fi
-% \ifx\currentouterreference\empty
-% \doifinstringelse+\currentinnerreference
-% {\scratchcounter\realpageno
-% \advance\scratchcounter \currentinnerreference
-% \edef\currentinnerreference{\the\scratchcounter}}
-% {\doifinstringelse-\currentinnerreference
-% {\scratchcounter\realpageno
-% \advance\scratchcounter \currentinnerreference
-% \edef\currentinnerreference{\the\scratchcounter}}
-% \donothing}%
-% \doifnonzeropositiveelse\currentinnerreference
-% \donothing
-% {\edef\currentinnerreference{1}}%
-% \gotorealpage\empty\empty\currentinnerreference{#2}%
-% \else
-% \setouterlocation\currentouterreference
-% \doifnonzeropositiveelse\currentinnerreference
-% \donothing
-% {\doifdefinedelse{\v!pagina:::\currentinnerreference}
-% {\edef\currentinnerreference{\getvalue{\v!pagina:::\currentinnerreference}}}
-% {\edef\currentinnerreference{1}}}%
-% \gotorealpage\otherURL\otherfile\currentinnerreference{#2}%
-% \fi
-% \else
-% {#2}%
-% \fi}
-
\definespeciallocation\v!page#1#2% page(n) page(+n) page(-n)
{\iflocation
\ifx\currentouterreference\empty
@@ -3407,6 +2996,7 @@
\let\currentinnerreference\currentreferenceoperation
\fi
\ifx\currentouterreference\empty
+% numexpr
\doifinstringelse+\currentinnerreference
{\scratchcounter\realpageno
\advance\scratchcounter \currentinnerreference
@@ -3426,9 +3016,11 @@
\setouterlocation\currentouterreference
\doifnonzeropositiveelse\currentinnerreference
\donothing
- {\doifdefinedelse{\v!page:::\currentinnerreference}
- {\edef\currentinnerreference{\getvalue{\v!page:::\currentinnerreference}}}
- {\edef\currentinnerreference{1}}}%
+ {\ifcsname\v!page:::\currentinnerreference\endcsname
+ \edef\currentinnerreference{\getvalue{\v!page:::\currentinnerreference}}%
+ \else
+ \edef\currentinnerreference{1}%
+ \fi}%
\gotorealpage\otherURL\otherfile\currentinnerreference{#2}%
\fi
\else
@@ -3464,7 +3056,7 @@
{\dogotospace{#2}[#4]}%
\fi}
{\unknownreference{#4}#1/#2}%
- \referentieinfo{<}{#4}}
+ \referenceinfo{<}{#4}}
\unexpanded\def\atpage[#1]%
{\dontleavehmode
@@ -3481,7 +3073,7 @@
\fi}
{\unknownreference{#1}%
\labeltexts\v!page\dummyreference}%
- \referentieinfo{<}{#1}}
+ \referenceinfo{<}{#1}}
%D We can cross link documents by using:
%D
@@ -3522,10 +3114,10 @@
\stopnointerference}%
\douseexternaldocument[#1][#2][#4]%
\doglobal\addtocommalist{#1}\crossdocumentreferences
- \def\docommando##1%
+ \def\docommand##1%
{\letgvalue{\??rf##1\c!state}\v!start % for fast checking
\doglobal\addtocommalist{##1}\crossdocumentelements}%
- \processcommalist[#3]\docommando
+ \processcommalist[#3]\docommand
\ifutilitydone
\global\autocrossdocumenttrue
\fi
@@ -3539,8 +3131,7 @@
\def\checkcontrastreference#1%
{\ifnum\currentreferencetype=\rt!page\ifnum\currentdatareference=\realpageno
- \doifdefined{#1\c!contrastcolor}
- {\setevalue{#1\c!color}{\getvalue{#1\c!contrastcolor}}}%
+ \doifdefined{#1\c!contrastcolor}{\setevalue{#1\c!color}{\getvalue{#1\c!contrastcolor}}}%
\fi\fi}
\def\checkcontrastreference#1%
@@ -3777,8 +3368,6 @@
\c!expansion=\v!no,
\c!separator=\nonbreakablespace]
-\let\nonbreakablespace=~
-
\setupurl
[\c!alternative=\v!both,
\c!space=\v!no,
diff --git a/Master/texmf-dist/tex/context/base/core-reg.tex b/Master/texmf-dist/tex/context/base/core-reg.tex
index 309aee2f9ed..bd64bd6adda 100644
--- a/Master/texmf-dist/tex/context/base/core-reg.tex
+++ b/Master/texmf-dist/tex/context/base/core-reg.tex
@@ -69,9 +69,8 @@
{\dotripleempty\dosetupregister}
\def\getlastregisterentry#1%
- {\def\docommando##1%
- {\def\!!stringa{##1}}%
- \processseparatedlist[#1][+]\docommando
+ {\def\docommand##1{\def\!!stringa{##1}}%
+ \processseparatedlist[#1][+]\docommand
\!!stringa}
\def\registerparameter#1{\csname\??id\currentregister#1\endcsname}
@@ -80,61 +79,37 @@
%
% \index[Ätsch]{Ätsch} test \index{QÄtsch} test \index[ratsch]{RÄtsch} test
-% \def\doprocesspageregister[#1]#2#3% key altnum entry
-% {\begingroup
-% \thisisnextinternal\s!ind
-% \ifduplicate\getlastregisterentry{#3}\fi
-% \convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
-% \convertexpanded{\registerparameter\c!expansion }{#3}\asciiregisterentryB
-% \doifsomething{\registerparameter\c!keyexpansion}
-% {\ifx\asciiregisterentryA\empty
-% \convertexpanded{\registerparameter\c!keyexpansion}{#3}\asciiregisterentryA
-% \fi}%
-% \makesectionformat
-% \doifelse{\registerparameter\c!ownnumber}\v!yes
-% \donetrue\donefalse
-% % the spaces between } { are essential for texutil's split
-% \expanded
-% {\writeutility%
-% {r \ifcase\registerpagestatus\space\or e \or f \or t \fi
-% {\currentregister} %
-% {\nextinternalreference} %
-% {\asciiregisterentryA} %
-% {\asciiregisterentryB} %
-% {\sectionformat\sectionseparator\sectionseparator
-% \ifdone#2\else\noexpand\pagenumber\fi} %
-% {\noexpand\realfolio}}}%
-% \getfirstcharacter\currentregister
-% \registerinfo{> \firstcharacter}{#3}%
-% \endgroup}
+\newif\ifwritetoregister \writetoregistertrue
\def\doprocesspageregister[#1]#2#3% key altnum entry
- {\begingroup
- \thisisnextinternal\s!ind
- \ifduplicate\getlastregisterentry{#3}\fi
- \convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
- \convertexpanded{\registerparameter\c!expansion }{#3}\asciiregisterentryB
- \doifsomething{\registerparameter\c!keyexpansion}
- {\ifx\asciiregisterentryA\empty
- \convertexpanded{\registerparameter\c!keyexpansion}{#3}\asciiregisterentryA
- \fi}%
- \makesectionformat
- \doifelse{\registerparameter\c!ownnumber}\v!yes
- \donetrue\donefalse
- % the spaces between } { are essential for texutil's split
- \expanded
- {\writeutility%
- {r \ifcase\registerpagestatus\space\or e \or f \or t \fi
- {\currentregister} %
- {\nextinternalreference} %
- {\asciiregisterentryA} %
- {\asciiregisterentryB} %
- {\sectionformat\sectionseparator\sectionseparator
- \ifdone#2\else\noexpand\pagenumber\fi} %
- {\noexpand\realfolio}}}%
- \getfirstcharacter\currentregister
- \registerinfo{> \firstcharacter}{#3}%
- \endgroup}
+ {\ifwritetoregister
+ \begingroup
+ \thisisnextinternal\s!ind
+ \ifduplicate\getlastregisterentry{#3}\fi
+ \convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
+ \convertexpanded{\registerparameter\c!expansion }{#3}\asciiregisterentryB
+ \doifsomething{\registerparameter\c!keyexpansion}
+ {\ifx\asciiregisterentryA\empty
+ \convertexpanded{\registerparameter\c!keyexpansion}{#3}\asciiregisterentryA
+ \fi}%
+ \makesectionformat
+ \doifelse{\registerparameter\c!ownnumber}\v!yes
+ \donetrue\donefalse
+ % the spaces between } { are essential for texutil's split
+ \expanded
+ {\writeutility%
+ {r \ifcase\registerpagestatus\space\or e \or f \or t \fi
+ {\currentregister} %
+ {\nextinternalreference} %
+ {\asciiregisterentryA} %
+ {\asciiregisterentryB} %
+ {\sectionformat\sectionseparator\sectionseparator
+ \ifdone#2\else\noexpand\pagenumber\fi} %
+ {\noexpand\realfolio}}}%
+ \getfirstcharacter\currentregister
+ \registerinfo{> \firstcharacter}{#3}%
+ \endgroup
+ \fi}
\def\doregister#1%
{\chardef\registerpagestatus\plusone
@@ -146,11 +121,6 @@
\def\donoregister[#1]%
{\dodoregister[#1]{}}
-% \def\dodoregister[#1]#2#3%
-% {\doprocesspageregister[#1]{#2}{#3}%
-% \ifvmode\nobreak\fi
-% \GotoPar}
-
% \long\def\doflushatpar#1%
% %{\dogotopar{#1}}
% %{\dogotopar{\dontleavehmode#1}} % this one can introduce empty lines
@@ -193,7 +163,8 @@
\dodoregister[#2]{}{#3}} % key altnum entry
\def\doprocessseeregister[#1]#2#3%
- {\begingroup
+ {\ifwritetoregister
+ \begingroup
\thisisnextinternal\s!ind
\ifduplicate\getlastregisterentry{#2}\fi
\convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
@@ -213,8 +184,9 @@
{\asciiregisterentryB} %
{\asciiregisterentryC} %
{\sectionformat}}}%
- \endgroup
- \registerinfo{> see}{#2}}
+ \endgroup
+ \registerinfo{> see}{#2}%
+ \fi}
\def\complexdoseeregister[#1]#2#3%
{\doflushatpar{\doprocessseeregister[#1]{#2}{#3}}}
@@ -249,7 +221,9 @@
{\nextregisterpage
\hbox to 1em{\hss\doregisterpagehowto{#1}{#2}\hss}}
-\def\setregisterpage#1%
+% todo: \installregisterpagehandler
+
+\def\setregisterpage#1% todo: currentregister gebruiken
{\let\registerpageseparator\empty
\processaction
[\getvalue{\??id#1\c!symbol}]
@@ -260,18 +234,37 @@
1=>{\def\doregisterpage##1[##2]%
{\doregisterpagelocation{#1}{$\bullet$}}},
2=>{\def\doregisterpage##1[##2]%
- {\doregisterpagelocation{#1}{\vrule\!!width1em\!!height1ex\!!depth\!!zeropoint}}},
+ {\doregisterpagelocation{#1}{\vrule\!!width1em\!!height1ex\!!depth\zeropoint}}},
\v!none=>{\def\doregisterpage##1[##2]{}},%
\s!unknown=>{\def\registerpagesymbol{\getvalue{\??id#1\c!symbol}}%
\def\doregisterpage##1[##2]%
{\doregisterpagelocation{#1}{\registerpagesymbol}}},
- \s!default=>{\def\registerpageseparator%
- {,}%
- \def\doregisterpage##1[##2]%
- {\doregisterpagehowto{##1}
- {\strut
- \pageprefix{\??id##1}[##2]%
- \translatednumber[##2]}}}]}
+ \s!default=>{\def\registerpageseparator{,}%
+ \let\doregisterpage\doregisterpagedefault}]}
+
+\def\doregisterpagedefault#1[#2]%
+ {\doregisterpagehowto{#1}{\strut\pageprefix{\??id#1}[#2]\translatednumber[#2]}}
+
+% test case
+%
+% \starttext
+% \placelist[section][criterium=all] \blank[2*big]
+% \placeregister[index][compress=no] \blank[2*big]
+% \placeregister[index][compress=no,sectionnumber=yes] \blank[2*big]
+% \placeregister[index][compress=yes] \page
+% test text \index{test index}
+% \section{heading}
+% more test text \index{test index}
+% \section{heading}
+% more test text \index{test index}
+% \page
+% \section{heading text \index{test index}}
+% more test text \index{test index}
+% \page
+% test text \index{test index}
+% \section{heading text \index{test index}}
+% more test text \index{test index}
+% \stoptext
\let\registerpagehowto\empty
\let\registertexthowto\empty
@@ -320,8 +313,6 @@
\let\c!entryb =\relax
\let\c!entryc =\relax
-\chardef\lastregisterpagestatus=0
-
\def\limitedregisterentry#1#2%
{\getvalue{\??id#1\c!textcommand}%
{\doifelsenothing{\??id#1\c!maxwidth}
@@ -331,74 +322,6 @@
\def\dosetpageregisterpage#1#2#3#4#5#6%
{\doifreglevelelse[#5]{\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}{}}
-% \def\dodosetpageregisterpage#1#2#3#4#5#6%
-% {\global\utilitydonetrue
-% \c!entryletter
-% \setregisterhowto[#3]%
-% \def\dohandleregisterentry##1%
-% {\bgroup
-% \if!!donea % \strut nieuw
-% %\setbox0\hbox{\showlocation{\doregistertexthowto{#2}
-% % {\strut\limitedregisterentry{#2}{##1}}}}%
-% % \gotonextinternal\s!ind{#4}{#6}{\box0}%
-% %
-% \hhboxindent\hangindent % maybe also left and right skip
-% \setbox0\hbox{\doregistertexthowto{#2}{\strut\limitedregisterentry{#2}{##1}}}%
-% \unhhbox0\with{\gotonextinternal\s!ind{#4}{#6}{\box\hhbox}}%
-% %
-% \else
-% \doregistertexthowto{#2}{##1}%
-% \fi
-% \egroup
-% \!!doneafalse}%
-% \!!doneafalse
-% \doifelsevalue{\??id#2\c!interaction}\v!text
-% {\ifcase\currententrylevel \or
-% \!!doneatrue\c!entrya\c!entryb\c!entryc \or
-% \c!entrya\!!doneatrue\c!entryb\c!entryc \or
-% \c!entrya\c!entryb\!!doneatrue\c!entryc \fi}
-% {\c!entrya\c!entryb\c!entryc}%
-% \global\let\c!entrya\relax
-% \global\let\c!entryb\relax
-% \global\let\c!entryc\relax
-% \global\let\c!entryletter\relax
-% \global\let\c!entryreference\relax
-% % \global\firstregisterentrytrue
-% \iffirstregisterpage
-% \global\chardef\lastregisterpagestatus\zerocount
-% \expandafter\hskip\getvalue{\??id#2\c!distance}\relax
-% \donetrue
-% \else\ifnum#1=3
-% |--|\relax % -- !
-% \donetrue
-% \else\ifnum\lastregisterpagestatus=2
-% \donefalse % waiting for "to" pagenumber
-% \else
-% \registerpageseparator
-% |\space|\relax % \relax needed because | looks ahead
-% \donetrue
-% \fi\fi\fi
-% \ifdone
-% \begingroup
-% %
-% \doifelsevalue{\??id#2\c!prefix}\v!none % default v!both
-% {\chardef\pageprefixmode\zerocount}%
-% {\doifvalue{\??id#2\c!prefix}\v!first % only first in range (1.2-4)
-% {\ifnum#1=3 \chardef\pageprefixmode\zerocount \fi}}%
-% %
-% \doifelsevalue{\??id#2\c!interaction}\v!pagenumber
-% {\bgroup
-% \setbox0\hbox
-% {\showlocation{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
-% \gotonextinternal{\s!ind}{#4}{#6}{\box0}%{\copy0}%
-% \egroup}
-% {\hbox{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
-% \endgroup
-% \ignorespaces
-% \global\chardef\lastregisterpagestatus#1\relax
-% \fi
-% \global\firstregisterpagefalse}
-
\def\dodosetpageregisterpageA#1#2#3#4#5#6%
{\global\utilitydonetrue
\c!entryletter
@@ -428,41 +351,33 @@
\global\let\c!entryreference\relax}
\def\dodosetpageregisterpageB#1#2#3#4#5#6%
- {% \global\firstregisterentrytrue
- \iffirstregisterpage
- \global\chardef\lastregisterpagestatus\zerocount
- \expandafter\hskip\getvalue{\??id#2\c!distance}\relax
- \donetrue
- \else\ifnum#1=3
- |--|\relax % -- !
- \donetrue
- \else\ifnum\lastregisterpagestatus=2
- \donefalse % waiting for "to" pagenumber
- \else
- \registerpageseparator
- |\space|\relax % \relax needed because | looks ahead
- \donetrue
- \fi\fi\fi
- \ifdone
- \begingroup
- %
- \doifelsevalue{\??id#2\c!prefix}\v!none % default v!both
- {\chardef\pageprefixmode\zerocount}%
- {\doifvalue{\??id#2\c!prefix}\v!first % only first in range (1.2-4)
- {\ifnum#1=3 \chardef\pageprefixmode\zerocount \fi}}%
- %
- \doifelsevalue{\??id#2\c!interaction}\v!pagenumber
- {\bgroup
- \setbox0\hbox
- {\showlocation{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
- \gotonextinternal{\s!ind}{#4}{#6}{\box0}%{\copy0}%
- \egroup}
- {\hbox{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
- \endgroup
- \ignorespaces
- \global\chardef\lastregisterpagestatus#1\relax
- \fi
- \global\firstregisterpagefalse}
+ {\iffirstregisterpage
+ \expandafter\hskip\getvalue{\??id#2\c!distance}\relax
+ \else\ifnum#1=3
+ \strut|--|\relax % -- !
+ \else
+ % \relax after space needed because | looks ahead
+ \strut\registerpageseparator|\space|\relax
+ \fi\fi
+ \iftrue % \iftrue ...\fi to preserve indentation, can be folded out
+ \begingroup
+ %
+ \doifelsevalue{\??id#2\c!prefix}\v!none % default v!both
+ {\chardef\pageprefixmode\zerocount}%
+ {\doifvalue{\??id#2\c!prefix}\v!first % only first in range (1.2-4)
+ {\ifnum#1=3 \chardef\pageprefixmode\zerocount \fi}}%
+ %
+ \doifelsevalue{\??id#2\c!interaction}\v!pagenumber
+ {\bgroup
+ \setbox0\hbox{\showlocation{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+ \gotonextinternal{\s!ind}{#4}{#6}{\box0}%{\copy0}%
+ \egroup}
+ {\hbox{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+ \endgroup
+ \ignorespaces
+ \relax
+ \fi
+ \global\firstregisterpagefalse}
\def\resetseenregisterpage
{\global\let\firstseenregisterreal \relax
@@ -477,27 +392,61 @@
\def\dodosetpageregisterpageC#1#2#3#4#5#6%
{\xdef\currentseenregisterpage{#5}%
\xdef\currentseenregisterreal{#6}%
- \gdef\flushseenregisterpage{\doflushseenregisterpage{#1}{#2}{#3}{#4}}%
\ifx\firstseenregisterreal\relax
+ % no range yet
\global\let\firstseenregisterreal\currentseenregisterreal
\global\let\firstseenregisterpage\currentseenregisterpage
\global\let\lastseenregisterreal \currentseenregisterreal
\global\let\lastseenregisterpage \currentseenregisterpage
+ \else\ifnum\lastseenregisterreal=\currentseenregisterreal\relax
+ % same page (catch error)
\else\ifnum\numexpr\lastseenregisterreal+\plusone\relax=\currentseenregisterreal\relax
\global\let\lastseenregisterreal \currentseenregisterreal
\global\let\lastseenregisterpage \currentseenregisterpage
\else
- \ifx\firstseenregisterreal\lastseenregisterreal
- \expanded{\dodosetpageregisterpageB{1}{#2}{#3}{#4}{\lastseenregisterpage}{\lastseenregisterreal}}%
- \else
- \expanded{\dodosetpageregisterpageB{2}{#2}{#3}{#4}{\firstseenregisterpage}{\firstseenregisterreal}}%
- \expanded{\dodosetpageregisterpageB{3}{#2}{#3}{#4}{\lastseenregisterpage }{\lastseenregisterreal }}%
- \fi
- \global\let\firstseenregisterreal\currentseenregisterreal
- \global\let\firstseenregisterpage\currentseenregisterpage
- \global\let\lastseenregisterreal \currentseenregisterreal
- \global\let\lastseenregisterpage \currentseenregisterpage
- \fi\fi}
+ \global\let\savedcurrentseenregisterreal\currentseenregisterreal
+ \global\let\savedcurrentseenregisterpage\currentseenregisterpage
+ \flushseenregisterpage
+ \global\let\firstseenregisterreal\savedcurrentseenregisterreal
+ \global\let\firstseenregisterpage\savedcurrentseenregisterpage
+ \global\let\lastseenregisterreal \savedcurrentseenregisterreal
+ \global\let\lastseenregisterpage \savedcurrentseenregisterpage
+ \fi\fi\fi
+ \gdef\flushseenregisterpage{\doflushseenregisterpage{#1}{#2}{#3}{#4}}}
+
+% \def\dodosetpageregisterpageC#1#2#3#4#5#6%
+% {\xdef\currentseenregisterpage{#5}%
+% \xdef\currentseenregisterreal{#6}%
+% \firstregisterpagefalse
+% \gdef\flushseenregisterpage{\doflushseenregisterpage{#1}{#2}{#3}{#4}}%
+% \ifx\firstseenregisterreal\relax
+% % no range yet
+% \global\let\firstseenregisterreal\currentseenregisterreal
+% \global\let\firstseenregisterpage\currentseenregisterpage
+% \global\let\lastseenregisterreal \currentseenregisterreal
+% \global\let\lastseenregisterpage \currentseenregisterpage
+% \else\ifnum\firstseenregisterreal=\currentseenregisterreal\relax
+% \global\let\firstseenregisterreal\currentseenregisterreal
+% \global\let\firstseenregisterpage\currentseenregisterpage
+% \global\let\lastseenregisterreal \currentseenregisterreal
+% \global\let\lastseenregisterpage \currentseenregisterpage
+% \else\ifnum\lastseenregisterreal=\currentseenregisterreal\relax
+% \global\let\lastseenregisterpage \currentseenregisterpage
+% \else\ifnum\numexpr\lastseenregisterreal+\plusone\relax=\currentseenregisterreal\relax
+% \global\let\lastseenregisterreal \currentseenregisterreal
+% \global\let\lastseenregisterpage \currentseenregisterpage
+% \else
+% % back up, flush, go on
+% \global\let\savedcurrentseenregisterreal\currentseenregisterreal
+% \global\let\savedcurrentseenregisterpage\currentseenregisterpage
+% \let\currentseenregisterpage\lastseenregisterpage
+% \let\currentseenregisterreal\lastseenregisterreal
+% \flushseenregisterpage
+% \global\let\firstseenregisterreal\savedcurrentseenregisterreal
+% \global\let\firstseenregisterpage\savedcurrentseenregisterpage
+% \global\let\lastseenregisterreal \savedcurrentseenregisterreal
+% \global\let\lastseenregisterpage \savedcurrentseenregisterpage
+% \fi\fi\fi\fi}
\def\doflushseenregisterpage#1#2#3#4%
{\global\let\flushseenregisterpage\relax
@@ -526,8 +475,13 @@
{\dodosetpageregisterpageA{#1}{#2}{#3}{#4}{#5}{#6}%
\dodosetpageregisterpageB{#1}{#2}{#3}{#4}{#5}{#6}}
+% \def\dodosetpageregisterpagecollapsed#1#2#3#4#5#6%
+% {\dodosetpageregisterpageA{#1}{#2}{#3}{#4}{#5}{#6}%
+% \dodosetpageregisterpageC{#1}{#2}{#3}{#4}{#5}{#6}}
+
\def\dodosetpageregisterpagecollapsed#1#2#3#4#5#6%
- {\dodosetpageregisterpageA{#1}{#2}{#3}{#4}{#5}{#6}%
+ {\ifx\firstseenregisterreal\relax\flushseenregisterpage\fi
+ \dodosetpageregisterpageA{#1}{#2}{#3}{#4}{#5}{#6}%
\dodosetpageregisterpageC{#1}{#2}{#3}{#4}{#5}{#6}}
% test case for collapsing (experimental, for Steffen Wolfrum)
@@ -564,9 +518,8 @@
\global\let\c!entryc\relax
\global\let\c!entryletter\relax
\global\let\c!entryreference\relax
- \global\chardef\lastregisterpagestatus\zerocount
% \global\firstregisterentrytrue
- \global\firstregisterpagefalse}}
+ \global\firstregisterpagetrue}}
{}}
%D Extended with variant:
@@ -699,7 +652,6 @@
\global\firstsubentrytrue
\global\firstsubsubentrytrue
\setregisterpage{#1}%
- \chardef\lastregisterpagestatus\zerocount
\setvalue{#1\s!entrya}{\dosetpageregisterentrya {#1}}%
\setvalue{#1\s!entryb}{\dosetpageregisterentryb {#1}}%
\setvalue{#1\s!entryc}{\dosetpageregisterentryc {#1}}%
@@ -763,7 +715,7 @@
\fi
\fi
% aangepast
- \def\dodocommando[##1-##2]%
+ \def\dodocommand[##1-##2]%
{\gotonextinternal{\s!ind}{##1}{##2}{\box0}}%
\doifelsevalue{\??id#1\c!interaction}\v!pagenumber
{\limitedregisterentry{#1}{#2}} % paginanummer
@@ -772,25 +724,25 @@
\ifx\midlistreference\empty
\box0
\else
- \expandafter\dodocommando\expandafter[\midlistreference]%
+ \expandafter\dodocommand\expandafter[\midlistreference]%
\fi
\else
- \expandafter\dodocommando\expandafter[\firstlistreference]%
+ \expandafter\dodocommand\expandafter[\firstlistreference]%
\fi}}%
\doifvalue{\??id#1\c!number}\v!yes
{\hskip\getvalue{\??id#1\c!distance}(\commalistsize)}%
\doifnotvalue{\??id#1\c!interaction}\v!text % paginanummer,alles
- {\def\docommando##1##2%
+ {\def\docommand##1##2%
{{\setbox0\hbox{\showlocation{\hbox to 1em{\hss\symbol[##2]\hss}}}%
\ifx##1\empty
% \hskip\wd0 % (optioneel maken)
\else
- \expandafter\dodocommando\expandafter[##1]%
+ \expandafter\dodocommand\expandafter[##1]%
\fi}}%
\hskip\getvalue{\??id#1\c!distance}%
- \docommando\firstlistreference\v!previous
- \docommando\midlistreference\v!somewhere
- \docommando\lastlistreference\v!next}%
+ \docommand\firstlistreference\v!previous
+ \docommand\midlistreference\v!somewhere
+ \docommand\lastlistreference\v!next}%
% tot hier
\else
% no \endgraf
@@ -857,8 +809,9 @@
\ifcase0\countervalue{autolink:#1}\relax % only once
\begingroup
\let\dosetregister\doloadregisterlinks
+ \def\currentregister{#1}%
\setupregister[#1][#2]%
- \doutilities{#1}\jobname{#1}\relax\relax
+ \doutilities{#1}{\registerparameter\c!file}{#1}\relax\relax
\endgroup
\ifautoregisterhack
\doinitializeautoregister{#1}%
@@ -871,10 +824,10 @@
\def\coupleregister
{\dodoubleempty\docoupleregister}
-\def\dodocommandoprolinrefAA[#1-#2]%
+\def\dodocommandprolinrefAA[#1-#2]%
{\def\lastlistreference{#1-#2}}
-\def\dodocommandoprolinrefA[#1-#2]%
+\def\dodocommandprolinrefA[#1-#2]%
{\def\lastlistreference{#1-#2}%
\ifx\firstlistreference\empty
\let\firstlistreference\lastlistreference
@@ -883,24 +836,24 @@
\let\prevlistreference\lastlistreference
\else\ifnum#1>\nextinternalreference\relax
\let\nextlistreference\lastlistreference
- \let\dodocommandoprolinrefA\dodocommandoprolinrefAA
+ \let\dodocommandprolinrefA\dodocommandprolinrefAA
\else
\let\selflistreference\lastlistreference
\fi\fi}
-\def\docommandoprolinrefA#1%
- {\dodocommandoprolinrefA[#1]}
+\def\docommandprolinrefA#1%
+ {\dodocommandprolinrefA[#1]}
-\def\dodocommandoprolinrefB[#1-#2]%
+\def\dodocommandprolinrefB[#1-#2]%
{\gotonextinternal{\s!ind}{#1}{#2}{\box0}}
-\def\docommandoprolinrefB#1#2#3%
+\def\docommandprolinrefB#1#2#3%
{\bgroup
\ifx#2\empty
\doifvalue{\??id#1\c!unknownreference}\v!empty{\hskip1em}%
\else
\setbox0\hbox to 1em{\hss\showlocation{\symbol[#3]}\hss}%
- \expandafter\dodocommandoprolinrefB\expandafter[#2]%
+ \expandafter\dodocommandprolinrefB\expandafter[#2]%
\fi
\egroup}
@@ -914,7 +867,7 @@
\let\nextlistreference\empty
\getalllistreferences{#1}{#3}%
\ifx\alllistreferences\empty \else
- \expanded{\rawprocesscommalist[\alllistreferences]}\docommandoprolinrefA
+ \expanded{\rawprocesscommalist[\alllistreferences]}\docommandprolinrefA
\fi
\ifx\prevlistreference\empty
\let\prevlistreference\lastlistreference
@@ -929,11 +882,11 @@
\setalignmentswitch{\getvalue{\??id#1\c!location}}%
\ifcase\alignmentswitch
% links
- \docommandoprolinrefB{#1}\prevlistreference\v!previous
- \docommandoprolinrefB{#1}\nextlistreference\v!next
+ \docommandprolinrefB{#1}\prevlistreference\v!previous
+ \docommandprolinrefB{#1}\nextlistreference\v!next
\or
% midden
- \docommandoprolinrefB{#1}\prevlistreference\v!previous
+ \docommandprolinrefB{#1}\prevlistreference\v!previous
\or
% rechts
\fi
@@ -946,31 +899,13 @@
% links
\or
% midden
- \docommandoprolinrefB{#1}\nextlistreference\v!next
+ \docommandprolinrefB{#1}\nextlistreference\v!next
\or
% rechts
- \docommandoprolinrefB{#1}\prevlistreference\v!previous
- \docommandoprolinrefB{#1}\nextlistreference\v!next
+ \docommandprolinrefB{#1}\prevlistreference\v!previous
+ \docommandprolinrefB{#1}\nextlistreference\v!next
\fi}}
-% \def\dodolinkedregister[#1][#2]#3% page auto link
-% {\bgroup
-% \chardef\registerpagestatus\plusone
-% \def\currentregister{#1}%
-% \iflocation
-% \ifautoregisterhack
-% \def\next{\doprocessautoregister[#1][#2]}%
-% \else
-% \def\next{\doprocesslinkregister[#1][#2]}%
-% \fi
-% \else
-% \def\next{\doprocesspageregister[#2]{}}%
-% \fi
-% \next{#3}%
-% \egroup
-% \ifvmode\nobreak\fi
-% \GotoPar}
-
\def\doprocesslinkedregister[#1][#2]#3% page auto link
{\bgroup
\chardef\registerpagestatus\plusone
@@ -1092,7 +1027,7 @@
\c!align=\registerparameter\c!align]%
\dontcomplain
\startpacked[\v!blank]%
- \doutilities\currentregister\jobname\currentregister\dobeforeplaceregister\doafterplaceregister
+ \doutilities\currentregister{\registerparameter\c!file}\currentregister\dobeforeplaceregister\doafterplaceregister
\stoppacked
\stopcolumns
\endgroup
@@ -1151,6 +1086,7 @@
\c!prefix=\v!both,
\c!expansion=,
\c!keyexpansion=,
+ \c!file=\jobname,
%\c!deeptextcommand=, % undefined by default !
\s!language=\currentmainlanguage]%
\doglobal\appendtoksonce
@@ -1176,6 +1112,7 @@
\def\dodetermineregistercharacteristics[#1][#2]%
{\begingroup
+ \def\currentregister{#1}%
\setupregister[#1][#2]%
\dosetreglevel{#1}%
\setvalue{#1\s!from}%
@@ -1186,8 +1123,7 @@
\global\utilitydonetrue}
{}}%
\doglobal\newcounter\utilityregisterlength
- \setbox0\vbox
- {\doutilities{#1}\jobname{#1}\relax\relax}%
+ \setbox0\vbox{\doutilities{#1}{\registerparameter\c!file}{#1}\relax\relax}%
\endgroup
\ifregistergeplaatst
\setsystemmode \v!register
diff --git a/Master/texmf-dist/tex/context/base/core-rul.tex b/Master/texmf-dist/tex/context/base/core-rul.tex
index 30b06403ca0..1ac7edc28e3 100644
--- a/Master/texmf-dist/tex/context/base/core-rul.tex
+++ b/Master/texmf-dist/tex/context/base/core-rul.tex
@@ -13,8 +13,13 @@
\writestatus{loading}{Context Core Macros / Ruled Content Handling}
+%D This module is now etex dependent.
+
\unprotect
+%D We have removed the rather old and out dated raster methods. They
+%D have not been used for ages.
+
%D \macros
%D {linewidth, setuplinewidth}
%D
@@ -36,13 +41,6 @@
\def\setuplinewidth
{\dosingleargument\dosetuplinewidth}
-% \def\dosetuprules[#1]%
-% {\getparameters[\??ln][#1]%
-% \setuplinewidth[\@@lndikte]}
-%
-% \def\setuprules
-% {\dosingleargument\dosetuprules}
-
%D \macros
%D {ruledlinewidth, inheritruledlinewidth}
%D
@@ -52,85 +50,80 @@
\newdimen\ruledlinewidth \newif\ifinheritruledlinewidth
-%D \TEX\ lacks support for color and even gray scales. The next
-%D macros can provide a sort of poor mans gray scales as well
-%D as give access to more suitable methods of rendering. Such a
-%D method looks like:
-%D
-%D \starttyping
-%D \def\methodegraybox
-%D \width#1\height#2\depth#3\raster#4\corner#5\radius#6\\%
-%D { ... }
-%D \stoptyping
-%D
-%D The string \type{graybox} is a common element in the name,
-%D so we can have for instance \type {\postscriptgraybox} or
-%D \type {\texgraybox}. The first three arguments take a
-%D dimension, the fourth one takes a number between~0 and~1,
-%D and the last argument specifies a radius of the box when
-%D rounded corners are used, so:
-%D
-%D \startbuffer
-%D \dotgraybox
-%D \width.5\hsize\height1cm\depth0cm\raster.85\corner\v!no\radius0pt\\
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D becomes:
-%D
-%D %\startlinecorrection
-%D % \vbox to 1cm{\getbuffer}
-%D %\stoplinecorrection
-%D
-%D \startlinecorrection
-%D \unprotect
-%D \vbox to 1cm
-%D {\dotgraybox
-%D \width.5\hsize\height1cm\depth0cm\raster.85\corner\v!no\radius0pt\\}
-%D \protect
-%D \stoplinecorrection
-%D
-%D There are two predefined methodes, one uses periods and the
-%D other uses small rules. The second method is less
-%D efficient, but sometimes give better results. The dimensions
-%D of the resullting box are set to zero.
-
-\setvalue{\v!dot graybox}{\processraster\symbol\rasterdot}
-\setvalue{\v!rule graybox}{\processraster\symbol\rasterbox}
-
-\def\rasterdot{\rasterfont.}
-\def\rasterbox{\hss\vrule\!!width.4pt\!!height.4pt\!!depth\zeropoint}
-
-%D Now of course we need:
-
-\ifx\rasterfont\undefined \def\rasterfont{\fivepoint} \fi
-
-%D We implement two pure \TEX\ based generators, that use
-%D \type{\leaders} to quickly gerenate the gray pattern. One
-%D should beware of \DIMENSION\ conflicts, so we use some
-%D registers above~8. These macros are memory hungry and byte
-%D spoiling.
-
-\def\processraster
- \symbol#1\width#2\height#3\depth#4\raster#5\corner#6\radius#7\\%
- {\bgroup
- \forgetall
- \dontcomplain
- \dimen10=\onepoint
- \dimen10=\@@rsfactor\dimen10
- \dimen10=#5\dimen10
- \setbox2\hbox to #2
- {\cleaders\hbox to 2\dimen10{#1\hss}\hss}%
- \dimen12=#3%
- \advance\dimen12 #4%
- \setbox0\vbox to \dimen12
- {\cleaders\vbox to 2\dimen10{\box2\vss}\vss}%
- \setbox0\hbox
- {\hskip-.5\dimen10\lower0.5\dimen10\copy0
- \hskip-\wd0\hskip\dimen10\lower1.5\dimen10\box0}%
- \box0
- \egroup}
+% %D \TEX\ lacks support for color and even gray scales. The next
+% %D macros can provide a sort of poor mans gray scales as well
+% %D as give access to more suitable methods of rendering. Such a
+% %D method looks like:
+% %D
+% %D \starttyping
+% %D \def\methodegraybox#1#2#3#4#5#6%
+% %D { ... }
+% %D \stoptyping
+% %D
+% %D The string \type{graybox} is a common element in the name,
+% %D so we can have for instance \type {\postscriptgraybox} or
+% %D \type {\texgraybox}. The first three arguments take a
+% %D dimension, the fourth one takes a number between~0 and~1,
+% %D and the last argument specifies a radius of the box when
+% %D rounded corners are used, so:
+% %D
+% %D \startbuffer
+% %D \dotgraybox{.5\hsize}{1cm}{0cm}{.85}{\v!no}{0pt}
+% %D \stopbuffer
+% %D
+% %D \typebuffer
+% %D
+% %D becomes:
+% %D
+% %D %\startlinecorrection
+% %D % \vbox to 1cm{\getbuffer}
+% %D %\stoplinecorrection
+% %D
+% %D \startlinecorrection
+% %D \unprotect
+% %D \vbox to 1cm{\dotgraybox{.5\hsize}{1cm}{0cm}{.85}{\v!no}{0pt}}
+% %D \protect
+% %D \stoplinecorrection
+% %D
+% %D There are two predefined methodes, one uses periods and the
+% %D other uses small rules. The second method is less
+% %D efficient, but sometimes give better results. The dimensions
+% %D of the resullting box are set to zero.
+%
+% \setvalue{\v!dot graybox}{\processraster\symbol\rasterdot}
+% \setvalue{\v!rule graybox}{\processraster\symbol\rasterbox}
+%
+% \def\rasterdot{\rasterfont.}
+% \def\rasterbox{\hss\vrule\!!width.4pt\!!height.4pt\!!depth\zeropoint}
+%
+% %D Now of course we need:
+%
+% \ifx\rasterfont\undefined \def\rasterfont{\fivepoint} \fi
+%
+% %D We implement two pure \TEX\ based generators, that use
+% %D \type{\leaders} to quickly gerenate the gray pattern. One
+% %D should beware of \DIMENSION\ conflicts, so we use some
+% %D registers above~8. These macros are memory hungry and byte
+% %D spoiling.
+%
+% \def\processraster#1#2#3#4#5#6#7%
+% {\bgroup
+% \forgetall
+% \dontcomplain
+% \dimen10=\onepoint
+% \dimen10=\@@rsfactor\dimen10
+% \dimen10=#5\dimen10
+% \setbox2\hbox to #2
+% {\cleaders\hbox to 2\dimen10{#1\hss}\hss}%
+% \dimen12=#3%
+% \advance\dimen12 #4%
+% % \setbox0\vbox to \dimen12
+% {\cleaders\vbox to 2\dimen10{\box2\vss}\vss}%
+% \setbox0\hbox
+% {\hskip-.5\dimen10\lower0.5\dimen10\copy0
+% \hskip-\wd0\hskip\dimen10\lower1.5\dimen10\box0}%
+% \box0
+% \egroup}
%D \macros
%D {setupscreens}
@@ -143,108 +136,141 @@
\def\setupscreens
{\dodoubleargument\getparameters[\??rs]}
-%D The most appropriate way to call for this feature is
-%D using \type{\graybox}, which is defined as:
-
-\def\graybox{\getvalue{\@@rsmethod graybox}}
-
-%D This macro takes the five arguments mentioned earlier and
-%D obey the user's settings.
-
-%D We just introduced two pure \TEX\ methods for generating
-%D rasters. However, it's far more efficient and comfortable in
-%D terms of speed, memory usage and file size, to use a driver
-%D supported method.
-
-\setvalue{\v!external graybox}\width#1\height#2\depth#3\raster#4\corner#5\radius#6\\%
- {\setgraybox\width#1\height#2\depth#3\raster#4\corner#5\radius#6\\}
-
-%D For compatibility reasons we also define the original one:
-
-\setvalue{\v!postscript graybox}%
- {\getvalue{\v!external graybox}}
-
-%D A quite valid way of letting drivers do the job, is giving
-%D a solid rule a gray texture.
-
-\def\raster[#1]%
- {\groupedcommand{\startraster[#1]}{\stopraster}}
-
-\def\setgraybox\width#1\height#2\depth#3\raster#4\corner#5\radius#6\\%
- {\doifelsenothing{#4} % avoid black rules when no gray
- {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\}
- {\raster[#4]%
- {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}}}
+% %D The most appropriate way to call for this feature is
+% %D using \type{\graybox}, which is defined as:
+%
+% \def\graybox{\getvalue{\@@rsmethod graybox}}
+%
+% %D We just introduced two pure \TEX\ methods for generating
+% %D rasters. However, it's far more efficient and comfortable in
+% %D terms of speed, memory usage and file size, to use a driver
+% %D supported method.
+%
+% \setvalue{\v!external graybox}{\setgraybox}
+%
+% %D For compatibility reasons we also define the original one:
+%
+% \setvalue{\v!postscript graybox}{\getvalue{\v!external graybox}}
+%
+% %D A quite valid way of letting drivers do the job, is giving
+% %D a solid rule a gray texture.
-%D The auxiliary macro is defined as:
+%D We will communicate through module specific variables, current
+%D framed parameters and some reserved dimension registers.
-\def\dophantombox#1\\{\hphantom{\dofilledbox#1\\}}
+\newdimen \frameddimenwd
+\newdimen \frameddimenht
+\newdimen \frameddimendp
%D We don't have to stick to a \TEX\ drawn rule, but
%D also can use rounded or even fancier shapes, as we will
%D see later on.
-\def\dofilledbox\width#1\height#2\depth#3\corner#4\radius#5\\%
+\def\dofilledbox
{\bgroup
- \doifelse{#4}\v!round
- {\dimen0=#5\relax % just in case of .x\bodyfontsize
- \ifzeropt\dimen0
- \dofilledlinedbox\width#1\height#2\depth#3\\%
+ \doifelse{\framedparameter\c!backgroundcorner}\v!rectangular
+ {\dofilledlinedbox}
+ {\scratchdimen\framedparameter\c!backgroundradius\relax % just in case of .x\bodyfontsize
+ \ifzeropt\scratchdimen
+ \dofilledlinedbox
\else
- \dofilledroundbox\width#1\height#2\depth#3\radius#5\\%
- \fi}
- {\dofilledlinedbox\width#1\height#2\depth#3\\}%
+ \dofilledroundbox
+ \fi}%
\egroup}
-\def\dofilledlinedbox\width#1\height#2\depth#3\\%
- {\vrule\!!width#1\!!height#2\!!depth#3}%
-\def\dofilledroundbox\width#1\height#2\depth#3\radius#4\\%
- {\ovalbox{#1}{#2}{#3}\ruledlinewidth{#4}\v!off\v!on}
+\def\dophantombox
+ {\hphantom{\dofilledbox}}
+
+\def\dofilledlinedbox
+ {\vrule\!!width\frameddimenwd\!!height\frameddimenht\!!depth\frameddimendp\relax}%
-\def\ovalbox#1#2#3#4#5#6#7% direct #1 etc passeren
+\def\dofilledroundbox
+ {\doroundedbox\v!off\v!on{\framedparameter\c!backgroundcorner}}
+
+\def\doroundedbox#1#2#3%
{\bgroup
- \scratchdimen#1\edef\ovalwid{\the\scratchdimen}%
- \scratchdimen#2\edef\ovalhei{\the\scratchdimen}%
- \scratchdimen#3\edef\ovaldep{\the\scratchdimen}%
- \scratchdimen#4\edef\ovallin{\the\scratchdimen}%
- \scratchdimen#5\edef\ovalrad{\the\scratchdimen}%
- \doifelse{#6}\v!on % will be a macro that handles
+ \doifelse{#3}\v!round{\let\ovalmod\!!zerocount}{\edef\ovalmod{\number#3}}%
+ \edef\ovalwid{\the\frameddimenwd}%
+ \edef\ovalhei{\the\frameddimenht}%
+ \edef\ovaldep{\the\frameddimendp}%
+ \scratchdimen\ruledlinewidth\edef\ovallin{\the\scratchdimen}%
+ \scratchdimen\framedparameter\c!frameradius\edef\ovalrad{\the\scratchdimen}%
+ \doifelse{#1}\v!on % will be a macro that handles
{\let\ovalstr\!!plusone} % start, stop, ja, nee, aan, uit
{\let\ovalstr\!!zerocount}% % and something \doif
- \doifelse{#7}\v!on
+ \doifelse{#2}\v!on
{\let\ovalfil\!!plusone}
{\let\ovalfil\!!zerocount}%
- \doovalbox\ovalwid\ovalhei\ovaldep\ovallin\ovalrad\ovalstr\ovalfil
+ \doovalbox\ovalwid\ovalhei\ovaldep\ovallin\ovalrad\ovalstr\ovalfil\ovalmod
\egroup}
+% a lot of weird corners
+%
+% \startTEXpage
+% \dontleavehmode\framed
+% [corner=0,frame=on,framecolor=green,
+% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green,
+% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green,
+% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse {9}{12}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse{13}{16}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse{17}{20}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse{21}{24}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \vskip1em
+% \dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed
+% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
+% \quad}
+% \stopTEXpage
+
%D The oval box is drawn using a special macro, depending on
%D the driver in use.
+\def\dograybox % avoid black rules when no gray
+ {\doifelsenothing{\framedparameter\c!backgroundscreen}
+ {\dophantombox}
+ {\raster[\framedparameter\c!backgroundscreen]{\dofilledbox}}}
+
%D It won't be a surprise that we not only provide gray boxes,
%D but also colored ones. Here it is:
-% \def\setcolorbox\width#1\height#2\depth#3\color#4\corner#5\radius#6\\%
-% {\ifincolor
-% \doifcolorelse{#4}{\color[#4]%
-% {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}}
-% {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\}%
-% \else
-% \dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\%
-% \fi}
-
-\def\setcolorbox\width#1\height#2\depth#3\color#4\corner#5\radius#6\\%
+\def\docolorbox
{\hbox{\ifincolor
- \doifcolorelse{#4}{\localcolortrue\color[#4]%
- {\dofilledbox \width#1\height#2\depth#3\corner#5\radius#6\\}}
- {\dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\}%
+ \doifcolorelse{\framedparameter\c!backgroundcolor}
+ {\localcolortrue\color[\framedparameter\c!backgroundcolor]{\dofilledbox}}
+ {\dophantombox}%
\else
- \dophantombox\width#1\height#2\depth#3\corner#5\radius#6\\%
+ \dophantombox
\fi}}
-\def\colorbox
- {\setcolorbox}
-
%D \macros
%D {defineoverlay, doifoverlayelse, overlayoffset,
%D overlaywidth, overlayheight, overlaydepth,
@@ -325,63 +351,34 @@
{\dodoubleargument\dodefineoverlay}
\def\dodefineoverlay[#1][#2]%
- {\def\docommando##1%
- {\setvalue{\??ov##1}{\executedefinedoverlay##1\\#2\\}}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\setvalue{\??ov##1}{\executedefinedoverlay{##1}{#2}}}%
+ \processcommalist[#1]\docommand}
\prependtoks
\hsize\overlaywidth
\vsize\overlayheight
\to\everyoverlay
-% \long\def\executedefinedoverlay#1\\#2\\#3#4#5#6#7#8#9%
-% {\bgroup
-% \scratchdimen#3%
-% \edef\overlaywidth{\the\scratchdimen\space}%
-% \scratchdimen#4%
-% \advance\scratchdimen#5%
-% \edef\overlayheight{\the\scratchdimen\space}%
-% \scratchdimen#5%
-% \edef\overlaydepth{\the\scratchdimen\space}%
-% \edef\overlaycolor{#6}%
-% \let\overlayoffset\backgroundoffset % we steal this one
-% %\writestatus
-% % {overlay}
-% % {#1\space w=\overlaywidth/h+d=\overlayheight/d=\overlaydepth]}%
-% \setbox\scratchbox\hbox{\lower\overlaydepth\hbox{\the\everyoverlay#2}}%
-% \dimen0\wd\scratchbox \advance\dimen0 -\overlaywidth
-% \dimen2\ht\scratchbox \advance\dimen2 -#4% not \overlayheight
-% %\wd\scratchbox\overlaywidth
-% %\ht\scratchbox\overlayheight
-% %\dp\scratchbox\overlaydepth
-% \setbox\scratchbox\hbox{\hskip-.5\dimen0\raise-.5\dimen2\box\scratchbox}%
-% \wd\scratchbox\overlaywidth
-% \ht\scratchbox\overlayheight
-% \dp\scratchbox\overlaydepth
-% \box\scratchbox
-% \egroup}
-
-\long\def\executedefinedoverlay#1\\#2\\#3#4#5#6#7#8#9%
+\long\def\executedefinedoverlay#1#2%
{\bgroup
- \scratchdimen#3%
- \edef\overlaywidth{\the\scratchdimen\space}%
- \scratchdimen#4%
- \advance\scratchdimen#5%
- \edef\overlayheight{\the\scratchdimen\space}%
- \scratchdimen#5%
- \edef\overlaydepth{\the\scratchdimen\space}%
- \edef\overlaycolor{#6}%
+ \edef\overlaywidth {\the\frameddimenwd\space}%
+ \edef\overlayheight{\the\dimexpr\frameddimenht+\frameddimendp\relax\space}%
+ \edef\overlaydepth {\the\frameddimendp\space}%
+ \edef\overlaycolor {\framedparameter\c!backgroundcolor}%
+ %\edef\overlaycorner{\framedparameter\c!backgroundcorner}%
+ %\edef\overlayradius{\framedparameter\c!backgroundradius}%
\let\overlayoffset\backgroundoffset % we steal this one
%\writestatus
% {overlay}
% {#1\space w=\overlaywidth/h+d=\overlayheight/d=\overlaydepth]}%
\setbox\scratchbox\hbox{\lower\overlaydepth\hbox{\the\everyoverlay#2}}%
- \dimen0\wd\scratchbox \advance\dimen0 -\overlaywidth
- \dimen2\ht\scratchbox \advance\dimen2 -#4% not \overlayheight
- %\wd\scratchbox\overlaywidth
- %\ht\scratchbox\overlayheight
- %\dp\scratchbox\overlaydepth
- \setbox\scratchbox\hbox{\hskip-.5\dimen0\raise-.5\dimen2\box\scratchbox}%
+% \dimen0=\dimexpr\wd\scratchbox-\overlaywidth \relax
+% \dimen2=\dimexpr\ht\scratchbox-\frameddimenht\relax % not overlayheight !
+% \setbox\scratchbox\hbox{\hskip-.5\dimen0\raise-.5\dimen2\box\scratchbox}%
+ \setbox\scratchbox\hbox
+ {\hskip-.5\dimexpr\wd\scratchbox-\overlaywidth \relax
+ \raise-.5\dimexpr\ht\scratchbox-\frameddimenht\relax % not overlayheight !
+ \box\scratchbox}%
\wd\scratchbox\overlaywidth
\ht\scratchbox\overlayheight
\dp\scratchbox\overlaydepth
@@ -401,27 +398,24 @@
%D We predefine two already familiar backgrounds:
-\setvalue{\??ov\v!screen}#1#2#3#4#5#6#7%
- {\graybox\width#1\height#2\depth#3\raster#5\corner#6\radius#7\\}
-
-\setvalue{\??ov\v!color}#1#2#3#4#5#6#7%
- {\colorbox\width#1\height#2\depth#3\color#4\corner#6\radius#7\\}
-
-%D After all these preparations, the background macro does no
-%D bring to many surprises. One has to keep in mind that this
-%D macro starts up a call chain, depending on the background
-%D one needs:
-%D
-%D \startitemize[packed]
-%D \item a raster, color or user defined shape
-%D \item square or round corners
-%D \item a \TEX\ or driver based method
-%D \stopitemize
-%D
-%D The macro can be extended by adding commands to the token
-%D list register \type {\everybackgroundbox}. For this
-%D purpose, the name of the current background is available in
-%D \type {\currentbackgound}.
+\setvalue{\??ov\v!screen}{\dograybox }
+\setvalue{\??ov\v!color }{\docolorbox}
+
+% %D After all these preparations, the background macro does no
+% %D bring to many surprises. One has to keep in mind that this
+% %D macro starts up a call chain, depending on the background
+% %D one needs:
+% %D
+% %D \startitemize[packed]
+% %D \item a raster, color or user defined shape
+% %D \item square or round corners
+% %D \item a \TEX\ or driver based method
+% %D \stopitemize
+% %D
+% %D The macro can be extended by adding commands to the token
+% %D list register \type {\everybackgroundbox}. For this
+% %D purpose, the name of the current background is available in
+% %D \type {\currentbackgound}.
\newbox\extraframebox
@@ -429,14 +423,12 @@
\let\currentbackground\empty
-\def\dodobackgroundbox#1#2#3#4#5#6%
+\def\dodobackgroundbox#1% also less passing, we can get rid of the old method
{\bgroup
\def\currentbackground{#1}%
\the\everybackgroundbox
\setbox\extraframebox\hbox
- {\vbox{\moveleft\dimen0\hbox
- {\executeifdefined{\??ov\currentbackground}\gobblesevenarguments
- {\dimen2}{\dimen4}{\dimen6}{#3}{#4}{#5}{#6}}}}%
+ {\vbox{\moveleft\backgroundoffset\hbox{\executeifdefined{\??ov\currentbackground}\donothing}}}%
\wd\extraframebox\zeropoint % \backgroundwidth
\ht\extraframebox\backgroundheight
\dp\extraframebox\backgrounddepth
@@ -450,34 +442,31 @@
% todo: also \def\theforegroundbox{#1}
-\def\dobackgroundbox#1\background#2\color#3\raster#4\offset#5\corner
- #6\radius#7\depth#8\component#9\\%
- {\vbox
- {\forgetall\boxmaxdepth\maxdimen
- \dimen0 #5\relax % space needed
- \dimen2\wd#1\advance\dimen2 2\dimen0
- \dimen4\ht#1\advance\dimen4 \dimen0
- \dimen6\dp#1\advance\dimen6 \dimen0
- \advance\dimen6 #8\relax
- \edef\backgroundoffset{\the\dimen0}%
- \edef\backgroundwidth {\the\wd#1}%
- \edef\backgroundheight{\the\ht#1}%
- \edef\backgrounddepth {\the\dp#1}%
+\def\dobackgroundbox#1%
+ {\setbox\framebox\vbox
+ {\forgetall
+ \boxmaxdepth\maxdimen
+ \scratchdimen \framedparameter{#1}\relax
+ \frameddimenwd\dimexpr\wd\framebox+2\scratchdimen\relax
+ \frameddimenht\dimexpr\ht\framebox+ \scratchdimen\relax
+ \frameddimendp\dimexpr\dp\framebox+ \scratchdimen+\framedparameter\c!backgrounddepth\relax
+ \edef\backgroundoffset{\the\scratchdimen}%
+ \edef\backgroundwidth {\the\wd\framebox}%
+ \edef\backgroundheight{\the\ht\framebox}%
+ \edef\backgrounddepth {\the\dp\framebox}%
%\edef\foregroundbox{\box#1}%
\def\foregroundbox% fuzzy but needed hack, this \vss, otherwise
- {\vbox to \backgroundheight{\vss\box#1\vss}}% vertical shift
- \def\docommando##1%
- {\dodobackgroundbox{##1}{#1}{#3}{#4}{#6}{#7}}%
- \edef\component{#9}%
+ {\vbox to \backgroundheight{\vss\box\framebox\vss}}% vertical shift
+ \edef\component{\framedparameter\c!component}%
\hbox to \backgroundwidth % in case 'foreground' is used as overlay
{\ifx\component\empty
- \expanded{\rawprocesscommalist[#2]}\docommando
+ \expanded{\rawprocesscommalist[\framedparameter\c!background]}\dodobackgroundbox
\else
\startlayoutcomponent{b:\component}{background \component}%
- \expanded{\rawprocesscommalist[#2]}\docommando
+ \expanded{\rawprocesscommalist[\framedparameter\c!background]}\dodobackgroundbox
\stoplayoutcomponent
\fi
- \box#1\hss}}}
+ \box\framebox\hss}}}
%D One can explictly insert the foreground box. For that
%D purpose we introduce the overlay \type {foreground}.
@@ -493,66 +482,60 @@
%D by \TEX\ itself, the latter one depends on the driver. This
%D macro also support a negative offset.
-\def\dooutlinebox#1\color#2\offset#3\corner#4\radius#5\depth#6\toggle#7\\%
- {\vbox % rules on top of box
- {\dimen0 #3\relax % space needed
- \dimen2\wd#1\advance\dimen2 2\dimen0
- \dimen4\ht#1\advance\dimen4 \dimen0
- \dimen6\dp#1\advance\dimen6 \dimen0\advance\dimen6 #6\relax
- \ifdim\dimen6<\zeropoint
- \advance\dimen4 \dimen6
- \dimen8-\dimen6
- \dimen6\zeropoint
+\def\dooutlinebox
+ {\setbox\framebox\vbox % rules on top of box
+ {\scratchdimen \framedparameter\c!frameoffset\relax
+ \frameddimenwd\dimexpr\wd\framebox+2\scratchdimen\relax
+ \frameddimenht\dimexpr\ht\framebox+ \scratchdimen\relax
+ \frameddimendp\dimexpr\dp\framebox+ \scratchdimen+\framedparameter\c!framedepth\relax
+ \ifdim\frameddimendp<\zeropoint
+ \advance\frameddimenht \frameddimendp
+ \scratchdimen-\frameddimendp
+ \frameddimendp\zeropoint
\else
- \dimen8\zeropoint
+ \scratchdimen\zeropoint
\fi
\setbox\extraframebox\hbox
- {\dostrokedbox\width\dimen2\height\dimen4\depth\dimen6%
- \corner#4\radius#5\toggle#7\\}%
+ {\dostrokedbox}%
\setbox\extraframebox\hbox
- {\raise\dimen8\vbox{\moveleft#3\box\extraframebox}}%
- \wd\extraframebox\wd#1%
- \ht\extraframebox\ht#1%
- \dp\extraframebox\dp#1%
+ {\raise\scratchdimen\vbox
+ {\moveleft\framedparameter\c!frameoffset\box\extraframebox}}%
+ \wd\extraframebox\wd\framebox
+ \ht\extraframebox\ht\framebox
+ \dp\extraframebox\dp\framebox
\hbox
- {%\copy#1\hskip-\wd#1%
- \box#1\hskip-\wd\extraframebox % faster
- \doifelsenothing{#2} % speeds up a little
- {\box\extraframebox}
- {\color[#2]{\box\extraframebox}}}}}
-
-\def\dostrokedbox\width#1\height#2\depth#3\corner#4\radius#5\toggle#6\\%
- {\bgroup
- \doifelse{#4}\v!round
- {\dimen0=#5\relax % just in case of .x\bodyfontsize
- \ifzeropt\dimen0
- \dostrokedlinedbox\width#1\height#2\depth#3\toggle#6\\%
+ {\box\framebox\hskip-\wd\extraframebox
+ \doifsomething{\framedparameter\c!framecolor}% no else needed,
+ {\color[\framedparameter\c!framecolor]}% %
+ {\box\extraframebox}}}} % but {} here
+
+\def\dostrokedbox
+ {\doifelse{\framedparameter\c!framecorner}\v!rectangular
+ {\dostrokedlinedbox}
+ {\ifzeropt\dimexpr\framedparameter\c!frameradius\relax % just in case of .x\bodyfontsize
+ \dostrokedlinedbox
\else
- \dostrokedroundbox\width#1\height#2\depth#3\radius#5\toggle#6\\%
- \fi}
- {\dostrokedlinedbox\width#1\height#2\depth#3\toggle#6\\}%
- \egroup}
-
-%D The toggle argument in these calls concern the individual
-%D rules: left, right, top and bottom. Each can be turned on,
-%D depending on the general state (\type{#4}) or the individual
-%D ones (\type{#5}, \type{#6}, \type{#7} and \type{#8}).
-
-\def\dostrokedlinedbox\width#1\height#2\depth#3\toggle
- #4\left#5\right#6\top#7\bottom#8\\%
- {\bgroup
- \setbox0\null
- \wd0=#1\ht0=#2\dp0=#3%
- \setbox2\vbox
- {\getvalue{t\@@frame@@#4#7}%
- \hbox
- {\getvalue{l\@@frame@@#4#5}%
- \box0%
- \getvalue{r\@@frame@@#4#6}}
- \getvalue{b\@@frame@@#4#8}}%
- \wd2=#1\ht2=#2\dp2=#3%
- \box2
- \egroup}
+ \dostrokedroundbox
+ \fi}}
+
+\def\dostrokedlinedbox
+ {\setbox\scratchbox\null
+ \wd\scratchbox\frameddimenwd
+ \ht\scratchbox\frameddimenht
+ \dp\scratchbox\frameddimendp
+ \setbox\scratchbox\vbox \bgroup
+ \csname t\@@frame@@\framedparameter\c!frame\framedparameter\c!topframe \endcsname
+ \hbox \bgroup
+ \csname l\@@frame@@\framedparameter\c!frame\framedparameter\c!leftframe \endcsname
+ \box\scratchbox
+ \csname r\@@frame@@\framedparameter\c!frame\framedparameter\c!rightframe \endcsname
+ \egroup
+ \csname b\@@frame@@\framedparameter\c!frame\framedparameter\c!bottomframe\endcsname
+ \egroup
+ \wd\scratchbox\frameddimenwd
+ \ht\scratchbox\frameddimenht
+ \dp\scratchbox\frameddimendp
+ \box\scratchbox}
\def\@@frame@@{@@frame@@}
@@ -576,10 +559,10 @@
%D Before we come to using these macros we yet have to define
%D the rounded corner alternative, which after all is not that
%D hard because it uses the previously defined macro \type
-%D {\ovalbox}.
+%D {\doroundedbox}.
-\def\dostrokedroundbox\width#1\height#2\depth#3\radius#4\toggle#5\left#6\\%
- {\doif{#5}\v!on{\ovalbox{#1}{#2}{#3}{\ruledlinewidth}{#4}\v!on\v!off}}
+\def\dostrokedroundbox
+ {\doif{\framedparameter\c!frame}\v!on{\doroundedbox\v!on\v!off{\framedparameter\c!framecorner}}}
%D The next few macros are probably the most misused ones in
%D \CONTEXT. They deal with putting rules around boxes, provide
@@ -653,8 +636,45 @@
\copyparameters[#1\c!frame][#1]%
[\c!radius,\c!corner,\c!depth]}
+% \def\setupframed
+% {\dodoubleargument\getparameters[\??oi]}
+
\def\setupframed
- {\dodoubleargument\getparameters[\??oi]}
+ {\dodoubleempty\dosetupframed}
+
+\def\dosetupframed
+ {\ifsecondargument
+ \@EA\dodoublesetupframed
+ \else
+ \@EA\dosinglesetupframed
+ \fi}
+
+\def\dosinglesetupframed[#1][#2]%
+ {\getparameters[\??oi][#1]}
+
+\def\dodoublesetupframed[#1][#2]%
+ {\bgroup
+ \let\dodoubleempty\empty
+ \def\doframed[##1]{\gdef\globalredefinedframed{\dodoubleempty\doframed[##1,#2]}}%
+ \getvalue{#1}%
+ \egroup
+ \letvalue{#1}\globalredefinedframed}
+
+%D \startbuffer
+%D \setupframed [framecolor=yellow] \framed{A}
+%D \defineframed[myframed] [framecolor=blue] \myframed{B}
+%D \setupframed [myframed] [framecolor=red] \myframed{C}
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \presetlocalframed[myframed]
+%D \setuplocalframed[myframed][width=4cm,height=2cm]
+%D \localframed[myframed][framecolor=green]{oeps}
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
%D \macros
%D {ifinframed}
@@ -674,7 +694,47 @@
{\bgroup
\dodoubleempty\startlocalframed}
-\let\fastlocalframed\localframed
+%D The next one is faster on multiple backgrounds per page. No
+%D dimensions can be set, only frames and backgrounds.
+
+\def\fastlocalframed[#1]#2[#3]#4% 3-4
+ {\bgroup
+ \inframedtrue
+ \edef\@@framed{#1}%
+ % more bytes
+ % \scratchdimen\framedparameter\c!frameoffset
+ % \setevalue{\@@framed\c!frameoffset}{\the\scratchdimen}%
+ % \doifnotvalue{\@@framed\c!backgroundoffset}\v!frame
+ % {\scratchdimen\framedparameter\c!backgroundoffset
+ % \setevalue{\@@framed\c!backgroundoffset}{\the\scratchdimen}}%
+ % less bytes
+ \@EA\freezedimenmacro\csname\@@framed\c!frameoffset\endcsname
+ \doifnotvalue{\@@framed\c!backgroundoffset}\v!frame
+ {\@EA\freezedimenmacro\csname\@@framed\c!backgroundoffset\endcsname}%
+ % so far
+ \setbox\framebox\hbox{#4}%
+ \getparameters[\@@framed][#3]% no \expanded !
+ % no, better in calling macro
+ %
+ % \edef\doframedsetups{\framedparameter\c!setups}%
+ % \ifx\doframedsetups\empty\else
+ % \edef\doframedsetups{\noexpand\setups[\doframedsetups]}%
+ % \fi
+ \removeframedboxdepth
+ \docolorframebox
+ \edef\overlaylinecolor{\framedparameter\c!framecolor}%
+ \edef\overlaylinewidth{\the\ruledlinewidth}%
+ \edef\@@localframing {\framedparameter\c!frame}%
+ \ifx\@@localframing\v!overlay \else \ifx\@@localframing\v!none \else
+ \doifvaluesomething{\@@framed\c!rulethickness}
+ {\ruledlinewidth\framedparameter\c!rulethickness\relax
+ \ifinheritruledlinewidth\linewidth\ruledlinewidth\fi}%
+ \dooutlinebox % real or invisible frame
+ \fi \fi
+ \doifvaluesomething{\@@framed\c!background}\dobackedbox
+ \restoreframedboxdepth
+ \box\framebox
+ \egroup}
%D Before we go into details, we present (and implement) the
%D main framing routine. I saw no real reason for splitting the
@@ -710,11 +770,9 @@
% \doifvaluesomething{\@@framed\c!rulethickness} % obsolete
% {\ruledlinewidth\getvalue{\@@framed\c!rulethickness}}% obsolete
% this piece of pre expansion is needed (sometimes used circular)
- \scratchdimen\framedparameter\c!frameoffset
- \setevalue{\@@framed\c!frameoffset}{\the\scratchdimen}%
+ \setevalue{\@@framed\c!frameoffset}{\the\dimexpr\framedparameter\c!frameoffset\relax}%
\doifnotvalue{\@@framed\c!backgroundoffset}\v!frame
- {\scratchdimen\framedparameter\c!backgroundoffset
- \setevalue{\@@framed\c!backgroundoffset}{\the\scratchdimen}}%
+ {\setevalue{\@@framed\c!backgroundoffset}{\the\dimexpr\framedparameter\c!backgroundoffset\relax}}%
% to prevent deadlock in case of self refering
\ifsecondargument % faster
\getparameters[\@@framed][#2]% here !
@@ -790,8 +848,7 @@
\else
\let\defaultframeoffset\localoffset
\fi
- \@@localoffset\localoffset
- \advance\@@localoffset \ruledlinewidth
+ \@@localoffset\dimexpr\localoffset+\ruledlinewidth\relax
\fi\fi
\!!framedheight\zeropoint
\!!framedwidth \zeropoint
@@ -981,7 +1038,8 @@
\def\stoplocalframed
{\dontshowcomposition
- \@@stopframedorientation
+ \@@stopframedorientation % hm, wrong place ! should rotatethe result (after reshape)
+ \handleframedlocator\c!before\@@locallocation
\ifboxhasformat
\ifx\@@localautowidth\v!force
\ifreshapeframebox\doreshapeframedbox\fi
@@ -1029,28 +1087,27 @@
\edef\overlaylinecolor{\framedparameter\c!framecolor}%
\edef\overlaylinewidth{\the\ruledlinewidth}% \@@...
\ifboxhasframe % real or invisible frame
- \doframedbox
+ \dooutlinebox
\fi
\doifvaluesomething{\@@framed\c!background}\dobackedbox
- \handleframedlocator\@@locallocation
+ \handleframedlocator\c!after\@@locallocation
\box\framebox
\egroup
\egroup}
-\def\installframedlocator#1#2%
- {\setvalue{\??ol:\c!location:#1}{#2}}
+\def\installframedlocator#1#2#3%
+ {\setvalue{\??ol:\c!location:\c!before:#1}{#2}%
+ \setvalue{\??ol:\c!location:\c!after :#1}{#3}}
-\def\handleframedlocator#1%
- {\getvalue{\??ol:\c!location:#1}}
+\def\handleframedlocator#1#2%
+ {\getvalue{\??ol:\c!location:#1:#2}}
\def\doprelocframedbox#1%
- {\scratchdimen#1\relax
- \advance\scratchdimen \ruledlinewidth
+ {\scratchdimen\dimexpr#1+\ruledlinewidth\relax
\ifboxhasoffset
\advance\scratchdimen \framedparameter\c!offset
\fi
- \scratchskip\ht\framebox
- \advance\scratchskip-\scratchdimen}
+ \scratchskip\dimexpr\ht\framebox-\scratchdimen\relax}
% \ruledhbox
% {A
@@ -1075,24 +1132,24 @@
% B}
\installframedlocator \v!hanging % best with strut=no
+ {}
{\dp\framebox\ht\framebox
\ht\framebox\zeropoint}
\installframedlocator \v!depth
- {\scratchdimen\ht\framebox
- \advance\scratchdimen -\strutdp
- \ht\framebox\scratchdimen
+ {}
+ {\ht\framebox\dimexpr\ht\framebox-\strutdp\relax
\dp\framebox\strutdp
\box\framebox}
\installframedlocator \v!height
- {\scratchdimen\ht\framebox
- \advance\scratchdimen -\strutht
+ {}
+ {\dp\framebox\dimexpr\ht\framebox-\strutht\relax
\ht\framebox\strutht
- \dp\framebox\scratchdimen
\box\framebox}
\installframedlocator \v!high
+ {}
{\doprelocframedbox\strutht
\setbox\framebox\hbox{\lower\scratchskip\box\framebox}%
\ht\framebox\strutht
@@ -1100,12 +1157,14 @@
\hbox{\box\framebox}}
\installframedlocator \v!line
+ {}
{\setbox\framebox\hbox{\lower.5\ht\framebox\box\framebox}%
\ht\framebox.5\lineheight
\dp\framebox.5\lineheight
\hbox{\box\framebox}}
\installframedlocator \v!low
+ {}
{\doprelocframedbox\strutdp
\setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
\ht\framebox\strutht
@@ -1113,6 +1172,7 @@
\box\framebox}
\installframedlocator \v!top
+ {}
{\doprelocframedbox\strutht
\setbox\framebox\hbox{\lower\scratchskip\box\framebox}%
\ht\framebox\scratchdimen
@@ -1120,6 +1180,7 @@
\hbox{\box\framebox}}
\installframedlocator \v!middle
+ {}
{\scratchdimen.5\ht\framebox
\setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
\ht\framebox\scratchdimen
@@ -1127,15 +1188,42 @@
\hbox{\box\framebox}}
\installframedlocator \v!lohi
- {\handleframedlocator\v!middle}
+ {\handleframedlocator\c!before\v!middle}
+ {\handleframedlocator\c!after \v!middle}
\installframedlocator \v!bottom
+ {}
{\doprelocframedbox\strutdp
\setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
\ht\framebox\scratchskip
\dp\framebox\scratchdimen
\hbox{\box\framebox}}
+\installframedlocator \v!keep % retains height/depth
+ {\removeframedboxdepth}
+ {\restoreframedboxdepth}
+
+% also used in fastlocalframed
+
+\newdimen\originalframedwd
+\newdimen\originalframedht
+\newdimen\originalframeddp
+
+\def\removeframedboxdepth
+ {\originalframedwd\wd\framebox
+ \originalframedht\ht\framebox
+ \originalframeddp\dp\framebox
+ \ifzeropt\originalframeddp\else\setbox\framebox\hbox{\raise\originalframeddp\box\framebox}\fi
+ \wd\framebox\originalframedwd
+ \ht\framebox\dimexpr\originalframedht+\originalframeddp\relax
+ \dp\framebox\zeropoint}
+
+\def\restoreframedboxdepth
+ {\ifzeropt\originalframeddp\else\setbox\framebox\hbox{\lower\originalframeddp\box\framebox}\fi
+ \wd\framebox\originalframedwd
+ \ht\framebox\originalframedht
+ \dp\framebox\originalframeddp}
+
% \let\@@startframedorientation\relax
% \let\@@stopframedorientation \relax
@@ -1407,39 +1495,13 @@
%D additional offset capabilities. The lot of calls to other
%D macros makes this mechanism not that easy to comprehend.
-\def\doframedbox
- {\setbox\framebox\vbox
- {\dooutlinebox\framebox
- \color \framedparameter\c!framecolor
- \offset \framedparameter\c!frameoffset
- \corner \framedparameter\c!framecorner
- \radius \framedparameter\c!frameradius
- \depth \framedparameter\c!framedepth
- \toggle \framedparameter\c!frame
- \left \framedparameter\c!leftframe
- \right \framedparameter\c!rightframe
- \top \framedparameter\c!topframe
- \bottom \framedparameter\c!bottomframe\\}}
-
%D Getting the backgrounds right takes less code. Again we
%D have to take care of additional offsets.
\def\dobackedbox
{\doifelsevalue{\@@framed\c!backgroundoffset}\v!frame % new
- {\dodobackedbox\c!frameoffset}
- {\dodobackedbox\c!backgroundoffset}}
-
-\def\dodobackedbox#1%
- {\setbox\framebox\vbox
- {\dobackgroundbox\framebox
- \background \framedparameter\c!background
- \color \framedparameter\c!backgroundcolor
- \raster \framedparameter\c!backgroundscreen
- \offset \framedparameter{#1}%
- \corner \framedparameter\c!backgroundcorner
- \radius \framedparameter\c!backgroundradius
- \depth \framedparameter\c!backgrounddepth
- \component \framedparameter\c!component\\}}
+ {\dobackgroundbox\c!frameoffset}
+ {\dobackgroundbox\c!backgroundoffset}}
%D We handle left, right or middle alignment as well as fixed
%D or free widths and heights. Each combination gets its own
@@ -1651,10 +1713,55 @@
% otherwise we get problems with framed display math and auto
% width.
+% \def\doreshapeframedbox % frozen
+% {\beginofshapebox
+% \unvcopy\framebox
+% \endofshapebox
+% \global\@@globalwidth\zeropoint
+% \resetshapeframebox
+% \reshapebox
+% {\setbox0\hbox
+% {\strut\ifhbox\shapebox\unhbox\else\box\fi\shapebox}%
+% \global\advance\framednoflines \plusone
+% \ifdim\framedlastlength>\zeropoint\else
+% \global\framedlastlength\wd0
+% \fi
+% \ifdim\wd0>\@@globalwidth
+% \global\@@globalwidth\wd0
+% \fi}%
+% \dosetraggedcommand\localformat
+% \raggedcommand
+% \ifboxhasheight
+% \setbox\framebox\vbox to \localheight
+% {\hsize\@@globalwidth
+% \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}%
+% \dobeforeframedbox
+% \innerflushshapebox
+% \doafterframedbox}%
+% \else
+% \scratchdimen\dp\framebox
+% \setbox\framebox\vbox to \ht\framebox
+% {\hsize\@@globalwidth
+% \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}%
+% \innerflushshapebox}%
+% \dp\framebox\scratchdimen % \strutdp otherwise problem with math
+% \fi
+% \ifdim\framedlastlength=\zeropoint\global\framednoflines\wd\framebox\fi
+% \ifcase\framednoflines\global\framednoflines\plusone\fi}
+
+\chardef\reshapeframeboxmethod\plusone % 0=no flush, 1=old method 2=no depth messing
+
+\let\framedboxwidth \!!zeropoint
+\let\framedboxheight\!!zeropoint
+\let\framedboxdepth \!!zeropoint
+
\def\doreshapeframedbox % frozen
{\beginofshapebox
\unvcopy\framebox
\endofshapebox
+ \edef\framedboxwidth {\the\wd\framebox}%
+ \edef\framedboxheight{\the\ht\framebox}%
+ \edef\framedboxdepth {\the\dp\framebox}%
\global\@@globalwidth\zeropoint
\resetshapeframebox
\reshapebox
@@ -1667,30 +1774,49 @@
\ifdim\wd0>\@@globalwidth
\global\@@globalwidth\wd0
\fi}%
- \dosetraggedcommand\localformat
- \raggedcommand
- \ifboxhasheight
- \setbox\framebox\vbox to \localheight
- {\hsize\@@globalwidth
- \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}%
- \dobeforeframedbox
- \innerflushshapebox
- \doafterframedbox}%
+ \ifreshapingfailed
+ % no need for anothr pass or finalizer
\else
- \scratchdimen\dp\framebox
- \setbox\framebox\vbox to \ht\framebox
- {\hsize\@@globalwidth
- \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}%
- \innerflushshapebox}%
- \dp\framebox\scratchdimen % \strutdp otherwise problem with math
- \fi
- \ifdim\framedlastlength=\zeropoint\global\framednoflines\wd\framebox\fi
- \ifcase\framednoflines\global\framednoflines\plusone\fi}
+ \dosetraggedcommand\localformat
+ \raggedcommand
+ \ifboxhasheight
+ \setbox\framebox\vbox to \localheight
+ {\hsize\@@globalwidth
+ \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}%
+ \dobeforeframedbox
+ \innerflushshapebox
+ \doafterframedbox}%
+ \else
+ \setbox\framebox\vbox to \ht\framebox
+ {\hsize\@@globalwidth
+ \reshapebox{\hbox to \hsize{\ifhbox\shapebox\unhbox\else\box\fi\shapebox}}%
+ \ifcase\reshapeframeboxmethod
+ \or \innerflushshapebox \or \innerflushshapebox
+ \fi}%
+ \ifcase\reshapeframeboxmethod \or
+ \dp\framebox\framedboxdepth % \strutdp otherwise problem with math
+ \fi
+ \fi
+ \ifdim\framedlastlength=\zeropoint\global\framednoflines\wd\framebox\fi
+ \ifcase\framednoflines\global\framednoflines\plusone\fi
+ \fi}
%D The two variables \type {\framednoflines} and \type
%D {\framedlastlength} can be used in a second pass to
%D optimized framed material.
+% torture test / strange case (much depth) / method 2 needed
+%
+% \startTEXpage[frame=on]
+% \startformula \startalign \NC A \NC B \NR \intertext{test} \NC C \NC D \NR \stopalign \stopformula
+% test outside formula
+% \startformula \startalign \NC A \NC B \NR \intertext{test} \NC C \NC D \NR \stopalign \stopformula
+% \blank[big]
+% \startformula \startalign \NC \int_01 \NC B \NR \intertext{test} \NC \int_01 \NC D \NR \stopalign \stopformula
+% test outside formula
+% \startformula \startalign \NC \int_01 \NC B \NR \intertext{test} \NC \int_01 \NC D \NR \stopalign \stopformula
+% \stopTEXpage
+
%D The examples on the next page show how one can give the
%D frame as well as the background an additional offset and
%D even a bit more depth. The blue outline is the frame, the
@@ -1751,8 +1877,7 @@
%D baseline intact outside as well as inside the framed box.
\def\doinlineframedbox
- {\scratchdimen\strutdp
- \advance\scratchdimen \ruledlinewidth
+ {\scratchdimen\dimexpr\strutdp+\ruledlinewidth\relax
\ifboxhasoffset
\advance\scratchdimen \framedparameter\c!offset
\fi
@@ -1765,9 +1890,7 @@
%D line.
\def\doloweredframedbox
- {\getboxheight\scratchdimen\of\box\framebox
- \advance\scratchdimen -\strutdp
- \ht\framebox\scratchdimen
+ {\ht\framebox\dimexpr\ht\framebox+\dp\framebox-\strutdp\relax
\dp\framebox\strutdp
\box\framebox}
@@ -1781,7 +1904,7 @@
%D \stoptyping
\def\dohangingframedbox % best with strut=no
- {\getboxheight\scratchdimen\of\box\framebox
+ {\scratchdimen\dimexpr\ht\framebox+\dp\framebox\relax
\ht\framebox\zeropoint
\dp\framebox\scratchdimen}
@@ -1808,8 +1931,7 @@
\def\vboxedhairline
{\bgroup
\dimen2=\ifboxhasoffset \localoffset \else \zeropoint \fi
- \dimen4=\dimen2
- \advance\dimen4 \ruledlinewidth
+ \dimen4=\dimexpr\dimen2+\ruledlinewidth\relax
\setbox0\vbox
{\advance\hsize 2\dimen4
\vskip\dimen2
@@ -1826,33 +1948,24 @@
\endgraf\nointerlineskip\localbegstrut
\egroup}
-\def\hboxedhairline
+\def\hboxedhairline % use framed dimen
{\bgroup
\dimen2=\ifboxhasoffset \localoffset \else \zeropoint \fi
\ifboxhasheight
- \dimen4=\localheight \divide\dimen4 2
- \dimen6=\dimen4
- \advance\dimen4 \strutdp
- \advance\dimen6 -\strutdp
- \advance\dimen4 -2\ruledlinewidth
- \advance\dimen6 2\ruledlinewidth
+ \dimen4\dimexpr\localheight/2+\strutdp-2\ruledlinewidth\relax
+ \dimen6\dimexpr\localheight/2-\strutdp+2\ruledlinewidth\relax
\else
- \dimen4\strutht
- \advance\dimen4 \dimen2
- \dimen6\strutdp
- \advance\dimen6 \dimen2
+ \dimen4\dimexpr\strutht+\dimen2\relax
+ \dimen6\dimexpr\strutdp+\dimen2\relax
\fi
\unskip
- \setbox0\hbox
+ \setbox\scratchbox\hbox
{\hskip\dimen2
- \vrule
- \!!height\dimen4
- \!!depth\dimen6
- \!!width\ruledlinewidth
+ \vrule\!!height\dimen4\!!depth\dimen6\!!width\ruledlinewidth
\hskip\dimen2}%
- \ht0\strutht
- \dp0\strutdp
- \box0
+ \ht\scratchbox\strutht
+ \dp\scratchbox\strutdp
+ \box\scratchbox
\ignorespaces
\egroup}
@@ -1935,9 +2048,9 @@
{\hbox\bgroup
\getparameters[\??bj][#1]%
\setstrut
- \doif\@@bjwidth\v!max{\def\@@bjwidth{1em}}%
- \doif\@@bjheight \v!max{\def\@@bjheight{\strutht}}%
- \doif\@@bjdepth \v!max{\def\@@bjdepth{\strutdp}}%
+ \doif\@@bjwidth \v!max{\def\@@bjwidth {1em}}%
+ \doif\@@bjheight\v!max{\def\@@bjheight{\strutht}}%
+ \doif\@@bjdepth \v!max{\def\@@bjdepth {\strutdp}}%
\localstartcolor[\@@bjcolor]%
\vrule
\!!width \@@bjwidth
@@ -2224,27 +2337,33 @@
\ifdim\linewidth=\zeropoint
\chardef\ruletype\zerocount
\else
- \doifnot\@@dlframe\v!on{\chardef\ruletype=0\relax}%
+ \doifnot\@@dlframe\v!on{\chardef\ruletype\zerocount}%
\fi
\ifnum\ruletype=\plusone
\doif\@@dlheight\v!max{\let\@@dlheight\!!plusone}%
- \doif\@@dldepth\v!max{\let\@@dldepth\!!plusone}%
+ \doif\@@dldepth \v!max{\let\@@dldepth \!!plusone}%
\else
\let\@@dlheight\!!plusone
\let\@@dldepth\!!plusone
\fi
\freezedimensionwithunit\@@dlheight\strutht
\freezedimensionwithunit\@@dldepth\strutdp
- \divide\linewidth 2
+ \divide\linewidth \plustwo
\doifelse\@@dlbackground\v!color
{\startcolor[\@@dlbackgroundcolor]%
- \dimen0=\@@dlheight
- \dimen2=\@@dldepth
- \ifnum\ruletype=2 % prevent overshoot due to rounding
- \advance\dimen0 -.5\linewidth
- \advance\dimen2 -.5\linewidth
+ \ifnum\ruletype=\plustwo % prevent overshoot due to rounding
+ \leaders
+ \hrule
+ \!!height\dimexpr\@@dlheight-.5\linewidth\relax
+ \!!depth \dimexpr\@@dldepth -.5\linewidth\relax
+ \hfill
+ \else
+ \leaders
+ \hrule
+ \!!height\@@dlheight
+ \!!depth \@@dldepth
+ \hfill
\fi
- \leaders\hrule\!!height\dimen0\!!depth\dimen2\hfill
\stopcolor
\ifcase\ruletype
% no rule
@@ -2255,10 +2374,8 @@
\stopcolor
\or
\startcolor[\@@dlcolor]%
- \dimen2=\@@dldepth\dimen0=-\dimen2 \advance\dimen0 \linewidth
- \hfillneg\leaders\hrule\!!height\dimen0\!!depth\dimen2\hfill
- \dimen2=\@@dlheight\dimen0=-\dimen2 \advance\dimen0 \linewidth
- \hfillneg\leaders\hrule\!!height\dimen2\!!depth\dimen0\hfill
+ \hfillneg\leaders\hrule\!!height\dimexpr-\@@dldepth+\linewidth\relax\!!depth\@@dldepth\hfill
+ \hfillneg\leaders\hrule\!!height\@@dlheight\!!depth\dimexpr-\@@dlheight+\linewidth\relax\hfill
\stopcolor
\fi}
{\ifcase\ruletype \else
@@ -2518,8 +2635,8 @@
\def\dosetupframedtexts[#1][#2]%
{\ifsecondargument
- \def\docommando##1{\getparameters[\??kd##1][#2]}%
- \processcommacommand[#1]\docommando % new, #1 may be macro
+ \def\docommand##1{\getparameters[\??kd##1][#2]}%
+ \processcommacommand[#1]\docommand % new, #1 may be macro
\else
\getparameters[\??kd\v!framedtext][#1]%
\fi}
@@ -2535,22 +2652,8 @@
{\dododostartframedtext[#1][][#2]}
{\dododostartframedtext[#1][#2][#3]}}
-\def\checkframedtext
- {\ifinsidefloat
- \localhsize\hsize
- \else\ifdim\sidefloatvsize>\zeropoint % will be proper handle
- % \strut % rather clean way to invoke the sidefloat OTR
- % \setbox0=\lastbox % and get the widths set, so from now on we
- % \setlocalhsize % can have framed texts alongside sidefloats
- \checksidefloat
- \setlocalhsize
- \else
- \localhsize\hsize
- \fi\fi}
-
\setfalse\framedtextlocationnone
-
\def\dododostartframedtext[#1][#2][#3]% #3 only passed to framed, not to framedtext
{\doifsomething{#2}{\setvalue{\??kd#1\c!location}{#2}}% does not listen to #3
\setfalse\framedtextlocationnone
@@ -2734,13 +2837,13 @@
\def\setuptextrules
{\dodoubleargument\getparameters[\??tl]}
-\def\complextextrule[#1]%
- {\processaction
+\def\complextextrule[#1]% if needed we can make it installable
+ {\let\next\dobottomtextrule
+ \processaction
[#1]
- [ \v!top=>\let\next\dotoptextrule,
- \v!bottom=>\let\next\dobottomtextrule,
- \s!default=>\let\next\dobottomtextrule,
- \s!unknown=>\let\next\dobottomtextrule]%
+ [ \v!top=>\let\next\dotoptextrule,
+ \v!middle=>\let\next\domiddletextrule,
+ \v!bottom=>\let\next\dobottomtextrule]%
\dosinglegroupempty\next}
\definecomplexorsimple\textrule
@@ -2750,21 +2853,17 @@
\def\docomplextextrule#1%
{\bgroup
- \advance\hsize -\rightskip
- \advance\hsize -\leftskip
+ \advance\hsize\dimexpr-\rightskip-\leftskip\relax
\setbox\scratchbox\hbox to \hsize
- {\dimen4=.5ex
- \dimen6=-.5ex
- \advance\dimen4 .5\linewidth
- \advance\dimen6 .5\linewidth
- \dimen8=\@@tldistance
+ {\dimen4\dimexpr .5ex+.5\linewidth\relax
+ \dimen6\dimexpr-.5ex+.5\linewidth\relax
\doifnothing{#1}\firstargumentfalse
\iffirstargument
\doifelse\@@tllocation\v!inmargin
{\llap{\doattributes\??tl\c!style\c!color{#1}\hskip\leftmargindistance}}
{\color[\@@tlrulecolor]
{\vrule\!!height\dimen4\!!depth\dimen6\!!width\@@tlwidth}%
- \hbox spread 2\dimen8
+ \hbox spread 2\dimexpr\@@tldistance\relax
{\hss\doattributes\??tl\c!style\c!color{\strut#1}\hss}}%
\fi
\color[\@@tlrulecolor]
@@ -2798,11 +2897,14 @@
\fi
\advance\dimen0 .5ex
\vskip\dimen0
+% ==
+% \vskip\dimexpr \strutdp + .5ex
+% \ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
+%
\@@tlinbetween
\doifelsenothing{#2}
{\bgroup
- \advance\hsize -\rightskip
- \advance\hsize -\leftskip
+ \advance\hsize\dimexpr-\rightskip-\leftskip\relax
\nointerlineskip
\moveleft-\leftskip\vbox
{\color[\@@tlrulecolor]
@@ -2961,12 +3063,11 @@
\def\par % very dangerous
{\let\par\endgraf % -)
\unskip\hfill
- \dimen0=\@@ivwidth
- \advance\dimen0 -\@@ivdistance
- \ifdim\dimen0>\@@ivmargin\else\expandafter\rlap\fi
+ \scratchdimen\dimexpr\@@ivwidth-\@@ivdistance\relax
+ \ifdim\scratchdimen>\@@ivmargin\else\expandafter\rlap\fi
{\kern\@@ivdistance
\vrule
- \!!width \dimen0
+ \!!width \scratchdimen
\!!height.5\linewidth
\!!depth .5\linewidth}%
\endgraf % !
@@ -3086,14 +3187,11 @@
\scratchdimen\textheight
\chardef\backgroundsplit\plusone % split to max height
\else
- \scratchdimen\pagegoal
\setbox\scratchbox\vbox{\@@agbefore}%
- \advance\scratchdimen -\ht\scratchbox
- \advance\scratchdimen -\pagetotal
+ \scratchdimen\dimexpr\pagegoal-\ht\scratchbox-\pagetotal\relax
\chardef\backgroundsplit\plustwo % split to partial height
\fi
- \advance\scratchdimen -\@@agtopoffset
- \advance\scratchdimen -\@@agbottomoffset \relax
+ \advance\scratchdimen\dimexpr-\@@agtopoffset-\@@agbottomoffset\relax
\ifdim\scratchdimen>2\lineheight\relax % reasonable, will be configurable
\ifdim\ht0>\scratchdimen % larger than page
\setbox2\vsplit0 to \scratchdimen
@@ -3206,8 +3304,8 @@
{\dodoubleempty\dosetupframedcontent}
\def\dosetupframedcontent[#1][#2]%
- {\def\docommando##1{\getparameters[\??fc##1][#2]}%
- \processcommacommand[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??fc##1][#2]}%
+ \processcommacommand[#1]\docommand}
\def\startframedcontent[#1]%
{\bgroup
@@ -3221,10 +3319,8 @@
{\setbox\framebox\hbox\bgroup
\setlocalhsize
\hsize\localhsize
- \advance\hsize-\getvalue{\??fc#1\c!leftoffset}%
- \advance\hsize-\getvalue{\??fc#1\c!rightoffset}%
- \advance\vsize-\getvalue{\??fc#1\c!topoffset}%
- \advance\vsize-\getvalue{\??fc#1\c!bottomoffset}%
+ \advance\hsize\dimexpr-\getvalue{\??fc#1\c!leftoffset}-\getvalue{\??fc#1\c!rightoffset} \relax
+ \advance\vsize\dimexpr-\getvalue{\??fc#1\c!topoffset} -\getvalue{\??fc#1\c!bottomoffset}\relax
\hskip\getvalue{\??fc#1\c!leftoffset}%
\vbox\bgroup
\vskip\getvalue{\??fc#1\c!topoffset}%
@@ -3288,12 +3384,6 @@
\let\omcirkeld\encircled
-% \def\copyright {\encircled{C}}
-% \def\registered{\encircled{R}}
-
-% \setuprules
-% [\c!lijndikte=\v!middel]
-
\setuplinewidth
[\v!medium]
@@ -3332,8 +3422,8 @@
\c!setups=]
\setupscreens
- [\c!factor=1.0,
- \c!method=\v!external, % \c!method=\v!dot
+ [%\c!factor=1.0, % obsolete
+ %\c!method=\v!external, % obsolete
\c!screen=0.95]
\setupblackrules
diff --git a/Master/texmf-dist/tex/context/base/core-sec.tex b/Master/texmf-dist/tex/context/base/core-sec.tex
index c5fc5db8ac5..1e8188ea0d4 100644
--- a/Master/texmf-dist/tex/context/base/core-sec.tex
+++ b/Master/texmf-dist/tex/context/base/core-sec.tex
@@ -75,6 +75,32 @@
\unprotect
+% new and to be tested
+
+\unexpanded\def\separatorlist#1%
+ {\ifx\sepnumber\undefined\def\sepnumber{0}\fi
+ \increment\sepnumber
+ \getfromcommacommand[#1][\sepnumber]%
+ \ifx\commalistelement\empty
+ \getcommalistsize[#1]%
+ \def\sepnumber{\number\commalistsize}%
+ \getfromcommacommand[#1][\sepnumber]%
+ \fi
+ \commalistelement}
+
+% \setuphead[section] [separator=\separatorlist{?,!,*}]
+% \setuphead[subsection][separator=\separatorlist{??,!!,**}]
+%
+% \let\spr\separatorlist % this will enable this feature
+%
+% \setuphead[section] [separator={?,!,*}]
+% \setuphead[subsection][separator={??,!!,**}]
+%
+% \setupheads[separator={A,B,C,D,E,F}]
+% \chapter{test}
+% \section{test} \subsection{test} \subsection{test}
+% \section{test} \subsection{test} \subsection{test}
+
% from now on, internaly numbers are separated by a period
% and postprocessed on demand
@@ -179,7 +205,7 @@
\def\domakeprecedingsectionnumber[#1]% will become ugly after speed up
{\bgroup % added
\globallet\precedingsectionnumber\empty
- \ifsectienummer
+ \ifsectionnumber
\doifvalue{\??sb\@@sectionblock\c!number}\v!yes % added
{\doifelsevalue{\@@thenumber{#1}\c!sectionnumber}\v!yes
\donetrue\donefalse
@@ -190,7 +216,7 @@
{\getvalue{\??by\getvalue{\@@thenumber{#1}\c!way\c!local}}}%
\doifnot\currentsection\zerosection
{\doifnot{\@@sectionvalue\currentsection}{0}
- {\xdef\precedingsectionnumber%
+ {\xdef\precedingsectionnumber
{\getvalue{\currentsection\c!number}%
\spr{\precedingseparator}}}}%
\fi}%
@@ -572,6 +598,8 @@
% \def\ignoresectionconversion % brrr
% {\let\@@sectionconversion\secondoftwoarguments}
+% todo: criterium=appendix|frontmatter|....
+
\def\dosetfilterlevel#1#2% beware: this one is \let
{\bgroup
\let\@@shortsectionnumber\@@sectionvalue
@@ -1050,12 +1078,9 @@
\expandafter\newif\csname if#2\endcsname % better a mode
\doglobal\increment\currentsectionblock
\setsectionblockenvironment{#1}{}%
- \setevalue{\??sb#1}%
- {\noexpand\dosetlocalsectionblock{\currentsectionblock}{#1}{#2}}%
- \setvalue{\e!start#2}%
- {\dostartsectionblock{#1}{#2}}%
- \setvalue{\e!stop#2}%
- {\dostopsectionblock}}
+ \setevalue{\??sb #1}{\noexpand\dosetlocalsectionblock{\currentsectionblock}{#1}{#2}}%
+ \setvalue {\e!start#2}{\dostartsectionblock{#1}{#2}}%
+ \setvalue {\e!stop #2}{\dostopsectionblock}}
\def\definesectionblock
{\dotripleargument\dodefinesectionblock}
@@ -1077,7 +1102,7 @@
\edef\!!stringa{#1}%
\@EA\writestatus\@EA
{\!!stringa}
- {\ifsectienummer#2\else(#2)\fi\normalspace\asciititle}%
+ {\ifsectionnumber#2\else(#2)\fi\normalspace\asciititle}%
\egroup}
\def\@@kolevel{1} \def\headlevel{\@@kolevel}
@@ -1175,7 +1200,7 @@
\newif\ifincrementnumber
\newif\ifreversesectionnumbers % todo: key/val
-\newif\ifsectienummer \sectienummertrue
+\newif\ifsectionnumber \sectionnumbertrue
\newif\ifdisplaysectionhead \displaysectionheadtrue
\newif\ifplacehead
\newif\ifemptyhead
@@ -1395,17 +1420,17 @@
\v!list=>\incrementnumberfalse
% beware, since no numbers are used, no nested lists are
% possible here
- \writetolisttrue,
- \s!unknown=>{\ifx\currentproduct\empty
- \findsectionnumber{#1}\commalistelement{#4}%
- \fi
- \incrementnumbertrue}]%
+ \writetolisttrue,
+ \s!unknown=>{\ifx\currentproduct\empty
+ \findsectionnumber{#1}\commalistelement{#4}%
+ \fi
+ \incrementnumbertrue}]%
\edef\numberheaddistance {\getvalue{\??ko#1\c!distance}}%
\edef\numberheadalternative{\getvalue{\??ko#1\c!alternative}}%
\doifelsevalue{\??ko:\numberheadalternative}\v!horizontal
\displaysectionheadfalse
\displaysectionheadtrue
- \ifsectienummer
+ \ifsectionnumber
\doifelsevalue{\??sb\@@sectionblock\c!number}\v!yes
{\doifelsevalue{\??ko#1\c!number}\v!yes
\headnumbertrue
@@ -1620,12 +1645,8 @@
\doifelse{\currentsectionformat}{}
{\setglobalcrossreference
{\e!previous#1}{}{\realfolio}{}}
-%
{\setglobalsystemreference\rt!list
{\e!previous#1}{\getvalue{\e!previouslocal#1}}}%
-%
-% {\definereference[\e!previous#1][\getvalue{\e!previouslocal#1}]%
-%
\def\stoplistreferences{\dostoplistreferences}}
\def\dostoplistreferences#1%
@@ -1633,21 +1654,21 @@
\addtocommalist{#1}\updatedlistreferences % nog global (\doglobal)
\globallet\updatedlistreferences\updatedlistreferences % een noodverbandje
\gdef\updatelistreferences%
- {\def\docommando####1%
-%
+ {\def\docommand####1%
{\setglobalsystemreference\rt!list
{\e!previous####1}{\getvalue{\e!currentlocal####1}}}%
-%
-% {\definereference[\e!previous####1][\getvalue{\e!currentlocal####1}]%
-%
- \processcommacommand[\updatedlistreferences]\docommando
+ \processcommacommand[\updatedlistreferences]\docommand
\globallet\updatelistreferences\relax
\globallet\updatedlistreferences\empty}%
\fi}
-\def\stoplistreferences%
+\def\stoplistreferences
{\gobbleoneargument}
+\appendtoks
+ \updatelistreferences
+\to\aftereverypage
+
% \prevdepth\strutdp % is belangrijk, vergelijk naast elkaar:
%
% \subject{test} \input tufte
@@ -2263,7 +2284,7 @@
\def\dosetupheads[#1]%
{\getparameters[\??ko][#1]%
- \doifelse{\@@kosectionnumber}\v!yes\sectienummertrue\sectienummerfalse}
+ \doifelse{\@@kosectionnumber}\v!yes\sectionnumbertrue\sectionnumberfalse}
\def\setupheads
{\dosingleargument\dosetupheads}
diff --git a/Master/texmf-dist/tex/context/base/core-spa.tex b/Master/texmf-dist/tex/context/base/core-spa.tex
index 189d98396fb..fa6e24a5b27 100644
--- a/Master/texmf-dist/tex/context/base/core-spa.tex
+++ b/Master/texmf-dist/tex/context/base/core-spa.tex
@@ -17,31 +17,35 @@
\unprotect
-\newevery \everybodyfont \EveryBodyFont % just to be sure
-\newevery \everyfontswitch \EveryFontSwitch % just to be sure
-\newevery \everydefinedfont \relax % just to be sure
-
-\appendtoks \spacing 1\to \everybodyfont
-\appendtoks \presetnormallineheight \to \everybodyfont
-\appendtoks \setnormalbaselines \to \everybodyfont % check if redundant
-\appendtoks \setstrut \to \everybodyfont % check if redundant
-\appendtoks \settopskip \to \everybodyfont
-\appendtoks \setmaxdepth \to \everybodyfont
-%appendtoks \spacing 1\to \everybodyfont
-\appendtoks \simplesetupindenting \to \everybodyfont
-\appendtoks \simplesetupblank \to \everybodyfont
-\appendtoks \simplesetupwhitespace \to \everybodyfont
-%appendtoks \checknotes \to \everybodyfont % not
-\appendtoks \simplesetupspacing \to \everybodyfont % nieuw
-\appendtoks \setdisplayskips \to \everybodyfont % nieuw
-
+% some will move to core-var
+
+\newif \ifgridsnapping
+\newif \iffuzzyvskip
+\let \fuzzyvskip \gobbleoneargument
+\let \removelastfuzzyvskip \relax
+
+\let \startbaselinecorrection \relax
+\let \stopbaselinecorrection \relax
+\let \baselinecorrection \relax
+\let \offbaselinecorrection \relax
+
+\appendtoks \spacing 1\to \everybodyfont
+\appendtoks \presetnormallineheight \to \everybodyfont
+\appendtoks \setnormalbaselines \to \everybodyfont % check if redundant
+\appendtoks \setstrut \to \everybodyfont % check if redundant
+\appendtoks \settopskip \to \everybodyfont
+\appendtoks \setmaxdepth \to \everybodyfont
+%appendtoks \spacing 1\to \everybodyfont
+\appendtoks \simplesetupindenting \to \everybodyfont
+\appendtoks \simplesetupblank \to \everybodyfont
+\appendtoks \simplesetupwhitespace \to \everybodyfont
+%appendtoks \checknotes \to \everybodyfont % not
+\appendtoks \simplesetupspacing \to \everybodyfont % nieuw
\appendtoks \setrelativeinterlinespace \to \everybodyfont
-\appendtoks \updateraggedskips \to \everyfontswitch % under test
-
-\prependtoks \let\par\endgraf \to \everypagebody % see \fillinline
-
-\appendtoks \simplesetupspacing \to \everydefinedfont
+\appendtoks \updateraggedskips \to \everyfontswitch % under test
+\prependtoks \let\par\endgraf \to \everypagebody % see \fillinline
+\appendtoks \simplesetupspacing \to \everydefinedfont
% if you want to hyphenate the first word of a paragraph ... \appendtoks\hskip0pt\to\everypar
@@ -270,7 +274,6 @@
\newif\iflocalblankfixed
\newif\iflocalblankflexible
-\newif\iffuzzyvskip
\def\geenblanko{\removelastskip} % will become obsolete
@@ -493,7 +496,7 @@
\defineblankmethod [\v!fixed] {\global\localblankfixedtrue}
\defineblankmethod [\v!back] {\global\blankgobacktrue} % {\geenblanko}
\defineblankmethod [\v!halfline] {\ifgridsnapping\global\fuzzyvskiptrue\fi
- \global\advance\blankskip .5\lineheight}
+ \global\advance\blankskip .5\lineheight}
\defineblankmethod [\v!none] {\global\blankresettrue}
\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi}
@@ -1105,8 +1108,8 @@
}%\let\deblanko\v!big}
\def\dodefineblank[#1][#2]%
- {\def\docommando##1{\setvalue{\??bo##1}{#2}}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\setvalue{\??bo##1}{#2}}%
+ \processcommalist[#1]\docommand}
\def\defineblank
{\dodoubleargument\dodefineblank}
@@ -1509,18 +1512,9 @@
% \frenchspacing leidt soms tot afbreken tussen -, vandaar
% de variant \newfrenchspacing.
-\def\dofrenchspacing#1%
- {\sfcode`\.#1 \sfcode`\,#1\relax
- \sfcode`\?#1 \sfcode`\!#1\relax
- \sfcode`\:#1 \sfcode`\;#1\relax}
-
-\def\frenchspacing {\dofrenchspacing{1000}}
-\def\newfrenchspacing{\dofrenchspacing{1050}}
-
-\def\nonfrenchspacing
- {\sfcode`\.3000 \sfcode`\,1250
- \sfcode`\?3000 \sfcode`\!3000
- \sfcode`\:2000 \sfcode`\;1500 }
+\def\frenchspacing {\setfrenchspacing{1000}}
+\def\newfrenchspacing{\setfrenchspacing{1050}}
+\def\nonfrenchspacing{\resetfrenchspacing}
\def\definespacingmethod[#1]#2{\setvalue{\??sg\??sg#1}{#2}}
@@ -1536,9 +1530,9 @@
\definecomplexorsimple\setupspacing
-\catcode`\~=\@@active % to be sure
+\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\ }
-\unexpanded\def~{\nonbreakablespace}
+\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace
\def\space { }
\def\removelastspace{\ifhmode\unskip\fi}
@@ -1550,31 +1544,32 @@
%
% but, since not all fonts have .5em digits:
-\def\fixedspace
- {\setbox\scratchbox\normalhbox\ifmmode{$0$}\else{0}\fi
+\unexpanded\def\fixedspace
+ {\setbox\scratchbox\normalhbox{\mathortext{0}{0}}%
\hskip\wd\scratchbox\relax}
\def\fixedspaces
- {\catcode`\~=\@@active
- \def~{\fixedspace}}
-
-% \def\removeunwantedspaces{\ifhmode\unskip\unskip\unskip\unskip\unskip\fi}
+ {\letcatcodecommand \ctxcatcodes `\~ \fixedspace}
\def\removeunwantedspaces
- {\ifhmode
- \doloop{\ifdim\lastskip>\zeropoint\unskip\else\exitloop\fi}%
+ {\ifhmode % we also need to unskip 0pt skips
+ \unskip\unskip\unskip\unskip\unskip
+ \unskip\unskip\unskip\unskip\unskip
\fi}
-% better, but not done:
+% still not fixed in aleph / luatex
+%
+% \beginETEX \lastnodetype
%
-% \def\removelastspace
-% {\ifhmode \ifdim\lastskip=\spaceamount\relax
-% \unskip
+% \def\removeunwantedspaces
+% {\ifhmode \ifnum\lastnodetype=\@@gluenode
+% \unskip \@EAEAEA\removeunwantedspaces
% \fi \fi}
%
-% due to backward compability
+% \endETEX
+
+%D For old time sake, will disappear soon.
-\let\space \space
\let\hardespatie\fixedspace
\let\geenspatie \nospace
@@ -2287,7 +2282,7 @@
% \edef\strutdepth{\the\strutdimen}%
% \dosetstrut}
-% interesting, strudepth is 4.05064pt vs 4.05066pt depending on grid
+% interesting, strutdepth is 4.05064pt vs 4.05066pt depending on grid
% nasty rounding problem
\def\setstrut
@@ -2734,26 +2729,29 @@
\newskip\ctxrightskip
\newskip\ctxmidskip
-\def\dosinglenarrower#1%
- {\processaction
- [#1]
- [ \v!left=>\global\advance\ctxleftskip \@@slleft,
- \v!middle=>\global\advance\ctxmidskip \@@slmiddle,
- \v!right=>\global\advance\ctxrightskip \@@slright,
- \v!none=>,
- \s!unknown=>\global\advance\ctxmidskip \commalistelement]}
+% \def\dosinglenarrower#1%
+% {\processaction
+% [#1]
+% [ \v!left=>\global\advance\ctxleftskip \@@slleft,
+% \v!middle=>\global\advance\ctxmidskip \@@slmiddle,
+% \v!right=>\global\advance\ctxrightskip \@@slright,
+% \v!none=>,
+% \s!unknown=>\global\advance\ctxmidskip \commalistelement]}
+
+% \def\donarrower[#1]% hm, can be dorepeat directly
+% {\processaction
+% [#1]
+% [ \v!left=>\global\advance\ctxleftskip \@@slleft,
+% \v!middle=>\global\advance\ctxmidskip \@@slmiddle,
+% \v!right=>\global\advance\ctxrightskip \@@slright,
+% \v!none=>,% handy for delimitedtexts
+% \s!unknown=>{\dorepeatwithcommand[#1]\dosinglenarrower}]}
-\def\donarrower[#1]%
- {\processaction
- [#1]
- [ \v!left=>\global\advance\ctxleftskip \@@slleft,
- \v!middle=>\global\advance\ctxmidskip \@@slmiddle,
- \v!right=>\global\advance\ctxrightskip \@@slright,
- \v!none=>,% handy for delimitedtexts
- \s!unknown=>{\dorepeatwithcommand[#1]\dosinglenarrower}]}
+\def\donarrower[#1]% hm, can be dorepeat directly
+ {\dorepeatwithcommand[#1]\dosinglenarrower}
\def\complexstartnarrower[#1]%
- {\par
+ {\@@slbefore % was hard coded \par
\bgroup
\global\ctxleftskip \zeropoint
\global\ctxrightskip\zeropoint
@@ -2765,13 +2763,15 @@
\advance\rightskip \ctxmidskip
\seteffectivehsize}
+% todo: definenarrower
+
\def\simplestartnarrower
{\startnarrower[\v!middle]}
\definecomplexorsimple\startnarrower
\def\stopnarrower
- {\par % else skips forgotten
+ {\@@slafter % was hard coded \par / needed, else skips forgotten
\egroup}
\def\setupnarrower
@@ -2810,7 +2810,8 @@
\def\ibox{\iobox\raggedright\raggedleft} % innerbox
\def\dosetraggedvbox#1%
- {\processaction
+ {\let\raggedbox\vbox
+ \processfirstactioninset
[#1]
[ \v!left=>\let\raggedbox\lbox,
\v!right=>\let\raggedbox\rbox,
@@ -2820,12 +2821,11 @@
\v!flushleft=>\let\raggedbox\rbox,
\v!flushright=>\let\raggedbox\lbox,
\v!center=>\let\raggedbox\cbox,
- \v!no=>\def\raggedbox{\vbox\bgroup\raggedright\let\next=},
- \s!default=>\let\raggedbox\vbox,
- \s!unknown=>\let\raggedbox\vbox]}
+ \v!no=>\def\raggedbox{\vbox\bgroup\raggedright\let\next=}]}
\def\dosetraggedhbox#1%
- {\processaction % slow
+ {\let\raggedbox\hbox
+ \processaction % slow
[#1]
[ \v!left=>\def\raggedbox{\doalignedline\v!left },
\v!right=>\def\raggedbox{\doalignedline\v!right },
@@ -2834,10 +2834,7 @@
\v!outer=>\def\raggedbox{\doalignedline\v!outer },
\v!flushleft=>\def\raggedbox{\doalignedline\v!right },
\v!flushright=>\def\raggedbox{\doalignedline\v!left },
- \v!center=>\def\raggedbox{\doalignedline\v!middle},
- \v!normal=>\let\raggedbox\hbox,
- \s!default=>\let\raggedbox\hbox,
- \s!unknown=>\let\raggedbox\hbox]}
+ \v!center=>\def\raggedbox{\doalignedline\v!middle}]}
\def\dosetraggedcommand#1%
{\expanded{\dodosetraggedcommand{#1}}}
@@ -2853,7 +2850,9 @@
% \!!donectrue
% \rawprocesscommalist[#1]\dododosetraggedcommand}}
-\newtoks\everyraggedcommand \def\raggedcommand{\the\everyraggedcommand}
+\newtoks\everyraggedcommand
+
+\def\raggedcommand{\the\everyraggedcommand}
\def\dodosetraggedcommand#1% beware: #1=empty is ignored, keep that!
{\everyraggedcommand \emptytoks
@@ -3077,9 +3076,6 @@
\def\forgetspacing
{\emergencystretch\zeropoint}
-\def\forgetall
- {\the\everyforgetall}
-
\newif\ifforgotten % rather good signal for inner
\appendtoks \forgottentrue \to \everyforgetall
@@ -3371,82 +3367,6 @@
\endETEX
-% \definetwopasslist\s!paragraph
-%
-% \newcounter\nofraggedparagraphs
-%
-% \def\doparagraphreference% looks very much like domarginreference
-% {\doglobal\increment\nofraggedparagraphs
-% \edef\writeparref%
-% {\writeutilitycommand%
-% {\twopassentry%
-% {\s!paragraph}%
-% {\nofraggedparagraphs}%
-% {\noexpand\realfolio}}}%
-% \writeparref}
-%
-% \def\setraggedparagraphmode#1#2% combineren met \ifrightpage
-% {\ifinpagebody
-% \ifdoublesided
-% \ifodd\realpageno\relax#1\else#2\fi
-% \else
-% #2\relax
-% \fi
-% \else\ifinner
-% \ifdoublesided
-% \gettwopassdata\s!paragraph
-% \iftwopassdatafound
-% \ifodd\twopassdata\relax#1\else#2\fi
-% \else
-% \ifodd\realpageno\relax#1\else#2\fi
-% \fi
-% \doparagraphreference
-% \else
-% #2\relax
-% \fi
-% \else
-% #2\relax
-% \fi\fi}
-%
-% \def\doifrightpageelse % watch out: other default ! ! !
-% {\ifinpagebody
-% % optimalisation ?
-% \ifdoublesided
-% \ifodd\realpageno\relax
-% \twopassdatafoundtrue \else \twopassdatafoundfalse
-% \fi
-% \else
-% \twopassdatafoundtrue
-% \fi
-% \else
-% \ifdoublesided
-% \gettwopassdata\s!paragraph
-% \iftwopassdatafound
-% \ifodd\twopassdata\relax
-% \twopassdatafoundtrue \else \twopassdatafoundfalse
-% \fi
-% \else
-% \ifodd\realpageno\relax
-% \twopassdatafoundtrue \else \twopassdatafoundfalse
-% \fi
-% \fi
-% \else
-% \twopassdatafoundtrue
-% \fi
-% \fi
-% \iftwopassdatafound
-% \@EA\firstoftwoarguments
-% \else
-% \@EA\secondoftwoarguments
-% \fi}
-%
-% \def\signalrightpage
-% {\ifdoublesided \ifinpagebody \else
-% \doparagraphreference
-% \fi \fi}
-
-% slightly adapted implementation
-
\newcounter \noftrackedpagestates
\newif \ifpagestatemismatch
\let \realpagestateno \realfolio
@@ -3459,13 +3379,10 @@
\def\doforcedtrackpagestate#1#2%
{\ifcase\frozenpagestate
- \doglobal\increment\noftrackedpagestates
- \doglobal\increment#2%
- \edef\dodotrackpagestate
- {\writeutilitycommand
- {\twopassentry{#1}{\noftrackedpagestates}{#2:\noexpand\realfolio}}}%
+ \doglobal\increment\noftrackedpagestates\relax
+ \doglobal\increment#2\relax
+ \lazysavetaggedtwopassdata{#1}{\noftrackedpagestates}{#2}{\noexpand\realfolio}%
%\llap{\infofont\noftrackedpagestates/#2}% tracing
- \dodotrackpagestate
\fi}
\def\doifrightpagestateelse#1#2%
@@ -3481,7 +3398,7 @@
\twopassdatafoundtrue
\fi
\else\ifdoublesided
- \findtwopassdata{#1}{#2:}%
+ \findtwopassdata{#1}{#2}%
\iftwopassdatafound
\let\realpagestateno\twopassdata
\ifnum\twopassdata=\realpageno \else
@@ -3513,7 +3430,7 @@
{\ifcase\frozenpagestate
\pagestatemismatchfalse
\let\realpagestateno\realfolio
- \findtwopassdata{#1}{#2:}%
+ \findtwopassdata{#1}{#2}%
\iftwopassdatafound
\let\realpagestateno\twopassdata
\ifnum\twopassdata=\realpageno \else
@@ -3563,7 +3480,10 @@
{\ifcase\pagesignallevel\or\postsignalrightpage\fi
\decrement\pagesignallevel}
-\def\setraggedparagraphmode{\signalrightpage\doifrightpageelse} % move it there
+\def\setraggedparagraphmode
+ {\signalrightpage\doifrightpageelse} % move it there
+
+\ifx\swapmargins\undefined \let\swapmargins\undefined \fi % todo
\def\doifswappedrightpageelse#1#2% alleen in box construction !
{\doifrightpageelse
@@ -3599,7 +3519,7 @@
\def\docheckpagestatechange#1#2#3%
{\pagechangedfalse
\doforcedtrackpagestate{#2}{#3}%
- \findtwopassdata{#2}{#3:}%
+ \findtwopassdata{#2}{#3}%
\iftwopassdatafound
\ifnum\twopassdata>0\getvalue{#2:p:#1}\relax
\pagechangedtrue
@@ -3705,6 +3625,10 @@
\def\middleraggedness {.5\hsize} % was: 6\bodyfontsize, fails on: \placefigure{x $x=x$ x}{}
+% oeps, hsize can be 0pt in which case we get a strange division
+
+\def\middleraggedness {\ifdim\hsize=\zeropoint6\bodyfontsize\else.5\hsize\fi} % was: 6\bodyfontsize, fails on: \placefigure{x $x=x$ x}{}
+
%D More hyphenation control, will be combined with align
%D setup.
@@ -3766,19 +3690,65 @@
% \def\notragged%
% {\setraggedskips{0}{0em}{0em}{0em}{0em}{1fil}{\parindent}}
-% todo
+% older (context) names:
+
+\let\spaceamount \interwordspace
+\let\emspaceamount\emwidth
+
+% tracing:
+
+\def\doshowpardata#1%
+ {\ifx#1\relax\else
+ \hbox{\string#1: \the#1}\endgraf
+ \expandafter\doshowpardata
+ \fi}
+
+\def\showpardata
+ {\edef\thepardata
+ {\hbox{font: \fontname\font}\endgraf
+ \doshowpardata
+ \interwordspace \interwordstretch \interwordshrink \emwidth \exheight \extraspace
+ \hsize \vsize
+ \leftskip \rightskip
+ \spaceskip \xspaceskip
+ \parindent \parfillskip
+ \hyphenpenalty \exhyphenpenalty
+ \displaywidowpenalty \widowpenalty \clubpenalty \brokenpenalty
+ \doublehyphendemerits \finalhyphendemerits \adjdemerits
+ \relax}%
+ \begingroup
+ \dontshowcomposition
+ \inleftmargin{\vsmash
+ {\switchtobodyfont[7pt,tt]%
+ \framed[\c!align=\v!right]{\thepardata}}}%
+ \endgroup}
+
+\def\startshowpardata
+ {\begingroup
+ \showcomposition
+ \showstruts\tracepositionstrue \tracingparagraphs\maxdimen
+ \appendtoksonce\showpardata\let\showpardata\relax\to\everypar}
+
+\def\stopshowpardata
+ {\endgraf
+ \endgroup}
+
+% \defineXMLenvironment[showpardata] \startshowpardata \stopshowpardata
+% \defineXMLsingular [showpardata] \showpardata
+
+% defaults
\def\raggedfillamount {1fil}
\def\raggedhalffillamount{.5fil}
-\def\raggedspaceamount {.3333em}
+\def\raggedspaceamount {\interwordspace} % {.3333em}
\def\raggedxspaceamount {.5em}
\def\notragged
{\chardef\raggedstatus\zerocount
- \leftskip1\leftskip
- \rightskip1\rightskip
- \spaceskip\zeropoint
- \xspaceskip\zeropoint
+ \leftskip 1\leftskip
+ \rightskip 1\rightskip
+ \spaceskip \zeropoint
+ \xspaceskip \zeropoint
\parfillskip\zeropoint\!!plus\raggedfillamount\relax
\let\updateraggedskips\relax} % new
@@ -3851,44 +3821,16 @@
% test \vfill test \endgraf \strut \endgraf \vskip-\lineheight \removedepth \pagina test
% \stoptext
-% Keep this one:
-%
-% \def\setupalign
-% {\dosingleargument\dosetupalign}
-%
-% \def\dosetupalign[#1]%
-% {\expanded{\dodosetupalign[#1]}}
-%
-% \def\dodosetupalign[#1]%
-% {\doifinsetelse\v!broad {#1}\!!doneatrue\!!doneafalse
-% \doifinsetelse\v!wide{#1}\!!donebtrue\!!donebfalse
-% \ExpandFirstAfter\processallactionsinset % expansion redundant
-% [#1]
-% [ \v!line=>\baselinebottom,
-% \v!bottom=>\raggedbottom,
-% \v!height=>\normalbottom,
-% \v!width=>\notragged,
-% \v!normal=>\notragged,
-% \v!yes=>\notragged,
-% \v!no=>\raggedright,
-% \if@@asragged\v!inner\else\v!outer\fi=>\setraggedparagraphmode\raggedleft\raggedright,
-% \if@@asragged\v!outer\else\v!inner\fi=>\setraggedparagraphmode\raggedright\raggedleft,
-% \if@@asragged\v!left \else\v!right\fi=>\if!!donea\veryraggedleft \else\raggedleft \fi,
-% \if@@asragged\v!right\else\v!left \fi=>\if!!donea\veryraggedright \else\raggedright \fi,
-% \v!middle=>\if!!doneb\raggedwidecenter\else\if!!donea\veryraggedcenter\else\raggedcenter\fi\fi,
-% \v!flushleft=>\if!!donea\veryraggedright \else\raggedright \fi,
-% \v!flushright=>\if!!donea\veryraggedleft \else\raggedleft \fi,
-% \v!center=>\if!!doneb\raggedwidecenter\else\if!!donea\veryraggedcenter\else\raggedcenter\fi\fi,
-% \v!hanging=>\enableprotruding,
-% \v!nothanging=>\disableprotruding,
-% \v!hz=>\enableadjusting,
-% \v!nohz=>\disableadjusting,
-% \v!hyphenated=>\dohyphens,
-% \v!nothyphenated=>\nohyphens,
-% \v!new=>\@@asraggedfalse, % so new will give you consistency
-% \v!reset=>\notragged\normalbottom]}
-%
-% The next one is more than three times faster:
+% \setupalign[reset,new,right,old]
+
+
+\def\@@align@@rl{\if!!donea\veryraggedleft \else\raggedleft \fi}
+\def\@@align@@rr{\if!!donea\veryraggedright \else\raggedright \fi}
+\def\@@align@@rc{\if!!donea\veryraggedcenter\else\raggedcenter\fi}
+
+\setvalue{@@align@@\v!new }{\@@asraggedfalse}
+\setvalue{@@align@@\v!old }{\@@asraggedtrue}
+\setvalue{@@align@@ }{}
\setvalue{@@align@@\v!line }{\baselinebottom}
\setvalue{@@align@@\v!bottom }{\raggedbottom}
@@ -3897,30 +3839,18 @@
\setvalue{@@align@@\v!normal }{\notragged}
\setvalue{@@align@@\v!yes }{\notragged}
\setvalue{@@align@@\v!no }{\raggedright}
-\setvalue{@@align@@\v!inner }{\if@@asragged
- \setraggedparagraphmode\raggedleft\raggedright
- \else
- \setraggedparagraphmode\raggedright\raggedleft
- \fi}
-\setvalue{@@align@@\v!outer }{\if@@asragged
- \setraggedparagraphmode\raggedright\raggedleft
- \else
- \setraggedparagraphmode\raggedleft\raggedright
- \fi}
-\setvalue{@@align@@\v!left }{\if@@asragged
- \if!!donea\veryraggedleft\else\raggedleft\fi
- \else
- \if!!donea\veryraggedright\else\raggedright\fi
- \fi}
-\setvalue{@@align@@\v!right }{\if@@asragged
- \if!!donea\veryraggedright\else\raggedright\fi
- \else
- \if!!donea\veryraggedleft\else\raggedleft\fi
- \fi}
-\setvalue{@@align@@\v!middle }{\if!!doneb\raggedwidecenter\else\if!!donea\veryraggedcenter\else\raggedcenter\fi\fi}
-\setvalue{@@align@@\v!flushleft }{\if!!donea\veryraggedright \else\raggedright \fi}
-\setvalue{@@align@@\v!flushright }{\if!!donea\veryraggedleft \else\raggedleft \fi}
-\setvalue{@@align@@\v!center }{\if!!doneb\raggedwidecenter\else\if!!donea\veryraggedcenter\else\raggedcenter\fi\fi}
+\setvalue{@@align@@\v!inner }{\if@@asragged \setraggedparagraphmode\@@align@@rl\@@align@@rr \else
+ \setraggedparagraphmode\@@align@@rr\@@align@@rl \fi}
+\setvalue{@@align@@\v!outer }{\if@@asragged \setraggedparagraphmode\@@align@@rr\@@align@@rl \else
+ \setraggedparagraphmode\@@align@@rl\@@align@@rr \fi}
+\setvalue{@@align@@\v!left }{\if@@asragged\@@align@@rl\else\@@align@@rr\fi}
+\setvalue{@@align@@\v!right }{\if@@asragged\@@align@@rr\else\@@align@@rl\fi}
+\setvalue{@@align@@\v!middle }{\if!!doneb\raggedwidecenter\else\@@align@@rc\fi}
+\setvalue{@@align@@\v!flushleft }{\if!!donea\veryraggedright \else\raggedright\fi}
+\setvalue{@@align@@\v!flushright }{\if!!donea\veryraggedleft \else\raggedleft \fi}
+\setvalue{@@align@@\v!flushouter }{\setraggedparagraphmode\raggedleft\raggedright}
+\setvalue{@@align@@\v!flushinner }{\setraggedparagraphmode\raggedright\raggedleft}
+\setvalue{@@align@@\v!center }{\if!!doneb\raggedwidecenter\else\@@align@@rc\fi}
\setvalue{@@align@@\v!hanging }{\enableprotruding}
\setvalue{@@align@@\v!nothanging }{\disableprotruding}
\setvalue{@@align@@\v!hz }{\enableadjusting}
@@ -3939,8 +3869,8 @@
\setvalue{@@ngila@@\v!broad }{\!!doneatrue}
\setvalue{@@ngila@@\v!wide }{\!!donebtrue}
-\def\dodosetupalign#1{\getvalue{@@align@@#1}}
-\def\dodosetupngila#1{\getvalue{@@ngila@@#1}}
+\def\dodosetupalign#1{\csname @@align@@#1\endcsname}
+\def\dodosetupngila#1{\csname @@ngila@@#1\endcsname}
\def\setupalign
{\dosingleargument\dosetupalign}
@@ -3972,16 +3902,23 @@
% see later for the real definition, which in the simple case is:
+\newtoks \everyleftofalignedline
+\newtoks \everyrightofalignedline
+
\def\doalignline#1#2% \\ == newline
- {\begingroup
- \setlocalhsize % new
- \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
- \dowithnextbox
- {\noindentation % was \ noindent
- \hbox to \localhsize
- {\ifcase\alignstrutmode\or\strut\fi
- #1\unhbox\nextbox#2}\endgroup}
- \hbox}
+ {\begingroup
+ \setlocalhsize % new
+ \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
+ \dowithnextbox
+ {\noindentation % was \ noindent
+ \dontleavehmode % added in marrakesch at TUG 2006
+ \hbox to \localhsize
+ {\ifcase\alignstrutmode\or\strut\fi
+ \the\everyleftofalignedline
+ #1\unhbox\nextbox#2\relax
+ \the\everyrightofalignedline}%
+ \endgroup}
+ \hbox}
% directe commando's
@@ -3993,10 +3930,9 @@
% indirecte commando's
-\letvalue{\s!do\v!line\v!left }\leftaligned
-\letvalue{\s!do\v!line\v!right }\rightaligned
-\letvalue{\s!do\v!line\v!middle}\midaligned
-
+\letvalue{\s!do\v!line\v!left }\leftaligned
+\letvalue{\s!do\v!line\v!right }\rightaligned
+\letvalue{\s!do\v!line\v!middle }\midaligned
\letvalue{\s!do\v!line\v!flushleft }\rightaligned
\letvalue{\s!do\v!line\v!flushright}\leftaligned
\letvalue{\s!do\v!line\v!center }\midaligned
@@ -4033,8 +3969,10 @@
\hbox to \localhsize
{#1\hskip\ifdone#2\else#3\fi#4%
\hbox to \localhsize
- {\ifcase\alignstrutmode\or\strut\fi
- \ifdone#5\unhbox\nextbox#6\else#6\unhbox\nextbox#5\fi}%
+ {\the\everyleftofalignedline
+ \ifcase\alignstrutmode\or\strut\fi
+ \ifdone#5\unhbox\nextbox#6\else#6\unhbox\nextbox#5\fi
+ \the\everyrightofalignedline}%
\hss}%
\egroup}
\hbox}
@@ -4064,14 +4002,14 @@
\def\doalignedline#1{\csname\s!do\v!line#1\endcsname}
-\def\alignedline#1#2% setting default
- {\csname
- \s!do\v!line
- \ifundefined{\s!do\v!line#1}#2\else#1\fi
- \endcsname}
+% \def\alignedline#1#2% setting default
+% {\csname
+% \s!do\v!line
+% \ifundefined{\s!do\v!line#1}#2\else#1\fi
+% \endcsname}
-% \def\doalignedline#1%
-% {\alignedline{#1}\v!links}
+\def\alignedline#1#2% setting default
+ {\csname\s!do\v!line\ifcsname\s!do\v!line#1\endcsname#1\else#2\fi\endcsname}
%D ...
@@ -4306,9 +4244,6 @@
\def\hspaceamount#1#2%
{\executeifdefined{\??hs#1:#2}{\executeifdefined{\??hs:#2}\zeropoint}}
-\def\emspaceamount{\fontdimen6\font}
-\def\spaceamount {\fontdimen2\font}
-
\definehspace [\v!small] [.25\emspaceamount]
\definehspace [\v!medium] [.5\emspaceamount]
\definehspace [\v!big] [1\emspaceamount]
@@ -4658,12 +4593,12 @@
\vtop}
\def\flexiblespaceamount#1#2#3%
- {#1\fontdimen2\font
- \!!plus#2\fontdimen3\font
- \!!minus#3\fontdimen4\font}
+ {#1\interwordspace
+ \!!plus#2\interwordstretch
+ \!!minus#3\interwordshrink}
\def\fixedspaceamount#1%
- {#1\fontdimen2\font}
+ {#1\interwordspace}
%D This is a dangerous feature because it makes the \TEX\ source
%D less portable, i.e. any parser now needs to apply exactly the
@@ -4725,7 +4660,9 @@
\c!stretch=0]
\setupnarrower
- [\c!left=1.5em,
+ [\c!before=\endgraf,
+ \c!after=\endgraf,
+ \c!left=1.5em,
\c!right=1.5em,
\c!middle=1.5em]
diff --git a/Master/texmf-dist/tex/context/base/core-stg.tex b/Master/texmf-dist/tex/context/base/core-stg.tex
new file mode 100644
index 00000000000..94e5250e500
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-stg.tex
@@ -0,0 +1,72 @@
+%D \module
+%D [ file=core-stg,
+%D version=2006.08.16,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Strategies,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This is a prelude to strategies. It is rather old code
+%D used in a project may years ago. Use with care since I
+%D will pick up this thread. (moved from cont-new)
+
+\unprotect
+
+\def\s!strategy{strategy}
+
+\def\currentstrategypass {1}
+\def\currentstrategyvariable{0}
+\def\maximumstrategypass {8}
+
+\newconditional\strategypassneeded
+\newconditional\strategypassforced
+
+\definetwopasslist{\s!strategy}
+
+\def\registerstrategypass%
+ {\ifnum\currentstrategypass>\maximumstrategypass \else
+ \ifconditional\strategypassforced
+ \doglobal\increment\currentstrategypass
+ \else%\ifconditional\strategypassneeded
+ %\doglobal\increment\currentstrategypass
+ \fi%\fi
+ \fi
+ \savecurrentvalue\currentstrategypass{\currentstrategypass}}
+
+\appendtoks \registerstrategypass \to \everybye % \everylastshipout
+
+\def\setstrategyvariable#1#2% key value
+ {%\doifnotstrategyvariable{#1}{\global\settrue\strategypassneeded}%
+ \doglobal\increment\currentstrategyvariable
+ \savetaggedtwopassdata{\s!strategy}{\currentstrategyvariable}{#1}{#2}}
+
+\def\doifstrategyvariableelse#1#2#3%
+ {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi}
+
+\def\getstrategyvariable#1% key
+ {\findtwopassdata{\s!strategy}{#1}%
+ \setxvalue{\s!strategy:#1}{\twopassdata}}
+
+\def\retainstrategyvariable#1% key
+ {\expanded{\setstrategyvariable{#1}{\strategyvariable{#1}}}}
+
+\def\strategyvariable#1% key
+ {\csname\s!strategy:#1\endcsname}
+
+\let\stratvar\strategyvariable
+
+\def\forcestrategy{\global\settrue \strategypassforced}
+\def\abortstrategy{\global\setfalse\strategypassforced}
+
+\def\doifstrategyvariableelse#1#2#3%
+ {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi}
+
+\def\doifstrategyvariable #1#2{\doifstrategyvariableelse{#1}{#2}{}}
+\def\doifnotstrategyvariable#1#2{\doifstrategyvariableelse{#1}{}{#2}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-syn.tex b/Master/texmf-dist/tex/context/base/core-syn.tex
index 7e7974d3b29..3f26b973d2f 100644
--- a/Master/texmf-dist/tex/context/base/core-syn.tex
+++ b/Master/texmf-dist/tex/context/base/core-syn.tex
@@ -63,16 +63,26 @@
\def\currentsynonym{#1}%
\definedescription % nog eens een class van maken, net als framed
[syndef]
- [\c!location=\getvalue{\??sm#1\c!location},
- \c!width=\getvalue{\??sm#1\c!width},
- \c!distance=\getvalue{\??sm#1\c!distance},
- \c!sample=\getvalue{\??sm#1\c!sample},
- \c!hang=\getvalue{\??sm#1\c!hang},
- \c!align=\getvalue{\??sm#1\c!align},
- \c!before=\getvalue{\??sm#1\c!before},
- \c!inbetween=\getvalue{\??sm#1\c!inbetween},
- \c!after=\getvalue{\??sm#1\c!after},
- \c!indentnext=\getvalue{\??sm#1\c!indentnext},
+% [\c!location=\getvalue{\??sm#1\c!location}, % todo \synonymparameter
+% \c!width=\getvalue{\??sm#1\c!width},
+% \c!distance=\getvalue{\??sm#1\c!distance},
+% \c!sample=\getvalue{\??sm#1\c!sample},
+% \c!hang=\getvalue{\??sm#1\c!hang},
+% \c!align=\getvalue{\??sm#1\c!align},
+% \c!before=\getvalue{\??sm#1\c!before},
+% \c!inbetween=\getvalue{\??sm#1\c!inbetween},
+% \c!after=\getvalue{\??sm#1\c!after},
+% \c!indentnext=\getvalue{\??sm#1\c!indentnext},
+ [\c!location=\synonymparameter\c!location,
+ \c!width=\synonymparameter\c!width,
+ \c!distance=\synonymparameter\c!distance,
+ \c!sample=\synonymparameter\c!sample,
+ \c!hang=\synonymparameter\c!hang,
+ \c!align=\synonymparameter\c!align,
+ \c!before=\synonymparameter\c!before,
+ \c!inbetween=\synonymparameter\c!inbetween,
+ \c!after=\synonymparameter\c!after,
+ \c!indentnext=\synonymparameter\c!indentnext,
\c!headstyle=,
\c!style=]%
\setupwhitespace[\v!none]%
diff --git a/Master/texmf-dist/tex/context/base/core-sys.mkii b/Master/texmf-dist/tex/context/base/core-sys.mkii
new file mode 100644
index 00000000000..6816364de7b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-sys.mkii
@@ -0,0 +1,14 @@
+%D \module
+%D [ file=core-sys, % moved from main-001
+%D version=1997.03.31,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=System,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D For the moment this file is empty.
diff --git a/Master/texmf-dist/tex/context/base/core-sys.tex b/Master/texmf-dist/tex/context/base/core-sys.tex
index 1bbe97d01a0..92d2b650c72 100644
--- a/Master/texmf-dist/tex/context/base/core-sys.tex
+++ b/Master/texmf-dist/tex/context/base/core-sys.tex
@@ -21,22 +21,35 @@
{\doifelse{#1}\contextversion
{\let\newcontextversion\gobbleoneargument}
{\writeline
- \writestatus{Fatal Error}{Your format does not match the base files!}%
+ \writestatus{Fatal Error}{Your format does not match the base files!}%
\writeline
- \writestatus{Format Version}{\contextversion}%
- \writestatus{Files Version}{#1}%
+ \writestatus{Format Version}{\contextversion\space\contextmark}%
+ \writestatus{Files Version}{#1}%
\batchmode
\normalend}}
+%D End of lines to the output. \TEX\ will map this onto the platform specific
+%D line ending. I hate this mess.
+
+%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}}
+\newlinechar=10 \edef\outputnewlinechar{^^J}
+
+% in case formats are shared:
+
+\appendtoks
+ \bgroup\newlinechar=10\xdef\outputnewlinechar{^^J}\egroup
+\to \everyjob
+
%D Job names.
\def\outputfilename {\@@svfile}
\def\inputfilename {\@@svinputfile}
\def\operatingsystem{\@@svtype}
+\let\jobfilename \jobname
\let\jobfilesuffix\c!tex
-\def\splitjobfilename
+\def\splitjobfilename % todo: mkiv
{\resetsystemmode{suffix-\jobfilesuffix}%
\edef\ascii{\inputfilename}\convertcommand\ascii\to\ascii
\splitstring\ascii\at.\to\jobfilename\and\jobfilesuffix
@@ -78,17 +91,17 @@
\or
\setsystemmode\v!last % 4 : (extra) last run
\fi
- \processaction
- [\@@svtype]
- %[ mswin=>\edef\@@svline{\rawcharacter{13}\rawcharacter{10}}, % crlf
- [ mswin=>\edef\@@svline{\rawcharacter{13}}, % cr % crlf
- darwin=>\edef\@@svline{\rawcharacter{13}}, % cr
- \s!unknown=>\edef\@@svline{\rawcharacter{10}}]% % lf
+% \processaction
+% [\@@svtype]
+% %[ mswin=>\edef\@@svline{\rawcharacter{13}\rawcharacter{10}}, % crlf
+% [ mswin=>\edef\@@svline{\rawcharacter{13}}, % cr % crlf
+% darwin=>\edef\@@svline{\rawcharacter{13}}, % cr
+% \s!unknown=>\edef\@@svline{\rawcharacter{10}}]% % lf
\splitjobfilename}
-\edef\@@svline{\rawcharacter{10}} % unix is the most critical/sensitive system
+% \edef\@@svline{\rawcharacter{10}} % unix is the most critical/sensitive system
-\def\systemendofline{\@@svline}
+\let\systemendofline\outputnewlinechar % will become obsolete
\def\setupsystem
{\dosingleargument\dosetupsystem}
@@ -108,22 +121,6 @@
%D \stoptext
%D \stoptyping
-% \def\setuprandomize[#1]%
-% {\doifsomething{#1}
-% {\bgroup
-% \setrandomseed\minusone % signals thrd-ran to reseed
-% % tex's time is in minutes
-% \processaction
-% [#1]
-% [ \v!small=>\divide\normaltime 15, % 900,
-% \v!medium=>\divide\normaltime 30, % 1800,
-% \v!big=>\divide\normaltime 60, % 3600,
-% \v!normal=>,
-% \s!default=>,
-% \s!unknown=>\normaltime=#1]%
-% \nextrandom
-% \egroup}}
-
\def\setuprandomize[#1]%
{\doifsomething{#1}
{\bgroup
@@ -154,8 +151,6 @@
%D is more picky, so we default to the \type {cr}. I never understood why
%D \type {crlf} was not used in all systems, since it makes most sense.
-%D
-
\def\dostartglobaldefs#1#2%
{\edef\!!stringa{\the\globaldefs}%
\ifnum\globaldefs#10
@@ -209,20 +204,20 @@
\getvalue{\??be#1\c!after}}}
\def\dodefinestartstop[#1][#2]%
- {\def\docommando##1{\dododefinestartstop[##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\dododefinestartstop[##1][#2]}%
+ \processcommalist[#1]\docommand}
\def\definestartstop
{\dodoubleargument\dodefinestartstop}
\def\dosetupstartstop[#1][#2]%
- {\def\docommando##1{\getparameters[\??be##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??be##1][#2]}%
+ \processcommalist[#1]\docommand}
\def\setupstartstop
{\dodoubleargument\dosetupstartstop}
-% \docommando kan niet worden gebruikt omdat deze macro
+% \docommand kan niet worden gebruikt omdat deze macro
% soms lokaal wordt gebruikt
% te zijner tijd:
@@ -278,8 +273,8 @@
\def\usecommands#1%
{\bgroup
- \def\docommando##1{\setbox0\hbox{\getvalue{\string##1}##1}}%
- \processcommalist[#1]\docommando
+ \def\docommand##1{\setbox0\hbox{\getvalue{\string##1}##1}}%
+ \processcommalist[#1]\docommand
\egroup}
\newif\ifforcefileexpansion % handy for document level overload
@@ -367,5 +362,9 @@
%
% \def\herhaler {\repeater}
% \def\herhaalmetcommando {\dorepeatwithcommand}
+
+%D Plugins
+
+\loadmarkfile{core-sys}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-tab.tex b/Master/texmf-dist/tex/context/base/core-tab.tex
index 0bdc95814d2..5828e85f7d5 100644
--- a/Master/texmf-dist/tex/context/base/core-tab.tex
+++ b/Master/texmf-dist/tex/context/base/core-tab.tex
@@ -368,16 +368,10 @@
\gdef\pushouterbarandquote
{\ifForgetTableBarAndQuote
- \ifnum\catcode`\|=\@@active
- \let\outertablebar|%
- \else
- \let\outertablebar\relax
- \fi
- \ifnum\catcode`\"=\@@active
- \let\outertablequote"%
- \else
- \let\outertablequote\relax
- \fi
+ \let|\letterbar
+ \let"\letterdoublequote
+ \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi
+ \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi
\fi}
\gdef\popouterbarandquote
@@ -470,7 +464,7 @@
\def\EndTableParBox
{\removelastskip % itemize or so
- \par
+ \endgraf
\ifnum\prevgraf>\zerocount % we want at least
\verticalstrut \nowhitespace \vskip-\struttotal% one line of text
\egroup
@@ -546,6 +540,11 @@
\!ttInitializeTable
\fi}
+%D The next redefinition is more robust than the original:
+
+\def\SetTableToWidth#1%
+ {\doifelsenothing{#1}{\!taTableSpread\emptytoks}{\!taTableSpread{to #1}}}
+
% (*) Try this one with \type {direction} and {girection};
% the \PPCHTEX\ manual is a nice testcase.
%
@@ -969,21 +968,14 @@
{\bgroup
\doif\@@tisplit\v!auto
{\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}%
- \doifelse\@@tisplit\v!yes
- {\def\stoptable{\stoptables}%
- \setfalse\tablerepeathead
- \setfalse\tablerepeattail
+ \doifinsetelse\@@tisplit{\v!yes,\v!repeat}
+ {\def\stoptable{\stoptables\egroup}%
\starttables}
- {\doifelse\@@tisplit\v!repeat
- {\def\stoptable{\stoptables}%
- \settrue\tablerepeathead
- \settrue\tablerepeattail
- \starttables}
- {\doifelsenothing\@@tiframe
- {\ifinsidefloat\else\startbaselinecorrection\fi}
- {\startframedcontent[\@@tiframe]}%
- \postponefootnotes
- \firststagestartTABLE}}}
+ {\doifelsenothing\@@tiframe
+ {\ifinsidefloat\else\startbaselinecorrection\fi}
+ {\startframedcontent[\@@tiframe]}%
+ \postponefootnotes
+ \firststagestartTABLE}}
\def\stoptable
{\chuckTABLEautorow % before the tail, else noalign problem
@@ -1081,22 +1073,37 @@
\TABLEtail
\TABLEnoalign{\global\setfalse\preventTABLEbreak}}
+% \def\dorestartTABLE#1%
+% {\gdef\restartTABLE{#1}%
+% \restartTABLE
+% \insertTABLEhead
+% \ifsplittables \ifconditional \tablerepeattail
+% \TABLEnoalign{\goodbreak}%
+% \insertTABLEtail
+% \TABLEnoalign{\goodbreak}%
+% \fi \fi}
+
+\def\verysimpleTableHL
+ {\TABLEnoalign{\expandafter\normalTABLEfullrule\@@tiHLheight}}
+
\def\dorestartTABLE#1%
{\gdef\restartTABLE{#1}%
\restartTABLE
+ \TABLEnoalign{\globalpushmacro\simpleTableHL\global\let\simpleTableHL\verysimpleTableHL}%
\insertTABLEhead
\ifsplittables \ifconditional \tablerepeattail
\TABLEnoalign{\goodbreak}%
\insertTABLEtail
\TABLEnoalign{\goodbreak}%
- \fi \fi}
+ \fi \fi
+ \TABLEnoalign{\globalpopmacro\simpleTableHL}}
\def\complexsecondstagestartTABLE#1[#2]%
- {\convertargument|\to\asciiA
- \convertargument#2\to\asciiB
+ {\convertargument|\to\asciia
+ \convertargument#2\to\asciib
\global\setfalse\someTABLEhead
\global\setfalse\someTABLEtail
- \doifinstringelse\asciiA\asciiB
+ \doifinstringelse\asciia\asciib
{\gdef\restartTABLE{\dorestartTABLE{\thirdstagestartTABLE{#2}}}}
{\doifdefinedelse{\c!Table#2}
{\gdef\restartTABLE{\getvalue{\c!Table#2}}}
@@ -1181,6 +1188,9 @@
\def\starttables
{\bgroup
\splittablestrue
+ \doifelse\@@tisplit\v!repeat
+ {\settrue \tablerepeathead\settrue \tablerepeattail}
+ {\setfalse\tablerepeathead\setfalse\tablerepeattail}%
\flushnotes
\setbox\tablecontentbox\vbox\bgroup
\forgetall
@@ -1400,13 +1410,13 @@
\def\checkTABLErow#1% pure for message purposes
{\unskip % added
\ifTABLEgraydone
- \convertargument #1\to\asciiA
- \convertcommand\TABLEendBCL\to\asciiB
- \ifx\asciiA\asciiB \else
- \writestatus\m!TABLE{confusing \asciiA\space and \asciiB}%
+ \convertargument #1\to\asciia
+ \convertcommand\TABLEendBCL\to\asciib
+ \ifx\asciia\asciib \else
+ \writestatus\m!TABLE{confusing \asciia\space and \asciib}%
\gdef\TABLEgraylineerror%
{\globalletempty\TABLEgraylineerror
- [\asciiA\unskip<->\asciiB\unskip]}%
+ [\asciia\unskip<->\asciib\unskip]}%
\fi
\global\TABLEgraydonefalse
\fi}
diff --git a/Master/texmf-dist/tex/context/base/core-tbl.tex b/Master/texmf-dist/tex/context/base/core-tbl.tex
index edead8e07c0..902b578b937 100644
--- a/Master/texmf-dist/tex/context/base/core-tbl.tex
+++ b/Master/texmf-dist/tex/context/base/core-tbl.tex
@@ -439,7 +439,7 @@
\edef\pretabskip{\the\scratchdimen}%
\let\postabskip\pretabskip
\let\gettabulateexit\settabulatepreamble
- \@EA\settabulatepreamble\next}
+ \@EA\settabulatepreamble\next}
\def\gettabulatesetups#1%
{\setvalue{\@@tabsetups@@\the\tabulatecolumns}{\setups[#1]}%
@@ -508,10 +508,10 @@
\def\dogettabulatewidth(#1)%
{\processallactionsinset
[#1]%
- [\v!fit=>\chardef\tabulatemodus\plusthree,
- \v!fixed=>\chardef\tabulatemodus\plusthree
- \tabulatenopbreaktrue,
- \s!unknown=>\tabulatewidth#1\relax]%
+ [ \v!fit=>\chardef\tabulatemodus\plusthree,
+ \v!fixed=>\chardef\tabulatemodus\plusthree
+ \tabulatenopbreaktrue,
+ \s!unknown=>\tabulatewidth#1\relax]%
\ifnum\tabulatedimen=\plusone
\global\advance\tabulatepwidth\tabulatewidth
\fi
@@ -865,12 +865,12 @@
[\tabulateparameter\c!distance]
[ \v!blank=>\scratchskip\bigskipamount,
\v!depth=>\scratchskip\strutdp,
- \v!small=>\def\factor{.25},
- \v!medium=>\def\factor{.5},
- \v!big=>,
- \v!none=>\scratchskip\zeropoint\def\factor{0},
- \v!grid=>\scratchskip\zeropoint\def\factor{0},
- \s!unknown=>\scratchskip\commalistelement]%
+ \v!small=>\def\factor{.25},
+ \v!medium=>\def\factor{.5},
+ \v!big=>,
+ \v!none=>\scratchskip\zeropoint\def\factor{0},
+ \v!grid=>\scratchskip\zeropoint\def\factor{0},
+ \s!unknown=>\scratchskip\commalistelement]%
\scratchdimen\factor\scratchskip
\ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new
\egroup}
diff --git a/Master/texmf-dist/tex/context/base/core-trf.tex b/Master/texmf-dist/tex/context/base/core-trf.tex
new file mode 100644
index 00000000000..cabafb30305
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-trf.tex
@@ -0,0 +1,543 @@
+%D \module
+%D [ file=core-fig,
+%D version=2006.08.26, % overhaul/split of 1997.03.31 core-fig
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Transformations,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D It may be that some functionality got lost. If it concerns
+%D defined features, let me know and it will be sorted out.
+
+\writestatus{loading}{Context Core Macros / Transformations}
+
+\unprotect
+
+%D Scaling:
+
+\def\scale{\dodoubleempty\doscalenextbox[\??xy]}
+
+% probably too many dimens / the width calculations can go
+% since we may assume scaling is available (was not true
+% long ago which is why we also calculate the width)
+
+\newdimen\scaleboxwidth
+\newdimen\scaleboxheight
+\newdimen\scaleboxdepth
+
+\newdimen\scaleboxsizex
+\newdimen\scaleboxsizey
+\newdimen\scaleboxoffsetx
+\newdimen\scaleboxoffsety
+
+\newdimen\scaleboxhsize
+\newdimen\scaleboxvsize
+
+% global
+
+\newdimen\scaleboxdimx \let\figwid \scaleboxdimx
+\newdimen\scaleboxdimy \let\fighei \scaleboxdimy
+\newcount\scaleboxscax \let\figxsca\scaleboxscax
+\newcount\scaleboxscay \let\figysca\scaleboxscay
+
+\newdimen\scaleboxoutervsize % we cannot manipulate any global vsize !
+
+\let\finalscaleboxxscale \!!plusone
+\let\finalscaleboxyscale \!!plusone
+\let\finalscaleboxwidth \!!zeropoint
+\let\finalscaleboxheight \!!zeropoint
+\let\finalscaleboxxfactor\!!hundred
+\let\finalscaleboxyfactor\!!hundred
+
+\newconditional\scaleboxdone
+
+\def\doscalenextbox[#1][#2]%
+ {\bgroup
+ \getparameters
+ [#1]
+ [\c!scale=,\c!xscale=,\c!yscale=,\c!width=,\c!height=,\c!lines=,
+ \c!factor=,\c!hfactor=,\c!wfactor=,\c!grid=,\c!sx=1,\c!sy=1,
+ \c!maxwidth=\scaleparameter\c!width,\c!maxheight=\scaleparameter\c!height,
+ #2]%
+ \dowithnextbox{\dodoscalenextbox{#1}\egroup}\hbox}
+
+\def\doscalebox#1%
+ {\bgroup\dowithnextbox{\dodoscalenextbox{#1}\egroup}\hbox}
+
+\let\currentscaletag\??xy
+
+\def\scaleparameter#1%
+ {\csname\currentscaletag#1\endcsname}
+
+\def\dodoscalenextbox#1%
+ {\edef\currentscaletag{#1}%
+ \forgetall
+ \dontshowcomposition
+ \dontcomplain
+ \doscaleboxcalculations
+ \doscaleboxindeed
+ \flushnextbox}
+
+\def\doscaleboxindeed
+ {\ifconditional\scaleboxdone
+ \scaleboxwidth \finalscaleboxxscale\nextboxwd
+ \scaleboxheight\finalscaleboxyscale\nextboxht
+ \scaleboxdepth \finalscaleboxyscale\nextboxdp
+ \setbox\nextbox\hbox
+ {\dostartscaling \finalscaleboxxscale \finalscaleboxyscale
+ \smashedbox\nextbox
+ \dostopscaling}%
+ \nextboxwd\scaleboxwidth
+ \nextboxht\scaleboxheight
+ \nextboxdp\scaleboxdepth
+ \fi}
+
+\def\doscaleboxcalculations
+ {\setfalse\scaleboxdone
+ % initial final value
+ \global\let\finalscaleboxxscale \!!plusone
+ \global\let\finalscaleboxyscale \!!plusone
+ \xdef \finalscaleboxwidth {\the\nextboxwd}%
+ \xdef \finalscaleboxheight{\the\nextboxht}%
+ \global\let\finalscaleboxxfactor\!!hundred
+ \global\let\finalscaleboxyfactor\!!hundred
+ \ifdim\nextboxht>\zeropoint \ifdim\nextboxwd>\zeropoint
+ \edef\scaleboxstampa % slow way [can be combined]
+ {\scaleparameter\c!scale \scaleparameter\c!xscale \scaleparameter\c!yscale
+ \scaleparameter\c!factor\scaleparameter\c!wfactor\scaleparameter\c!hfactor
+ \scaleparameter\c!lines \scaleparameter\c!width \scaleparameter\c!height}%
+ \edef\scaleboxstampb % fast way [just sx/sy]
+ {\scaleparameter\c!sx
+ \scaleparameter\c!sy}%
+ \ifx\scaleboxstampa\empty
+ \ifx\scaleboxstampb\empty
+ % no scaling
+ \else
+ \dosetscalboxsxsy
+ \nodoscaleboxcalculations
+ \fi
+ \else
+ \ifx\scaleboxstampb\empty
+ % no need to check further
+ \else
+ \dosetscalboxsxsy
+ \fi
+ \dodoscaleboxcalculations
+ \fi
+ \fi \fi}
+
+\def\dosetscalboxsxsy
+ {\ifdim\scaleparameter\c!sx\onepoint=\onepoint\else
+ \setevalue{\currentscaletag\c!width }{\the\dimexpr\scaleparameter\c!sx\wd\nextbox\relax}%
+ \fi
+ \ifdim\scaleparameter\c!sy\onepoint=\onepoint\else
+ \setevalue{\currentscaletag\c!height}{\the\dimexpr\scaleparameter\c!sy\ht\nextbox\relax}%
+ \fi}
+
+\def\doscaleboxrounding#1.#2\relax{#1}
+
+\def\scaleboxrounding#1%
+ {\@EA\@EA\@EA\doscaleboxrounding\@EA\WITHOUTPT\the\dimexpr#1\points*100+32768sp\relax.\relax}
+
+\def\nodoscaleboxcalculations
+ {\settrue\scaleboxdone
+ \xdef\finalscaleboxwidth {\the\dimexpr\scaleparameter\c!sx\wd\nextbox\relax}%
+ \xdef\finalscaleboxheight {\the\dimexpr\scaleparameter\c!sy\ht\nextbox\relax}%
+ \xdef\finalscaleboxxscale {\scaleparameter\c!sx}%
+ \xdef\finalscaleboxyscale {\scaleparameter\c!sy}%
+ \ifx\finalscaleboxxscale\empty\let\finalscaleboxxscale\!!plusone\fi
+ \ifx\finalscaleboxyscale\empty\let\finalscaleboxyscale\!!plusone\fi
+ \xdef\finalscaleboxxfactor{\scaleboxrounding\finalscaleboxxscale}%
+ \xdef\finalscaleboxyfactor{\scaleboxrounding\finalscaleboxyscale}}
+
+\def\dodoscaleboxcalculations
+ {\settrue\scaleboxdone
+ % initial values
+ \scaleboxoffsetx\zeropoint
+ \scaleboxoffsety\zeropoint
+ \scaleboxsizex \nextboxwd
+ \scaleboxsizey \nextboxht % alleen ht wordt geschaald!
+ % final values
+ \global\scaleboxdimx \zeropoint % see note * (core-fig)
+ \global\scaleboxdimy \zeropoint % see note * (core-fig)
+ \scaleboxscax \plusone % see note * (core-fig)
+ \scaleboxscay \plusone % see note * (core-fig)
+ % preparations
+ \checkscaleboxsettings
+ % calculators
+ %setscaleboxbynature % when? needed?
+ \setscaleboxbyfactor
+ \setscaleboxbyscale
+ \setscaleboxbydimension
+ % finalizers / to be done (no longer needed this way, clean up)
+ \convertscaleboxinsertscale\scaleboxhsize\figx\scaleboxscax\scax
+ \convertscaleboxinsertscale\scaleboxvsize\figy\scaleboxscay\scay
+ % used in actual scaling
+ \xdef\finalscaleboxwidth {\the\scaleboxdimx}%
+ \xdef\finalscaleboxheight {\the\scaleboxdimy}%
+ \xdef\finalscaleboxxfactor{\the\scaleboxscax}%
+ \xdef\finalscaleboxyfactor{\the\scaleboxscay}%
+ \xdef\finalscaleboxxscale {\withoutpt\the\dimexpr\scax\points/\plushundred\relax}%
+ \xdef\finalscaleboxyscale {\withoutpt\the\dimexpr\scay\points/\plushundred\relax}}
+
+\def\checkscaleboxsettings
+ {\doifsomething{\scaleparameter\c!maxwidth }% can be defined in itself
+ {\setevalue{\currentscaletag\c!maxwidth }{\the\dimexpr\scaleparameter\c!maxwidth \relax}}%
+ \doifsomething{\scaleparameter\c!maxheight}% can be defined in itself
+ {\setevalue{\currentscaletag\c!maxheight}{\the\dimexpr\scaleparameter\c!maxheight\relax}}%
+ \doifsomething{\scaleparameter\c!lines}
+ {\setevalue{\currentscaletag\c!height}{\the\dimexpr\scaleparameter\c!lines\lineheight\relax}}%
+ \doifsomething{\scaleparameter\c!grid}
+ {\processaction
+ [\scaleparameter\c!grid]
+ [ \v!yes=>\getnoflines\fighei
+ \setevalue{\currentscaletag\c!height}{\the\noflines\lineheight},
+ \v!height=>\getrawnoflines\fighei
+ \setevalue{\currentscaletag\c!height}{\the\dimexpr\noflines\lineheight+\strutdepth\relax},
+ \v!depth=>\getrawnoflines\fighei
+ \setevalue{\currentscaletag\c!height}{\the\dimexpr\noflines\lineheight-\strutdepth\relax},
+ \v!halfline=>\getrawnoflines\fighei
+ \setevalue{\currentscaletag\c!height}{\the\dimexpr\noflines\lineheight+.5\lineheight\relax},
+ \v!fit=>\getrawnoflines\fighei
+ \setevalue{\currentscaletag\c!height}{\the\noflines\lineheight}]}}
+
+\def\setscaleboxbynature % where ! ! ! ! !
+ {\doifsomething{\scaleparameter\c!width }{\global\scaleboxdimx\scaleparameter\c!width }%
+ \doifsomething{\scaleparameter\c!height}{\global\scaleboxdimy\scaleparameter\c!height}%
+ \doifsomething{\scaleparameter\c!scale } {\scaleboxscax\scaleparameter\c!scale
+ \scaleboxscay\scaleparameter\c!scale }%
+ \doifsomething{\scaleparameter\c!xscale} {\scaleboxscax\scaleparameter\c!xscale}%
+ \doifsomething{\scaleparameter\c!yscale} {\scaleboxscay\scaleparameter\c!yscale}} % oeps, was x
+
+\def\setscaleboxbyfactor
+ {\doifinsetelse{\scaleparameter\c!factor}{\v!max,\v!fit,\v!broad}
+ {\doapplyscaleboxsize
+ \ifdim\scaleboxsizex>\scaleboxsizey
+ \docalculatescaleboxnorm \scaleboxdimx\c!factor\c!maxwidth\hsize\scaleboxhsize
+ \docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey
+ \else
+ \docalculatescaleboxnorm \scaleboxdimy\c!factor\c!maxheight\scaleboxoutervsize\scaleboxvsize
+ \docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex
+ \fi
+ \donetrue}
+ {\doifinsetelse{\scaleparameter\c!hfactor}{\v!max,\v!fit,\v!broad}
+ {\doapplyscaleboxsize
+ \docalculatescaleboxnorm \scaleboxdimy\c!hfactor\c!maxheight\scaleboxoutervsize\scaleboxvsize
+ \docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex
+ \donetrue}
+ {\doifinsetelse{\scaleparameter\c!wfactor}{\v!max,\v!fit,\v!broad}
+ {\doapplyscaleboxsize
+ \docalculatescaleboxnorm \scaleboxdimx\c!wfactor\c!maxwidth\hsize\scaleboxhsize
+ \docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey
+ \donetrue}
+ {\docalculatescaleboxnorm\scaleboxdimy\c!factor \c!height \textheight\scaleboxvsize
+ \docalculatescaleboxnorm\scaleboxdimy\c!hfactor\c!height \textheight\scaleboxvsize
+ \docalculatescaleboxnorm\scaleboxdimx\c!wfactor\c!width \hsize \hsize
+ \donefalse}}}%
+ \ifdone
+ \ifdim\scaleboxdimx>\scaleboxhsize
+ \global\scaleboxdimy\zeropoint \global\scaleboxdimx\scaleboxhsize
+ \else\ifdim\scaleboxdimy>\scaleboxvsize
+ \global\scaleboxdimx\zeropoint \global\scaleboxdimy\scaleboxvsize
+ \fi\fi
+ \fi}
+
+\def\setscaleboxbyscale
+ {\doifsomething{\scaleparameter\c!scale\scaleparameter\c!xscale\scaleparameter\c!yscale}
+ {\doapplyscaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax\c!xscale
+ \doapplyscaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay\c!yscale
+ \global\scaleboxdimx\zeropoint
+ \global\scaleboxdimy\zeropoint
+ \doifelsenothing{\scaleparameter\c!maxwidth}
+ {\doifsomething{\scaleparameter\c!maxheight}
+ {\ifdim\scaleboxsizey>\scaleparameter\c!maxheight\relax
+ \global\scaleboxdimy\scaleparameter\c!maxheight
+ \fi}}
+ {\ifdim\scaleboxsizex>\scaleparameter\c!maxwidth\relax
+ \global\scaleboxdimx\scaleparameter\c!maxwidth
+ \fi}}}
+
+\def\setscaleboxbydimension
+ {\ifdim\scaleboxdimx>\zeropoint
+ \ifdim\scaleboxdimy>\zeropoint
+ \dosetdimensionscaleboxsize
+ {\docalculatescaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay
+ \docalculatescaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax}%
+ {\docalculatescaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay
+ \docalculatescaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax}%
+ {\docalculatescaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay
+ \docalculatescaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax}%
+ \else
+ \dosetdimensionscaleboxsize
+ {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
+ {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
+ {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
+ \fi
+ \else
+ \ifdim\scaleboxdimy>\zeropoint
+ \dosetdimensionscaleboxsize
+ {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
+ {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
+ {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
+ \else
+ \dosetdimensionscaleboxsize
+ {\doapplyscaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax\c!xscale
+ \doapplyscaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay\c!yscale}%
+ {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
+ {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
+ \fi
+ \fi}
+
+\def\dosetdimensionscaleboxsize#1#2#3%
+ {#1\relax
+ \doifsomething{\scaleparameter\c!maxwidth}
+ {\ifdim\scaleboxdimx>\scaleparameter\c!maxwidth\relax
+ \global\scaleboxdimx\scaleparameter\c!maxwidth
+ #2\relax
+ \fi}%
+ \doifsomething{\scaleparameter\c!maxheight}
+ {\ifdim\scaleboxdimy>\scaleparameter\c!maxheight\relax
+ \global\scaleboxdimy\scaleparameter\c!maxheight
+ #3\relax
+ \fi}}
+
+\def\docalculatescaleboxnorm#1#2#3#4#5% 2 3 parameters
+ {\processaction
+ [\scaleparameter#2]
+ [ \v!max=>\global#1\dimexpr#4\relax,
+ \v!fit=>\global#1\dimexpr#5\relax,
+ \v!broad=>\global#1\dimexpr#5-4\@@exbodyfont\relax,
+ \s!default=>\doifsomething{\scaleparameter#3}{\global#1\dimexpr\scaleparameter#3\relax},
+ \s!unknown=>\global#1\dimexpr\scaleparameter#2\dimexpr\@@exbodyfont/10\relax\relax]}
+
+\def\docalculatescaleboxscales#1#2#3#4%
+ {\scratchdimen\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax
+ \scaleboxscax\scratchdimen
+ \scaleboxscay\scratchdimen
+ #3\dimexpr\scaleboxscax\dimexpr#4/\plusthousand\relax\relax}
+
+\def\docalculatescaleboxscale#1#2#3%
+ {#3\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax}
+
+\def\doapplyscaleboxscale#1#2#3#4% $4 = parameter / scale can be empty
+ {\ifcase0\scaleparameter#4\relax
+ \ifcase0\scaleparameter\c!scale\relax
+ #3=\plusthousand
+ \else
+ #3=\scaleparameter\c!scale
+ \fi
+ \else
+ #3=\scaleparameter#4%
+ \fi
+ \relax % important ! still ?
+ \global#1\ifnum#3=\plusthousand#2\else\dimexpr#3\dimexpr#2/\plusthousand\relax\relax\fi
+ \relax}
+
+\def\doapplyscaleboxsize
+ {\doifelsenothing{\scaleparameter\c!maxheight}
+ {\scaleboxoutervsize\textheight
+ \ifinner
+ \scaleboxoutervsize \vsize % \textheight =\vsize
+ \scratchdimen\vsize % \scratchdimen=\textheight
+ \else\ifinsidefloat
+ \scaleboxoutervsize \vsize % \textheight =\vsize
+ \scratchdimen\vsize % \scratchdimen=\textheight
+ \else\ifinpagebody
+ \scaleboxoutervsize \vsize % \textheight =\vsize
+ \scratchdimen\vsize % \scratchdimen=\textheight
+ \else % hm, there should be an option to force this
+ \ifdim\pagegoal<\maxdimen
+ \ifdim\pagetotal<\pagegoal
+ \scratchdimen\pagegoal
+ \advance\scratchdimen -\pagetotal
+ \else
+ \scratchdimen\scaleboxoutervsize % \textheight
+ \fi
+ \else
+ \scratchdimen\scaleboxoutervsize % \textheight
+ \fi
+ \fi\fi\fi}
+ {\scaleboxoutervsize\scaleparameter\c!maxheight}%
+ \doifelsenothing{\scaleparameter\c!height}
+ {\scaleboxvsize\scratchdimen}
+ {\scaleboxvsize\scaleparameter\c!height}%
+ \doifelsenothing{\scaleparameter\c!width}
+ {\scaleboxhsize\hsize}
+ {\scaleboxhsize\scaleparameter\c!width}}
+
+\def\convertscaleboxinsertscale#1#2#3#4%
+ {\scratchdimen#1\relax
+ \ifnum#3=\plusthousand
+ % == scale 1
+ \else
+ % better 1000 100 10 ranges, evt round 2sp
+ \divide\scratchdimen \plusthousand
+ \multiply\scratchdimen #3\relax
+ \fi
+ \scratchdimen-\scratchdimen % beter hier - dan in driver
+ \edef#2{\the\scratchdimen}%
+ \scratchcounter#3\relax
+ \ifnum\scratchcounter>\plustenthousand
+ \divide\scratchcounter\!!ten \scratchdimen\the\scratchcounter\points
+ \else
+ \scratchdimen\the\scratchcounter\points \divide\scratchdimen\!!ten
+ \fi
+ \edef#4{\withoutpt\the\scratchdimen}}
+
+
+%D \macros
+%D {clip, setupclipping}
+%D
+%D Although related to figures, clipping can be applied to
+%D arbitrary content. We can use \METAPOST\ to provide a non
+%D rectangular clipping path.
+%D
+%D \starttyping
+%D \startMPclip{fun}
+%D clip currentpicture to fullcircle
+%D shifted (.5,.5) xscaled \width yscaled \height ;
+%D \stopMPclip
+%D \stoptyping
+%D
+%D We get a rectangular piece of the figure when we say:
+%D
+%D \starttyping
+%D \clip[x=2,y=1]{\externalfigure[photo]}
+%D \stoptyping
+%D
+%D When we want to clip to the oval we defined a few lines ago,
+%D we say:
+%D
+%D \starttyping
+%D \clip[nx=1,ny=1,x=1,y=1,mp=fun]{\externalfigure[photo]}
+%D \stoptyping
+%D
+%D The general characteristics of clipping can be set up with
+%D
+%D \showsetup{setupclipping}
+
+\def\setupclipping
+ {\dodoubleargument\getparameters[\??cp]}
+
+\def\clip
+ {\dosingleempty\doclip}
+
+\def\doclip[#1]% nb top->bottom left->right
+ {\bgroup
+ \getparameters[\??cp][#1]%
+ \doifelse\@@cpstate\v!start\dodoclip{\egroup\hbox}}
+
+\def\dodoclip
+ {\dowithnextbox
+ {\ifdim\@@cpwidth>\zeropoint
+ \!!dimena\@@cpwidth
+ \!!dimenc\@@cphoffset
+ \else
+ \!!dimena\nextboxwd
+ \divide\!!dimena \@@cpnx
+ \!!dimenc\@@cpx\!!dimena
+ \advance\!!dimenc -\!!dimena
+ \!!dimena\@@cpsx\!!dimena
+ \fi
+ \relax % sure
+ \ifdim\@@cpheight>\zeropoint
+ \!!dimenb\@@cpheight
+ \!!dimend\nextboxht
+ \advance\!!dimend -\@@cpvoffset
+ \advance\!!dimend -\!!dimenb
+ \else
+ \!!dimenb\nextboxht
+ \divide\!!dimenb \@@cpny
+ \!!dimend-\@@cpy\!!dimenb
+ \advance\!!dimend -\@@cpsy\!!dimenb
+ \advance\!!dimend \!!dimenb
+ \!!dimenb\@@cpsy\!!dimenb
+ \advance\!!dimend \nextboxht % dimend !
+ \fi
+ \setbox\nextbox\hbox % old
+ {\advance\!!dimenc -\@@cpleftoffset % new !
+ \advance\!!dimend -\@@cpbottomoffset % new ! % - added
+ \hskip-\!!dimenc\lower\!!dimend\flushnextbox}% old
+ \nextboxwd\zeropoint
+ \nextboxht\zeropoint
+ \nextboxdp\zeropoint
+ \setbox\nextbox\hbox
+ {\advance\!!dimena \@@cpleftoffset % new !
+ \advance\!!dimena \@@cprightoffset % new !
+ \advance\!!dimenb \@@cpbottomoffset % new !
+ \advance\!!dimenb \@@cptopoffset % new !
+ \dostartclipping\@@cpmp\!!dimena\!!dimenb % old
+ \flushnextbox
+ \dostopclipping}%
+ \setbox\nextbox\hbox % new !
+ {\!!dimena-\@@cpleftoffset % new !
+ \!!dimenb \@@cpbottomoffset % new ! % - removed
+ \hskip\!!dimena\lower\!!dimenb\flushnextbox}% new !
+ \nextboxwd\!!dimena
+ \nextboxht\!!dimenb
+ \nextboxdp\zeropoint
+ \flushnextbox
+ \egroup}%
+ \hbox}
+
+\setupclipping
+ [\c!state=\v!start,
+ \c!n=1, % was 2
+ \c!nx=\@@cpn,\c!x=1,\c!sx=1,
+ \c!ny=\@@cpn,\c!y=1,\c!sy=1,
+ \c!width=\!!zeropoint,
+ \c!height=\!!zeropoint,
+ \c!hoffset=\!!zeropoint,
+ \c!voffset=\!!zeropoint,
+ \c!offset=\zeropoint,
+ \c!leftoffset=\@@cpoffset, % \zeropoint,
+ \c!rightoffset=\@@cpoffset, % \zeropoint,
+ \c!topoffset=\@@cpoffset, % \zeropoint,
+ \c!bottomoffset=\@@cpoffset,% \zeropoint,
+ \c!mp=]
+
+%D \startbuffer
+%D \startuseMPgraphic{test}
+%D path p ; p := fullcircle scaled 4cm ;
+%D draw p withpen pencircle scaled 1cm ;
+%D setbounds currentpicture to boundingbox p ;
+%D \stopuseMPgraphic
+%D
+%D \hbox to \hsize \bgroup
+%D \hss
+%D \ruledhbox{\useMPgraphic{test}}%
+%D \hss
+%D \ruledhbox{\clip{\useMPgraphic{test}}}%
+%D \hss
+%D \egroup
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D Mirroring.
+
+\def\domirrorbox % \hbox/\vbox/\vtop
+ {\bgroup
+ \dowithnextbox
+ {\dontshowcomposition
+ \scratchdimen\nextboxwd
+ % better use an hbox (if no \forgetall, leftskip etc may creep in)
+ %\setbox\nextbox\vbox{\forgetall\dostartmirroring\hskip-\nextboxwd\flushnextbox\dostopmirroring}%
+ \setbox\nextbox\hbox{\dostartmirroring\hskip-\nextboxwd\flushnextbox\dostopmirroring}%
+ \nextboxwd\scratchdimen
+ \flushnextbox
+ \egroup}}
+
+\def\mirror
+ {\domirrorbox\hbox}
+
+% \setbox0=\hbox{gans}
+% \ruledhbox{\copy0 \schaal[sx=2,sy=2]{\copy0}}
+% \mirror{\ruledhbox{\copy0 \schaal{\box0}}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-tsp.tex b/Master/texmf-dist/tex/context/base/core-tsp.tex
index dd2b42f61e6..5523c2ccdbf 100644
--- a/Master/texmf-dist/tex/context/base/core-tsp.tex
+++ b/Master/texmf-dist/tex/context/base/core-tsp.tex
@@ -23,9 +23,7 @@
% only to be used with single tokens (will be prim)
-\ifx\htdp\undefined
- \def\htdp#1{\dimexpr\ht#1+\dp#1\relax}
-\fi
+\ifx\htdp\undefined \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi
%D Although the name resembles floats, and therefore this should be
%D a page module, we decided to make it core functionality because the
@@ -50,52 +48,6 @@
\def\splitfloat
{\dosingleempty\dosplitfloat}
-% \def\dosplitfloat[#1]#2% nog dubbele refs
-% {\ifinsidecolumns % tzt ook nog figuren splitten
-% % not yet supported
-% \else
-% \bgroup
-% \insidefloattrue
-% \insidesplitfloattrue
-% \getparameters[\??si][#1]%
-% \resetnumber[\??si]%
-% \def\floatcaptionsuffix{\convertednumber[\??si]}%
-% % \TABLEcaptionheight\@@silines\lineheight% brrr
-% % todo: auto == \getnoflines\captionheight
-% \let\extrasplitfloatlines\@@silines
-% \the\everysplitfloatsetup
-% \simplifypagebreak % \page becomes \goodbreak, no fails misserably
-% % todo: a preceding float does not count yet
-% % so we need a better predictor
-% \dowithnextbox
-% {\forgetall
-% \dontcomplain
-% \chardef\nodelocationmode\zerocount
-% \doloop
-% {\setbox2\vsplit\nextbox to \lineheight
-% \setbox2\vbox{\unvbox2}
-% \ifdim\ht2>\lineheight
-% \incrementnumber[\??si]%
-% \ifcase\rawnumber[\??si]\or \ifdim\nextboxht=\zeropoint
-% \let\floatcaptionsuffix\empty
-% \fi \fi
-% \bgroup
-% #2{\unvbox2}
-% \egroup
-% \ifdim\nextboxht>\zeropoint
-% \page
-% \decrementnumber[\floatcaptionnumber]%
-% \fi
-% \fi
-% \ifdim\nextboxht>\zeropoint
-% \page
-% \else
-% \expandafter\exitloop
-% \fi}%
-% \egroup}
-% \vbox
-% \fi}
-
\ifx\floatcaptionsuffix\undefined \else
\let\floatcaptionsuffix\empty % will become \splitfloatcaptionsuffix
\fi
@@ -207,7 +159,7 @@
\fi
\fi}
-\def\analyzesplitfloatcaption#1% depend son page-flt
+\def\analyzesplitfloatcaption#1% depends on page-flt
{\doif\extrasplitfloatlines\v!auto
{\bgroup
\settrue\retainfloatnumber
@@ -251,8 +203,8 @@
\newbox\tsplitnext
\newbox\tsplittail
-\def\resettsplit
- {\def\tsplitminimumfreelines{0}%
+\def\resettsplit{% only \def's starting a a new line are seen by the dep checker
+ \def\tsplitminimumfreelines{0}%
\def\tsplitminimumfreespace{0pt}%
\setbox\tsplitcontent \vbox{}%
\setbox\tsplitresult \vbox{}%
@@ -264,7 +216,8 @@
\let\tsplitinbetween \donothing
\let\tsplitbefore \donothing
\let\tsplitafter \donothing
- \let\postprocesstsplit \donothing}
+ \let\postprocesstsplit \donothing
+}
\resettsplit
@@ -317,11 +270,15 @@
\else
\!!donedfalse % no tablehead
\fi
+ \splittopskip\zeropoint
\doloop
{\setbox\scratchbox\vsplit\tsplitcontent to \onepoint % \lineheight
\setbox\scratchbox\vbox{\unvbox\scratchbox}%
\ifdim\dimexpr\scratchdimen-\htdp\scratchbox-\htdp\tsplitresult\relax>\zeropoint
- \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}%
+ \setbox\tsplitresult\vbox
+ {\unvbox\tsplitresult
+ \tsplitinbetween
+ \unvbox\scratchbox}%
\ifvoid\tsplitcontent \exitloop \fi
\else\if!!doned
% we only have a tablehead so far
@@ -330,11 +287,15 @@
\else\if!!donec
% we have text height available, but the (one) cell is too
% large to fit, so, in order to avoid loops/deadcycles we do:
- \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}%
+ \setbox\tsplitresult\vbox
+ {\unvbox\tsplitresult
+ \tsplitinbetween
+ \unvbox\scratchbox}%
\exitloop
\else
\setbox\tsplitcontent\vbox
{\unvbox\scratchbox
+ \tsplitinbetween
\ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}%
\exitloop
\fi\fi\fi
@@ -343,7 +304,10 @@
\postprocesstsplit
\dochecksplitofffloat\tsplitcontent
\ifvoid\tsplitcontent
- \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvcopy\tsplittail}%
+ \setbox\tsplitresult\vbox
+ {\unvbox\tsplitresult
+ \tsplitinbetween
+ \unvcopy\tsplittail}%
\dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
\doifnotinsidesplitfloat\tsplitafter
\endgraf
@@ -355,7 +319,10 @@
\fi
% brrr
\ifdim\ht\tsplitresult>\zeropoint
- \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvcopy\tsplittail}%
+ \setbox\tsplitresult\vbox
+ {\unvbox\tsplitresult
+ \tsplitinbetween
+ \unvcopy\tsplittail}%
\dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
\doifnotinsidesplitfloat\tsplitafter
\endgraf
diff --git a/Master/texmf-dist/tex/context/base/core-two.mkii b/Master/texmf-dist/tex/context/base/core-two.mkii
new file mode 100644
index 00000000000..38bf1b8d4a0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-two.mkii
@@ -0,0 +1,149 @@
+%D \module
+%D [ file=core-two, % moved from core-uti
+%D version=1997.03.31,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Two Pass Data,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D We save two pass information in the utility file.
+
+\def\resettwopassentries
+ {\let\twopassentry\gobblethreearguments}
+
+\addutilityreset{twopassentries}
+
+\resettwopassentries
+
+\def\settwopassentries
+ {\def\twopassentry##1{\executeifdefined{@@##1\s!pass}\gobbletwoarguments}}
+
+\def\savetwopassdata#1#2#3%
+ {\immediatewriteutilitycommand{\twopassentry{#1}{#2}{#3}}}
+
+\def\lazysavetwopassdata#1#2#3% expanded !
+ {\expanded{\writeutilitycommand{\noexpand\twopassentry{#1}{#2}{#3}}}}
+
+\def\savetaggedtwopassdata#1#2#3#4%
+ {\immediatewriteutilitycommand{\twopassentry{#1}{#2}{#3::#4}}}
+
+\def\lazysavetaggedtwopassdata#1#2#3#4% expanded !
+ {\expanded{\writeutilitycommand{\noexpand\twopassentry{#1}{#2}{#3::#4}}}}
+
+\def\appendtwopasselement#1#2#3% can sometimes become a large list
+ {%\debuggerinfo{\m!systems}{twopass data #1 - #2 = #3}%
+ \expandafter\xdef\csname#1:\s!list\endcsname
+ {\@EA\ifx\csname#1:\s!list\endcsname\empty \else
+ \csname#1:\s!list\endcsname,\fi#3}}
+
+\def\dodefinetwopasslist#1%
+ {\doifundefined{#1:\s!list}
+ {%\debuggerinfo\m!systems{defining twopass class #1}%
+ \doglobal\addutilityreset{#1\s!pass}%
+ \setgvalue{\s!set #1\s!pass}{\dosettwopasslist {#1}}%
+ \setgvalue{\s!reset#1\s!pass}{\doresettwopasslist{#1}}%
+ \getvalue {\s!reset#1\s!pass}}}
+
+\def\definetwopasslist#1%
+ {\expanded{\dodefinetwopasslist{#1}}%
+ \doglobal\addtocommalist{#1}\alltwopasslists}
+
+\def\dosettwopasslist#1%
+ {\letgvalue{\s!set#1\s!pass}\gobbletwoarguments
+ \setgvalue{@@#1\s!pass}{\appendtwopasselement{#1}}}
+
+\def\doresettwopasslist#1%
+ {\letgvalue{@@#1\s!pass}\gobbletwoarguments}
+
+\def\doloadtwopassdata#1%
+ {\doifundefined{#1:\s!list}
+ {\startnointerference
+ \letgvalueempty{#1:\s!list}%
+ \protectlabels
+ \doutilities{twopassentries,#1\s!pass}\jobname\empty\relax\relax
+ \stopnointerference}}
+
+\def\loadtwopassdata
+ {\ifx\alltwopasslists\empty\else
+ \processcommacommand[\alltwopasslists]\doloadtwopassdata
+ \globallet\alltwopassdata\empty
+ \fi}
+
+\def\dogettwopassdata[#1,#2]#3#4%
+ {\edef\twopassdata{#1}%
+ \ifx\twopassdata\empty
+ \twopassdatafoundfalse
+ \let\twopassdata\empty
+ \else
+ \twopassdatafoundtrue
+ \ifcase#4\or\setxvalue{#3:\s!list}{#2}\fi
+ \fi}
+
+\def\gettwopassdata#1%
+ {\loadtwopassdata \@EAEAEA\dogettwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname,]{#1}\plusone}
+
+\def\checktwopassdata#1%
+ {\loadtwopassdata \@EAEAEA\dogettwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname,]{#1}\zerocount}
+
+\def\findtwopassdata#1#2%
+ {\loadtwopassdata \expanded{\dofindtwopassdata{#1}{#2}}}
+
+\def\dofindtwopassdata#1#2%
+ {\def\dodofindtwopassdata[##1,##2#2::##3,##4]{\edef\twopassdata{##3}}%
+ \@EAEAEA\dodofindtwopassdata\@EA\@EA\@EA[\@EA\@EA\@EA,\csname#1:\s!list\endcsname,#2,#2::,]%
+ \ifx\twopassdata\empty
+ \twopassdatafoundfalse
+ \else
+ \twopassdatafoundtrue
+ \fi}
+
+\let\getfirsttwopassdata\checktwopassdata
+
+\def\getlasttwopassdata#1%
+ {\loadtwopassdata
+ \scratchcounter\zerocount
+ \@EAEAEA\rawprocesscommalist\@EA\@EA\@EA[\csname#1:\s!list\endcsname]\dogetlasttwopassdata
+ \edef\noftwopassitems{\the\scratchcounter}%
+ \iftwopassdatafound\else
+ \let\twopassdata\empty
+ \fi}
+
+\def\dogetlasttwopassdata#1%
+ {\edef\nexttwopassdata{#1}%
+ \ifx\nexttwopassdata\empty \else
+ \let\twopassdata\nexttwopassdata
+ \advance\scratchcounter \plusone
+ \twopassdatafoundtrue
+ \fi}
+
+\def\getfromtwopassdata#1#2%
+ {\loadtwopassdata
+ \@EAEAEA\getfromcommalist\@EA\@EA\@EA[\csname#1:\s!list\endcsname][#2]%
+ \ifx\commalistelement\empty
+ \twopassdatafoundfalse
+ \let\twopassdata\empty
+ \else
+ \twopassdatafoundtrue
+ \let\twopassdata\commalistelement
+ \fi}
+
+\def\gettwopassdatalist#1%
+ {\loadtwopassdata
+ \letcscsname\twopassdatalist\csname#1:\s!list\endcsname
+ \ifx\twopassdatalist\relax\let\twopassdatalist\empty\fi}
+
+\def\gettwopassdatalist
+ {\getnamedtwopassdatalist\twopassdatalist}
+
+\def\doifelseintwopassdata#1#2% tag dat
+ {\gettwopassdatalist{#1}%
+ \expanded{\doifinsetelse{#2}{\twopassdatalist}}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-two.tex b/Master/texmf-dist/tex/context/base/core-two.tex
new file mode 100644
index 00000000000..ebe601f19ba
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-two.tex
@@ -0,0 +1,102 @@
+%D \module
+%D [ file=core-two, % moved from core-uti
+%D version=1997.03.31,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Two Pass Data,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Core Macros / Two Pass Data}
+
+%D This is a rather old mechanism which has not changed much over
+%D time, apart from adding a few more selectors. This code used
+%D to be part of \type {core-uti}. The following examples demonstrate
+%D the interface.
+%D
+%D \startbuffer
+%D \definetwopasslist{test-1}
+%D
+%D \gettwopassdatalist{test-1} [\twopassdatalist=]
+%D \checktwopassdata {test-1} [\twopassdata=]
+%D \checktwopassdata {test-1} [\twopassdata=]
+%D \gettwopassdata {test-1} [\twopassdata=]
+%D \gettwopassdata {test-1} [\twopassdata=]
+%D
+%D \definetwopasslist{test-2}
+%D
+%D \lazysavetwopassdata{test-2}{1}{x}
+%D \lazysavetwopassdata{test-2}{2}{y}
+%D \lazysavetwopassdata{test-2}{3}{z}
+%D
+%D \gettwopassdatalist{test-2} [\twopassdatalist=x,y,z]
+%D \checktwopassdata {test-2} [\twopassdata=x]
+%D \checktwopassdata {test-2} [\twopassdata=x]
+%D \gettwopassdata {test-2} [\twopassdata=x]
+%D \gettwopassdata {test-2} [\twopassdata=y]
+%D \gettwopassdata {test-2} [\twopassdata=z]
+%D \gettwopassdata {test-2} [\twopassdata=]
+%D
+%D \definetwopasslist{test-3}
+%D
+%D \lazysavetaggedtwopassdata{test-3}{1}{x}{a}
+%D \lazysavetaggedtwopassdata{test-3}{2}{y}{b}
+%D \lazysavetaggedtwopassdata{test-3}{3}{z}{c}
+%D
+%D \findtwopassdata{test-3}{x} [\twopassdata=a]
+%D \findtwopassdata{test-3}{y} [\twopassdata=b]
+%D \findtwopassdata{test-3}{z} [\twopassdata=c]
+%D \findtwopassdata{test-3}{w} [\twopassdata=]
+%D
+%D \definetwopasslist{test-4}
+%D
+%D \lazysavetwopassdata{test-4}{1}{A}
+%D \lazysavetwopassdata{test-4}{2}{B}
+%D \lazysavetwopassdata{test-4}{3}{C}
+%D
+%D \getfirsttwopassdata{test-4} [\twopassdata=A]
+%D \getlasttwopassdata {test-4} [\twopassdata=C]
+%D \getfirsttwopassdata{test-4} [\twopassdata=A]
+%D \getlasttwopassdata {test-4} [\twopassdata=C]
+%D \getfromtwopassdata {test-4}{1} [\twopassdata=A]
+%D \getfromtwopassdata {test-4}{3} [\twopassdata=C]
+%D \getfromtwopassdata {test-4}{2} [\twopassdata=B]
+%D \stopbuffer
+%D
+%D \getbuffer \typebuffer
+
+\unprotect
+
+\let\alltwopasslists\empty
+\let\twopassentry \empty
+\let\twopassdata \empty
+\let\twopassdatalist\empty
+
+\newif\iftwopassdatafound
+
+\let\savetwopassdata \gobblethreearguments
+\let\lazysavetwopassdata \gobblethreearguments
+\let\savetaggedtwopassdata \gobblefourarguments
+\let\lazysavetaggedtwopassdata\gobblefourarguments
+
+\let\twopassentry \gobblethreearguments % permits loading a MK II file
+\let\loadtwopassdata\relax % permits loading a MK II file
+
+\let\definetwopasslist\gobbleoneargument
+
+\def\gettwopassdata #1{\let\twopassdata \empty \twopassdatafoundfalse}
+\def\checktwopassdata #1{\let\twopassdata \empty \twopassdatafoundfalse}
+\def\findtwopassdata #1#2{\let\twopassdata \empty \twopassdatafoundfalse}
+\def\getlasttwopassdata #1{\let\twopassdata \empty \twopassdatafoundfalse}
+\def\getfromtwopassdata #1#2{\let\twopassdata \empty \twopassdatafoundfalse}
+\def\gettwopassdatalist #1{\let\twopassdatalist\empty \twopassdatafoundfalse}
+\def\getnamedtwopassdatalist#1#2{\let#1 \empty \twopassdatafoundfalse}
+\def\doifelseintwopassdata #1#2{\secondoftwoarguments}
+
+\loadmarkfile{core-two}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-uti.mkii b/Master/texmf-dist/tex/context/base/core-uti.mkii
new file mode 100644
index 00000000000..decb5ceb197
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-uti.mkii
@@ -0,0 +1,47 @@
+%D \module
+%D [ file=core-uti,
+%D version=1997.03.31,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Utility File Handling,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\def\savecurrentvalue#1#2%
+ {\immediatewriteutilitycommand{\initializevariable\string#1{#2}}}
+
+\let\initializevariable\gdef
+
+\appendtoks
+ \globallet\initializevariable\gobbletwoarguments
+\to \everyafterutilityread
+
+\edef\testbytesequence
+ {\rawcharacter{7}%
+ \rawcharacter{27}%
+ %rawcharacter{227}% invalid in xetex, which expects utf
+ \rawcharacter{195}\rawcharacter{128}} % valid utf code
+
+\def\thisisbytesequence#1%
+ {\ifx\testbytesequence\empty\else
+ \convertcommand\testbytesequence\to\testbytesequence
+ \convertargument#1\to\ascii
+ \ifx\testbytesequence\ascii \else
+ \writestatus\m!systems{possible problem with 8 bit output}%
+ \fi
+ \fi
+ \global\let\thisisbytesequence\gobbleoneargument}
+
+\beginXETEX
+ \let\testbytesequence\empty
+\endXETEX
+
+\appendtoks
+ \immediatewriteutilitycommand{\thisisbytesequence{\testbytesequence}}%
+\to \everyopenutilities
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/core-uti.tex b/Master/texmf-dist/tex/context/base/core-uti.tex
index f1f499a75be..b630a13502b 100644
--- a/Master/texmf-dist/tex/context/base/core-uti.tex
+++ b/Master/texmf-dist/tex/context/base/core-uti.tex
@@ -32,6 +32,7 @@
\edef\utilityversion{1998.12.20} % was: 1998.07.07 % index attributes
\edef\utilityversion{2003.07.19} % was: 1998.12.20 % object pages
\edef\utilityversion{2006.06.23} % was: 2003.07.19 % -- instead of :
+\edef\utilityversion{2006.09.21} % pt in pos
% Bepaalde commando's worden als string weggeschreven. Deze
% zijn aan het eind van deze file gedefinieerd.
@@ -45,7 +46,7 @@
%
% \catcode`\^^M=5 (end of line)
-\newwrite\uti
+\newwrite\utility@tui
\newif\ifutilitydone
\def\@@utilityerrormessage
@@ -65,11 +66,11 @@
\def\thisissectionseparator#1%
{\bgroup
\globallet\checksectionseparator\relax
- \convertcommand \sectionseparator\to\asciiA
- \convertargument #1\to\asciiB
+ \convertcommand \sectionseparator\to\asciia
+ \convertargument #1\to\asciib
\expanded{\gdef\noexpand\dosplitofffoliopart[####1\sectionseparator
\sectionseparator####2\sectionseparator\sectionseparator####3]{####3}}%
- \ifx\asciiA\asciiB
+ \ifx\asciia\asciib
\egroup
\else
\egroup
@@ -78,8 +79,8 @@
\endinput
\fi}
-\def\writeutility {\write\uti}
-\def\writeutilitycommand#1{\write\uti{c \string#1}}
+\def\writeutility {\write\utility@tui}
+\def\writeutilitycommand#1{\write\utility@tui{c \string#1}}
% less tokens
%
@@ -88,16 +89,16 @@
%
% more flexible (for overloading)
-\def\immediatewriteutility {\immediate\write\uti}
-\def\immediatewriteutilitycommand#1{\immediate\write\uti{c \string#1}}
+\def\immediatewriteutility {\immediate\write\utility@tui}
+\def\immediatewriteutilitycommand#1{\immediate\write\utility@tui{c \string#1}}
% as in:
\def\cwriteutility#1%
- {\write\uti{\noexpand\checkedutility{\number\nofshipouts}{#1}}}
+ {\write\utility@tui{\noexpand\checkedutility{\number\nofshipouts}{#1}}}
\def\cwriteutilitycommand#1%
- {\write\uti{\noexpand\checkedutility{\number\nofshipouts}{c \string#1}}}
+ {\write\utility@tui{\noexpand\checkedutility{\number\nofshipouts}{c \string#1}}}
\let\checkedutility\secondoftwoarguments
@@ -107,55 +108,43 @@
\let\checkedutility\docheckedutility
\to \everybeforeshipout
-\edef\testbytesequence
- {\rawcharacter{7}%
- \rawcharacter{27}%
- %rawcharacter{227}% invalid in xetex, which expects utf
- \rawcharacter{195}\rawcharacter{128}} % valid utf code
-
-\def\thisisbytesequence#1%
- {\ifx\testbytesequence\empty\else
- \convertcommand\testbytesequence\to\testbytesequence
- \convertargument#1\to\ascii
- \ifx\testbytesequence\ascii \else
- \writestatus\m!systems{possible problem with 8 bit output}%
- \fi
- \fi
- \global\let\thisisbytesequence\gobbleoneargument}
-
-\beginXETEX
- \let\testbytesequence\empty
-\endXETEX
-
% Better use marks.
-\def\checkutilities
- {\let\writeutility \cwriteutility
- \let\writeutilitycommand \cwriteutilitycommand
- %\let\immediatewriteutility \cimmediatewriteutility
- %\let\immediatewriteutilitycommand\cimmediatewriteutilitycommand
- \let\checkutilities \relax}
-
-% this trickery is used in s-pre-50
-
-\def\openutilities
- {\immediate\openout\uti\jobname.\f!inputextension
- \immediatewriteutilitycommand{\thisissectionseparator{\sectionseparator}}% for the moment
- \immediatewriteutilitycommand{\thisisutilityversion {\utilityversion }}% in this order
- \immediatewriteutilitycommand{\thisisbytesequence {\testbytesequence}}}
-
-\def\closeutilities
- {\immediate\closeout\uti % niet echt nodig
- \reportutilityproblems
- % should be a message :
- \let\writeutilitycommand \gobbleoneargument
- \let\writeutility \gobbleoneargument
- \let\immediatewriteutilitycommand\gobbleoneargument
- \let\immediatewriteutility \gobbleoneargument}
-
-\def\reopenutilities
- {\immediate\closeout\uti
- \openutilities}
+\newtoks \everyopenutilities
+\newtoks \everycloseutilities
+\newtoks \everycheckutilities
+
+\def\openutilities {\the\everyopenutilities }
+\def\closeutilities{\the\everycloseutilities}
+\def\checkutilities{\the\everycheckutilities}
+
+\appendtoks
+ \let\writeutility \cwriteutility
+ \let\writeutilitycommand \cwriteutilitycommand
+ %\let\immediatewriteutility \cimmediatewriteutility
+ %\let\immediatewriteutilitycommand\cimmediatewriteutilitycommand
+ \let\checkutilities \relax
+\to \everycheckutilities
+
+\appendtoks
+ \immediate\openout\utility@tui\jobname.\f!inputextension
+ \immediatewriteutilitycommand{\thisissectionseparator{\sectionseparator}}% for the moment
+ \immediatewriteutilitycommand{\thisisutilityversion {\utilityversion }}% in this order
+\to \everyopenutilities
+
+\appendtoks
+ \immediate\closeout\utility@tui % niet echt nodig
+ \reportutilityproblems
+ % should be a message :
+ \let\writeutilitycommand \gobbleoneargument
+ \let\writeutility \gobbleoneargument
+ \let\immediatewriteutilitycommand\gobbleoneargument
+ \let\immediatewriteutility \gobbleoneargument
+\to \everycloseutilities
+
+% \def\reopenutilities
+% {\immediate\closeout\utility@tui
+% \openutilities}
\def\abortutilitygeneration
{\immediatewriteutilitycommand\utilitygenerationaborted
@@ -167,39 +156,15 @@
\gdef\reportutilityproblems{\showmessage\m!systems{22}\empty}%
\endinput}
-\def\savecurrentvalue#1#2%
- {\immediatewriteutilitycommand{\initializevariable\string#1{#2}}}
-
-\let\initializevariable\gdef
+\let\savecurrentvalue \gobbletwoarguments % mkii/mkiv
+\let\initializevariable\gobbletwoarguments % mkii/mkiv
-\def\disableinitializevariables
- {\globallet\initializevariable\gobbletwoarguments}
+\appendtoks
+ \globallet\initializevariable\gobbletwoarguments
+\to \everyafterutilityread
-\let\reportutilityproblems=\relax
-
-\let\utilityresetlist=\empty
-
-% the original
-%
-% \def\addutilityreset#1%
-% {\addtocommalist{\s!reset#1}\utilityresetlist}
-%
-% \def\resetutilities%
-% {\processcommacommand[\utilityresetlist]\getvalue}
-%
-% the more efficient
-%
-% \def\addutilityreset#1%
-% {\addtocommalist{#1}\utilityresetlist}
-%
-% \def\doresetutility#1%
-% {\getvalue{\s!reset#1}}
-%
-% \def\resetutilities%
-% {\processcommacommand[\utilityresetlist]\doresetutility}
-%
-% the fastest, about two times, but who cares, since this
-% can be neglected
+\let\reportutilityproblems\relax
+\let\utilityresetlist \empty
\newtoks\utilityresetlist
@@ -307,287 +272,49 @@
\type{[\currentmessagetext]}%
\blank}}%
\fi
- \disableinitializevariables
\endgroup}
% Saving the sort vector:
-\def\savesortkeys
- {\startnointerference
- \def\flushsortkey##1##2##3##4%
- {\convertargument{##1}{##2}{##3}{##4}\to\ascii
- \immediatewriteutility{k {\currentlanguage}{\currentencoding}\ascii}}%
- \let\definesortkey\flushsortkey
- \flushsortkeys
- \globallet\savesortkeys\relax
- \stopnointerference}
-
-\prependtoks \savesortkeys \to \everystarttext
+% \def\savesortkeys
+% {\startnointerference
+% \def\flushsortkey##1##2##3##4%
+% {\convertargument{##1}{##2}{##3}{##4}\to\ascii
+% \immediatewriteutility{k {\currentlanguage}{\currentencoding}\ascii}}%
+% \let\definesortkey\flushsortkey
+% \flushsortkeys
+% \globallet\savesortkeys\relax
+% \stopnointerference}
+%
+% \prependtoks \savesortkeys \to \everystarttext
-% Commando's ten behoeve van two-pass lists. In principe
-% kan alles in een keer worden ingelezen. Omdat de macro's
-% groeien is de kans groot dat het (main) geheugen door
-% (de)allocatie volloopt. Vandaar dat we het toch maar niet
-% doen.
-%
-% \definetwopasslist{\s!xxx}
-%
-% \gettwopassdata{\s!xxx}
-% \getfrompassdata{\s!xxx}{n} n=index (getal)
-% \findtwopassdata{\s!xxx}{tag} bijvoorbeeld {label:}
-% \iftwopassdatafound
-% \twopassdata
-%
-% \twopassentry{\s!xxx}{nr}{data} nr alleen voor testdoeleinden
-%
-% also:
-%
-% \definerawpasslist{\s!xxx}
-% \moverawpasslist\s!xxx\to\somemacro
-
-\let\alltwopasslists\empty % with 0,0 -> stepwise commalist
-\let\allrawpasslists\empty % without 0,0 -> raw commalist
-
-\newif\iftwopassdatafound
-
-\def\settwopassentries
- {\def\twopassentry##1{\executeifdefined{@@##1\s!pass}\gobbletwoarguments}}
-
-\def\resettwopassentries
- {\let\twopassentry\gobblethreearguments}
-
-\addutilityreset{twopassentries}
-
-\resettwopassentries
-
-% \def\twopassentry#1%
-% {\executeifdefined{@@#1\s!pass}\gobbletwoarguments}
-
-%\def\appendtwopasselement#1#2#3%
-% {%\debuggerinfo{\m!systems}{twopass data #1 - #2 = #3}%
-% \@EA\ifx\csname#1:\s!list\endcsname\empty
-% \setxvalue{#1:\s!list}{#3}%
-% \else
-% \setxvalue{#1:\s!list}{\getvalue{#1:\s!list},#3}%
-% \fi}
-
-\def\appendtwopasselement#1#2#3% can sometimes become a large list
- {%\debuggerinfo{\m!systems}{twopass data #1 - #2 = #3}%
- \expandafter\xdef\csname#1:\s!list\endcsname
- {\@EA\ifx\csname#1:\s!list\endcsname\empty \else
- \csname#1:\s!list\endcsname,\fi#3}}
-
-\def\dodefinetwopasslist#1%
- {\doifundefined{#1:\s!list}
- {%\debuggerinfo\m!systems{defining twopass class #1}%
- \doglobal\addutilityreset{#1\s!pass}%
- \setgvalue{\s!set #1\s!pass}{\dosettwopasslist {#1}}%
- \setgvalue{\s!reset#1\s!pass}{\doresettwopasslist{#1}}%
- \getvalue {\s!reset#1\s!pass}}}
-
-\def\dosettwopasslist#1%
- {\letgvalue{\s!set#1\s!pass}\gobbletwoarguments
- \setgvalue{@@#1\s!pass}{\appendtwopasselement{#1}}}
-
-\def\doresettwopasslist#1%
- {\letgvalue{@@#1\s!pass}\gobbletwoarguments}
-
-\def\definetwopasslist#1%
- {\expanded{\dodefinetwopasslist{#1}}%
- \doglobal\addtocommalist{#1}\alltwopasslists}
-
-\def\definerawpasslist#1%
- {\expanded{\dodefinetwopasslist{#1}}%
- \doglobal\addtocommalist{#1}\allrawpasslists}
-
-\def\doloadtwopassdata#1%
- {\doifundefined{#1:\s!list}
- {\startnointerference
- \letgvalueempty{#1:\s!list}%
- \protectlabels
- \doutilities{twopassentries,#1\s!pass}\jobname\empty\relax\relax
- \ifx\twopassdata\empty\else
- \appendtwopasselement{#1}{0}\twopassdata
- \fi
- \stopnointerference}}
-
-\def\loadtwopassdata
- {\ifx\alltwopasslists\empty\else
- \def\twopassdata{0,0}% end condition
- \processcommacommand[\alltwopasslists]\doloadtwopassdata
- \globallet\alltwopassdata\empty
- \fi
- \ifx\allrawpasslists\empty\else
- \let\twopassdata\empty
- \processcommacommand[\allrawpasslists]\doloadtwopassdata
- \globallet\allrawpassdata\empty
- \fi}
-
-\def\moverawpasslist#1#2% erases the old one, like the others do
- {\loadtwopassdata
- \@EA\let\@EA#2\csname#1:\s!list\endcsname
- \@EA\let\csname#1:\s!list\endcsname\empty}
-
-\let\twopassdata=\empty
-
-%\def\dogettwopassdata[#1,#2]#3%
-% {\doifelse{#1}{0} % \ifcase truukje gaat fout
-% {\twopassdatafoundfalse
-% \let\twopassdata\empty}
-% {\twopassdatafoundtrue
-% \setxvalue{#3:\s!list}{#2}%
-% \edef\twopassdata{#1}}}
-
-\def\notwopassdata{0}
-
-% \def\dogettwopassdata[#1,#2]#3%
-% {\edef\twopassdata{#1}%
-% \ifx\twopassdata\notwopassdata
-% \twopassdatafoundfalse
-% \let\twopassdata\empty
-% \else
-% \twopassdatafoundtrue
-% \setxvalue{#3:\s!list}{#2}%
-% \fi}
-%
-% \def\gettwopassdata#1%
-% {\loadtwopassdata
-% %\edef\!!stringa{\csname#1:\s!list\endcsname}%
-% %\debuggerinfo{\m!systems}{twopass get #1 - \!!stringa}%
-% %\expandafter\dogettwopassdata\expandafter[\!!stringa]{#1}}
-% \expanded{\dogettwopassdata[\csname#1:\s!list\endcsname]}{#1}}
-%
-% \def\findtwopassdata#1#2%
-% {\loadtwopassdata
-% \expanded{\dofindtwopassdata{#1}{#2}}}
-%
-% \def\dofindtwopassdata#1#2%
-% {\edef\!!stringa{,\csname#1:\s!list\endcsname}%
-% %\debuggerinfo{\m!systems}{twopass find #2 - \!!stringa}%
-% \def\dodofindtwopassdata[##1,##2#2##3,##4]%
-% {\edef\twopassdata{##3}%
-% \ifx\twopassdata\empty
-% \twopassdatafoundfalse
-% \else
-% \twopassdatafoundtrue
-% \fi}%
-% \@EA\dodofindtwopassdata\@EA[\!!stringa,#2,#2,]}
-%
-% \def\getfirsttwopassdata#1%
-% {\loadtwopassdata
-% \edef\!!stringa{\getvalue{#1:\s!list}}%
-% \expandafter\dogetfirsttwopassdata\expandafter[\!!stringa]{#1}}
-%
-% \def\dogetfirsttwopassdata[#1,#2]#3%
-% {\doifelse{#1}{0}
-% {\twopassdatafoundfalse
-% \let\twopassdata\empty}
-% {\twopassdatafoundtrue
-% \edef\twopassdata{#1}}}
-%
-% \def\getlasttwopassdata#1%
-% {\loadtwopassdata
-% \edef\twopassdata{0}\twopassdatafoundfalse
-% \newcounter\noftwopassitems
-% \def\docommando##1%
-% {\doifnot{##1}{0}
-% {\increment\noftwopassitems
-% \edef\twopassdata{##1}\twopassdatafoundtrue}}%
-% \processcommacommand[\getvalue{#1:\s!list}]\docommando}
-%
-% \def\getfromtwopassdata#1#2%
-% {\loadtwopassdata
-% \getfromcommacommand[\csname#1:\s!list\endcsname][#2]%
-% \doifelsenothing{\commalistelement}
-% {\twopassdatafoundfalse
-% \let\twopassdata\empty}
-% {\twopassdatafoundtrue
-% \let\twopassdata\commalistelement}}
-
-% todo: store each entry in hash, an load all uti commands at once
-
-% todo: use \expanded
-
-\def\dogettwopassdata[#1,#2]#3#4%
- {\edef\twopassdata{#1}%
- \ifx\twopassdata\notwopassdata
- \twopassdatafoundfalse
- \let\twopassdata\empty
- \else
- \twopassdatafoundtrue
- \ifcase#4\or\setxvalue{#3:\s!list}{#2}\fi
- \fi}
-
-\def\gettwopassdata#1%
- {\loadtwopassdata \@EAEAEA\dogettwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname]{#1}\plusone}
-
-\def\checktwopassdata#1%
- {\loadtwopassdata \@EAEAEA\dogettwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname]{#1}\zerocount}
-
-\def\findtwopassdata#1#2%
- {\loadtwopassdata \expanded{\dofindtwopassdata{#1}{#2}}}
-
-\def\dofindtwopassdata#1#2%
- {\def\dodofindtwopassdata[##1,##2#2##3,##4]{\edef\twopassdata{##3}}%
- \@EAEAEA\dodofindtwopassdata\@EA\@EA\@EA[\@EA\@EA\@EA,\csname#1:\s!list\endcsname,#2,#2,]%
- \ifx\twopassdata\empty
- \twopassdatafoundfalse
- \else
- \twopassdatafoundtrue
- \fi}
-
-\def\getfirsttwopassdata#1%
- {\loadtwopassdata
- \@EAEAEA\dogetfirsttwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname]{#1}}
-
-\def\dogetfirsttwopassdata[#1,#2]#3%
- {\edef\twopassdata{#1}%
- \ifx\twopassdata\notwopassdata
- \twopassdatafoundfalse
- \let\twopassdata\empty
- \else
- \twopassdatafoundtrue
- \fi}
-
-\def\dogetlasttwopassdata#1%
- {\edef\nexttwopassdata{#1}%
- \ifx\nexttwopassdata\notwopassdata \else
- \let\twopassdata\nexttwopassdata
- \advance\scratchcounter \plusone
- \twopassdatafoundtrue
- \fi}
-
-\def\getlasttwopassdata#1%
- {\loadtwopassdata
- \scratchcounter\zerocount
- \@EAEAEA\rawprocesscommalist\@EA\@EA\@EA[\csname#1:\s!list\endcsname]\dogetlasttwopassdata
- \edef\noftwopassitems{\the\scratchcounter}%
- \iftwopassdatafound\else
- \let\twopassdata\empty
- \fi}
-
-\def\getfromtwopassdata#1#2%
- {\loadtwopassdata
- \@EAEAEA\getfromcommalist\@EA\@EA\@EA[\csname#1:\s!list\endcsname][#2]%
- \ifx\commalistelement\empty
- \twopassdatafoundfalse
- \let\twopassdata\empty
- \else
- \twopassdatafoundtrue
- \let\twopassdata\commalistelement
- \fi}
-
% Default-instellingen (verborgen)
\prependtoks \resetutilities \to \everyjob
% Experiment
%
-%\installprogram{Hello World}
+% \installprogram{Hello World}
+% \installprogram[hw]{Hello World}
+% \installedprogram[hw]
-\def\installprogram#1%
+\def\installprogram
+ {\dosingleempty\doinstallprogram}
+
+\def\doinstallprogram[#1]#2%
+ {\doifelsenothing{#1}
+ {\dodoinstallprogram{#2}}
+ {\setvalue{\??up#1}{\dodoinstallprogram{#2}}}}
+
+% \def\doinstallprogram[#1][#2]% less code
+% {\doifsomething{#1}{\setvalue{\??up#1}}{\dodoinstallprogram{#2}}}
+
+\def\dodoinstallprogram#1%
{\immediatewriteutility{e p {#1}}}
+\def\installedprogram[#1]%
+ {\getvalue{\??up#1}}
+
% \writeplugindata{texutil}{{alpha}}
% \writeplugindata{texutil}{{beta}}
% \writeplugindata{texutil}{{gamma}}
@@ -641,4 +368,8 @@
\long\setvalue{\s!reset#1}{#2}%
\long\setvalue{\s!set #1}{#3}}
+% plugins
+
+\loadmarkfile{core-uti}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-var.tex b/Master/texmf-dist/tex/context/base/core-var.tex
index 54c9c52df5d..eba38fdc565 100644
--- a/Master/texmf-dist/tex/context/base/core-var.tex
+++ b/Master/texmf-dist/tex/context/base/core-var.tex
@@ -160,26 +160,13 @@
\def\dodocheckformode#1%
{\ifcase0\csname\@mode@#1\endcsname\or\checkedmodetrue\fi}
-% \def\docheckformode#1#2#3% will be sped up with a quit
-% {\protect\checkedmodefalse\rawprocesscommalist[#3]\dodocheckformode
-% \ifcheckedmode\@EA#1\else\@EA#2\fi}
-%
-% better:
-
\def\docheckformode#1#2#3% will be sped up with a quit
{\cleanuplabel{#3}%
\protect\checkedmodefalse\rawprocesscommacommand[\cleanlabel]\dodocheckformode
\ifcheckedmode\@EA#1\else\@EA#2\fi}
\def\dodocheckforallmodes#1%
- {\ifcase0\csname\@mode@#1\endcsname\relax
- \checkedmodefalse\or\or\checkedmodefalse\fi}
-
-% \def\docheckforallmodes#1#2#3% will be sped up with a quit
-% {\protect\checkedmodetrue\rawprocesscommalist[#3]\dodocheckforallmodes
-% \ifcheckedmode\@EA#1\else\@EA#2\fi}
-%
-% better:
+ {\ifcase0\csname\@mode@#1\endcsname\relax\checkedmodefalse\or\or\checkedmodefalse\fi}
\def\docheckforallmodes#1#2#3% will be sped up with a quit
{\cleanuplabel{#3}%
@@ -221,13 +208,13 @@
\def\startallmodes {\unprotect\dostartallmodes}
\def\startnotallmodes{\unprotect\dostartnotallmodes}
-\def\doifallmodeselse
+\def\dodoifallmodeselse
{\docheckforallmodes\firstoftwoarguments\secondoftwoarguments}
-\def\doifallmodes
+\def\dodoifallmodes
{\docheckforallmodes\firstofoneargument\gobbleoneargument}
-\def\doifnotallmodes
+\def\dodoifnotallmodes
{\docheckforallmodes\gobbleoneargument\firstofoneargument}
\long\def\dostartallmodes[#1]%
@@ -258,13 +245,15 @@
\newevery \everystoptext \relax
\newevery \everyforgetall \relax
\newevery \everybeforepagebody \relax
-\newevery \everyafterpagebody \relax \let \everypagebody \everybeforepagebody % backward compatible
+\newevery \everyafterpagebody \relax
\newevery \everybeforeutilityread \relax
\newevery \everyafterutilityread \relax
+\let \everypagebody \everybeforepagebody % backward compatible
+
%newevery \everybeforeutilitywrite \relax
-\newevery \everycleanupfeatures \relax \def\cleanupfeatures{\the\everycleanupfeatures}
+\newevery \everycleanupfeatures \relax
\newevery \everyinsidefloat \relax
\newevery \everyheadstart \relax
\newevery \everyendoftextbody \relax
@@ -274,6 +263,14 @@
\newevery \everymarking \relax
\newevery \everysavesortkeys \relax
+\newevery \everyfont \relax
+\newevery \everybodyfont \EveryBodyFont
+\newevery \everyfontswitch \EveryFontSwitch
+\newevery \everydefinedfont \relax
+
+\def\cleanupfeatures{\the\everycleanupfeatures}
+\def\forgetall {\the\everyforgetall}
+
%D For shared \type {\everymath} and \type {\everydisplay}:
\newevery \everymathematics \relax
@@ -304,6 +301,12 @@
\def\starttextproperties{\the\everystarttextproperties}
\def\stoptextproperties {\the\everystoptextproperties}
+%D This is pretty important (esp since we now ignore shipouts).
+%D Actually we should nil all writes, marks, specials.
+
+\appendtoks \globallet\popproperties \relax \to \everylastshipout
+\appendtoks \globallet\popsplitproperties\relax \to \everylastshipout
+
%D \macros
%D {defineinputmode,setinputmode}
%D
@@ -324,25 +327,20 @@
%D We disable trial typesetting in the output routine,
%D just to be sure.
+% defined in syst-ext
+
\prependtoks \trialtypesettingfalse \to \everybeforepagebody
%D \macros
-%D {starttextdata}
-%D
-%D This is a user macro (appending to every last shipout is not
-%D really user friendly.
-
-\newtoks \collectedtextdata
-
-\long\def\starttextdata#1\stoptextdata
- {\doglobal\appendtoks#1\to\collectedtextdata}
-
-\def\flushtextdata
- {\vsmashed{\the\collectedtextdata}% all dimensions zero
- \global\collectedtextdata\emptytoks
- \globallet\flushtextdata\donothing}
+%D {ifinpagebody,ifinsidecolumns,ifdoublesided,ifsinglesided}
-\prependtoks \flushtextdata \to \everylastshipout
+\newif \ifinpagebody
+\newif \ifinsidecolumns
+\newif \ifdoublesided \doublesidedfalse
+\newif \ifsinglesided \singlesidedtrue
+\newif \ifinsidefloat
+\newif \ifdoingblocks
+\newif \ifgridsnapping
%D \macros
%D {ifprocessingXML}
@@ -382,8 +380,6 @@
%D The command \type {\fastmode} disables some time consuming
%D typesetting.
-\let\normalwritestatus\writestatus
-
\newevery \everyfastmode \relax
\newif\iffastmode
@@ -561,4 +557,71 @@
\let\startlayoutcomponent\gobbletwoarguments
\let\stoplayoutcomponent \relax
+%D Label cleanup:
+
+\bgroup % some day this will go away / we could use detokenize as well
+
+% actually we should handle all discretionaries here
+
+\catcode`:=\@@active
+
+\gdef\cleanuplabel#1%
+ {\begingroup
+ \let:\lettercolon
+ \xdef\cleanlabel{#1}%
+ \endgroup}
+
+\gdef\cleanupprefixedlabel#1#2%
+ {\begingroup
+ \let:\lettercolon
+ \xdef\cleanprefix{#1}%
+ \xdef\cleanlabel {#2}%
+ \endgroup}
+
+\gdef\protectlabels
+ {\let:\lettercolon}
+
+\global\def\blabelgroup {\begingroup \let:\lettercolon}
+\global\let\elabelgroup \endgroup
+
+\gdef\labelcsname
+ {\begingroup\let:\lettercolon
+ \expandafter\endgroup\csname}
+
+\gdef\labelvalue#1%
+ {\labelcsname#1\endcsname}
+
+\egroup
+
+%D TO BE TESTED FIRST (needs changes in usage too)
+
+% \def\cleanuplabel#1%
+% {\edef\cleanlabel{\detokenize{#1}}}
+%
+% \def\cleanupprefixedlabel#1#2%
+% {\edef\cleanprefix{\detokenize{#1}}%
+% \edef\cleanlabel {\detokenize{#2}}}
+%
+% \def\labelvalue#1%
+% {\csname\detokenize{#1}\endcsname}
+%
+% \let\protectlabels\donothing
+%
+% \def\blabelgroup {\begingroup} % why no \let ?
+% \let\elabelgroup \endgroup
+
+
+
+
+%D Concepts:
+
+\chardef\conceptmode\zerocount
+
+\def\doifconcepttracing
+ {\ifnum\conceptmode>\plustwo
+ \expandafter\firstofoneargument
+ \else
+ \expandafter\gobbleoneargument
+ \fi}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-ver.mkii b/Master/texmf-dist/tex/context/base/core-ver.mkii
new file mode 100644
index 00000000000..374b9a0636b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-ver.mkii
@@ -0,0 +1,298 @@
+%D \module
+%D [ file=core-ver,
+%D version=2000.05.09,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Verbatim,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+% uses \prettyidentifier and sets \setupprettytype
+
+\def\mksetupprettiesintype
+ {\doifundefined{setuppretty\prettyidentifier type}%
+ {\startnointerference
+ \restorecatcodes % also needed when loading during \newpretty
+ \startreadingfile % restore < and > if needed
+ \lowercasestring verb-\prettyidentifier.tex\to\filename
+ \readsysfile\filename\donothing\donothing
+ \stopreadingfile
+ \stopnointerference}%
+ \doifdefinedelse{setuppretty\prettyidentifier type}%
+ {\let\uncatcodecharacters\uncatcodeallcharacters % ugly, should be switch / todo
+ \def\mksetupprettytype{\getvalue{setuppretty\prettyidentifier type}}}
+ {\let\mksetupprettytype\relax}}
+
+% not that fast but catches \type{\command} % nothing more after \command
+%
+% \setupcolors[state=start]
+% \setuptype[option=TEX]
+% \setupcolors[textcolor=red]
+%
+% The options \type{before=\startsolutionbackground } and
+% \type{after=\stopsolutionbackground} take care of putting a frame,
+% which can
+%
+% {\blue The options \type{before=\startsolutionbackground } and
+% \type{after=\stopsolutionbackground} take care of putting a frame,
+% which} can
+
+\def\resumecoloraftergroup
+ {\localstartcolor[\s!black]%
+ \localstartcolor[\maintextcolor]%
+ \aftergroup\localstopcolor
+ \aftergroup\localstopcolor}
+
+% the rather messy \type command
+
+\def\mktype#1% was \dotype
+ {\bgroup
+ \resumecoloraftergroup % a problem is that we can still be in color mode, tricky hack
+ \strut % new, enables leading space in \type { abc } at par start
+ \let\currenttypingclass\??ty
+ \edef\currenttyping{#1}%
+ \catcode`\<=\@@other
+ \catcode`\>=\@@other
+ \futurelet\next\dodotype}
+
+\def\dodotypeA
+ {\initializetype
+ \initializetypegrouping
+ \verbatimfont
+ \verbatimcolor
+ \afterassignment\protectfirsttype\let\next=}
+
+\def\dodotypeB
+ {\initializetype
+ \setupnotypegrouping
+ \verbatimfont
+ \verbatimcolor
+ \let\next=}
+
+\def\dodotypeC<#1%
+ {\initializetype
+ \verbatimfont
+ \verbatimcolor
+ \if#1<%
+ \@EA\setupalternativetypegrouping
+ \else
+ \@EA#1%
+ \fi}
+
+\def\dodotypeD#1%
+ {\initializetype
+ \verbatimfont
+ \verbatimcolor
+ \catcode`#1=\@@endgroup}
+
+\def\dodotype
+ {\ifx\next\bgroup
+ \@EA\dodotypeA
+ \else\if\next<%
+ \doifelse{\typingparameter\c!option}\v!none
+ {\@EAEAEA\dodotypeB}{\@EAEAEA\dodotypeC}%
+ \else
+ \@EAEAEA\dodotypeD
+ \fi\fi}
+
+% Verbatim does not work when passed as an argument, so here is a
+% workaround. Beware, spaces are introduced after a \type {\csname}.
+
+\chardef\recodeverbatimmode\zerocount % 0=nothing 1=rescan 2=autorescan
+
+% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytabulate
+% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytable
+
+\def\dodotypeA
+ {\initializetype
+ \initializetypegrouping
+ \verbatimfont
+ \verbatimcolor
+ \ifcase\recodeverbatimmode
+ \@EA\dodotypeAA
+ \or
+ \@EA\dodotypeAB
+ \or
+ \ifnum\catcode`\{=\@@active
+ \@EAEAEA\dodotypeAB
+ \else
+ \@EAEAEA\dodotypeAA
+ \fi
+ \else
+ \@EA\dodotypeAA
+ \fi}
+
+\def\dodotypeAA
+ {\afterassignment\protectfirsttype\let\next=}
+
+\def\dodotypeAB
+ {\bgroup
+ \catcode`\}=\@@endgroup
+ \catcode`\{=\@@begingroup
+ \afterassignment\redotypeAB\global\globalscratchtoks}
+
+\def\redotypeAB
+ {\egroup
+ \expandafter\convertargument\the\globalscratchtoks\to\ascii
+ \ifx\scantokens\undefined\ascii\else\everyeof{\hskip-\spaceskip}\scantokens\expandafter{\ascii}\fi
+ \egroup}
+
+\bgroup
+\catcode`\[=\@@begingroup
+\catcode`\]=\@@endgroup
+\catcode`\{=\@@active
+\catcode`\}=\@@active
+\gdef\initializetypegrouping
+ [\ifnum\catcode`\{=\@@active
+ \let\normalactivebgroup{%
+ \let\normalactiveegroup}%
+ \else
+ \catcode`\{=\@@active
+ \catcode`\}=\@@active
+ \let\normalactivebgroup\leftargument
+ \let\normalactiveegroup\rightargument
+ \fi
+ \def\activeleftargument
+ [\bgroup
+ \catcode`\}=\@@active
+ \let}\activerightargument
+ \normalactivebgroup]%
+ \def\activerightargument
+ [\normalactiveegroup
+ \egroup]%
+ \let{=\activeleftargument
+ % not \let}=\egroup, otherwise things go wrong in alignments (???)
+ \catcode`\}=\@@endgroup]
+\egroup
+
+\bgroup
+\catcode`\<=\@@active
+\catcode`\>=\@@active
+\gdef\setupalternativetypegrouping
+ {\catcode`\<=\@@active
+ \catcode`\>=\@@active
+ \def\doless
+ {\ifx<\next
+ \def\next
+ {\bgroup\switchslantedtype
+ \let\next=}%
+ \else
+ \let\next\lesscharacter
+ \fi
+ \next}%
+ \def\domore
+ {\ifx>\next
+ \def\next
+ {\egroup
+ \let\next=}%
+ \else
+ \let\next\morecharacter
+ \fi
+ \next}%
+ \def<{\futurelet\next\doless}%
+ \def>{\futurelet\next\domore}}
+\egroup
+
+\def\setupnotypegrouping
+ {\catcode`\<=\@@begingroup
+ \catcode`\>=\@@endgroup}
+
+\def\doenterdoublelesstype
+ {\ifx\next\egroup
+ \lesscharacter\null\lesscharacter
+ \else
+ \bgroup\switchslantedtype
+ \let\doenterdoublemoretype\egroup
+ \fi}
+
+\def\doenterdoublemoretype
+ {\def\doenterdoubletype
+ {\ifx\next\egroup
+ \morecharacter\null\morecharacter
+ \fi}}
+
+\bgroup
+\catcode`\<=\@@active
+\catcode`\>=\@@active
+\gdef\setupgroupedtype
+ {\catcode`\<=\@@active
+ \catcode`\>=\@@active
+ \def\doless
+ {\ifx<\next
+ \def\next
+ {\def\enterdoubletype{\futurelet\next\doenterdoublelesstype}%
+ \afterassignment\enterdoubletype
+ \let\next=}%
+ \else
+ \let\next\lesscharacter
+ \fi
+ \next}%
+ \def\domore
+ {\ifx>\next
+ \def\next
+ {\def\enterdoubletype{\futurelet\next\doenterdoublemoretype}%
+ \afterassignment\enterdoubletype
+ \let\next=}%
+ \else
+ \let\next\morecharacter
+ \fi
+ \next}%
+ \def<{\futurelet\next\doless}%
+ \def>{\futurelet\next\domore}}
+\egroup
+
+\def\mksetupcommandsintype% can also be \string\
+ {\setupgroupedtype
+ \edef\\{\typingparameter\c!escape}%
+ \letvalue{\\}=\\% for instance \/=/
+ \@EA\catcode\@EA`\\=\@@escape
+ \def\BTEX##1\ETEX##2% ##2 gobbles active space
+ {\naturaltextext##1\unskip\relax}}
+
+\def\mksetupslantedtype
+ {\setupgroupedtype}
+
+\let\protectedfirsttype\string % \relax for special cases
+
+% The next one is safe for: \def\xx#1{\type{#1}} \xx{\ifx}
+
+\bgroup
+\catcode`\<=\active
+\catcode`\>=\active
+\gdef\doprotectfirsttype
+ {\normalifx\next<%
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\bgroup
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\egroup % takes care of \type{}
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\activeleftargument
+ \endrobusttest \let\next\relax
+ \normalelse
+ \endrobusttest \let\next\protectedfirsttype
+ \normalfi\normalfi\normalfi\normalfi
+ \next}
+\egroup
+
+\def\protectfirsttype
+ {\beginrobusttest
+ \futurelet\next\doprotectfirsttype}
+
+% typing:
+
+\def\mktypeblockverbatim#1#2%
+ {\processdisplayverbatim{#2}} % needs to be fixed
+
+% typefile:
+
+\def\mktypefileverbatim {\processfileverbatim \readfilename} % #1
+\def\mktypefilelinesverbatim{\processfilelinesverbatim\readfilename} % #1 / #2#3
+
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/core-ver.tex b/Master/texmf-dist/tex/context/base/core-ver.tex
index 5713e0cb36d..8623dffef51 100644
--- a/Master/texmf-dist/tex/context/base/core-ver.tex
+++ b/Master/texmf-dist/tex/context/base/core-ver.tex
@@ -55,6 +55,10 @@
\unprotect
+\ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
+\ifx\stoplinenumbering \undefined \let\stoplinenumbering\relax \fi
+\ifx\setuplinenumbering\undefined \def\setuplinenumbering[#1]{} \fi
+
% \type{ <crlf> char} geeft bagger
%D We are going to embed the general verbatim support macros in
@@ -63,6 +67,18 @@
%D are hooked into the support macros via the \type{\obey}
%D macros.
+\newif\ifslantedtypeactivated
+\newif\ifslantedtypepermitted
+
+\def\switchslantedtype
+ {\ifslantedtypepermitted
+ \ifslantedtypeactivated
+ \slantedtypeactivatedfalse\tttf
+ \else
+ \slantedtypeactivatedtrue\ttsl
+ \fi
+ \fi}
+
\newprettytrue % movet to here from cont-sys.tex
\def\prettyidentifier {TEX}
@@ -72,71 +88,19 @@
{\dodoubleargument\doinstallprettytype}
\def\doinstallprettytype[#1][#2]% map #1 onto #2
- {\uppercasestring#1\to\asciiA
- \uppercasestring#2\to\asciiB
- \setevalue{\??ty\??ty\asciiA}{\asciiB}}
+ {\uppercasestring#1\to\asciia
+ \uppercasestring#2\to\asciib
+ \setevalue{\??ty\??ty\asciia}{\asciib}}
\def\setupprettiesintype#1%
{\uppercasestring#1\to\ascii
- \edef\prettyidentifier
- {\ifundefined{\??ty\??ty\ascii}TEX%
- \else\getvalue{\??ty\??ty\ascii}\fi}%
- \doifundefined{setuppretty\prettyidentifier type}%
- {\bgroup
- \setbox0\hbox % get rid of spaces when in-line \newpretty loading
- {\restorecatcodes % also needed when loading during \newpretty
- \startreadingfile % restore < and > if needed
- \lowercasestring verb-\prettyidentifier.tex\to\filename
- \readsysfile\filename\donothing\donothing
- \stopreadingfile}%
- \egroup}%
- \doifdefinedelse{setuppretty\prettyidentifier type}%
- {\let\uncatcodecharacters\uncatcodeallcharacters % ugly, should be switch
- \def\setupprettytype{\getvalue{setuppretty\prettyidentifier type}}}
- {\let\setupprettytype\relax}}
-
-\installprettytype [RAW] [RAW]
-
-\installprettytype [TEX] [TEX]
-
-\installprettytype [PERL] [PL]
-\installprettytype [PL] [PL]
-\installprettytype [PM] [PL]
-
-\installprettytype [METAPOST] [MP]
-\installprettytype [METAFONT] [MP]
-\installprettytype [MP] [MP]
-\installprettytype [MF] [MP]
-
-\installprettytype [JAVASCRIPT] [JS]
-\installprettytype [JAVA] [JV]
-\installprettytype [JS] [JS]
-\installprettytype [JV] [JV]
+ \edef\prettyidentifier{\executeifdefined{\??ty\??ty\ascii}{TEX}}%
+ \mksetupprettiesintype}
-\installprettytype [SQL] [SQL]
-
-\installprettytype [PASCAL] [PAS]
-\installprettytype [PAS] [PAS]
-\installprettytype [MODULA] [PAS]
-\installprettytype [MOD] [PAS]
-
-\installprettytype [EIFFEL] [EIF]
-\installprettytype [EIF] [EIF]
-\installprettytype [E] [EIF]
-
-\installprettytype [XML] [XML]
-
-\installnewpretty M {\setupprettiesintype {MP}\setupprettytype}
-\installnewpretty P {\setupprettiesintype {PL}\setupprettytype}
-\installnewpretty T {\setupprettiesintype{TEX}\setupprettytype}
-\installnewpretty J {\setupprettiesintype {JV}\setupprettytype}
-\installnewpretty S {\setupprettiesintype{SQL}\setupprettytype}
-\installnewpretty W {\setupprettiesintype{PAS}\setupprettytype} % Wirth
-\installnewpretty I {\setupprettiesintype{EIF}\setupprettytype} % E taken
-\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
+\def\setupprettytype{\mksetupprettytype}
\def\setupcommonverbatim
- {\eightbitcharactersfalse % obey regime / encoding
+ {\recatcodeuppercharactersfalse % obey regime / encoding
%
\def\prettyidentifier{TEX}%
%
@@ -190,6 +154,22 @@
\def\verbatimfont{\redoconvertfont\dosetfontattribute{\currenttypingclass\currenttyping}\c!style\normalnoligatures\font}%
\setupverbatimcolor}
+% BEWARE: the noligatures will globally change the verbatim font's behaviour
+
+% test case:
+%
+% \definetype[typeTEX][option=tex]
+%
+% \typeTEX|\example---oeps|. this---ligates---again.
+% \typeTEX{\example---oeps}. this---ligates---again.
+% \type {\example---oeps}. this---ligates---again.
+
+\def\setupcommandsintype{\mksetupcommandsintype}
+\def\setupslantedtype {\slantedtypepermittedtrue\mksetupslantedtype}
+
+\ifx\setupprettytype \undefined \let\setupprettytype \relax \fi
+\ifx\setupslantedtype \undefined \let\setupslantedtype \relax \fi
+\ifx\setupgroupedtype \undefined \let\setupgroupedtype \relax \fi
\ifx\normalnoligatures\undefined \let\normalnoligatures\gobbleoneargument \fi
%D The verbatim commands have a rather long and turbulent
@@ -232,9 +212,9 @@
%D \macros
%D {type}
%D
-%D We define \type{\type} as a protected command. First we
-%D set the catcodes of \type{<} and \type{>} and then we start
-%D looking ahead.
+%D We define \type{\type} as a protected command. This command
+%D has several invocations: grouped, wirt boundary characters,
+%D and with font switches.
% \starttyping
% normal: \par \type{xx<<..xx..<<xx <<xx>> >>..>>xx} \par \type<<....>> \par \type<<..<<xx>>..>> \par
@@ -246,261 +226,14 @@
% none: \par \type{xx<<..xx..<<xx <<xx>> >>..>>xx} \par \type<<....>> \par \type<<..<<xx>>..>> \par
% \stoptyping
-\unexpanded\def\type
- {\dotype\empty}
-
-\def\dotype#1%
- {\bgroup
- \strut % new, enables leading space in \type { abc } at par start
- \let\currenttypingclass\??ty
- \edef\currenttyping{#1}%
- \catcode`\<=\@@other
- \catcode`\>=\@@other
- \futurelet\next\dodotype}
-
-%D Next we distinguish between the three alternatives and call
-%D for the appropriate macros.
-
-\def\dodotypeA
- {\initializetype
- \initializetypegrouping
- \verbatimcolor
- \afterassignment\protectfirsttype\let\next=}
-
-\def\dodotypeB
- {\initializetype
- \setupnotypegrouping
- \verbatimcolor
- \let\next=}
-
-\def\dodotypeC<#1%
- {\initializetype
- \verbatimcolor
- \if#1<%
- \@EA\setupalternativetypegrouping
- \else
- \@EA#1%
- \fi}
-
-\def\dodotypeD#1%
- {\initializetype
- \verbatimcolor
- \catcode`#1=\@@endgroup}
-
-\def\dodotype%
- {\ifx\next\bgroup
- \@EA\dodotypeA
- \else\if\next<%
- \doifelse{\typingparameter\c!option}\v!none
- {\@EAEAEA\dodotypeB}{\@EAEAEA\dodotypeC}%
- \else
- \@EAEAEA\dodotypeD
- \fi\fi}
-
-% Verbatim does not work when passed as an argument, so here is a
-% workaround. Beware, spaces are introduced after a \type {\csname}.
-
-\chardef\recodeverbatimmode\zerocount % 0=nothing 1=rescan 2=autorescan
-
-% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytabulate
-% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytable
-
-\def\dodotypeA
- {\initializetype
- \initializetypegrouping
- \verbatimcolor
- \ifcase\recodeverbatimmode
- \@EA\dodotypeAA
- \or
- \@EA\dodotypeAB
- \or
- \ifnum\catcode`\{=\@@active
- \@EAEAEA\dodotypeAB
- \else
- \@EAEAEA\dodotypeAA
- \fi
- \else
- \@EA\dodotypeAA
- \fi}
-
-\def\dodotypeAA
- {\afterassignment\protectfirsttype\let\next=}
-
-\def\dodotypeAB
- {\bgroup
- \catcode`\}=\@@endgroup
- \catcode`\{=\@@begingroup
- \afterassignment\redotypeAB\global\globalscratchtoks}
-
-\def\redotypeAB
- {\egroup
- \expandafter\convertargument\the\globalscratchtoks\to\ascii
- \ifx\scantokens\undefined\ascii\else\everyeof{\hskip-\spaceskip}\scantokens\expandafter{\ascii}\fi
- \egroup}
-
-\bgroup
-\catcode`\[=\@@begingroup
-\catcode`\]=\@@endgroup
-\catcode`\{=\@@active
-\catcode`\}=\@@active
-\gdef\initializetypegrouping
- [\ifnum\catcode`\{=\@@active
- \let\normalactivebgroup{%
- \let\normalactiveegroup}%
- \else
- \catcode`\{=\@@active
- \catcode`\}=\@@active
- \let\normalactivebgroup\leftargument
- \let\normalactiveegroup\rightargument
- \fi
- \def\activeleftargument
- [\bgroup
- \catcode`\}=\@@active
- \let}\activerightargument
- \normalactivebgroup]%
- \def\activerightargument
- [\normalactiveegroup
- \egroup]%
- \let{=\activeleftargument
- % not \let}=\egroup, otherwise things go wrong in alignments (???)
- \catcode`\}=\@@endgroup]
-\egroup
-
-\bgroup
-\catcode`\<=\@@active
-\catcode`\>=\@@active
-\gdef\setupalternativetypegrouping
- {\catcode`\<=\@@active
- \catcode`\>=\@@active
- \def\doless
- {\ifx<\next
- \def\next
- {\bgroup\switchslantedtype
- \let\next=}%
- \else
- \let\next\lesscharacter
- \fi
- \next}%
- \def\domore
- {\ifx>\next
- \def\next
- {\egroup
- \let\next=}%
- \else
- \let\next\morecharacter
- \fi
- \next}%
- \def<{\futurelet\next\doless}%
- \def>{\futurelet\next\domore}}
-\egroup
-
-\def\setupnotypegrouping
- {\catcode`\<=\@@begingroup
- \catcode`\>=\@@endgroup}
-
%D When writing the manual to \CONTEXT\ and documenting this
%D source we needed to typeset \type{<<} and \type{>>}. Because
%D we wanted to do this in the natural way, we've adapted the
-%D original definition a bit. We still show the original
-%D because we think it's shows a bit better what we are
-%D doing.
-%D
-%D \starttyping
-%D \bgroup
-%D \catcode`\<=\@@active
-%D \catcode`\>=\@@active
-%D \gdef\setupgroupedtype%
-%D {\catcode`\<=\@@active
-%D \catcode`\>=\@@active
-%D \def<%
-%D {\def\do%
-%D {\ifx\next<%
-%D \def\next{\bgroup\switchslantedtype\let\next=}%
-%D \else
-%D \let\next\lesscharacter
-%D \fi
-%D \next}%
-%D \futurelet\next\do}%
-%D \def>%
-%D {\def\do%
-%D {\ifx\next>%
-%D \def\next{\egroup\let\next=}%
-%D \else
-%D \let\next\morecharacter
-%D \fi
-%D \next}%
-%D \futurelet\next\do}}
-%D \egroup
-%D \stoptyping
-%D
-%D The final implementation looks a bit further and treats the
-%D lone \type{<<} and \type{>>} a bit different. The \type
-%D {\null} prevents ligatures, which unfortunately turn up
-%D in Lucida fonts.
-
-\def\doenterdoublelesstype
- {\ifx\next\egroup
- \lesscharacter\null\lesscharacter
- \else
- \bgroup\switchslantedtype
- \let\doenterdoublemoretype\egroup
- \fi}
-
-\def\doenterdoublemoretype
- {\def\doenterdoubletype
- {\ifx\next\egroup
- \morecharacter\null\morecharacter
- \fi}}
-
-\bgroup
-\catcode`\<=\@@active
-\catcode`\>=\@@active
-\gdef\setupgroupedtype
- {\catcode`\<=\@@active
- \catcode`\>=\@@active
- \def\doless
- {\ifx<\next
- \def\next
- {\def\enterdoubletype{\futurelet\next\doenterdoublelesstype}%
- \afterassignment\enterdoubletype
- \let\next=}%
- \else
- \let\next\lesscharacter
- \fi
- \next}%
- \def\domore
- {\ifx>\next
- \def\next
- {\def\enterdoubletype{\futurelet\next\doenterdoublemoretype}%
- \afterassignment\enterdoubletype
- \let\next=}%
- \else
- \let\next\morecharacter
- \fi
- \next}%
- \def<{\futurelet\next\doless}%
- \def>{\futurelet\next\domore}}
-\egroup
-
-\newif\ifslantedtypeactivated
-\newif\ifslantedtypepermitted
-
-\def\switchslantedtype
- {\ifslantedtypepermitted
- \ifslantedtypeactivated
- \slantedtypeactivatedfalse\tttf
- \else
- \slantedtypeactivatedtrue\ttsl
- \fi
- \fi}
-
-\def\setupcommandsintype% can also be \string\
- {\setupgroupedtype
- \edef\\{\typingparameter\c!escape}%
- \letvalue{\\}=\\% for instance \/=/
- \@EA\catcode\@EA`\\=\@@escape
- \def\BTEX##1\ETEX##2% ##2 gobbles active space
- {\naturaltextext##1\unskip\relax}}
+%D original definition a bit. This implementation went through
+%D several live cycles. The final implementation looks a bit
+%D further and treats the lone \type{<<} and \type{>>} a bit
+%D different. The \type {\null} prevents ligatures, which
+%D unfortunately turn up in Lucida fonts.
%D The following lines show what happens when we set
%D \type {option=commands}.
@@ -520,58 +253,9 @@
%D
%D \typebuffer
-\def\setupslantedtype
- {\setupgroupedtype
- \slantedtypepermittedtrue}
-
-\let\protectedfirsttype\string % \relax for special cases
-
-% \bgroup
-% \catcode`\<=\active
-% \catcode`\>=\active
-% \gdef\doprotectfirsttype
-% {\ifx\next<%
-% \let\next\relax
-% \else\ifx\next\bgroup
-% \let\next\relax
-% \else\ifx\next\egroup % takes care of \type{}
-% \let\next\relax
-% \else\ifx\next\activeleftargument
-% \let\next\relax
-% \else
-% \let\next\protectedfirsttype
-% \fi\fi\fi\fi
-% \next}
-% \egroup
-%
-% \def\protectfirsttype
-% {\futurelet\next\doprotectfirsttype}
-%
-% The next one is safe for:
-%
-% \def\xx#1{\type{#1}} \xx{\ifx}
-
-\bgroup
-\catcode`\<=\active
-\catcode`\>=\active
-\gdef\doprotectfirsttype
- {\normalifx\next<%
- \endrobusttest \let\next\relax
- \normalelse\normalifx\next\bgroup
- \endrobusttest \let\next\relax
- \normalelse\normalifx\next\egroup % takes care of \type{}
- \endrobusttest \let\next\relax
- \normalelse\normalifx\next\activeleftargument
- \endrobusttest \let\next\relax
- \normalelse
- \endrobusttest \let\next\protectedfirsttype
- \normalfi\normalfi\normalfi\normalfi
- \next}
-\egroup
-
-\def\protectfirsttype
- {\beginrobusttest
- \futurelet\next\doprotectfirsttype}
+\unexpanded\def\type{\mktype\empty}
+
+\let\mktype\gobbleoneargument
%D The neccessary initializations are done by calling
%D \type{\initializetype} which in return calls for the support
@@ -597,17 +281,6 @@
\getparameters[\??ty][#1]%
\fi}
-%D The setups for inline verbatim default to:
-
-\setuptype
- [ \c!space=\v!off,
- \c!color=,
- \c!style=\tt\tf, % \tttf gives problems with {\tx \type...}
- \c!page=\v!no,
- \c!tab=\v!yes,
- \c!palet=colorpretty,
- \c!option=\v!normal]
-
%D \macros
%D {typ,obeyhyphens,obeybreakpoints}
%D
@@ -618,43 +291,20 @@
%D works all right, but a decent hyphenation support of
%D \type{\tt} text will be implemented soon.
-% \def\obeyhyphens
-% {\def\obeyedspace{\hskip\spaceskip}%
-% \edef\savedfont{\the\font}%
-% \ttsl\hyphenchar\font45
-% \tttf\hyphenchar\font45
-% \savedfont
-% \spaceskip.5em\!!plus.25em\!!minus.25em\relax}
-%
-% \def\obeybreakpoints
-% {\def\obeyedspace{\hskip\spaceskip}%
-% \spaceskip.5em
-% \veryraggedright}
-
\def\obeyhyphens
- {\def\obeyedspace {\hskip\spaceskip}%
+ {\def\obeyedspace {\hskip\interwordspace}% better than spaceskip
\def\controlspace{\hskip\zeropoint\hbox{\char32}\hskip\zeropoint}%
- \spaceskip.25em\!!plus.5em\!!minus.25em\relax}
+ \spaceskip.25em\relax} % hm a bit of stretch !
\def\obeybreakpoints
{\ignorehyphens
\veryraggedright}
\def\ignorehyphens
- {\def\obeyedspace {\null\hskip\spaceskip\null}%
+ {\def\obeyedspace {\null\hskip\interwordspace\null}% better than spaceskip
\def\controlspace{\null\hskip\zeropoint\hbox{\char32}\hskip\zeropoint\null}%
\spaceskip.5em\relax}
-%\unexpanded\def\typ
-% {\bgroup
-% \obeyhyphens
-% \futurelet\next\dotype}
-
-%\unexpanded\def\typ
-% {\bgroup
-% \obeyhyphens
-% \futurelet\next\dodotype}
-
\unexpanded\def\typ
{\bgroup
\let\@@tylines\v!hyphenated
@@ -693,36 +343,6 @@
%D \unexpanded\def\mat{\dospecialtype\$\$}
%D \unexpanded\def\dis{\dospecialtype{\$\$}{\$\$}}
%D \stoptyping
-%D
-% %D For sometime we used the better but less readable is
-% %D alternative
-% %D
-% %D \starttyping
-% %D \def\doprocessgroup#1#2#3%
-% %D {\bgroup
-% %D #1%
-% %D \def\doprocessgroup%
-% %D {\def\doprocessgroup{#3\egroup}%
-% %D \bgroup
-% %D \aftergroup\doprocessgroup
-% %D #2}%
-% %D \afterassignment\doprocessgroup
-% %D \let\next=}
-% %D
-% %D \def\setgroupedtype%
-% %D {\initializetype
-% %D \catcode`\{=\@@begingroup
-% %D \catcode`\}=\@@endgroup}
-% %D
-% %D \unexpanded\def\tex{\doprocessgroup\setgroupedtype\texescape\relax}
-% %D \unexpanded\def\arg{\doprocessgroup\setgroupedtype\leftargument\rightargument}
-% %D \unexpanded\def\mat{\doprocessgroup\setgroupedtype\$\$}
-% %D \unexpanded\def\dis{\doprocessgroup\setgroupedtype{\$\$}{\$\$}}
-% %D \stoptyping
-% %D
-%D
-%D But since \type{\groupedcommand} became available, we use
-%D however
\def\setgroupedtype
{\let\currenttypingclass\??ty
@@ -804,18 +424,6 @@
%D indirect way. As we will see, they are a specific case of a
%D more general mechanism.
-% formal version
-%
-% \def\dostarttyping#1%
-% {\let\currenttypingclass\??tp
-% \edef\currenttyping{#1}%
-% \typingparameter\c!before
-% \startpacked % includes \bgroup
-% \dosetuptypelinenumbering{}%
-% \initializetyping
-% \startverbatimcolor
-% \expandafter\processdisplayverbatim\expandafter{\s!stop#1}}
-
% we need this hack because otherwise verbatim skips
% the first line (everything after the initial command)
@@ -842,9 +450,9 @@
\dosetuptypelinenumbering{#1}%
\initializetyping
\startverbatimcolor
- \expanded{\processdisplayverbatim{\s!stop\currenttyping}}}
+ \expanded{\mktypeblockverbatim{\s!start\currenttyping}{\s!stop\currenttyping}}}
-\def\dostoptyping#1%
+\def\dostoptyping#1% hm, currenttyping
{\stopverbatimcolor
\stoppacked % includes \egroup
\typingparameter\c!after
@@ -884,20 +492,6 @@
%D argument is given, the values apply to both the standard
%D command \type{\starttyping} and \type{\typefile}.
-%\indirect\def\setuptyping\dodoubleempty[#1][#2]%
-% {\iffirstargument
-% \getparameters[\??tp#1][#2]%
-% \else
-% \getparameters[\??tp][#1]%
-% \fi}
-%
-%\doubleemptied\def\setuptyping[#1][#2]%
-% {\iffirstargument
-% \getparameters[\??tp#1][#2]%
-% \else
-% \getparameters[\??tp][#1]%
-% \fi}
-
\def\dosetuptyping[#1][#2]%
{\ifsecondargument
\getparameters[\??tp#1][#2]%
@@ -908,36 +502,6 @@
\def\setuptyping
{\dodoubleempty\dosetuptyping}
-%D The setups for display verbatim and file verbatim are
-%D shared. One can adapt the extra defined typing environments,
-%D but they also default to the values below. Watch the
-%D alternative escape character.
-
-\setuptyping
- [ \c!before=\blank,
- \c!after=\blank,
- \c!bodyfont=,
- \c!color=,
- \c!space=\v!off,
- \c!page=\v!no,
- \c!tab=\s!ascii,
- \c!option=\v!none,
- \c!palet=colorpretty,
- \c!text=\v!no,
- \c!style=\tttf,
- \c!icommand=\ttsl,
- \c!vcommand=,
- \c!ccommand=\tttf,
- \c!indentnext=\v!yes,
- \c!margin=\!!zeropoint,
- \c!evenmargin=\!!zeropoint,
- \c!oddmargin=\!!zeropoint,
- \c!blank=\v!line,
- \c!escape=/, % beware \string\ , should also be accepted
- \c!numbering=\v!no,
- \c!lines=,
- \c!empty=]
-
%D \macros
%D {definetype}
%D
@@ -948,10 +512,7 @@
{\dodoubleempty\dodefinetype}
\def\dodefinetype[#1][#2]%
- {\unexpanded\setvalue{#1}{\dotype{#1}}%
-% \copyparameters % maybe no longer needed, implicit inheritance now
-% [\??ty#1][\??ty]
-% [\c!space,\c!palet,\c!color,\c!style,\c!page,\c!tab,\c!option]%
+ {\unexpanded\setvalue{#1}{\mktype{#1}}%
\getparameters[\??ty#1][#2]}
%D \macros
@@ -972,12 +533,8 @@
%D The definitions default to the standard typing values.
\def\presettyping[#1][#2]%
- {\copyparameters
- [\??tp#1][\??tp]
- [\c!color,\c!style]%
- \getparameters
- [\??tp#1]
- [#2]}
+ {\copyparameters[\??tp#1][\??tp][\c!color,\c!style]%
+ \getparameters [\??tp#1][#2]}
\def\dodefinetyping[#1][#2]%
{\setvalue{\e!start#1}{\dostarttyping{#1}}%
@@ -987,76 +544,6 @@
\def\definetyping
{\dodoubleempty\dodefinetyping}
-\definetyping[\v!typing]
-
-\definetyping[RAW] [\c!option=RAW]
-\definetyping[MP] [\c!option=MP]
-\definetyping[PL] [\c!option=PL]
-\definetyping[PM] [\c!option=PL]
-\definetyping[JS] [\c!option=JS]
-\definetyping[JV] [\c!option=JV]
-\definetyping[SQL] [\c!option=SQL]
-\definetyping[TEX] [\c!option=TEX]
-\definetyping[PAS] [\c!option=PAS]
-\definetyping[PASCAL][\c!option=PAS]
-\definetyping[MOD] [\c!option=PAS]
-\definetyping[MODULA][\c!option=PAS]
-\definetyping[DELPHI][\c!option=PAS]
-\definetyping[EIFFEL][\c!option=EIF]
-\definetyping[XML] [\c!option=XML]
-
-%D We use the \CONTEXT\ color system for switching to and from
-%D color mode. We can always redefine these colors afterwards.
-
-\definecolor [colorprettyone] [r=.9, g=.0, b=.0] % red
-\definecolor [colorprettytwo] [r=.0, g=.8, b=.0] % green
-\definecolor [colorprettythree] [r=.0, g=.0, b=.9] % blue
-\definecolor [colorprettyfour] [r=.8, g=.8, b=.6] % yellow
-
-\definecolor [grayprettyone] [s=.30]
-\definecolor [grayprettytwo] [s=.45]
-\definecolor [grayprettythree] [s=.60]
-\definecolor [grayprettyfour] [s=.75]
-
-\definepalet
- [colorpretty]
- [ prettyone=colorprettyone,
- prettytwo=colorprettytwo,
- prettythree=colorprettythree,
- prettyfour=colorprettyfour]
-
-\definepalet
- [graypretty]
- [ prettyone=grayprettyone,
- prettytwo=grayprettytwo,
- prettythree=grayprettythree,
- prettyfour=grayprettyfour]
-
-% ---> naar verb-* ? of predefine als undefined?
-
-\definepalet [TEXcolorpretty] [colorpretty]
-\definepalet [TEXgraypretty] [graypretty]
-\definepalet [PLcolorpretty] [colorpretty]
-\definepalet [PLgraypretty] [graypretty]
-\definepalet [PMcolorpretty] [colorpretty]
-\definepalet [PMgraypretty] [graypretty]
-\definepalet [MPcolorpretty] [colorpretty]
-\definepalet [MPgraypretty] [graypretty]
-\definepalet [JVcolorpretty] [colorpretty]
-\definepalet [JVgraypretty] [graypretty]
-\definepalet [JScolorpretty] [colorpretty]
-\definepalet [JSgraypretty] [graypretty]
-\definepalet [SQLcolorpretty] [colorpretty]
-\definepalet [SQLgraypretty] [graypretty]
-\definepalet [PAScolorpretty] [colorpretty]
-\definepalet [PASgraypretty] [graypretty]
-\definepalet [EIFcolorpretty] [colorpretty]
-\definepalet [EIFgraypretty] [graypretty]
-\definepalet [XMLcolorpretty] [colorpretty]
-\definepalet [XMLgraypretty] [graypretty]
-
-% Some real in-depth knowlegde of palets: `palet:color' it is!
-
%D We can use some core color commands. These are faster than
%D the standard color switching ones and work ok on a line by
%D line basis.
@@ -1214,8 +701,6 @@
% \typefile[start=4,step=3]{zapf}
% \typefile{zapf}
-\presettyping[\v!file][]
-
\def\typefile
{\dodoubleempty\dotypefile}
@@ -1230,31 +715,6 @@
\dodotypefile[\v!file][]{#3}%
\fi\fi}
-% \def\dosetuptypelinenumbering#1% fuzzy
-% {\doifundefined{\currenttypingclass\currenttyping\c!start}
-% {\setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=,#1]}%
-% \doifelse{\typingparameter\c!numbering}\v!file
-% {\setuplinenumbering[\c!method=\v!file]%
-% \donetrue}
-% {\doifelse{\typingparameter\c!numbering}\v!line
-% {% \setuplinenumbering defaults start/step to 1/1, so we need
-% \doifnothing{\typingparameter\c!start }{\settypingparameter\c!start {1}}%
-% \doifnothing{\typingparameter\c!step }{\settypingparameter\c!step {1}}%
-% \doifnothing{\typingparameter\c!continue}{\settypingparameter\c!continue{}}%
-% \setuplinenumbering
-% [\c!method=\v!type,
-% \c!continue=\typingparameter\c!continue,
-% \c!start=\typingparameter\c!start,
-% \c!step=\typingparameter\c!step]%
-% \donetrue}
-% {\donefalse}}%
-% \ifdone
-% \ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
-% \ifx\stoplinenumbering \undefined \let\stoplinenumbering \relax \fi
-% \def\beginofverbatimlines{\startlinenumbering}%
-% \def\endofverbatimlines {\stoplinenumbering }%
-% \fi}
-
\def\dosetuptypelinenumbering#1% fuzzy
{\doifundefined{\currenttypingclass\currenttyping\c!start}
{\setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]}%
@@ -1284,78 +744,63 @@
\def\endofverbatimlines {\stoplinenumbering\setxtypingparameter\c!n{\number\linenumber}}%
\fi}
-% \setuptyping % not needed
-% [\v!file]
-% [\c!start=1,
-% \c!stop=,
-% \c!step=1,
-% \c!continue=,
-% \c!nlines=]
-
-\setuptyping
- [\c!start=1,
- \c!stop=,
- \c!step=1,
- \c!continue=,
- \c!nlines=]
+\def\reporttypingerror#1% temp hack
+ {\blank
+ \dontleavehmode\hbox\bgroup
+ \expanded{\convertargument#1}\to\ascii
+ \tttf[\makemessage\m!verbatims1\ascii]%
+ \showmessage\m!verbatims1\ascii
+ \egroup
+ \blank}
-\def\dodotypefile[#1][#2]#3%
+\def\dosometyping#1#2#3#4#5%
{\bgroup
\let\currenttypingclass\??tp
\edef\currenttyping{#1}%
\typingparameter\c!before
- \doiflocfileelse{#3}
- \donetrue % sets \readfilename
- {\doifinputfileelse{#3}
- {\donetrue
- \def\readfilename{\pathplusfile\filepath{#3}}}
- \donefalse}%
- \ifdone
- \startpacked % includes \bgroup
- \dosetuptypelinenumbering{#2}%
- \doifinset{\typingparameter\c!option}{\v!commands,\v!slanted,\v!normal}
- {\setuptyping[#1][\c!option=\v!none]}%
- \doif{\typingparameter\c!option}\v!color
- {\expandafter\aftersplitstring#3\at.\to\prettyidentifier
- \settypingparameter\c!option{\prettyidentifier}}%
- \initializetyping
- \startverbatimcolor
- \doifundefinedelse{\currenttypingclass#3\v!global\c!start}
- {\scratchcounter\zerocount}
- {\scratchcounter\getvalue{\currenttypingclass#3\v!global\c!start}}%
- \advance\scratchcounter\plusone
- \setxvalue{\currenttypingclass#3\v!global\c!start}{\the\scratchcounter}%
- \doifelsenothing{\typingparameter\c!start}
- {\processfileverbatim\readfilename}
- {\doif{\typingparameter\c!start}\v!continue
- {\setevalue{\currenttypingclass#1\c!start}%
- {\getvalue{\currenttypingclass#3\v!global\c!start}}}%
- \doifelsenothing{\typingparameter\c!stop}
- {\doifelsenothing{\typingparameter\c!nlines}
- {\processfileverbatim\readfilename}
- {\scratchcounter\typingparameter\c!start
- \advance\scratchcounter\typingparameter\c!nlines
- \advance\scratchcounter\minusone
- \setxvalue{\currenttypingclass#3\v!global\c!start}%
- {\the\scratchcounter}%
- \processfilelinesverbatim\readfilename
- {\typingparameter\c!start}
- {\getvalue{\currenttypingclass#3\v!global\c!start}}}}%
- {\processfilelinesverbatim\readfilename
- {\typingparameter\c!start}
- {\typingparameter\c!stop }}}%
- \stopverbatimcolor
- \stoppacked % includes \egroup
- \else
- \ifmmode\hbox\fi\bgroup
- \expanded{\convertargument#3}\to\ascii
- \tttf[\makemessage\m!verbatims1\ascii]%
- \showmessage\m!verbatims1\ascii
- \egroup
- \fi
+ \startpacked % includes \bgroup
+ \dosetuptypelinenumbering{#2}%
+ \doifinset{\typingparameter\c!option}{\v!commands,\v!slanted,\v!normal}
+ {\setuptyping[#1][\c!option=\v!none]}%
+ \doif{\typingparameter\c!option}\v!color
+ {\expandafter\aftersplitstring#3\at.\to\prettyidentifier
+ \settypingparameter\c!option{\prettyidentifier}}%
+ \initializetyping
+ \startverbatimcolor
+ \doifundefinedelse{\currenttypingclass#3\v!global\c!start}
+ {\scratchcounter\zerocount}
+ {\scratchcounter\getvalue{\currenttypingclass#3\v!global\c!start}}%
+ \advance\scratchcounter\plusone
+ \setxvalue{\currenttypingclass#3\v!global\c!start}{\the\scratchcounter}%
+ \doifelsenothing{\typingparameter\c!start}
+ {#4}
+ {\doif{\typingparameter\c!start}\v!continue
+ {\setevalue{\currenttypingclass#1\c!start}%
+ {\getvalue{\currenttypingclass#3\v!global\c!start}}}%
+ \doifelsenothing{\typingparameter\c!stop}
+ {\doifelsenothing{\typingparameter\c!nlines}
+ {#4}
+ {\setxvalue{\currenttypingclass#3\v!global\c!start}%
+ {\the\numexpr\typingparameter\c!start+\typingparameter\c!nlines+\minusone\relax}%
+ #5{\typingparameter\c!start}{\getvalue{\currenttypingclass#3\v!global\c!start}}}}%
+ {#5{\typingparameter\c!start}{\typingparameter\c!stop}}}%
+ \stopverbatimcolor
+ \stoppacked
\typingparameter\c!after
\egroup}
+\def\doifelsetypingfile#1% sets \readfilename
+ {\doiflocfileelse{#1}
+ {\firstoftwoarguments}
+ {\doifinputfileelse{#1}
+ {\def\readfilename{\pathplusfile\filepath{#1}}\firstoftwoarguments}
+ {\secondoftwoarguments}}}
+
+\def\dodotypefile[#1][#2]#3%
+ {\doifelsetypingfile{#3}
+ {\dosometyping{#1}{#2}{#3}\mktypefileverbatim\mktypefilelinesverbatim}
+ {\reporttypingerror{#3}}}
+
%D \macros
%D {filename}
%D
@@ -1378,4 +823,175 @@
\def\verbatim#1{\convertargument#1\to\ascii\ascii}
+%D Plugins
+
+\loadmarkfile{core-ver}
+
+%D The setups for display verbatim and file verbatim are
+%D shared. One can adapt the extra defined typing environments,
+%D but they also default to the values below. Watch the
+%D alternative escape character.
+
+\setuptyping
+ [ \c!before=\blank,
+ \c!after=\blank,
+ \c!bodyfont=,
+ \c!color=,
+ \c!space=\v!off,
+ \c!page=\v!no,
+ \c!tab=\s!ascii,
+ \c!option=\v!none,
+ \c!palet=colorpretty,
+ \c!text=\v!no,
+ \c!style=\tttf,
+ \c!icommand=\ttsl,
+ \c!vcommand=,
+ \c!ccommand=\tttf,
+ \c!indentnext=\v!yes,
+ \c!margin=\!!zeropoint,
+ \c!evenmargin=\!!zeropoint,
+ \c!oddmargin=\!!zeropoint,
+ \c!blank=\v!line,
+ \c!escape=/, % beware \string\ , should also be accepted
+ \c!numbering=\v!no,
+ \c!lines=,
+ \c!empty=,
+ \c!start=1,
+ \c!stop=,
+ \c!step=1,
+ \c!continue=,
+ \c!nlines=]
+
+\definetyping[\v!typing]
+
+\presettyping[\v!file][]
+
+% \setuptyping % not needed
+% [\v!file]
+% [\c!start=1,
+% \c!stop=,
+% \c!step=1,
+% \c!continue=,
+% \c!nlines=]
+
+%D The setups for inline verbatim default to:
+
+\setuptype
+ [ \c!space=\v!off,
+ \c!color=,
+ \c!style=\tt\tf, % \tttf gives problems with {\tx \type...}
+ \c!page=\v!no,
+ \c!tab=\v!yes,
+ \c!palet=colorpretty,
+ \c!option=\v!normal]
+
+\definetyping[RAW] [\c!option=RAW]
+\definetyping[MP] [\c!option=MP]
+\definetyping[PL] [\c!option=PL]
+\definetyping[PM] [\c!option=PL]
+\definetyping[JS] [\c!option=JS]
+\definetyping[JV] [\c!option=JV]
+\definetyping[SQL] [\c!option=SQL]
+\definetyping[TEX] [\c!option=TEX]
+\definetyping[PAS] [\c!option=PAS]
+\definetyping[PASCAL][\c!option=PAS]
+\definetyping[MOD] [\c!option=PAS]
+\definetyping[MODULA][\c!option=PAS]
+\definetyping[DELPHI][\c!option=PAS]
+\definetyping[EIFFEL][\c!option=EIF]
+\definetyping[XML] [\c!option=XML]
+\definetyping[LUA] [\c!option=LUA]
+
+\installprettytype [RAW] [RAW]
+
+\installprettytype [TEX] [TEX]
+
+\installprettytype [PERL] [PL]
+\installprettytype [PL] [PL]
+\installprettytype [PM] [PL]
+
+\installprettytype [METAPOST] [MP]
+\installprettytype [METAFONT] [MP]
+\installprettytype [MP] [MP]
+\installprettytype [MF] [MP]
+
+\installprettytype [JAVASCRIPT] [JS]
+\installprettytype [JAVA] [JV]
+\installprettytype [JS] [JS]
+\installprettytype [JV] [JV]
+
+\installprettytype [SQL] [SQL]
+
+\installprettytype [PASCAL] [PAS]
+\installprettytype [PAS] [PAS]
+\installprettytype [MODULA] [PAS]
+\installprettytype [MOD] [PAS]
+
+\installprettytype [EIFFEL] [EIF]
+\installprettytype [EIF] [EIF]
+\installprettytype [E] [EIF]
+
+\installprettytype [XML] [XML]
+
+\installprettytype [LUA] [LUA]
+
+\installnewpretty M {\setupprettiesintype {MP}\setupprettytype}
+\installnewpretty P {\setupprettiesintype {PL}\setupprettytype}
+\installnewpretty T {\setupprettiesintype{TEX}\setupprettytype}
+\installnewpretty J {\setupprettiesintype {JV}\setupprettytype}
+\installnewpretty S {\setupprettiesintype{SQL}\setupprettytype}
+\installnewpretty W {\setupprettiesintype{PAS}\setupprettytype} % Wirth
+\installnewpretty I {\setupprettiesintype{EIF}\setupprettytype} % E taken
+\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
+
+%D We use the \CONTEXT\ color system for switching to and from
+%D color mode. We can always redefine these colors afterwards.
+
+\definecolor [colorprettyone] [r=.9, g=.0, b=.0] % red
+\definecolor [colorprettytwo] [r=.0, g=.8, b=.0] % green
+\definecolor [colorprettythree] [r=.0, g=.0, b=.9] % blue
+\definecolor [colorprettyfour] [r=.8, g=.8, b=.6] % yellow
+
+\definecolor [grayprettyone] [s=.30]
+\definecolor [grayprettytwo] [s=.45]
+\definecolor [grayprettythree] [s=.60]
+\definecolor [grayprettyfour] [s=.75]
+
+\definepalet
+ [colorpretty]
+ [ prettyone=colorprettyone,
+ prettytwo=colorprettytwo,
+ prettythree=colorprettythree,
+ prettyfour=colorprettyfour]
+
+\definepalet
+ [graypretty]
+ [ prettyone=grayprettyone,
+ prettytwo=grayprettytwo,
+ prettythree=grayprettythree,
+ prettyfour=grayprettyfour]
+
+\definepalet [TEXcolorpretty] [colorpretty]
+\definepalet [TEXgraypretty] [graypretty]
+\definepalet [PLcolorpretty] [colorpretty]
+\definepalet [PLgraypretty] [graypretty]
+\definepalet [PMcolorpretty] [colorpretty]
+\definepalet [PMgraypretty] [graypretty]
+\definepalet [MPcolorpretty] [colorpretty]
+\definepalet [MPgraypretty] [graypretty]
+\definepalet [JVcolorpretty] [colorpretty]
+\definepalet [JVgraypretty] [graypretty]
+\definepalet [JScolorpretty] [colorpretty]
+\definepalet [JSgraypretty] [graypretty]
+\definepalet [SQLcolorpretty] [colorpretty]
+\definepalet [SQLgraypretty] [graypretty]
+\definepalet [PAScolorpretty] [colorpretty]
+\definepalet [PASgraypretty] [graypretty]
+\definepalet [EIFcolorpretty] [colorpretty]
+\definepalet [EIFgraypretty] [graypretty]
+\definepalet [XMLcolorpretty] [colorpretty]
+\definepalet [XMLgraypretty] [graypretty]
+\definepalet [LUAcolorpretty] [colorpretty]
+\definepalet [LUAgraypretty] [graypretty]
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-vis.tex b/Master/texmf-dist/tex/context/base/core-vis.tex
index 44a3eb37afe..ed469e2e074 100644
--- a/Master/texmf-dist/tex/context/base/core-vis.tex
+++ b/Master/texmf-dist/tex/context/base/core-vis.tex
@@ -241,10 +241,12 @@
{\EveryPar{\doshowpagebuilder}}
\def\doshowpagebuilder
- {\strut\llap{\blue \vl
- \high{\infofont v:\the\vsize }\vl
- \high{\infofont g:\the\pagegoal }\vl
- \high{\infofont t:\the\pagetotal}\vl}}
+ {\strut\llap
+ {\startcolor[blue]\vl
+ \high{\infofont v:\the\vsize }\vl
+ \high{\infofont g:\the\pagegoal }\vl
+ \high{\infofont t:\the\pagetotal}\vl
+ \stopcolor}}
%D \macros
%D {makecutbox, cuthbox, cutvbox, cutvtop}
@@ -493,7 +495,7 @@
\advance\scratchdimen \ruledheight
\advance\scratchdimen \ruleddepth
\divide\scratchdimen 21
- \def\docommando##1%
+ \def\docommand##1%
{\vbox
{\hsize3em % \scratchdimen
\definecolor
@@ -521,7 +523,7 @@
\vss}%
\fi}}%
\offinterlineskip
- \processcommalist[1.00,0.95,0.75,0.50,0.25,0.05,0.00]\docommando}}
+ \processcommalist[1.00,0.95,0.75,0.50,0.25,0.05,0.00]\docommand}}
\def\colorrangeB
{\hbox
@@ -529,7 +531,7 @@
\multiply\scratchdimen \plustwo
\advance\scratchdimen \ruledwidth
\divide\scratchdimen 11
- \def\docommando ##1 ##2 ##3##4##5##6%
+ \def\docommand ##1 ##2 ##3##4##5##6%
{\definecolor
[\s!dummy]
[\c!c=##3##2\else0\fi,
@@ -554,17 +556,17 @@
\hss}
\vss}%
\fi}%
- \docommando C .5 \iftrue \iffalse\iffalse\iffalse
- \docommando M .5 \iffalse\iftrue \iffalse\iffalse
- \docommando Y .5 \iffalse\iffalse\iftrue \iffalse
- \docommando K .5 \iffalse\iffalse\iffalse\iftrue
- \docommando C 1 \iftrue \iffalse\iffalse\iffalse
- \docommando G 1 \iftrue \iffalse\iftrue \iffalse
- \docommando Y 1 \iffalse\iffalse\iftrue \iffalse
- \docommando R 1 \iffalse\iftrue \iftrue \iffalse
- \docommando M 1 \iffalse\iftrue \iffalse\iffalse
- \docommando B 1 \iftrue \iftrue \iffalse\iffalse
- \docommando K 1 \iffalse\iffalse\iffalse\iftrue}}
+ \docommand C .5 \iftrue \iffalse\iffalse\iffalse
+ \docommand M .5 \iffalse\iftrue \iffalse\iffalse
+ \docommand Y .5 \iffalse\iffalse\iftrue \iffalse
+ \docommand K .5 \iffalse\iffalse\iffalse\iftrue
+ \docommand C 1 \iftrue \iffalse\iffalse\iffalse
+ \docommand G 1 \iftrue \iffalse\iftrue \iffalse
+ \docommand Y 1 \iffalse\iffalse\iftrue \iffalse
+ \docommand R 1 \iffalse\iftrue \iftrue \iffalse
+ \docommand M 1 \iffalse\iftrue \iffalse\iffalse
+ \docommand B 1 \iftrue \iftrue \iffalse\iffalse
+ \docommand K 1 \iffalse\iffalse\iffalse\iftrue}}
\def\colorrangeC
{\hbox
@@ -573,7 +575,7 @@
\multiply\scratchdimen 2
\advance\scratchdimen \ruledwidth
\divide\scratchdimen 14
- \def\docommando##1%
+ \def\docommand##1%
{\definecolor[\s!dummy][\c!s=##1]%
\localstartcolor[\s!dummy]%
\vrule
@@ -590,7 +592,7 @@
\localstopcolor
\vss}%
\fi}%
- \processcommalist[1,.95,.9,.85,.8,.75,.7,.6,.5,.4,.3,.2,.1,0]\docommando}}
+ \processcommalist[1,.95,.9,.85,.8,.75,.7,.6,.5,.4,.3,.2,.1,0]\docommand}}
\def\docolormarkbox#1#2%
{\edef\ruledheight{\the\ht#2}%
@@ -676,8 +678,8 @@
\else
- \let\supernormalmark \normalmark % mark may already superseded
- \let\supernormalmarks \normalmarks % mark may already superseded
+ \let\supernormalmark \normalmark % mark may already been superseded
+ \let\supernormalmarks \normalmarks % mark may already been superseded
\def\showwhatsits
{\protected\def\normalmark {\visualwhatsit100+m\supernormalmark }%
diff --git a/Master/texmf-dist/tex/context/base/enco-fde.tex b/Master/texmf-dist/tex/context/base/enco-fde.tex
index bbefb51bf07..da104b802b7 100644
--- a/Master/texmf-dist/tex/context/base/enco-fde.tex
+++ b/Master/texmf-dist/tex/context/base/enco-fde.tex
@@ -13,9 +13,9 @@
\unprotect
-\startlanguagespecifics[\s!de]
+\installactivecharacter "
- \appendtoks \makecharacteractive " \to \everynormalcatcodes
+\startlanguagespecifics[\s!de]
\installcompoundcharacter "a {\aumlaut\midworddiscretionary}
\installcompoundcharacter "e {\eumlaut\midworddiscretionary}
@@ -87,11 +87,11 @@
% no {\simplifiedcompoundcharacter"}
-\startencoding[pdfdoc]
- \startlanguagespecifics[\s!de]% hm, a % is needed
- \defineactivecharacter " {\"}
- \stoplanguagespecifics
-\stopencoding
+% \startencoding[pdfdoc]
+% \startlanguagespecifics[\s!de]% hm, a % is needed
+% \defineactivecharacter " {\"}
+% \stoplanguagespecifics
+% \stopencoding
\startencoding[ec]
\startlanguagespecifics[\s!de]%
diff --git a/Master/texmf-dist/tex/context/base/enco-ffr.tex b/Master/texmf-dist/tex/context/base/enco-ffr.tex
index 1ddd226eebe..abe3627504d 100644
--- a/Master/texmf-dist/tex/context/base/enco-ffr.tex
+++ b/Master/texmf-dist/tex/context/base/enco-ffr.tex
@@ -18,6 +18,11 @@
\enablemode[activecolon] \usemodule[tryout] % for the moment
+\installactivecharacter :
+\installactivecharacter ;
+\installactivecharacter ?
+\installactivecharacter !
+
\unprotect
\startlanguagespecifics[\s!fr]
@@ -28,10 +33,10 @@
\stoplanguagespecifics
\startlanguagespecifics[\s!fr]
- \defineactivecharacter : {\mathortext{:}{\directdiscretionary{:}}}
- \defineactivecharacter ; {\mathortext{;}{\directdiscretionary{;}}}
- \defineactivecharacter ! {\mathortext{!}{\directdiscretionary{!}}}
- \defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}}
+ \defineactivecharacter : {\mathortext{:}{\directdiscretionary{:}}}
+ \defineactivecharacter ; {\mathortext{;}{\directdiscretionary{;}}}
+ \defineactivecharacter ! {\mathortext{!}{\directdiscretionary{!}}}
+ \defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}}
\stoplanguagespecifics
% maybe tricky due to possible name clashes:
diff --git a/Master/texmf-dist/tex/context/base/enco-fpl.tex b/Master/texmf-dist/tex/context/base/enco-fpl.tex
index 2f90ad9c7ad..ee9d98dc8bf 100644
--- a/Master/texmf-dist/tex/context/base/enco-fpl.tex
+++ b/Master/texmf-dist/tex/context/base/enco-fpl.tex
@@ -17,6 +17,8 @@
% todo : named glyphs
+\installactivecharacter /
+
\startlanguagespecifics[\s!pl]
\appendtoks \makecharacteractive / \to \everynormalcatcodes
diff --git a/Master/texmf-dist/tex/context/base/enco-fro.tex b/Master/texmf-dist/tex/context/base/enco-fro.tex
index f6644402bdd..e5f5e1257f2 100644
--- a/Master/texmf-dist/tex/context/base/enco-fro.tex
+++ b/Master/texmf-dist/tex/context/base/enco-fro.tex
@@ -15,6 +15,8 @@
\unprotect
+\installactivecharacter "
+
\startlanguagespecifics[\s!ro]
\installcompoundcharacter "a {\acircumflex}
diff --git a/Master/texmf-dist/tex/context/base/enco-ini.tex b/Master/texmf-dist/tex/context/base/enco-ini.tex
index 9b78ae18da0..da14b509b4e 100644
--- a/Master/texmf-dist/tex/context/base/enco-ini.tex
+++ b/Master/texmf-dist/tex/context/base/enco-ini.tex
@@ -18,17 +18,6 @@
%D well as moving plain handling of accents to this module
%D instead of overloading plain \TEX\ commands.
-% \everyuppercase
-% \dotlessi
-% single/double quotes
-% hyphens
-% characterencoding => encoding
-% charactermapping => mapping
-
-%D Most of this module used to be part of the font and language
-%D modules. While implementing Czech support, I decided to
-%D isolate this code.
-
%D Patterns are kind of mixed with font encodings and
%D mappings. Alas.
@@ -111,7 +100,7 @@
\startmessages romanian library: encodings
title: codificari
1: codificarea --
- 2: codificarea -- este Œncarcata
+ 2: codificarea -- este Encarcata
3: codificarea -- este necunoscuta
\stopmessages
@@ -125,249 +114,12 @@
%D First we define a few local or not yet initialized constants.
\def\@map@{@m@ap@} % mapping prefix
-\def\@reg@{@r@eg@} % regime prefix
\def\@fha@{@f@ha@} % font prefix
\def\@cas@{@c@as@} % casecom prefix
\ifx\currentlanguage\undefined \let\currentlanguage\s!en \fi
%D \macros
-%D {protectregime}
-%D
-%D The next boolean is used later on to prevent unwanted
-%D catcode changes. Use it with care.
-
-\newif\ifprotectregime \protectregimetrue
-
-\def\setregimecode#1#2%
- {\ifprotectregime\ifnum\catcode#1=\active\else
- \catcode#1=#2%\relax
- \fi\else
- \catcode#1=#2%\relax
- \fi
- \relax}
-
-%D \macros
-%D {startregime, enableregime}
-%D
-%D Sometimes it makes sense to activate the characters in the
-%D upper half of the character table. Such a bundle of
-%D characters can be packages in a regime. Later we will see
-%D encodings (that links characters slots to glyphs) and
-%D mappings (that take care of hyphenation and case changes).
-%D
-%D When character~231 is of category code letter, it
-%D directly maps to glyph~231 (unless of course some virtual
-%D font is used). By making character~231 active, we can map
-%D it onto for instance the glyph in slot 233. This mapping
-%D can in itself be indirect, in the sense that it is for
-%D instance handled by an accent command.
-%D
-%D Regimes are implemented roughly the same as mappings, but
-%D enabled under different circumstances. In the future, the
-%D low level implementation may change.
-
-\def\startregime[#1]%
- {\pushmacro\characterregime
- \edef\characterregime{@#1@}%
- \checkregimetoks}
-
-\def\checkregimetoks
- {\doifundefined{\@reg@\characterregime}
- {\@EA\newtoks\csname\@reg@\characterregime\endcsname}}
-
-\def\stopregime
- {\popmacro\characterregime}
-
-%\long\def\startregime[#1]#2\stopregime{}
-
-\def\setregimetoks
- {\checkregimetoks
- \@EA\let\@EA\regimetoks\csname\@reg@\characterregime\endcsname}
-
-\let\enabledregime\empty
-
-% \def\enableregime[#1]%
-% {\edef\characterregime{@#1@}%
-% \ifx\enabledregime\characterregime \else
-% \doifdefined{\@reg@\characterregime}
-% {\the\csname\@reg@\characterregime\endcsname}%
-% \let\enabledregime\characterregime
-% \fi}
-
-% \def\enableregime[#1]%
-% {\edef\characterregime{@#1@}%
-% \ifx\enabledregime\characterregime \else
-% \the\executeifdefined{\@reg@\characterregime}\emptytoks
-% \fi}
-
-\def\defineregimesynonym
- {\dodoubleargument\dodefineregimesynonym}
-
-\def\dodefineregimesynonym[#1][#2]%
- {\setevalue{\@reg@::#1}{#2}}
-
-\def\trueregimename#1%
- {\executeifdefined{\@reg@::#1}{#1}}
-
-% \def\enableregime[#1]%
-% {\edef\characterregime{@\trueregimename{#1}@}%
-% \ifx\enabledregime\characterregime \else
-% \the\executeifdefined{\@reg@\characterregime}\emptytoks
-% \fi}
-
-\def\enableregime[#1]%
- {\edef\characterregime{@\trueregimename{#1}@}%
- \ifx\enabledregime\characterregime \else
- \doifundefined{\@reg@\characterregime}
- {\expanded{\useregime[\pureencodingname\characterregime]}}% auto load
- \the\executeifdefined{\@reg@\characterregime}\emptytoks
- \fi}
-
-%D \macros
-%D {defineactivedecimal, defineactivedecimals, defineactivetoken}
-%D
-%D The following commands are rather ugly ones. It makes a
-%D character active and assigns it a value. When expanded,
-%D the decimal number of the character is passed as first
-%D argument.
-%D
-%D \starttyping
-%D \def\decimalcharacter#1{\message{#1 is now active}}
-%D
-%D \defineactivedecimal 122 {\decimalcharacter}
-%D
-%D \defineactivedecimals 128 to 255 as {\decimalcharacter}
-%D \stoptyping
-%D
-%D This command is typically used in coding definitions,
-%D like the \UNICODE\ one.
-
-%\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
-% {\catcode#1=\active % maybe \protectregimetrue
-% \scratchcounter=\the\uccode`~
-% \uccode`~=#1\relax
-% \uppercase{\unexpanded\edef~{\noexpand#2{\number#1}}}%
-% \uccode`~=\scratchcounter}
-
-\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
- {\catcode#1\active
- \scratchcounter\uccode\activehackcode
- \uccode\activehackcode#1\relax
- \uppercase{\unexpanded\edef~{\noexpand#2{\number#1}}}%
- \uccode\activehackcode\scratchcounter}
-
-% \long\def\defineactivedecimal#1 #2 %
-% {\setregimetoks
-% \appendtoks\dodefineactivedecimal{#1}{#2}\to\regimetoks}
-%
-% \long\def\defineactivedecimals#1 to #2 as #3 %
-% {\setregimetoks
-% \dostepwiserecurse{#1}{#2}\plusone
-% {\@EA\appendtoks\@EA\dodefineactivedecimal\@EA{\recurselevel}{#3}\to\regimetoks}}
-%
-% \long\def\defineactivetoken #1 #2% no {} after #2, else no kern
-% {\setregimetoks
-% \appendtoks\defineactivecharacter#1 {#2}\to\regimetoks}
-%
-% \long\def\defineactiveinspector #1 #2% watch the missing {}
-% {\setregimetoks
-% \appendtoks\defineactivecharacter#1 {#2}\to\regimetoks}
-%
-% faster:
-
-\long\def\defineactivedecimal#1 #2 %
- {\setregimetoks
- \regimetoks\expandafter{\the\regimetoks\dodefineactivedecimal{#1}{#2}}}
-
-\long\def\defineactivedecimals#1 to #2 as #3 %
- {\setregimetoks
- \dostepwiserecurse{#1}{#2}\plusone
- {\regimetoks\@EA\@EA\@EA{\@EA\the\@EA\regimetoks\@EA\dodefineactivedecimal\@EA{\recurselevel}{#3}}}}
-
-\beginETEX
-
- % much faster, prelude to run time loading
-
- % \def\doexpandactivedecimal#1#2#3%
- % {\ifnum#1>#2 %
- % \expandafter\gobblefourarguments
- % \else
- % \noexpand\dodefineactivedecimal{#1}{#3}%
- % \expandafter\expandafter\expandafter\doexpandactivedecimal\expandafter
- % \fi\expandafter{\the\numexpr#1+1\relax}{#2}{#3}}
- %
- % \long\def\defineactivedecimals#1 to #2 as #3 %
- % {\setregimetoks
- % \scratchcounter#2\relax
- % \scratchtoks{#3}%
- % \expanded{\regimetoks{\the\regimetoks\doexpandactivedecimal{#1}{#2}{\the\scratchtoks}}}%
- % \ignorespaces}
-
- \def\doexpandactivedecimal#1%
- {\ifnum#1>\scratchcounter
- \expandafter\gobbletwoarguments
- \else
- \noexpand\dodefineactivedecimal{#1}{\the\scratchtoks}%
- \expandafter\expandafter\expandafter\doexpandactivedecimal\expandafter
- \fi\expandafter{\the\numexpr#1+\plusone\relax}}
-
- \long\def\defineactivedecimals#1 to #2 as #3 %
- {\setregimetoks
- \scratchcounter#2\relax
- \scratchtoks{#3}%
- \expanded{\regimetoks{\the\regimetoks\doexpandactivedecimal{#1}}}%
- \ignorespaces}
-
-\endETEX
-
-\long\def\defineactivetoken #1 #2% no {} after #2, else no kern
- {\setregimetoks
- \regimetoks\expandafter{\the\regimetoks\defineactivecharacter#1 {#2}}}
-
-\long\def\defineactiveinspector #1 #2% watch the missing {}
- {\setregimetoks
- \regimetoks\expandafter{\the\regimetoks\defineactivecharacter#1 {#2}}}
-
-%D ....
-
-\edef\nocharacterregime{@\s!default @}
-
-\def\definetoken #1 % #1 = rawtoken or number
- {\doifnumberelse{\string#1}
- {\expanded{\dodefinetoken{\rawcharacter{#1}}}}
- {\expanded{\dodefinetoken{\string#1}}}}
-
-\def\dodefinetoken#1#2%
- {\defineactivecharacter#1 {\dohandletoken{#1}} %
- \setvalue{\characterregime#1}{#2}}
-
-\beginTEX
-
-\def\dohandletoken#1%
- {\csname\expandafter\ifx\csname\characterregime#1\endcsname\relax
- \nocharacterregime\else\characterregime\fi#1\endcsname}
-
-\endTEX
-
-\beginETEX \ifcsname
-
-\def\dohandletoken#1%
- {\csname\ifcsname\characterregime#1\endcsname
- \characterregime\else\nocharacterregime\fi#1\endcsname}
-
-\endETEX
-
-%D ....
-
-\def\doautosetregime#1#2%
- {\ifnum#2>127
- % \def\!!stringa{#2 }%
- % \@EA\@EA\@EA\defineactivetoken\@EA\!!stringa\@EA{\csname#1\endcsname}%
- \expanded{\defineactivetoken #2 \@EA\noexpand\csname#1\endcsname}%
- \fi}
-
-%D \macros
%D {setupencoding}
%D
%D The following setup command is used to tune encoding
@@ -425,19 +177,6 @@
%D So, character 165 becomes 181 in uppercase and 165 in
%D lowercase. A mapping is activated with \type {\enablemapping}.
-% quite slow, esp when done at runtime
-
-% \def\startmapping[#1]%
-% {\pushmacro\charactermapping
-% \edef\charactermapping{@#1@}%
-% \ifundefined{\@map@\charactermapping}%
-% \expandafter\newtoks\csname\@map@\charactermapping\endcsname
-% \fi}
-
-% \def\stopmapping
-% {%\setmappingtoks\showthe\mappingtoks
-% \popmacro\charactermapping}
-
\def\startsavingmappingtoks#1%
{\bgroup
\edef\charactermapping{@#1@}%
@@ -451,7 +190,7 @@
{\edef\@@expanded
{\the\mappingtoks
\ifnum\recurselevel>127
- \noexpand\checkregimecode\recurselevel\space
+ \noexpand\settoletterunlessactive{\recurselevel}%
\fi
\lccode\recurselevel\ifnum\lccode\recurselevel=\zerocount\zerocount\else\space\the\lccode\recurselevel\space\fi
\uccode\recurselevel\ifnum\uccode\recurselevel=\zerocount\zerocount\else\space\the\uccode\recurselevel\space\fi
@@ -488,30 +227,6 @@
\expandafter\newtoks\csname\@cas@\charactermapping\endcsname
\fi}
-\def\checkregimecode#1 %
- {\ifprotectregime\ifnum\catcode#1=\active\else
- \catcode#1\@@letter
- \fi\else
- \catcode#1\@@letter
- \fi
- \relax}
-
-% \def\definecasemap #1 #2 #3 % code lower upper
-% {\setmappingtoks
-% \doifelse{#2}{to}
-% {\appendtoks\presetcaserange{#1}{#3}\to\mappingtoks}
-% {\appendtoks\setcasemap #1 #2 #3 \to\mappingtoks}%
-% \ignorespaces}
-%
-% faster
-
-% \def\definecasemap #1 #2 #3 % code lower upper
-% {\setmappingtoks
-% \doifelse{#2}{to}
-% {\mappingtoks\@EA{\the\mappingtoks\presetcaserange{#1}{#3}}}
-% {\mappingtoks\@EA{\the\mappingtoks\setcasemap #1 #2 #3 }}%
-% \ignorespaces}
-
\def\definecasemap #1 #2 #3 % code lower upper
{\doifelse{#2}{to}
{\presetcaserange{#1}{#3}}
@@ -521,11 +236,6 @@
%D Saves a few tokens
-% \def\definecaseswap #1 #2 % lower upper
-% {\setmappingtoks
-% \mappingtoks\@EA{\the\mappingtoks\setcaseswap #1 #2 }%
-% \ignorespaces}
-
\def\definecaseswap #1 #2 % lower upper
{\lccode#1=#1\relax
\uccode#2=#2\relax
@@ -533,62 +243,14 @@
\uccode#1=#2\relax
\ignorespaces}
-% \def\definecaseself #1 % lower=upper=self
-% {\setmappingtoks
-% \mappingtoks\@EA{\the\mappingtoks\setcaseself #1 }%
-% \ignorespaces}
-
\def\definecaseself #1 % lower=upper=self
- {\lccode #1=#1\relax
- \uccode #1=#1\relax
+ {\lccode#1=#1\relax
+ \uccode#1=#1\relax
\ignorespaces}
%D Watch the \type {\definecasemap 127 to 255} option!
%D Dedicated to Taco there is also:
-% \def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
-% {\dostepwiserecurse{#1}{#2}\plusone
-% {\!!counta\recurselevel\advance\!!counta #3\relax
-% \!!countb\recurselevel\advance\!!countb #4\relax
-% \expanded{\definecasemap
-% \recurselevel\space\the\!!counta\space\the\!!countb\space}}%
-% \ignorespaces}
-
-% \beginETEX
-
-% % much faster, prelude to run time loading
-
-% % \def\doexpandcasemaps#1#2#3#4%
-% % {\ifnum#1>#2 %
-% % \expandafter\gobblefivearguments
-% % \else
-% % \noexpand\setcasemap#1\space\the\numexpr#1+#3\relax\space\the\numexpr#1+#4\relax\space
-% % \expandafter\expandafter\expandafter\doexpandcasemaps\expandafter
-% % \fi\expandafter{\the\numexpr#1+1\relax}{#2}{#3}{#4}}
-% %
-% % \def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
-% % {\setmappingtoks
-% % \expanded{\mappingtoks{\the\mappingtoks\doexpandcasemaps{#1}{#2}{#3}{#4}}}%
-% % \ignorespaces}
-
-% \def\doexpandcasemaps#1%
-% {\ifnum#1>\scratchcounter
-% \expandafter\gobbletwoarguments
-% \else
-% \noexpand\setcasemap#1\space\the\numexpr#1+\!!counta\relax\space\the\numexpr#1+\!!countb\relax\space
-% \expandafter\expandafter\expandafter\doexpandcasemaps\expandafter
-% \fi\expandafter{\the\numexpr#1+\plusone\relax}}
-
-% \def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
-% {\setmappingtoks
-% \scratchcounter#2\relax
-% \!!counta#3\relax
-% \!!countb#4\relax
-% \expanded{\mappingtoks{\the\mappingtoks\doexpandcasemaps{#1}}}%
-% \ignorespaces}
-
-% \endETEX
-
\def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
{\dostepwiserecurse{#1}{#2}\plusone
{\scratchcounter\recurselevel\advance\scratchcounter#3\lccode\recurselevel=\scratchcounter
@@ -606,71 +268,12 @@
%D
%D and saves a lot of typing (copying).
-% \def\resetcaserange #1 to #2
-% {\dostepwiserecurse{#1}{#2}{1}
-% {\expanded{\definecasemap\recurselevel\space0\space0\space}}}
-
-% \def\resetcaserange #1 to #2
-% {\setmappingtoks
-% \dostepwiserecurse{#1}{#2}\plusone
-% {\edef\@@expanded{\recurselevel\space}%
-% \@EA\appendtoks\@EA\setcasemap\@@expanded 0 0 \to\mappingtoks}%
-% \ignorespaces}
-%
-% faster:
-
-% \def\resetcaserange #1 to #2
-% {\setmappingtoks
-% \dostepwiserecurse{#1}{#2}\plusone
-% {\edef\@@expanded{\recurselevel\space}%
-% \mappingtoks\@EA\@EA\@EA{\@EA\the\@EA\mappingtoks\@EA\setcasemap\@@expanded 0 0 }}%
-% \ignorespaces}
-
-% \beginETEX
-
-% % much faster, prelude to run time loading
-
-% % \def\doexpandcaserange#1#2%
-% % {\ifnum#1>#2 %
-% % \expandafter\gobblethreearguments
-% % \else
-% % \noexpand\setcasemap #1 0 0 %
-% % \expandafter\expandafter\expandafter\doexpandcaserange\expandafter
-% % \fi\expandafter{\the\numexpr#1+1\relax}{#2}}
-% %
-% % \def\resetcaserange #1 to #2
-% % {\setmappingtoks
-% % \expanded{\mappingtoks{\the\mappingtoks\doexpandcaserange{#1}{#2}}}%
-% % \ignorespaces}
-
-% \def\doexpandcaserange#1%
-% {\ifnum#1>\scratchcounter
-% \expandafter\gobbletwoarguments
-% \else
-% \noexpand\setcasemap #1 0 0 %
-% \expandafter\expandafter\expandafter\doexpandcaserange\expandafter
-% \fi\expandafter{\the\numexpr#1+\plusone\relax}}
-
-% \def\resetcaserange #1 to #2
-% {\setmappingtoks
-% \scratchcounter#2\relax
-% \expanded{\mappingtoks{\the\mappingtoks\doexpandcaserange{#1}}}%
-% \ignorespaces}
-
-% \endETEX
-
\def\resetcaserange #1 to #2
{\dostepwiserecurse{#1}{#2}\plusone
{\lccode\recurselevel\zerocount
\uccode\recurselevel\zerocount}%
\ignorespaces}
-% \def\presetcaserange#1#2% could be pre-expanded
-% {\dostepwiserecurse{#1}{#2}\plusone
-% {\setregimecode\recurselevel\@@letter
-% \lccode \recurselevel=\recurselevel
-% \uccode \recurselevel=\recurselevel}}
-
\def\presetcaserange#1#2% could be pre-expanded
{\dostepwiserecurse{#1}{#2}\plusone
{\lccode\recurselevel=\recurselevel
@@ -678,77 +281,33 @@
\ignorespaces}
\def\setcasemap #1 #2 #3 %
- {\setregimecode{#1}\@@letter
+ {\settoletterunlessactive{#1}%
\lccode #1=#2
\uccode #1=#3 }
\def\setcaseswap #1 #2 %
- {\setregimecode{#1}\@@letter
- \setregimecode{#2}\@@letter
+ {\settoletterunlessactive{#1}%
+ \settoletterunlessactive{#2}%
\lccode #1=#1
\uccode #2=#2
\lccode #2=#1
\uccode #1=#2 }
\def\setcaseself #1 %
- {\setregimecode{#1}\@@letter
+ {\settoletterunlessactive{#1}%
\lccode #1=#1
\uccode #1=#1 }
-% \def\definespacemap #1 #2 % code sfcode
-% {\setmappingtoks
-% \appendtoks\setspacemap #1 #2 \to\mappingtoks
-% \ignorespaces}
-
-% faster:
-
-% \def\definespacemap #1 #2 % code sfcode
-% {\setmappingtoks
-% \mappingtoks\expandafter{\the\mappingtoks\setspacemap #1 #2 }%
-% \ignorespaces}
-
\def\definespacemap #1 #2 % code sfcode
{\sfcode#1=#2%
\ignorespaces}
\def\setspacemap #1 #2 %
- {\setregimecode{#1}\@@other
+ {\settootherunlessactive{#1}%
%\lccode #1=\zerocount
%\uccode #1=\zerocount
\sfcode #1=#2 }
-% \def\defineuppercasecom#1#2%
-% {\setmappingtoks
-% \appendtoks\setuppercasecom#1{#2}\to\mappingtoks
-% \ignorespaces}
-%
-% \def\definelowercasecom#1#2%
-% {\setmappingtoks
-% \appendtoks\setlowercasecom#1{#2}\to\mappingtoks
-% \ignorespaces}
-%
-% faster
-
-% \def\defineuppercasecom#1#2%
-% {\setmappingtoks
-% \mappingtoks\expandafter{\the\mappingtoks\setuppercasecom#1{#2}}%
-% \ignorespaces}
-
-% \def\definelowercasecom#1#2%
-% {\setmappingtoks
-% \mappingtoks\expandafter{\the\mappingtoks\setlowercasecom#1{#2}}%
-% \ignorespaces}
-
-% \def\defineuppercasecom#1#2%
-% {\setmappingtoks
-% \mappingtoks\expandafter{\the\mappingtoks\setuppercasecom#1{#2}}%
-% \ignorespaces}
-
-% \def\definelowercasecom#1#2%
-% {\setmappingtoks
-% \mappingtoks\expandafter{\the\mappingtoks\setlowercasecom#1{#2}}%
-% \ignorespaces}
-
\def\defineuppercasecom#1#2%
{\global\casecomtoks\expandafter{\the\casecomtoks\setuppercasecom#1{#2}}%
\ignorespaces}
@@ -889,7 +448,6 @@
\edef\characterencoding {@\s!default @}
\edef\nocharacterencoding {@\s!default @}
\edef\charactermapping {@\s!default @}
-\edef\characterregime {@\s!default @}
% todo, else \d j == \dj, print file and check
@@ -932,12 +490,6 @@
\edef\nocharacterencoding{@\ifsecondargument#2\else\s!default\fi @}%
\synchronizepatterns}
-%\def\enablesimpleencoding#1% e.g. \enableencoding{raw}
-% {\edef\characterencoding{@#1@}% handy for XML key=val's
-% \edef\nocharacterencoding{@\s!default @}} % evt noppes
-
-% in font switch and xml simple k/v remapping
-
\edef\xnocharacterencoding{@\s!default @}
\def\fastenableencoding#1%
@@ -950,10 +502,9 @@
\def\dostartencoding[#1][#2]% encoding regime
{%\showmessage\m!encodings1{#1}%
\pushmacro\characterencoding
- \pushmacro\characterregime
+ \pushmacro\currentregime
\pushmacro\dohandleaccent % still needed?
\pushmacro\dohandlecommand % still needed?
- %pushmacro\definesortkey
\pushmacro\doautosetregime
\let\dohandleaccent\donthandleaccent % still needed?
\let\dohandlecommand\donthandlecommand % still needed?
@@ -961,14 +512,13 @@
\edef\characterencoding{@#1@}%
\doifelsenothing{#2}%
{\let\doautosetregime\gobbletwoarguments}
- {\def\characterregime{@#2@}}}
+ {\def\currentregime{#2}}}
\def\stopencoding
{\popmacro\doautosetregime
- %popmacro\definesortkey
\popmacro\dohandlecommand % still needed?
\popmacro\dohandleaccent % still needed?
- \popmacro\characterregime
+ \popmacro\currentregime
\popmacro\characterencoding}
% probably obsolete (hm, not yet)
@@ -1008,31 +558,7 @@
%D {\flushsortkey}, a macro taking 4~arguments.
%D
%D This mechanism is currently being tested and subjected to
-%D changes!
-
-%D THS CODE IS OBSOLETE
-
-% \def\savesortkey#1#2#3#4%
-% {\let\flushsortkey\relax % important
-% \edef\!!stringa{sort:\characterencoding}%
-% \ifundefined\!!stringa
-% \let\!!stringb\empty
-% \else
-% \@EA\def\@EA\!!stringb\@EA{\csname\!!stringa\endcsname}%
-% \fi
-% \convertargument#1\to\asciiA \convertargument#2\to\asciiB
-% \convertargument#3\to\asciiC \convertargument#4\to\asciiD
-% \setevalue{\!!stringa}%
-% {\!!stringb\flushsortkey{\asciiA}{\asciiB}{\asciiC}{\asciiD}}}
-%
-% \def\definesortkey#1#2#3#4%
-% {}
-%
-% \def\flushsortkeys
-% {\enablelanguagespecifics[\currentlanguage]%
-% \getvalue{sort:\characterencoding}}
-%
-% \let\flushsortkey \relax
+%D changes! Obsolete:
\let\definesortkey\gobblefourarguments
\let\savesortkey \gobblefourarguments
@@ -1059,31 +585,6 @@
{\setvalue{\accentprefix\characterencoding#1\string#2}{\char#3 }} % space added
{\setvalue{\accentprefix\characterencoding#1\string#2}{#3}}}
-\beginTEX
-
-\def\dohandleaccent#1#2%
- {\@EA\ifx\csname\accentprefix\characterencoding#1\string#2\empty\endcsname\relax
- \@EA\ifx\csname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname\relax
- \@EA\ifx\csname\accentprefix\characterencoding#1\endcsname\relax
-% \@EA\ifx\csname\accentprefix\nocharacterencoding#1\endcsname\relax
-% \donormaltextaccent{#1}{#2}%
-% \else
- \csname\accentprefix\nocharacterencoding#1\endcsname{#2}%
-% \fi
- \else
- \csname\accentprefix\characterencoding#1\endcsname{#2}%
- \fi
- \else
- \csname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname
- \fi
- \else
- \csname\accentprefix\characterencoding#1\string#2\empty\endcsname
- \fi}
-
-\endTEX
-
-\beginETEX \ifcsname
-
\def\dohandleaccent#1#2%
{\ifcsname\accentprefix\characterencoding#1\string#2\empty\endcsname
\csname\accentprefix\characterencoding#1\string#2\empty\endcsname
@@ -1097,8 +598,6 @@
% \donormaltextaccent{#1}{#2}%
\fi\fi\fi}%\fi}
-\endETEX
-
%D In patterns, characters have to be bytes. These will be
%D mapped onto the compact pattern arrays.
@@ -1107,17 +606,13 @@
\def\patternchar#1 {\rawcharacter{#1}} % space is part of character definition !
-\ifx \enablepatterntokens\undefined
- \def\handlepatterntoken#1]{\csname#1\endcsname}
-\fi
+% \ifx \enablepatterntokens\undefined
+% \def\handlepatterntoken#1]{\csname#1\endcsname}
+% \fi
% we need to postpone catcode changes, e.g. hr patterns
% have \catcode" -> which fails when " is letter
-% new patterns, some day
-%
-% \enableregime[utf]%
-
\def\pathypsettings
{\ifx \enablepatterntokens\undefined
\defineactivecharacter [ {\handlepatterntoken}%
@@ -1165,16 +660,6 @@
{\egroup
\stopreadingfile}
-% \def\definecharacter#1 #2 %
-% {\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
-% \doifnumberelse{\string#2}
-% {\setvalue{\characterprefix\characterencoding\string#1}{\char#2 }% watch the space
-% \doautosetregime{#1}{#2}}
-% {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-
-% \def\numcharacter#1{\char#1 }
-% \let\dochar\numcharacter
-
\def\thechr#1{\char#1 } % just in case \relax interferes
\unexpanded\def\numchr#1{\char#1\relax}
\unexpanded\def\strchr#1{\csname#1\endcsname}
@@ -1186,48 +671,15 @@
\def\definecharacter#1 #2 %
{\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
-% \doifnumberelse{\string#2}
\doifnumberelse{\string#2}
{\setvalue{\characterprefix\characterencoding\string#1}{\dochar{#2}}%
\doautosetregime{#1}{#2}}
{\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-% better
-%
-% \def\definecharacter#1 #2 %
-% {\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
-% \doifnumberelse{\string#2}
-% {\setevalue{\characterprefix\characterencoding\string#1}{\noexpand\charofnum{\number#2}}% watch the space
-% \doautosetregime{#1}{#2}}
-% {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-%
-% \def\charofnum#1{\char#1 }
-% \def\byteofnum#1{\rawcharacter{#1}}
-
-\beginTEX
-
-\def\dohandlecharacter#1%
- {\csname\characterprefix\expandafter\ifx\csname\characterprefix\characterencoding#1\endcsname\relax
- \nocharacterencoding\else\characterencoding\fi#1\endcsname}
-
-% \def\dopatterncharacter#1%
-% {\csname\expandafter\ifx\csname\characterprefix\characterencoding#1\endcsname\relax
-% \strippedcsname\fallbackpatternchar\else\characterprefix\characterencoding#1\fi\endcsname}
-
-\endTEX
-
-\beginETEX \ifcsname
-
\def\dohandlecharacter#1%
{\csname\characterprefix\ifcsname\characterprefix\characterencoding#1\endcsname
\characterencoding\else\nocharacterencoding\fi#1\endcsname}
-% \def\dopatterncharacter#1%
-% {\csname\ifcsname\characterprefix\characterencoding#1\endcsname
-% \characterprefix\characterencoding#1\else\strippedcsname\fallbackpatternchar\fi\endcsname}
-
-\endETEX
-
% \def\fallbackpatternchar{x} % makes no sense, duplicate patterns
\def\defaultcharacter#1%
@@ -1240,20 +692,6 @@
%\redefinecommand #1 % just to be sure
\setvalue{\commandprefix\characterencoding\string#1}{#2}}
-% %D This one is needed in order to prevent problems with math (see \type
-% %D {\over} in dutch interface). This became a problem one when going
-% %D low level english.
-
-% \def\doifdefinedascommandelse#1%
-% {\bgroup
-% \convertargument\dohandlecommand{#1}\to\asciiA
-% \@EAEAEA\convertargument\csname#1\endcsname\to\asciiB
-% \ifx\asciiA\asciiB
-% \egroup\expandafter\firstoftwoarguments
-% \else
-% \egroup\expandafter\secondoftwoarguments
-% \fi}
-
%D Here we see that redefining accents is characters is more
%D or less the same as redefining commands. We also could have
%D said:
@@ -1263,48 +701,6 @@
%D \def\definecharacter#1 {\definecommand#1 \char}
%D \stoptyping
-% obsolete
-%
-% %D \macros
-% %D {redefineaccent}
-% %D
-% %D Telling \CONTEXT\ how to treat accents and special
-% %D characters is a two stage process. First we signal the
-% %D system which commands are to be adapted, after which we can
-% %D redefine their behavior when needed. We showed this in the
-% %D previous paragraphs. These redefinitions are grouped at the
-% %D end of this file, but we show some examples here.
-% %D
-% %D Accents or accent generating commands are redefined by:
-% %D
-% %D \starttyping
-% %D \redefineaccent ' % grave
-% %D \redefineaccent " % diaeresis
-% %D \redefineaccent ^ % circumflex
-% %D \redefineaccent v % caron
-% %D \stoptyping
-% %D
-% %D The original \PLAIN\ \TEX\ meaning of each accent generating
-% %D command is saved first. Next these commands are redefined to
-% %D do an indirect call to a macro that acts according to the
-% %D encoding vector in use.
-%
-% \def\redefineaccent%
-% {\protectfontcharacters
-% \doredefineaccent}
-%
-% \def\doredefineaccent#1 %
-% {\def\!!stringa{\nocharacterencoding\string#1}%
-% \doifundefined{\!!stringa}
-% {\@EA\letvalue\@EA\!!stringa\@EA=\csname\string#1\endcsname}%
-% % no \unexpanded, else pdfdoc fails
-% \setvalue{\string#1}{\dohandleaccent#1}%
-% \unprotectfontcharacters}
-%
-% \def\doredefineaccent#1 %
-% {\setvalue{#1}{\dohandleaccent{#1}}%
-% \unprotectfontcharacters}
-
%D \macros
%D {defineaccentcommand}
%D
@@ -1348,53 +744,6 @@
\let\normalchar =\char
\let\normalaccent=\accent
-% \beginETEX \ifcsname
-%
-% \unexpanded\def\dohandleaccent#1#2%
-% {\def\glyph{#2}%
-% \ifx\glyph\empty
-% \dohandleaccent#1\relax
-% \else\ifx\glyph\space
-% \dohandleaccent#1\relax
-% \else\ifcsname\characterencoding#1\string#2\empty\endcsname
-% \csname\characterencoding#1\string#2\endcsname
-% \else\ifcsname\characterencoding#1\endcsname
-% \csname\characterencoding#1\endcsname#2%
-% \else
-% \csname\nocharacterencoding#1\endcsname#2%
-% \fi\fi\fi\fi
-% \relax} % prevents further reading
-%
-% \endETEX
-%
-% \beginTEX
-%
-% \unexpanded\def\dohandleaccent#1#2%
-% {\def\glyph{#2}%
-% \ifx\glyph\empty
-% \dohandleaccent#1\relax
-% \else\ifx\glyph\space
-% \dohandleaccent#1\relax
-% \else\expandafter\ifx\csname\characterencoding#1\string#2\empty\endcsname\relax
-% \expandafter\ifx\csname\characterencoding#1\endcsname\relax
-% \csname\nocharacterencoding#1\endcsname#2%
-% \else
-% \csname\characterencoding#1\endcsname#2%
-% \fi
-% \else
-% \csname\characterencoding#1\string#2\endcsname
-% \fi\fi\fi
-% \relax} % prevents further reading
-%
-% \endTEX
-%
-% %D The trick with \type{\\} is needed to prevent spaces from
-% %D being gobbled after the accented character, should we have
-% %D used \type{\next}, we should have ended up with gobbled
-% %D spaces. The \type {\empty} after \type {#2} takes care of
-% %D empty arguments, so that we can savely say~\type{\"{}}
-% %D and alike.
-
%D \macros
%D {redefinecommand}
%D
@@ -1420,8 +769,6 @@
{% no \unexpanded, else pdfdoc fails
\setvalue{\string#1}{\dohandlecommand{#1}}}%
-\beginETEX \ifcsname
-
\def\dohandlecommand#1%
{\csname\commandprefix
\ifcsname\commandprefix\characterencoding#1\endcsname
@@ -1431,45 +778,13 @@
\fi
#1\endcsname}
-\endETEX
-
-\beginTEX
-
-\def\dohandlecommand#1%
- {\csname\commandprefix
- \expandafter\ifx\csname\commandprefix\characterencoding#1\endcsname\relax
- \nocharacterencoding
- \else
- \characterencoding
- \fi
- #1\endcsname}
-
-\endTEX
-
-% %D \macros
-% %D {redefinecharacter}
-% %D
-% %D Special characters, which differ from accented characters
-% %D in that they are to be presented as they are, are redefined
-% %D by
-% %D
-% %D \starttyping
-% %D \redefinecharacter ae % ae
-% %D \redefinecharacter cc % ccedilla
-% %D \stoptyping
-% %D
-% %D To keep things simple, we just copy this command:
-%
-% \let\redefinecharacter=\redefinecommand
-
%D \macros
-%D {currentencoding, currentregime, currentmapping}
+%D {currentencoding, currentmapping}
%D
%D When we show 'm, we don't want to see the protection
%D measures.
\def\currentencoding{\@EA\dopureencodingname\characterencoding}
-\def\currentregime {\@EA\dopureencodingname\characterregime }
\def\currentmapping {\@EA\dopureencodingname\charactermapping }
\def\dopureencodingname @#1@{#1}
@@ -1623,54 +938,13 @@
\newevery \everysanitize \EverySanitize
%D \macros
-%D {retainlccodes}
-%D
-%D One way of manipulating characters is changing the their
-%D \type{\lccode} and applying \type{\lowcase}. An example of
-%D this can be found in \type{spec-mis}.
-
-\ifx\retainlccodes\undefined
-
- \def\retainlccodes{\dostepwiserecurse{0}{255}{1}{\lccode\recurselevel=\recurselevel}\relax}
-
-\fi
-
-% %D \macros
-% %D {cc,CC}
-% %D
-% %D Hm, not in plain at all, those \cc's and \CC's.
-%
-% \def\CC{\c{C}}
-% \def\cc{\c{c}}
-%
-% %D \macros
-% %D {dotlessi,dotlessj}
-% %D
-% %D We also save both dotless~\dotlessi\ and~\dotlessj. This
-% %D way we still have them were we expect them, even when
-% %D macros of font providers redefine them.
-%
-% \let\dotlessi=\i
-% \let\dotlessj=\j
-
-%D \macros
%D {defineuclass,defineudigit,udigit}
%D
%D The next few macros are experimental and needed for unicoded
%D chinese characters.
-\beginETEX
- \def\defineuclass #1 #2 #3 %
- {\setvalue{uc\the\numexpr#2*256+#3\relax}{#1}}
-\endETEX
-
-\beginTEX
- \def\defineuclass #1 #2 #3 %
- {\scratchcounter256\relax
- \multiply\scratchcounter#2\relax
- \advance\scratchcounter#3\relax
- \setvalue{uc\the\scratchcounter}{#1}}
-\endTEX
+\def\defineuclass #1 #2 #3 %
+ {\setvalue{uc\the\numexpr#2*256+#3\relax}{#1}}
\def\defineudigit #1 #2 #3 {\setvalue{\characterencoding uc#1}{\uchar{#2}{#3}}}
@@ -1687,92 +961,6 @@
\def\octuchar#1#2{\uchar{`#1}{`#2}}
\def\hexuchar#1#2{\uchar{"#1}{"#2}}
-% %D Just to be sure, we save the original values of \type {\ss}.
-%
-% \ifx\undefined\SS \let\SS=\ss \fi
-% \ifx\undefined\sz \let\sz=\ss \fi
-%
-% %D Here come the definitions.
-%
-% \redefineaccent ' % grave
-% \redefineaccent ` % acute
-% \redefineaccent " % diaeresis
-% \redefineaccent ^ % circumflex
-% \redefineaccent ~ % tilde
-% \redefineaccent v % caron
-% \redefineaccent u % breve
-% \redefineaccent . % dotaccent
-% \redefineaccent H % hungarumlaut
-% \redefineaccent t % ........
-% \redefineaccent r % ........
-% \redefineaccent =
-% \redefineaccent b
-% \redefineaccent c
-% \redefineaccent d
-% \redefineaccent k
-
-% obsolete (moved)
-%
-% \redefinecharacter ae % ae
-% \redefinecharacter AE % AE
-% \redefinecharacter oe % oe
-% \redefinecharacter OE % OE
-% \redefinecharacter o % ostroke
-% \redefinecharacter O % Ostroke
-% \redefinecharacter sz % germandbls
-% \redefinecharacter SS % germandbls
-% \redefinecharacter aa % aring
-% \redefinecharacter AA % Aring
-
-% \redefinecharacter th
-% \redefinecharacter TH
-% \redefinecharacter ng
-% \redefinecharacter NG
-% \redefinecharacter ij
-% \redefinecharacter IJ
-%
-% \redefinecharacter i \redefinecharacter dotlessi
-% \redefinecharacter j \redefinecharacter dotlessj
-%
-% \redefinecharacter l
-% \redefinecharacter L
-
-% replaced
-%
-% \defineaccent " i {\"\i} \defineaccent " j {\"\j}
-% \defineaccent ^ i {\^\i} \defineaccent ^ j {\^\j}
-% \defineaccent ` i {\`\i} \defineaccent ` j {\`\j}
-% \defineaccent ' i {\'\i} \defineaccent ' j {\'\j}
-% \defineaccent ~ i {\~\i} \defineaccent ~ j {\~\j}
-
-% \redefinecharacter leftguillemot
-% \redefinecharacter rightguillemot
-% \redefinecharacter leftsubguillemot
-% \redefinecharacter rightsubguillemot
-
-% obsolete
-%
-% %D Some more:
-%
-% \startmapping[\s!default]
-%
-% \defineuppercasecom \i {I}
-% \defineuppercasecom \j {J}
-% \defineuppercasecom \sz {SS}
-% \defineuppercasecom \SS {SS}
-% \defineuppercasecom \l \L
-% \defineuppercasecom \ae \AE
-% \defineuppercasecom \aa \AA
-% \defineuppercasecom \o \O
-% \defineuppercasecom \oe \OE
-% \definelowercasecom \L \l
-% \definelowercasecom \AE \ae
-% \definelowercasecom \AA \aa
-% \definelowercasecom \O \o
-% \definelowercasecom \OE \oe
-%
-% \stopmapping
-
%D Basics and fallbacks.
\newif\ifignoreaccent
@@ -1807,24 +995,6 @@
% will be overloaded later
-%\def\definetextaccent#1 #2%
-% {\setvalue{\string#1}{#2}% will be overloaded
-% \setvalue{normaltextaccent\string#1}{#2}}
-%
-%\def\donormaltextaccent#1%
-% {\getvalue{normaltextaccent\string#1}}
-%
-%\definetextaccent ` {\buildtextaccent\textgrave}
-%\definetextaccent ' {\buildtextaccent\textacute}
-%\definetextaccent v {\buildtextaccent\textcaron}
-%\definetextaccent u {\buildtextaccent\textbreve}
-%\definetextaccent = {\buildtextaccent\textmacron}
-%\definetextaccent ^ {\buildtextaccent\textcircumflex}
-%\definetextaccent . {\buildtextaccent\textdotaccent}
-%\definetextaccent H {\buildtextaccent\texthungarumlaut}
-%\definetextaccent ~ {\buildtextaccent\texttilde}
-%\definetextaccent " {\buildtextaccent\textdiaeresis}
-
\definecommand ` {\buildtextaccent\textgrave}
\definecommand ' {\buildtextaccent\textacute}
\definecommand r {\buildtextaccent\textring}
@@ -1853,7 +1023,7 @@
{##\crcr\hbox{#5}\crcr
\hidewidth
\hskip#2\wd0
- \hskip-#3\fontdimen1\font % in plain 1ex * dimenless value
+ \hskip-#3\slantperpoint % in plain 1ex * dimenless value
\vbox to .2ex{\box0\vss}\hidewidth
\crcr}}}
@@ -1862,11 +1032,6 @@
\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}}
\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}}
-%\definetextaccent c {\buildtextcedilla}
-%\definetextaccent b {\buildtextmacron}
-%\definetextaccent d {\buildtextbottomdot}
-%\definetextaccent k {\buildtextogonek}
-
\definecommand c {\buildtextcedilla}
\definecommand b {\buildtextmacron}
\definecommand d {\buildtextbottomdot}
@@ -1886,7 +1051,7 @@
\hbox to \wd2 \bgroup
\hss\copy2\hss
\hskip-\wd2
- \hss\hskip#2\wd0\hskip-#3\fontdimen1\font\raise#1\hbox{#4}\hss
+ \hss\hskip#2\wd0\hskip-#3\slantperpoint\raise#1\hbox{#4}\hss
\egroup
\egroup}
@@ -1923,32 +1088,6 @@
\def\usepdffontresource #1 {} % this will be defined elsewhere
\fi
-%D Some day \unknown\
-
-% \def\useencodingvector #1 % file tag
-% {\pushmacro\definecharacter
-% \pushmacro\startencoding
-% \pushmacro\stopencoding
-% \def\definecharacter ##1 ##2 %
-% {\doifnumberelse{##2}
-% {\ifnum##2>127
-% \def\!!stringa{##2 }%
-% \@EA\@EA\@EA\defineactivetoken\@EA\!!stringa\@EA{\csname##1\endcsname}%
-% \fi}
-% {}}%
-% \def\startencoding[##1]{}
-% \def\stopencoding{\endinput}
-% \readfile{xxxx-#1}\donothing\donothing
-% \popmacro\stopencoding
-% \popmacro\startencoding
-% \popmacro\definecharacter}
-%
-% \startregime[ec]
-% \useencodingvector ec
-% \stopregime
-
-% new, to be documented (oeps, conflicts with existing code)
-
\def\donthandleaccent #1{\expandafter\string\csname#1\endcsname\space}
\def\donthandlecommand #1{\expandafter\string\csname#1\endcsname\space}
\def\donthandlecharacter #1{\expandafter\string\csname#1\endcsname\space}
@@ -1994,7 +1133,40 @@
\def\dohandlecommand {\uhandlecommand}%
\def\dohandlecharacter{\uhandlecharacter}}
-\def\convertencodedtokens{\dontexpandencoding}
+% no longer: \def\convertencodedtokens{\dontexpandencoding} but:
+
+\def\convertencodedtokens{\stringifyencodedtokens}
+
+% test case:
+%
+% \enableregime[cp1250]
+% \mainlanguage[cz]
+%
+% \starttext
+%
+% \title{Žluouècí konì úpí}
+% \placelist[chapter][criterium=all]
+%
+% \startbuffer
+% <chapter>
+% <title>Žluouècí konì úpí</title>
+% </chapter>
+% \stopbuffer
+%
+% \defineXMLenvironment
+% [chapter]
+% {\defineXMLsave[title]}
+% {\expanded{\chapter{\XMLflush{title}}}}
+% \processXMLbuffer
+%
+% \setuphead[chapter][expansion=yes]
+% \defineXMLenvironment
+% [chapter]
+% {\defineXMLsave[title]}
+% {\chapter{\XMLflush{title}}}
+% \processXMLbuffer
+%
+% \stoptext
%D Still valid? To be checked:
diff --git a/Master/texmf-dist/tex/context/base/enco-mis.tex b/Master/texmf-dist/tex/context/base/enco-mis.tex
index d3e5b7883cd..b04d4ab7dc6 100644
--- a/Master/texmf-dist/tex/context/base/enco-mis.tex
+++ b/Master/texmf-dist/tex/context/base/enco-mis.tex
@@ -42,7 +42,7 @@
% \dimen0=\ht0
% \advance\dimen0 1ex
% \dimen0=.45\dimen0
-% \dimen2=\withoutpt\the\fontdimen1\font\dimen0
+% \dimen2=\withoutpt\the\slantperpoint\dimen0
% \advance\dimen2 .5ex
% \rlap{\raise\dimen0\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.3em}}}%
% \box0
@@ -53,9 +53,9 @@
% \hbox\bgroup
% \setbox0\hbox{D}%
% \dimen0=.55\ht0
-% \dimen2=\withoutpt\the\fontdimen1\font\dimen0
+% \dimen2=\withoutpt\the\slantperpoint\dimen0
% \advance\dimen2 .15ex
-% \advance\dimen2 -.15\fontdimen7\font
+% \advance\dimen2 -.15\extraspace
% \rlap{\raise\dimen0\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.33em}}}%
% \box0
% \egroup}
@@ -66,7 +66,7 @@
\scratchdimen\ht\scratchbox
\advance\scratchdimen 1ex
\scratchdimen.45\scratchdimen
- \dimen2=\withoutpt\the\fontdimen1\font\dimen0
+ \dimen2=\withoutpt\the\slantperpoint\dimen0
\advance\dimen2 .5ex
\hbox to \wd\scratchbox
{\box\scratchbox\hss
@@ -78,9 +78,9 @@
% \hbox\bgroup
% \setbox\scratchbox\hbox{D}%
% \scratchdimen.55\ht\scratchbox
-% \dimen2=\withoutpt\the\fontdimen1\font\scratchdimen
+% \dimen2=\withoutpt\the\slantperpoint\scratchdimen
% \advance\dimen2 .15ex
-% \advance\dimen2 -.15\fontdimen7\font
+% \advance\dimen2 -.15\extraspace
% \hbox to \wd\scratchbox
% {\box\scratchbox\hss
% \raise\scratchdimen\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.3em}}}%
@@ -91,7 +91,7 @@
\hbox\bgroup
\setbox\scratchbox\hbox{D}%
\dimen2=1.1ex
- \dimen2=\withoutpt\the\fontdimen1\font\dimen2
+ \dimen2=\withoutpt\the\slantperpoint\dimen2
\hbox to \wd\scratchbox
{\rlap
{\raise.52\ht\scratchbox
diff --git a/Master/texmf-dist/tex/context/base/enco-pfr.tex b/Master/texmf-dist/tex/context/base/enco-pfr.tex
index a74a8c6a72a..52069bfe981 100644
--- a/Master/texmf-dist/tex/context/base/enco-pfr.tex
+++ b/Master/texmf-dist/tex/context/base/enco-pfr.tex
@@ -139,9 +139,39 @@
% alternatively we can use object references
+% fails when we switch back and forward between dvi/pdf mode
+%
+% \long\def\startpdffontresource[#1]#2\stoppdffontresource
+% {\doif{#1}\currentencoding{\doifdefined\pdffontresource
+% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}}
+
\long\def\startpdffontresource[#1]#2\stoppdffontresource
{\doif{#1}\currentencoding{\doifdefined\pdffontresource
- {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}}
+ {\expanded{\doshipoutpdffontresource{\getvalue{\pdffontresource}}{#2}}}}}
+
+\def\doshipoutpdffontresource#1#2%
+ {\ifnum\realpageno<\plustwo
+ \doglobal\appendtoks
+ \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi
+ \to\everyfirstshipout
+ \else
+ \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi
+ \fi}
+
+% cleaner but not better:
+%
+% \newtoks \collectedpdffontresources
+%
+% \def\doshipoutpdffontresource#1#2%
+% {\doglobal\appendtoks
+% \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi
+% \to \collectedpdffontresources}
+%
+% \def\dofluspdffontresources
+% {\the\collectedpdffontresources
+% \global\collectedpdffontresources\emptytoks}
+%
+% \appendtoks \dofluspdffontresources \to \everybeforeshipout
%D The reference to such a vector is to be handled at font
%D definition time, which is why we hook it into the font
diff --git a/Master/texmf-dist/tex/context/base/enco-xtx.tex b/Master/texmf-dist/tex/context/base/enco-xtx.tex
new file mode 100644
index 00000000000..26fd97dfbb3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/enco-xtx.tex
@@ -0,0 +1,1986 @@
+% filename : enco-xtx.tex
+% comment : poor man's alternative for a proper enco file
+% author : Hans Hagen, PRAGMA-ADE, Hasselt NL
+% copyright: PRAGMA ADE / ConTeXt Development Team
+% license : see context related readme files
+
+\ifx\setcclcuc\undefined
+
+ \def\setcclcuc #1 #2 #3 %
+ {\global\catcode"#1=11
+ \global\lccode "#1="#2
+ \global\uccode "#1="#3 }
+
+\fi
+
+\setcclcuc 0041 0061 0041 % LATIN CAPITAL LETTER A
+\setcclcuc 0042 0062 0042 % LATIN CAPITAL LETTER B
+\setcclcuc 0043 0063 0043 % LATIN CAPITAL LETTER C
+\setcclcuc 0044 0064 0044 % LATIN CAPITAL LETTER D
+\setcclcuc 0045 0065 0045 % LATIN CAPITAL LETTER E
+\setcclcuc 0046 0066 0046 % LATIN CAPITAL LETTER F
+\setcclcuc 0047 0067 0047 % LATIN CAPITAL LETTER G
+\setcclcuc 0048 0068 0048 % LATIN CAPITAL LETTER H
+\setcclcuc 0049 0069 0049 % LATIN CAPITAL LETTER I
+\setcclcuc 004A 006A 004A % LATIN CAPITAL LETTER J
+\setcclcuc 004B 006B 004B % LATIN CAPITAL LETTER K
+\setcclcuc 004C 006C 004C % LATIN CAPITAL LETTER L
+\setcclcuc 004D 006D 004D % LATIN CAPITAL LETTER M
+\setcclcuc 004E 006E 004E % LATIN CAPITAL LETTER N
+\setcclcuc 004F 006F 004F % LATIN CAPITAL LETTER O
+\setcclcuc 0050 0070 0050 % LATIN CAPITAL LETTER P
+\setcclcuc 0051 0071 0051 % LATIN CAPITAL LETTER Q
+\setcclcuc 0052 0072 0052 % LATIN CAPITAL LETTER R
+\setcclcuc 0053 0073 0053 % LATIN CAPITAL LETTER S
+\setcclcuc 0054 0074 0054 % LATIN CAPITAL LETTER T
+\setcclcuc 0055 0075 0055 % LATIN CAPITAL LETTER U
+\setcclcuc 0056 0076 0056 % LATIN CAPITAL LETTER V
+\setcclcuc 0057 0077 0057 % LATIN CAPITAL LETTER W
+\setcclcuc 0058 0078 0058 % LATIN CAPITAL LETTER X
+\setcclcuc 0059 0079 0059 % LATIN CAPITAL LETTER Y
+\setcclcuc 005A 007A 005A % LATIN CAPITAL LETTER Z
+\setcclcuc 0061 0061 0041 % LATIN SMALL LETTER A
+\setcclcuc 0062 0062 0042 % LATIN SMALL LETTER B
+\setcclcuc 0063 0063 0043 % LATIN SMALL LETTER C
+\setcclcuc 0064 0064 0044 % LATIN SMALL LETTER D
+\setcclcuc 0065 0065 0045 % LATIN SMALL LETTER E
+\setcclcuc 0066 0066 0046 % LATIN SMALL LETTER F
+\setcclcuc 0067 0067 0047 % LATIN SMALL LETTER G
+\setcclcuc 0068 0068 0048 % LATIN SMALL LETTER H
+\setcclcuc 0069 0069 0049 % LATIN SMALL LETTER I
+\setcclcuc 006A 006A 004A % LATIN SMALL LETTER J
+\setcclcuc 006B 006B 004B % LATIN SMALL LETTER K
+\setcclcuc 006C 006C 004C % LATIN SMALL LETTER L
+\setcclcuc 006D 006D 004D % LATIN SMALL LETTER M
+\setcclcuc 006E 006E 004E % LATIN SMALL LETTER N
+\setcclcuc 006F 006F 004F % LATIN SMALL LETTER O
+\setcclcuc 0070 0070 0050 % LATIN SMALL LETTER P
+\setcclcuc 0071 0071 0051 % LATIN SMALL LETTER Q
+\setcclcuc 0072 0072 0052 % LATIN SMALL LETTER R
+\setcclcuc 0073 0073 0053 % LATIN SMALL LETTER S
+\setcclcuc 0074 0074 0054 % LATIN SMALL LETTER T
+\setcclcuc 0075 0075 0055 % LATIN SMALL LETTER U
+\setcclcuc 0076 0076 0056 % LATIN SMALL LETTER V
+\setcclcuc 0077 0077 0057 % LATIN SMALL LETTER W
+\setcclcuc 0078 0078 0058 % LATIN SMALL LETTER X
+\setcclcuc 0079 0079 0059 % LATIN SMALL LETTER Y
+\setcclcuc 007A 007A 005A % LATIN SMALL LETTER Z
+\setcclcuc 00AA 00AA 00AA % FEMININE ORDINAL INDICATOR
+\setcclcuc 00B5 00B5 039C % MICRO SIGN
+\setcclcuc 00BA 00BA 00BA % MASCULINE ORDINAL INDICATOR
+\setcclcuc 00C0 00E0 00C0 % LATIN CAPITAL LETTER A WITH GRAVE
+\setcclcuc 00C1 00E1 00C1 % LATIN CAPITAL LETTER A WITH ACUTE
+\setcclcuc 00C2 00E2 00C2 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\setcclcuc 00C3 00E3 00C3 % LATIN CAPITAL LETTER A WITH TILDE
+\setcclcuc 00C4 00E4 00C4 % LATIN CAPITAL LETTER A WITH DIAERESIS
+\setcclcuc 00C5 00E5 00C5 % LATIN CAPITAL LETTER A WITH RING ABOVE
+\setcclcuc 00C6 00E6 00C6 % LATIN CAPITAL LETTER AE
+\setcclcuc 00C7 00E7 00C7 % LATIN CAPITAL LETTER C WITH CEDILLA
+\setcclcuc 00C8 00E8 00C8 % LATIN CAPITAL LETTER E WITH GRAVE
+\setcclcuc 00C9 00E9 00C9 % LATIN CAPITAL LETTER E WITH ACUTE
+\setcclcuc 00CA 00EA 00CA % LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\setcclcuc 00CB 00EB 00CB % LATIN CAPITAL LETTER E WITH DIAERESIS
+\setcclcuc 00CC 00EC 00CC % LATIN CAPITAL LETTER I WITH GRAVE
+\setcclcuc 00CD 00ED 00CD % LATIN CAPITAL LETTER I WITH ACUTE
+\setcclcuc 00CE 00EE 00CE % LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\setcclcuc 00CF 00EF 00CF % LATIN CAPITAL LETTER I WITH DIAERESIS
+\setcclcuc 00D0 00F0 00D0 % LATIN CAPITAL LETTER ETH
+\setcclcuc 00D1 00F1 00D1 % LATIN CAPITAL LETTER N WITH TILDE
+\setcclcuc 00D2 00F2 00D2 % LATIN CAPITAL LETTER O WITH GRAVE
+\setcclcuc 00D3 00F3 00D3 % LATIN CAPITAL LETTER O WITH ACUTE
+\setcclcuc 00D4 00F4 00D4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\setcclcuc 00D5 00F5 00D5 % LATIN CAPITAL LETTER O WITH TILDE
+\setcclcuc 00D6 00F6 00D6 % LATIN CAPITAL LETTER O WITH DIAERESIS
+\setcclcuc 00D8 00F8 00D8 % LATIN CAPITAL LETTER O WITH STROKE
+\setcclcuc 00D9 00F9 00D9 % LATIN CAPITAL LETTER U WITH GRAVE
+\setcclcuc 00DA 00FA 00DA % LATIN CAPITAL LETTER U WITH ACUTE
+\setcclcuc 00DB 00FB 00DB % LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\setcclcuc 00DC 00FC 00DC % LATIN CAPITAL LETTER U WITH DIAERESIS
+\setcclcuc 00DD 00FD 00DD % LATIN CAPITAL LETTER Y WITH ACUTE
+\setcclcuc 00DE 00FE 00DE % LATIN CAPITAL LETTER THORN
+\setcclcuc 00DF 00DF 00DF % LATIN SMALL LETTER SHARP S
+\setcclcuc 00E0 00E0 00C0 % LATIN SMALL LETTER A WITH GRAVE
+\setcclcuc 00E1 00E1 00C1 % LATIN SMALL LETTER A WITH ACUTE
+\setcclcuc 00E2 00E2 00C2 % LATIN SMALL LETTER A WITH CIRCUMFLEX
+\setcclcuc 00E3 00E3 00C3 % LATIN SMALL LETTER A WITH TILDE
+\setcclcuc 00E4 00E4 00C4 % LATIN SMALL LETTER A WITH DIAERESIS
+\setcclcuc 00E5 00E5 00C5 % LATIN SMALL LETTER A WITH RING ABOVE
+\setcclcuc 00E6 00E6 00C6 % LATIN SMALL LETTER AE
+\setcclcuc 00E7 00E7 00C7 % LATIN SMALL LETTER C WITH CEDILLA
+\setcclcuc 00E8 00E8 00C8 % LATIN SMALL LETTER E WITH GRAVE
+\setcclcuc 00E9 00E9 00C9 % LATIN SMALL LETTER E WITH ACUTE
+\setcclcuc 00EA 00EA 00CA % LATIN SMALL LETTER E WITH CIRCUMFLEX
+\setcclcuc 00EB 00EB 00CB % LATIN SMALL LETTER E WITH DIAERESIS
+\setcclcuc 00EC 00EC 00CC % LATIN SMALL LETTER I WITH GRAVE
+\setcclcuc 00ED 00ED 00CD % LATIN SMALL LETTER I WITH ACUTE
+\setcclcuc 00EE 00EE 00CE % LATIN SMALL LETTER I WITH CIRCUMFLEX
+\setcclcuc 00EF 00EF 00CF % LATIN SMALL LETTER I WITH DIAERESIS
+\setcclcuc 00F0 00F0 00D0 % LATIN SMALL LETTER ETH
+\setcclcuc 00F1 00F1 00D1 % LATIN SMALL LETTER N WITH TILDE
+\setcclcuc 00F2 00F2 00D2 % LATIN SMALL LETTER O WITH GRAVE
+\setcclcuc 00F3 00F3 00D3 % LATIN SMALL LETTER O WITH ACUTE
+\setcclcuc 00F4 00F4 00D4 % LATIN SMALL LETTER O WITH CIRCUMFLEX
+\setcclcuc 00F5 00F5 00D5 % LATIN SMALL LETTER O WITH TILDE
+\setcclcuc 00F6 00F6 00D6 % LATIN SMALL LETTER O WITH DIAERESIS
+\setcclcuc 00F8 00F8 00D8 % LATIN SMALL LETTER O WITH STROKE
+\setcclcuc 00F9 00F9 00D9 % LATIN SMALL LETTER U WITH GRAVE
+\setcclcuc 00FA 00FA 00DA % LATIN SMALL LETTER U WITH ACUTE
+\setcclcuc 00FB 00FB 00DB % LATIN SMALL LETTER U WITH CIRCUMFLEX
+\setcclcuc 00FC 00FC 00DC % LATIN SMALL LETTER U WITH DIAERESIS
+\setcclcuc 00FD 00FD 00DD % LATIN SMALL LETTER Y WITH ACUTE
+\setcclcuc 00FE 00FE 00DE % LATIN SMALL LETTER THORN
+\setcclcuc 00FF 00FF 0178 % LATIN SMALL LETTER Y WITH DIAERESIS
+\setcclcuc 0100 0101 0100 % LATIN CAPITAL LETTER A WITH MACRON
+\setcclcuc 0101 0101 0100 % LATIN SMALL LETTER A WITH MACRON
+\setcclcuc 0102 0103 0102 % LATIN CAPITAL LETTER A WITH BREVE
+\setcclcuc 0103 0103 0102 % LATIN SMALL LETTER A WITH BREVE
+\setcclcuc 0104 0105 0104 % LATIN CAPITAL LETTER A WITH OGONEK
+\setcclcuc 0105 0105 0104 % LATIN SMALL LETTER A WITH OGONEK
+\setcclcuc 0106 0107 0106 % LATIN CAPITAL LETTER C WITH ACUTE
+\setcclcuc 0107 0107 0106 % LATIN SMALL LETTER C WITH ACUTE
+\setcclcuc 0108 0109 0108 % LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+\setcclcuc 0109 0109 0108 % LATIN SMALL LETTER C WITH CIRCUMFLEX
+\setcclcuc 010A 010B 010A % LATIN CAPITAL LETTER C WITH DOT ABOVE
+\setcclcuc 010B 010B 010A % LATIN SMALL LETTER C WITH DOT ABOVE
+\setcclcuc 010C 010D 010C % LATIN CAPITAL LETTER C WITH CARON
+\setcclcuc 010D 010D 010C % LATIN SMALL LETTER C WITH CARON
+\setcclcuc 010E 010F 010E % LATIN CAPITAL LETTER D WITH CARON
+\setcclcuc 010F 010F 010E % LATIN SMALL LETTER D WITH CARON
+\setcclcuc 0110 0111 0110 % LATIN CAPITAL LETTER D WITH STROKE
+\setcclcuc 0111 0111 0110 % LATIN SMALL LETTER D WITH STROKE
+\setcclcuc 0112 0113 0112 % LATIN CAPITAL LETTER E WITH MACRON
+\setcclcuc 0113 0113 0112 % LATIN SMALL LETTER E WITH MACRON
+\setcclcuc 0114 0115 0114 % LATIN CAPITAL LETTER E WITH BREVE
+\setcclcuc 0115 0115 0114 % LATIN SMALL LETTER E WITH BREVE
+\setcclcuc 0116 0117 0116 % LATIN CAPITAL LETTER E WITH DOT ABOVE
+\setcclcuc 0117 0117 0116 % LATIN SMALL LETTER E WITH DOT ABOVE
+\setcclcuc 0118 0119 0118 % LATIN CAPITAL LETTER E WITH OGONEK
+\setcclcuc 0119 0119 0118 % LATIN SMALL LETTER E WITH OGONEK
+\setcclcuc 011A 011B 011A % LATIN CAPITAL LETTER E WITH CARON
+\setcclcuc 011B 011B 011A % LATIN SMALL LETTER E WITH CARON
+\setcclcuc 011C 011D 011C % LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+\setcclcuc 011D 011D 011C % LATIN SMALL LETTER G WITH CIRCUMFLEX
+\setcclcuc 011E 011F 011E % LATIN CAPITAL LETTER G WITH BREVE
+\setcclcuc 011F 011F 011E % LATIN SMALL LETTER G WITH BREVE
+\setcclcuc 0120 0121 0120 % LATIN CAPITAL LETTER G WITH DOT ABOVE
+\setcclcuc 0121 0121 0120 % LATIN SMALL LETTER G WITH DOT ABOVE
+\setcclcuc 0122 0123 0122 % LATIN CAPITAL LETTER G WITH CEDILLA
+\setcclcuc 0123 0123 0122 % LATIN SMALL LETTER G WITH CEDILLA
+\setcclcuc 0124 0125 0124 % LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+\setcclcuc 0125 0125 0124 % LATIN SMALL LETTER H WITH CIRCUMFLEX
+\setcclcuc 0126 0127 0126 % LATIN CAPITAL LETTER H WITH STROKE
+\setcclcuc 0127 0127 0126 % LATIN SMALL LETTER H WITH STROKE
+\setcclcuc 0128 0129 0128 % LATIN CAPITAL LETTER I WITH TILDE
+\setcclcuc 0129 0129 0128 % LATIN SMALL LETTER I WITH TILDE
+\setcclcuc 012A 012B 012A % LATIN CAPITAL LETTER I WITH MACRON
+\setcclcuc 012B 012B 012A % LATIN SMALL LETTER I WITH MACRON
+\setcclcuc 012C 012D 012C % LATIN CAPITAL LETTER I WITH BREVE
+\setcclcuc 012D 012D 012C % LATIN SMALL LETTER I WITH BREVE
+\setcclcuc 012E 012F 012E % LATIN CAPITAL LETTER I WITH OGONEK
+\setcclcuc 012F 012F 012E % LATIN SMALL LETTER I WITH OGONEK
+\setcclcuc 0130 0069 0130 % LATIN CAPITAL LETTER I WITH DOT ABOVE
+\setcclcuc 0131 0131 0049 % LATIN SMALL LETTER DOTLESS I
+\setcclcuc 0132 0133 0132 % LATIN CAPITAL LIGATURE IJ
+\setcclcuc 0133 0133 0132 % LATIN SMALL LIGATURE IJ
+\setcclcuc 0134 0135 0134 % LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+\setcclcuc 0135 0135 0134 % LATIN SMALL LETTER J WITH CIRCUMFLEX
+\setcclcuc 0136 0137 0136 % LATIN CAPITAL LETTER K WITH CEDILLA
+\setcclcuc 0137 0137 0136 % LATIN SMALL LETTER K WITH CEDILLA
+\setcclcuc 0138 0138 0138 % LATIN SMALL LETTER KRA
+\setcclcuc 0139 013A 0139 % LATIN CAPITAL LETTER L WITH ACUTE
+\setcclcuc 013A 013A 0139 % LATIN SMALL LETTER L WITH ACUTE
+\setcclcuc 013B 013C 013B % LATIN CAPITAL LETTER L WITH CEDILLA
+\setcclcuc 013C 013C 013B % LATIN SMALL LETTER L WITH CEDILLA
+\setcclcuc 013D 013E 013D % LATIN CAPITAL LETTER L WITH CARON
+\setcclcuc 013E 013E 013D % LATIN SMALL LETTER L WITH CARON
+\setcclcuc 013F 0140 013F % LATIN CAPITAL LETTER L WITH MIDDLE DOT
+\setcclcuc 0140 0140 013F % LATIN SMALL LETTER L WITH MIDDLE DOT
+\setcclcuc 0141 0142 0141 % LATIN CAPITAL LETTER L WITH STROKE
+\setcclcuc 0142 0142 0141 % LATIN SMALL LETTER L WITH STROKE
+\setcclcuc 0143 0144 0143 % LATIN CAPITAL LETTER N WITH ACUTE
+\setcclcuc 0144 0144 0143 % LATIN SMALL LETTER N WITH ACUTE
+\setcclcuc 0145 0146 0145 % LATIN CAPITAL LETTER N WITH CEDILLA
+\setcclcuc 0146 0146 0145 % LATIN SMALL LETTER N WITH CEDILLA
+\setcclcuc 0147 0148 0147 % LATIN CAPITAL LETTER N WITH CARON
+\setcclcuc 0148 0148 0147 % LATIN SMALL LETTER N WITH CARON
+\setcclcuc 0149 0149 0149 % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
+\setcclcuc 014A 014B 014A % LATIN CAPITAL LETTER ENG
+\setcclcuc 014B 014B 014A % LATIN SMALL LETTER ENG
+\setcclcuc 014C 014D 014C % LATIN CAPITAL LETTER O WITH MACRON
+\setcclcuc 014D 014D 014C % LATIN SMALL LETTER O WITH MACRON
+\setcclcuc 014E 014F 014E % LATIN CAPITAL LETTER O WITH BREVE
+\setcclcuc 014F 014F 014E % LATIN SMALL LETTER O WITH BREVE
+\setcclcuc 0150 0151 0150 % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\setcclcuc 0151 0151 0150 % LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\setcclcuc 0152 0153 0152 % LATIN CAPITAL LIGATURE OE
+\setcclcuc 0153 0153 0152 % LATIN SMALL LIGATURE OE
+\setcclcuc 0154 0155 0154 % LATIN CAPITAL LETTER R WITH ACUTE
+\setcclcuc 0155 0155 0154 % LATIN SMALL LETTER R WITH ACUTE
+\setcclcuc 0156 0157 0156 % LATIN CAPITAL LETTER R WITH CEDILLA
+\setcclcuc 0157 0157 0156 % LATIN SMALL LETTER R WITH CEDILLA
+\setcclcuc 0158 0159 0158 % LATIN CAPITAL LETTER R WITH CARON
+\setcclcuc 0159 0159 0158 % LATIN SMALL LETTER R WITH CARON
+\setcclcuc 015A 015B 015A % LATIN CAPITAL LETTER S WITH ACUTE
+\setcclcuc 015B 015B 015A % LATIN SMALL LETTER S WITH ACUTE
+\setcclcuc 015C 015D 015C % LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+\setcclcuc 015D 015D 015C % LATIN SMALL LETTER S WITH CIRCUMFLEX
+\setcclcuc 015E 015F 015E % LATIN CAPITAL LETTER S WITH CEDILLA
+\setcclcuc 015F 015F 015E % LATIN SMALL LETTER S WITH CEDILLA
+\setcclcuc 0160 0161 0160 % LATIN CAPITAL LETTER S WITH CARON
+\setcclcuc 0161 0161 0160 % LATIN SMALL LETTER S WITH CARON
+\setcclcuc 0162 0163 0162 % LATIN CAPITAL LETTER T WITH CEDILLA
+\setcclcuc 0163 0163 0162 % LATIN SMALL LETTER T WITH CEDILLA
+\setcclcuc 0164 0165 0164 % LATIN CAPITAL LETTER T WITH CARON
+\setcclcuc 0165 0165 0164 % LATIN SMALL LETTER T WITH CARON
+\setcclcuc 0166 0167 0166 % LATIN CAPITAL LETTER T WITH STROKE
+\setcclcuc 0167 0167 0166 % LATIN SMALL LETTER T WITH STROKE
+\setcclcuc 0168 0169 0168 % LATIN CAPITAL LETTER U WITH TILDE
+\setcclcuc 0169 0169 0168 % LATIN SMALL LETTER U WITH TILDE
+\setcclcuc 016A 016B 016A % LATIN CAPITAL LETTER U WITH MACRON
+\setcclcuc 016B 016B 016A % LATIN SMALL LETTER U WITH MACRON
+\setcclcuc 016C 016D 016C % LATIN CAPITAL LETTER U WITH BREVE
+\setcclcuc 016D 016D 016C % LATIN SMALL LETTER U WITH BREVE
+\setcclcuc 016E 016F 016E % LATIN CAPITAL LETTER U WITH RING ABOVE
+\setcclcuc 016F 016F 016E % LATIN SMALL LETTER U WITH RING ABOVE
+\setcclcuc 0170 0171 0170 % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\setcclcuc 0171 0171 0170 % LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\setcclcuc 0172 0173 0172 % LATIN CAPITAL LETTER U WITH OGONEK
+\setcclcuc 0173 0173 0172 % LATIN SMALL LETTER U WITH OGONEK
+\setcclcuc 0174 0175 0174 % LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+\setcclcuc 0175 0175 0174 % LATIN SMALL LETTER W WITH CIRCUMFLEX
+\setcclcuc 0176 0177 0176 % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+\setcclcuc 0177 0177 0176 % LATIN SMALL LETTER Y WITH CIRCUMFLEX
+\setcclcuc 0178 00FF 0178 % LATIN CAPITAL LETTER Y WITH DIAERESIS
+\setcclcuc 0179 017A 0179 % LATIN CAPITAL LETTER Z WITH ACUTE
+\setcclcuc 017A 017A 0179 % LATIN SMALL LETTER Z WITH ACUTE
+\setcclcuc 017B 017C 017B % LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\setcclcuc 017C 017C 017B % LATIN SMALL LETTER Z WITH DOT ABOVE
+\setcclcuc 017D 017E 017D % LATIN CAPITAL LETTER Z WITH CARON
+\setcclcuc 017E 017E 017D % LATIN SMALL LETTER Z WITH CARON
+\setcclcuc 017F 017F 0053 % LATIN SMALL LETTER LONG S
+\setcclcuc 0180 0180 0243 % LATIN SMALL LETTER B WITH STROKE
+\setcclcuc 0181 0253 0181 % LATIN CAPITAL LETTER B WITH HOOK
+\setcclcuc 0182 0183 0182 % LATIN CAPITAL LETTER B WITH TOPBAR
+\setcclcuc 0183 0183 0182 % LATIN SMALL LETTER B WITH TOPBAR
+\setcclcuc 0184 0185 0184 % LATIN CAPITAL LETTER TONE SIX
+\setcclcuc 0185 0185 0184 % LATIN SMALL LETTER TONE SIX
+\setcclcuc 0186 0254 0186 % LATIN CAPITAL LETTER OPEN O
+\setcclcuc 0187 0188 0187 % LATIN CAPITAL LETTER C WITH HOOK
+\setcclcuc 0188 0188 0187 % LATIN SMALL LETTER C WITH HOOK
+\setcclcuc 0189 0256 0189 % LATIN CAPITAL LETTER AFRICAN D
+\setcclcuc 018A 0257 018A % LATIN CAPITAL LETTER D WITH HOOK
+\setcclcuc 018B 018C 018B % LATIN CAPITAL LETTER D WITH TOPBAR
+\setcclcuc 018C 018C 018B % LATIN SMALL LETTER D WITH TOPBAR
+\setcclcuc 018D 018D 018D % LATIN SMALL LETTER TURNED DELTA
+\setcclcuc 018E 01DD 018E % LATIN CAPITAL LETTER REVERSED E
+\setcclcuc 018F 0259 018F % LATIN CAPITAL LETTER SCHWA
+\setcclcuc 0190 025B 0190 % LATIN CAPITAL LETTER OPEN E
+\setcclcuc 0191 0192 0191 % LATIN CAPITAL LETTER F WITH HOOK
+\setcclcuc 0192 0192 0191 % LATIN SMALL LETTER F WITH HOOK
+\setcclcuc 0193 0260 0193 % LATIN CAPITAL LETTER G WITH HOOK
+\setcclcuc 0194 0263 0194 % LATIN CAPITAL LETTER GAMMA
+\setcclcuc 0195 0195 01F6 % LATIN SMALL LETTER HV
+\setcclcuc 0196 0269 0196 % LATIN CAPITAL LETTER IOTA
+\setcclcuc 0197 0268 0197 % LATIN CAPITAL LETTER I WITH STROKE
+\setcclcuc 0198 0199 0198 % LATIN CAPITAL LETTER K WITH HOOK
+\setcclcuc 0199 0199 0198 % LATIN SMALL LETTER K WITH HOOK
+\setcclcuc 019A 019A 023D % LATIN SMALL LETTER L WITH BAR
+\setcclcuc 019B 019B 019B % LATIN SMALL LETTER LAMBDA WITH STROKE
+\setcclcuc 019C 026F 019C % LATIN CAPITAL LETTER TURNED M
+\setcclcuc 019D 0272 019D % LATIN CAPITAL LETTER N WITH LEFT HOOK
+\setcclcuc 019E 019E 0220 % LATIN SMALL LETTER N WITH LONG RIGHT LEG
+\setcclcuc 019F 0275 019F % LATIN CAPITAL LETTER O WITH MIDDLE TILDE
+\setcclcuc 01A0 01A1 01A0 % LATIN CAPITAL LETTER O WITH HORN
+\setcclcuc 01A1 01A1 01A0 % LATIN SMALL LETTER O WITH HORN
+\setcclcuc 01A2 01A3 01A2 % LATIN CAPITAL LETTER OI
+\setcclcuc 01A3 01A3 01A2 % LATIN SMALL LETTER OI
+\setcclcuc 01A4 01A5 01A4 % LATIN CAPITAL LETTER P WITH HOOK
+\setcclcuc 01A5 01A5 01A4 % LATIN SMALL LETTER P WITH HOOK
+\setcclcuc 01A6 0280 01A6 % LATIN LETTER YR
+\setcclcuc 01A7 01A8 01A7 % LATIN CAPITAL LETTER TONE TWO
+\setcclcuc 01A8 01A8 01A7 % LATIN SMALL LETTER TONE TWO
+\setcclcuc 01A9 0283 01A9 % LATIN CAPITAL LETTER ESH
+\setcclcuc 01AA 01AA 01AA % LATIN LETTER REVERSED ESH LOOP
+\setcclcuc 01AB 01AB 01AB % LATIN SMALL LETTER T WITH PALATAL HOOK
+\setcclcuc 01AC 01AD 01AC % LATIN CAPITAL LETTER T WITH HOOK
+\setcclcuc 01AD 01AD 01AC % LATIN SMALL LETTER T WITH HOOK
+\setcclcuc 01AE 0288 01AE % LATIN CAPITAL LETTER T WITH RETROFLEX HOOK
+\setcclcuc 01AF 01B0 01AF % LATIN CAPITAL LETTER U WITH HORN
+\setcclcuc 01B0 01B0 01AF % LATIN SMALL LETTER U WITH HORN
+\setcclcuc 01B1 028A 01B1 % LATIN CAPITAL LETTER UPSILON
+\setcclcuc 01B2 028B 01B2 % LATIN CAPITAL LETTER V WITH HOOK
+\setcclcuc 01B3 01B4 01B3 % LATIN CAPITAL LETTER Y WITH HOOK
+\setcclcuc 01B4 01B4 01B3 % LATIN SMALL LETTER Y WITH HOOK
+\setcclcuc 01B5 01B6 01B5 % LATIN CAPITAL LETTER Z WITH STROKE
+\setcclcuc 01B6 01B6 01B5 % LATIN SMALL LETTER Z WITH STROKE
+\setcclcuc 01B7 0292 01B7 % LATIN CAPITAL LETTER EZH
+\setcclcuc 01B8 01B9 01B8 % LATIN CAPITAL LETTER EZH REVERSED
+\setcclcuc 01B9 01B9 01B8 % LATIN SMALL LETTER EZH REVERSED
+\setcclcuc 01BA 01BA 01BA % LATIN SMALL LETTER EZH WITH TAIL
+\setcclcuc 01BC 01BD 01BC % LATIN CAPITAL LETTER TONE FIVE
+\setcclcuc 01BD 01BD 01BC % LATIN SMALL LETTER TONE FIVE
+\setcclcuc 01BE 01BE 01BE % LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE
+\setcclcuc 01BF 01BF 01F7 % LATIN LETTER WYNN
+\setcclcuc 01C4 01C6 01C5 % LATIN CAPITAL LETTER DZ WITH CARON
+\setcclcuc 01C5 01C6 01C4 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+\setcclcuc 01C6 01C6 01C4 % LATIN SMALL LETTER DZ WITH CARON
+\setcclcuc 01C7 01C9 01C8 % LATIN CAPITAL LETTER LJ
+\setcclcuc 01C8 01C9 01C7 % LATIN CAPITAL LETTER L WITH SMALL LETTER J
+\setcclcuc 01C9 01C9 01C7 % LATIN SMALL LETTER LJ
+\setcclcuc 01CA 01CC 01CB % LATIN CAPITAL LETTER NJ
+\setcclcuc 01CB 01CC 01CA % LATIN CAPITAL LETTER N WITH SMALL LETTER J
+\setcclcuc 01CC 01CC 01CA % LATIN SMALL LETTER NJ
+\setcclcuc 01CD 01CE 01CD % LATIN CAPITAL LETTER A WITH CARON
+\setcclcuc 01CE 01CE 01CD % LATIN SMALL LETTER A WITH CARON
+\setcclcuc 01CF 01D0 01CF % LATIN CAPITAL LETTER I WITH CARON
+\setcclcuc 01D0 01D0 01CF % LATIN SMALL LETTER I WITH CARON
+\setcclcuc 01D1 01D2 01D1 % LATIN CAPITAL LETTER O WITH CARON
+\setcclcuc 01D2 01D2 01D1 % LATIN SMALL LETTER O WITH CARON
+\setcclcuc 01D3 01D4 01D3 % LATIN CAPITAL LETTER U WITH CARON
+\setcclcuc 01D4 01D4 01D3 % LATIN SMALL LETTER U WITH CARON
+\setcclcuc 01D5 01D6 01D5 % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+\setcclcuc 01D6 01D6 01D5 % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+\setcclcuc 01D7 01D8 01D7 % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+\setcclcuc 01D8 01D8 01D7 % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+\setcclcuc 01D9 01DA 01D9 % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+\setcclcuc 01DA 01DA 01D9 % LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+\setcclcuc 01DB 01DC 01DB % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+\setcclcuc 01DC 01DC 01DB % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+\setcclcuc 01DD 01DD 018E % LATIN SMALL LETTER TURNED E
+\setcclcuc 01DE 01DF 01DE % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+\setcclcuc 01DF 01DF 01DE % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+\setcclcuc 01E0 01E1 01E0 % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+\setcclcuc 01E1 01E1 01E0 % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+\setcclcuc 01E2 01E3 01E2 % LATIN CAPITAL LETTER AE WITH MACRON
+\setcclcuc 01E3 01E3 01E2 % LATIN SMALL LETTER AE WITH MACRON
+\setcclcuc 01E4 01E5 01E4 % LATIN CAPITAL LETTER G WITH STROKE
+\setcclcuc 01E5 01E5 01E4 % LATIN SMALL LETTER G WITH STROKE
+\setcclcuc 01E6 01E7 01E6 % LATIN CAPITAL LETTER G WITH CARON
+\setcclcuc 01E7 01E7 01E6 % LATIN SMALL LETTER G WITH CARON
+\setcclcuc 01E8 01E9 01E8 % LATIN CAPITAL LETTER K WITH CARON
+\setcclcuc 01E9 01E9 01E8 % LATIN SMALL LETTER K WITH CARON
+\setcclcuc 01EA 01EB 01EA % LATIN CAPITAL LETTER O WITH OGONEK
+\setcclcuc 01EB 01EB 01EA % LATIN SMALL LETTER O WITH OGONEK
+\setcclcuc 01EC 01ED 01EC % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+\setcclcuc 01ED 01ED 01EC % LATIN SMALL LETTER O WITH OGONEK AND MACRON
+\setcclcuc 01EE 01EF 01EE % LATIN CAPITAL LETTER EZH WITH CARON
+\setcclcuc 01EF 01EF 01EE % LATIN SMALL LETTER EZH WITH CARON
+\setcclcuc 01F0 01F0 01F0 % LATIN SMALL LETTER J WITH CARON
+\setcclcuc 01F1 01F3 01F2 % LATIN CAPITAL LETTER DZ
+\setcclcuc 01F2 01F3 01F1 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z
+\setcclcuc 01F3 01F3 01F1 % LATIN SMALL LETTER DZ
+\setcclcuc 01F4 01F5 01F4 % LATIN CAPITAL LETTER G WITH ACUTE
+\setcclcuc 01F5 01F5 01F4 % LATIN SMALL LETTER G WITH ACUTE
+\setcclcuc 01F6 0195 01F6 % LATIN CAPITAL LETTER HWAIR
+\setcclcuc 01F7 01BF 01F7 % LATIN CAPITAL LETTER WYNN
+\setcclcuc 01F8 01F9 01F8 % LATIN CAPITAL LETTER N WITH GRAVE
+\setcclcuc 01F9 01F9 01F8 % LATIN SMALL LETTER N WITH GRAVE
+\setcclcuc 01FA 01FB 01FA % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+\setcclcuc 01FB 01FB 01FA % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+\setcclcuc 01FC 01FD 01FC % LATIN CAPITAL LETTER AE WITH ACUTE
+\setcclcuc 01FD 01FD 01FC % LATIN SMALL LETTER AE WITH ACUTE
+\setcclcuc 01FE 01FF 01FE % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+\setcclcuc 01FF 01FF 01FE % LATIN SMALL LETTER O WITH STROKE AND ACUTE
+\setcclcuc 0200 0201 0200 % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
+\setcclcuc 0201 0201 0200 % LATIN SMALL LETTER A WITH DOUBLE GRAVE
+\setcclcuc 0202 0203 0202 % LATIN CAPITAL LETTER A WITH INVERTED BREVE
+\setcclcuc 0203 0203 0202 % LATIN SMALL LETTER A WITH INVERTED BREVE
+\setcclcuc 0204 0205 0204 % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
+\setcclcuc 0205 0205 0204 % LATIN SMALL LETTER E WITH DOUBLE GRAVE
+\setcclcuc 0206 0207 0206 % LATIN CAPITAL LETTER E WITH INVERTED BREVE
+\setcclcuc 0207 0207 0206 % LATIN SMALL LETTER E WITH INVERTED BREVE
+\setcclcuc 0208 0209 0208 % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
+\setcclcuc 0209 0209 0208 % LATIN SMALL LETTER I WITH DOUBLE GRAVE
+\setcclcuc 020A 020B 020A % LATIN CAPITAL LETTER I WITH INVERTED BREVE
+\setcclcuc 020B 020B 020A % LATIN SMALL LETTER I WITH INVERTED BREVE
+\setcclcuc 020C 020D 020C % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
+\setcclcuc 020D 020D 020C % LATIN SMALL LETTER O WITH DOUBLE GRAVE
+\setcclcuc 020E 020F 020E % LATIN CAPITAL LETTER O WITH INVERTED BREVE
+\setcclcuc 020F 020F 020E % LATIN SMALL LETTER O WITH INVERTED BREVE
+\setcclcuc 0210 0211 0210 % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
+\setcclcuc 0211 0211 0210 % LATIN SMALL LETTER R WITH DOUBLE GRAVE
+\setcclcuc 0212 0213 0212 % LATIN CAPITAL LETTER R WITH INVERTED BREVE
+\setcclcuc 0213 0213 0212 % LATIN SMALL LETTER R WITH INVERTED BREVE
+\setcclcuc 0214 0215 0214 % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
+\setcclcuc 0215 0215 0214 % LATIN SMALL LETTER U WITH DOUBLE GRAVE
+\setcclcuc 0216 0217 0216 % LATIN CAPITAL LETTER U WITH INVERTED BREVE
+\setcclcuc 0217 0217 0216 % LATIN SMALL LETTER U WITH INVERTED BREVE
+\setcclcuc 0218 0219 0218 % LATIN CAPITAL LETTER S WITH COMMA BELOW
+\setcclcuc 0219 0219 0218 % LATIN SMALL LETTER S WITH COMMA BELOW
+\setcclcuc 021A 021B 021A % LATIN CAPITAL LETTER T WITH COMMA BELOW
+\setcclcuc 021B 021B 021A % LATIN SMALL LETTER T WITH COMMA BELOW
+\setcclcuc 021C 021D 021C % LATIN CAPITAL LETTER YOGH
+\setcclcuc 021D 021D 021C % LATIN SMALL LETTER YOGH
+\setcclcuc 021E 021F 021E % LATIN CAPITAL LETTER H WITH CARON
+\setcclcuc 021F 021F 021E % LATIN SMALL LETTER H WITH CARON
+\setcclcuc 0220 019E 0220 % LATIN CAPITAL LETTER N WITH LONG RIGHT LEG
+\setcclcuc 0221 0221 0221 % LATIN SMALL LETTER D WITH CURL
+\setcclcuc 0222 0223 0222 % LATIN CAPITAL LETTER OU
+\setcclcuc 0223 0223 0222 % LATIN SMALL LETTER OU
+\setcclcuc 0224 0225 0224 % LATIN CAPITAL LETTER Z WITH HOOK
+\setcclcuc 0225 0225 0224 % LATIN SMALL LETTER Z WITH HOOK
+\setcclcuc 0226 0227 0226 % LATIN CAPITAL LETTER A WITH DOT ABOVE
+\setcclcuc 0227 0227 0226 % LATIN SMALL LETTER A WITH DOT ABOVE
+\setcclcuc 0228 0229 0228 % LATIN CAPITAL LETTER E WITH CEDILLA
+\setcclcuc 0229 0229 0228 % LATIN SMALL LETTER E WITH CEDILLA
+\setcclcuc 022A 022B 022A % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+\setcclcuc 022B 022B 022A % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+\setcclcuc 022C 022D 022C % LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+\setcclcuc 022D 022D 022C % LATIN SMALL LETTER O WITH TILDE AND MACRON
+\setcclcuc 022E 022F 022E % LATIN CAPITAL LETTER O WITH DOT ABOVE
+\setcclcuc 022F 022F 022E % LATIN SMALL LETTER O WITH DOT ABOVE
+\setcclcuc 0230 0231 0230 % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+\setcclcuc 0231 0231 0230 % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+\setcclcuc 0232 0233 0232 % LATIN CAPITAL LETTER Y WITH MACRON
+\setcclcuc 0233 0233 0232 % LATIN SMALL LETTER Y WITH MACRON
+\setcclcuc 0234 0234 0234 % LATIN SMALL LETTER L WITH CURL
+\setcclcuc 0235 0235 0235 % LATIN SMALL LETTER N WITH CURL
+\setcclcuc 0236 0236 0236 % LATIN SMALL LETTER T WITH CURL
+\setcclcuc 0237 0237 0237 % LATIN SMALL LETTER DOTLESS J
+\setcclcuc 0238 0238 0238 % LATIN SMALL LETTER DB DIGRAPH
+\setcclcuc 0239 0239 0239 % LATIN SMALL LETTER QP DIGRAPH
+\setcclcuc 023A 2C65 023A % LATIN CAPITAL LETTER A WITH STROKE
+\setcclcuc 023B 023C 023B % LATIN CAPITAL LETTER C WITH STROKE
+\setcclcuc 023C 023C 023B % LATIN SMALL LETTER C WITH STROKE
+\setcclcuc 023D 019A 023D % LATIN CAPITAL LETTER L WITH BAR
+\setcclcuc 023E 2C66 023E % LATIN CAPITAL LETTER T WITH DIAGONAL STROKE
+\setcclcuc 023F 023F 023F % LATIN SMALL LETTER S WITH SWASH TAIL
+\setcclcuc 0240 0240 0240 % LATIN SMALL LETTER Z WITH SWASH TAIL
+\setcclcuc 0241 0242 0241 % LATIN CAPITAL LETTER GLOTTAL STOP
+\setcclcuc 0242 0242 0241 % LATIN SMALL LETTER GLOTTAL STOP
+\setcclcuc 0243 0180 0243 % LATIN CAPITAL LETTER B WITH STROKE
+\setcclcuc 0244 0289 0244 % LATIN CAPITAL LETTER U BAR
+\setcclcuc 0245 028C 0245 % LATIN CAPITAL LETTER TURNED V
+\setcclcuc 0246 0247 0246 % LATIN CAPITAL LETTER E WITH STROKE
+\setcclcuc 0247 0247 0246 % LATIN SMALL LETTER E WITH STROKE
+\setcclcuc 0248 0249 0248 % LATIN CAPITAL LETTER J WITH STROKE
+\setcclcuc 0249 0249 0248 % LATIN SMALL LETTER J WITH STROKE
+\setcclcuc 024A 024B 024A % LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL
+\setcclcuc 024B 024B 024A % LATIN SMALL LETTER Q WITH HOOK TAIL
+\setcclcuc 024C 024D 024C % LATIN CAPITAL LETTER R WITH STROKE
+\setcclcuc 024D 024D 024C % LATIN SMALL LETTER R WITH STROKE
+\setcclcuc 024E 024F 024E % LATIN CAPITAL LETTER Y WITH STROKE
+\setcclcuc 024F 024F 024E % LATIN SMALL LETTER Y WITH STROKE
+\setcclcuc 0250 0250 0250 % LATIN SMALL LETTER TURNED A
+\setcclcuc 0251 0251 0251 % LATIN SMALL LETTER ALPHA
+\setcclcuc 0252 0252 0252 % LATIN SMALL LETTER TURNED ALPHA
+\setcclcuc 0253 0253 0181 % LATIN SMALL LETTER B WITH HOOK
+\setcclcuc 0254 0254 0186 % LATIN SMALL LETTER OPEN O
+\setcclcuc 0255 0255 0255 % LATIN SMALL LETTER C WITH CURL
+\setcclcuc 0256 0256 0189 % LATIN SMALL LETTER D WITH TAIL
+\setcclcuc 0257 0257 018A % LATIN SMALL LETTER D WITH HOOK
+\setcclcuc 0258 0258 0258 % LATIN SMALL LETTER REVERSED E
+\setcclcuc 0259 0259 018F % LATIN SMALL LETTER SCHWA
+\setcclcuc 025A 025A 025A % LATIN SMALL LETTER SCHWA WITH HOOK
+\setcclcuc 025B 025B 0190 % LATIN SMALL LETTER OPEN E
+\setcclcuc 025C 025C 025C % LATIN SMALL LETTER REVERSED OPEN E
+\setcclcuc 025D 025D 025D % LATIN SMALL LETTER REVERSED OPEN E WITH HOOK
+\setcclcuc 025E 025E 025E % LATIN SMALL LETTER CLOSED REVERSED OPEN E
+\setcclcuc 025F 025F 025F % LATIN SMALL LETTER DOTLESS J WITH STROKE
+\setcclcuc 0260 0260 0193 % LATIN SMALL LETTER G WITH HOOK
+\setcclcuc 0261 0261 0261 % LATIN SMALL LETTER SCRIPT G
+\setcclcuc 0262 0262 0262 % LATIN LETTER SMALL CAPITAL G
+\setcclcuc 0263 0263 0194 % LATIN SMALL LETTER GAMMA
+\setcclcuc 0264 0264 0264 % LATIN SMALL LETTER RAMS HORN
+\setcclcuc 0265 0265 0265 % LATIN SMALL LETTER TURNED H
+\setcclcuc 0266 0266 0266 % LATIN SMALL LETTER H WITH HOOK
+\setcclcuc 0267 0267 0267 % LATIN SMALL LETTER HENG WITH HOOK
+\setcclcuc 0268 0268 0197 % LATIN SMALL LETTER I WITH STROKE
+\setcclcuc 0269 0269 0196 % LATIN SMALL LETTER IOTA
+\setcclcuc 026A 026A 026A % LATIN LETTER SMALL CAPITAL I
+\setcclcuc 026B 026B 2C62 % LATIN SMALL LETTER L WITH MIDDLE TILDE
+\setcclcuc 026C 026C 026C % LATIN SMALL LETTER L WITH BELT
+\setcclcuc 026D 026D 026D % LATIN SMALL LETTER L WITH RETROFLEX HOOK
+\setcclcuc 026E 026E 026E % LATIN SMALL LETTER LEZH
+\setcclcuc 026F 026F 019C % LATIN SMALL LETTER TURNED M
+\setcclcuc 0270 0270 0270 % LATIN SMALL LETTER TURNED M WITH LONG LEG
+\setcclcuc 0271 0271 0271 % LATIN SMALL LETTER M WITH HOOK
+\setcclcuc 0272 0272 019D % LATIN SMALL LETTER N WITH LEFT HOOK
+\setcclcuc 0273 0273 0273 % LATIN SMALL LETTER N WITH RETROFLEX HOOK
+\setcclcuc 0274 0274 0274 % LATIN LETTER SMALL CAPITAL N
+\setcclcuc 0275 0275 019F % LATIN SMALL LETTER BARRED O
+\setcclcuc 0276 0276 0276 % LATIN LETTER SMALL CAPITAL OE
+\setcclcuc 0277 0277 0277 % LATIN SMALL LETTER CLOSED OMEGA
+\setcclcuc 0278 0278 0278 % LATIN SMALL LETTER PHI
+\setcclcuc 0279 0279 0279 % LATIN SMALL LETTER TURNED R
+\setcclcuc 027A 027A 027A % LATIN SMALL LETTER TURNED R WITH LONG LEG
+\setcclcuc 027B 027B 027B % LATIN SMALL LETTER TURNED R WITH HOOK
+\setcclcuc 027C 027C 027C % LATIN SMALL LETTER R WITH LONG LEG
+\setcclcuc 027D 027D 2C64 % LATIN SMALL LETTER R WITH TAIL
+\setcclcuc 027E 027E 027E % LATIN SMALL LETTER R WITH FISHHOOK
+\setcclcuc 027F 027F 027F % LATIN SMALL LETTER REVERSED R WITH FISHHOOK
+\setcclcuc 0280 0280 01A6 % LATIN LETTER SMALL CAPITAL R
+\setcclcuc 0281 0281 0281 % LATIN LETTER SMALL CAPITAL INVERTED R
+\setcclcuc 0282 0282 0282 % LATIN SMALL LETTER S WITH HOOK
+\setcclcuc 0283 0283 01A9 % LATIN SMALL LETTER ESH
+\setcclcuc 0284 0284 0284 % LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK
+\setcclcuc 0285 0285 0285 % LATIN SMALL LETTER SQUAT REVERSED ESH
+\setcclcuc 0286 0286 0286 % LATIN SMALL LETTER ESH WITH CURL
+\setcclcuc 0287 0287 0287 % LATIN SMALL LETTER TURNED T
+\setcclcuc 0288 0288 01AE % LATIN SMALL LETTER T WITH RETROFLEX HOOK
+\setcclcuc 0289 0289 0244 % LATIN SMALL LETTER U BAR
+\setcclcuc 028A 028A 01B1 % LATIN SMALL LETTER UPSILON
+\setcclcuc 028B 028B 01B2 % LATIN SMALL LETTER V WITH HOOK
+\setcclcuc 028C 028C 0245 % LATIN SMALL LETTER TURNED V
+\setcclcuc 028D 028D 028D % LATIN SMALL LETTER TURNED W
+\setcclcuc 028E 028E 028E % LATIN SMALL LETTER TURNED Y
+\setcclcuc 028F 028F 028F % LATIN LETTER SMALL CAPITAL Y
+\setcclcuc 0290 0290 0290 % LATIN SMALL LETTER Z WITH RETROFLEX HOOK
+\setcclcuc 0291 0291 0291 % LATIN SMALL LETTER Z WITH CURL
+\setcclcuc 0292 0292 01B7 % LATIN SMALL LETTER EZH
+\setcclcuc 0293 0293 0293 % LATIN SMALL LETTER EZH WITH CURL
+\setcclcuc 0295 0295 0295 % LATIN LETTER PHARYNGEAL VOICED FRICATIVE
+\setcclcuc 0296 0296 0296 % LATIN LETTER INVERTED GLOTTAL STOP
+\setcclcuc 0297 0297 0297 % LATIN LETTER STRETCHED C
+\setcclcuc 0298 0298 0298 % LATIN LETTER BILABIAL CLICK
+\setcclcuc 0299 0299 0299 % LATIN LETTER SMALL CAPITAL B
+\setcclcuc 029A 029A 029A % LATIN SMALL LETTER CLOSED OPEN E
+\setcclcuc 029B 029B 029B % LATIN LETTER SMALL CAPITAL G WITH HOOK
+\setcclcuc 029C 029C 029C % LATIN LETTER SMALL CAPITAL H
+\setcclcuc 029D 029D 029D % LATIN SMALL LETTER J WITH CROSSED-TAIL
+\setcclcuc 029E 029E 029E % LATIN SMALL LETTER TURNED K
+\setcclcuc 029F 029F 029F % LATIN LETTER SMALL CAPITAL L
+\setcclcuc 02A0 02A0 02A0 % LATIN SMALL LETTER Q WITH HOOK
+\setcclcuc 02A1 02A1 02A1 % LATIN LETTER GLOTTAL STOP WITH STROKE
+\setcclcuc 02A2 02A2 02A2 % LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE
+\setcclcuc 02A3 02A3 02A3 % LATIN SMALL LETTER DZ DIGRAPH
+\setcclcuc 02A4 02A4 02A4 % LATIN SMALL LETTER DEZH DIGRAPH
+\setcclcuc 02A5 02A5 02A5 % LATIN SMALL LETTER DZ DIGRAPH WITH CURL
+\setcclcuc 02A6 02A6 02A6 % LATIN SMALL LETTER TS DIGRAPH
+\setcclcuc 02A7 02A7 02A7 % LATIN SMALL LETTER TESH DIGRAPH
+\setcclcuc 02A8 02A8 02A8 % LATIN SMALL LETTER TC DIGRAPH WITH CURL
+\setcclcuc 02A9 02A9 02A9 % LATIN SMALL LETTER FENG DIGRAPH
+\setcclcuc 02AA 02AA 02AA % LATIN SMALL LETTER LS DIGRAPH
+\setcclcuc 02AB 02AB 02AB % LATIN SMALL LETTER LZ DIGRAPH
+\setcclcuc 02AC 02AC 02AC % LATIN LETTER BILABIAL PERCUSSIVE
+\setcclcuc 02AD 02AD 02AD % LATIN LETTER BIDENTAL PERCUSSIVE
+\setcclcuc 02AE 02AE 02AE % LATIN SMALL LETTER TURNED H WITH FISHHOOK
+\setcclcuc 02AF 02AF 02AF % LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
+\setcclcuc 037B 037B 03FD % GREEK SMALL REVERSED LUNATE SIGMA SYMBOL
+\setcclcuc 037C 037C 03FE % GREEK SMALL DOTTED LUNATE SIGMA SYMBOL
+\setcclcuc 037D 037D 03FF % GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL
+\setcclcuc 0386 03AC 0386 % GREEK CAPITAL LETTER ALPHA WITH TONOS
+\setcclcuc 0388 03AD 0388 % GREEK CAPITAL LETTER EPSILON WITH TONOS
+\setcclcuc 0389 03AE 0389 % GREEK CAPITAL LETTER ETA WITH TONOS
+\setcclcuc 038A 03AF 038A % GREEK CAPITAL LETTER IOTA WITH TONOS
+\setcclcuc 038C 03CC 038C % GREEK CAPITAL LETTER OMICRON WITH TONOS
+\setcclcuc 038E 03CD 038E % GREEK CAPITAL LETTER UPSILON WITH TONOS
+\setcclcuc 038F 03CE 038F % GREEK CAPITAL LETTER OMEGA WITH TONOS
+\setcclcuc 0390 0390 0390 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+\setcclcuc 0391 03B1 0391 % GREEK CAPITAL LETTER ALPHA
+\setcclcuc 0392 03B2 0392 % GREEK CAPITAL LETTER BETA
+\setcclcuc 0393 03B3 0393 % GREEK CAPITAL LETTER GAMMA
+\setcclcuc 0394 03B4 0394 % GREEK CAPITAL LETTER DELTA
+\setcclcuc 0395 03B5 0395 % GREEK CAPITAL LETTER EPSILON
+\setcclcuc 0396 03B6 0396 % GREEK CAPITAL LETTER ZETA
+\setcclcuc 0397 03B7 0397 % GREEK CAPITAL LETTER ETA
+\setcclcuc 0398 03B8 0398 % GREEK CAPITAL LETTER THETA
+\setcclcuc 0399 03B9 0399 % GREEK CAPITAL LETTER IOTA
+\setcclcuc 039A 03BA 039A % GREEK CAPITAL LETTER KAPPA
+\setcclcuc 039B 03BB 039B % GREEK CAPITAL LETTER LAMDA
+\setcclcuc 039C 03BC 039C % GREEK CAPITAL LETTER MU
+\setcclcuc 039D 03BD 039D % GREEK CAPITAL LETTER NU
+\setcclcuc 039E 03BE 039E % GREEK CAPITAL LETTER XI
+\setcclcuc 039F 03BF 039F % GREEK CAPITAL LETTER OMICRON
+\setcclcuc 03A0 03C0 03A0 % GREEK CAPITAL LETTER PI
+\setcclcuc 03A1 03C1 03A1 % GREEK CAPITAL LETTER RHO
+\setcclcuc 03A3 03C3 03A3 % GREEK CAPITAL LETTER SIGMA
+\setcclcuc 03A4 03C4 03A4 % GREEK CAPITAL LETTER TAU
+\setcclcuc 03A5 03C5 03A5 % GREEK CAPITAL LETTER UPSILON
+\setcclcuc 03A6 03C6 03A6 % GREEK CAPITAL LETTER PHI
+\setcclcuc 03A7 03C7 03A7 % GREEK CAPITAL LETTER CHI
+\setcclcuc 03A8 03C8 03A8 % GREEK CAPITAL LETTER PSI
+\setcclcuc 03A9 03C9 03A9 % GREEK CAPITAL LETTER OMEGA
+\setcclcuc 03AA 03CA 03AA % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+\setcclcuc 03AB 03CB 03AB % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+\setcclcuc 03AC 03AC 0386 % GREEK SMALL LETTER ALPHA WITH TONOS
+\setcclcuc 03AD 03AD 0388 % GREEK SMALL LETTER EPSILON WITH TONOS
+\setcclcuc 03AE 03AE 0389 % GREEK SMALL LETTER ETA WITH TONOS
+\setcclcuc 03AF 03AF 038A % GREEK SMALL LETTER IOTA WITH TONOS
+\setcclcuc 03B0 03B0 03B0 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+\setcclcuc 03B1 03B1 0391 % GREEK SMALL LETTER ALPHA
+\setcclcuc 03B2 03B2 0392 % GREEK SMALL LETTER BETA
+\setcclcuc 03B3 03B3 0393 % GREEK SMALL LETTER GAMMA
+\setcclcuc 03B4 03B4 0394 % GREEK SMALL LETTER DELTA
+\setcclcuc 03B5 03B5 0395 % GREEK SMALL LETTER EPSILON
+\setcclcuc 03B6 03B6 0396 % GREEK SMALL LETTER ZETA
+\setcclcuc 03B7 03B7 0397 % GREEK SMALL LETTER ETA
+\setcclcuc 03B8 03B8 0398 % GREEK SMALL LETTER THETA
+\setcclcuc 03B9 03B9 0399 % GREEK SMALL LETTER IOTA
+\setcclcuc 03BA 03BA 039A % GREEK SMALL LETTER KAPPA
+\setcclcuc 03BB 03BB 039B % GREEK SMALL LETTER LAMDA
+\setcclcuc 03BC 03BC 039C % GREEK SMALL LETTER MU
+\setcclcuc 03BD 03BD 039D % GREEK SMALL LETTER NU
+\setcclcuc 03BE 03BE 039E % GREEK SMALL LETTER XI
+\setcclcuc 03BF 03BF 039F % GREEK SMALL LETTER OMICRON
+\setcclcuc 03C0 03C0 03A0 % GREEK SMALL LETTER PI
+\setcclcuc 03C1 03C1 03A1 % GREEK SMALL LETTER RHO
+\setcclcuc 03C2 03C2 03A3 % GREEK SMALL LETTER FINAL SIGMA
+\setcclcuc 03C3 03C3 03A3 % GREEK SMALL LETTER SIGMA
+\setcclcuc 03C4 03C4 03A4 % GREEK SMALL LETTER TAU
+\setcclcuc 03C5 03C5 03A5 % GREEK SMALL LETTER UPSILON
+\setcclcuc 03C6 03C6 03A6 % GREEK SMALL LETTER PHI
+\setcclcuc 03C7 03C7 03A7 % GREEK SMALL LETTER CHI
+\setcclcuc 03C8 03C8 03A8 % GREEK SMALL LETTER PSI
+\setcclcuc 03C9 03C9 03A9 % GREEK SMALL LETTER OMEGA
+\setcclcuc 03CA 03CA 03AA % GREEK SMALL LETTER IOTA WITH DIALYTIKA
+\setcclcuc 03CB 03CB 03AB % GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+\setcclcuc 03CC 03CC 038C % GREEK SMALL LETTER OMICRON WITH TONOS
+\setcclcuc 03CD 03CD 038E % GREEK SMALL LETTER UPSILON WITH TONOS
+\setcclcuc 03CE 03CE 038F % GREEK SMALL LETTER OMEGA WITH TONOS
+\setcclcuc 03D0 03D0 0392 % GREEK BETA SYMBOL
+\setcclcuc 03D1 03D1 0398 % GREEK THETA SYMBOL
+\setcclcuc 03D2 03D2 03D2 % GREEK UPSILON WITH HOOK SYMBOL
+\setcclcuc 03D3 03D3 03D3 % GREEK UPSILON WITH ACUTE AND HOOK SYMBOL
+\setcclcuc 03D4 03D4 03D4 % GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
+\setcclcuc 03D5 03D5 03A6 % GREEK PHI SYMBOL
+\setcclcuc 03D6 03D6 03A0 % GREEK PI SYMBOL
+\setcclcuc 03D7 03D7 03D7 % GREEK KAI SYMBOL
+\setcclcuc 03D8 03D9 03D8 % GREEK LETTER ARCHAIC KOPPA
+\setcclcuc 03D9 03D9 03D8 % GREEK SMALL LETTER ARCHAIC KOPPA
+\setcclcuc 03DA 03DB 03DA % GREEK LETTER STIGMA
+\setcclcuc 03DB 03DB 03DA % GREEK SMALL LETTER STIGMA
+\setcclcuc 03DC 03DD 03DC % GREEK LETTER DIGAMMA
+\setcclcuc 03DD 03DD 03DC % GREEK SMALL LETTER DIGAMMA
+\setcclcuc 03DE 03DF 03DE % GREEK LETTER KOPPA
+\setcclcuc 03DF 03DF 03DE % GREEK SMALL LETTER KOPPA
+\setcclcuc 03E0 03E1 03E0 % GREEK LETTER SAMPI
+\setcclcuc 03E1 03E1 03E0 % GREEK SMALL LETTER SAMPI
+\setcclcuc 03E2 03E3 03E2 % COPTIC CAPITAL LETTER SHEI
+\setcclcuc 03E3 03E3 03E2 % COPTIC SMALL LETTER SHEI
+\setcclcuc 03E4 03E5 03E4 % COPTIC CAPITAL LETTER FEI
+\setcclcuc 03E5 03E5 03E4 % COPTIC SMALL LETTER FEI
+\setcclcuc 03E6 03E7 03E6 % COPTIC CAPITAL LETTER KHEI
+\setcclcuc 03E7 03E7 03E6 % COPTIC SMALL LETTER KHEI
+\setcclcuc 03E8 03E9 03E8 % COPTIC CAPITAL LETTER HORI
+\setcclcuc 03E9 03E9 03E8 % COPTIC SMALL LETTER HORI
+\setcclcuc 03EA 03EB 03EA % COPTIC CAPITAL LETTER GANGIA
+\setcclcuc 03EB 03EB 03EA % COPTIC SMALL LETTER GANGIA
+\setcclcuc 03EC 03ED 03EC % COPTIC CAPITAL LETTER SHIMA
+\setcclcuc 03ED 03ED 03EC % COPTIC SMALL LETTER SHIMA
+\setcclcuc 03EE 03EF 03EE % COPTIC CAPITAL LETTER DEI
+\setcclcuc 03EF 03EF 03EE % COPTIC SMALL LETTER DEI
+\setcclcuc 03F0 03F0 039A % GREEK KAPPA SYMBOL
+\setcclcuc 03F1 03F1 03A1 % GREEK RHO SYMBOL
+\setcclcuc 03F2 03F2 03F9 % GREEK LUNATE SIGMA SYMBOL
+\setcclcuc 03F3 03F3 03F3 % GREEK LETTER YOT
+\setcclcuc 03F4 03B8 03F4 % GREEK CAPITAL THETA SYMBOL
+\setcclcuc 03F5 03F5 0395 % GREEK LUNATE EPSILON SYMBOL
+\setcclcuc 03F7 03F8 03F7 % GREEK CAPITAL LETTER SHO
+\setcclcuc 03F8 03F8 03F7 % GREEK SMALL LETTER SHO
+\setcclcuc 03F9 03F2 03F9 % GREEK CAPITAL LUNATE SIGMA SYMBOL
+\setcclcuc 03FA 03FB 03FA % GREEK CAPITAL LETTER SAN
+\setcclcuc 03FB 03FB 03FA % GREEK SMALL LETTER SAN
+\setcclcuc 03FC 03FC 03FC % GREEK RHO WITH STROKE SYMBOL
+\setcclcuc 03FD 037B 03FD % GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL
+\setcclcuc 03FE 037C 03FE % GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL
+\setcclcuc 03FF 037D 03FF % GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL
+\setcclcuc 0400 0450 0400 % CYRILLIC CAPITAL LETTER IE WITH GRAVE
+\setcclcuc 0401 0451 0401 % CYRILLIC CAPITAL LETTER IO
+\setcclcuc 0402 0452 0402 % CYRILLIC CAPITAL LETTER DJE
+\setcclcuc 0403 0453 0403 % CYRILLIC CAPITAL LETTER GJE
+\setcclcuc 0404 0454 0404 % CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\setcclcuc 0405 0455 0405 % CYRILLIC CAPITAL LETTER DZE
+\setcclcuc 0406 0456 0406 % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\setcclcuc 0407 0457 0407 % CYRILLIC CAPITAL LETTER YI
+\setcclcuc 0408 0458 0408 % CYRILLIC CAPITAL LETTER JE
+\setcclcuc 0409 0459 0409 % CYRILLIC CAPITAL LETTER LJE
+\setcclcuc 040A 045A 040A % CYRILLIC CAPITAL LETTER NJE
+\setcclcuc 040B 045B 040B % CYRILLIC CAPITAL LETTER TSHE
+\setcclcuc 040C 045C 040C % CYRILLIC CAPITAL LETTER KJE
+\setcclcuc 040D 045D 040D % CYRILLIC CAPITAL LETTER I WITH GRAVE
+\setcclcuc 040E 045E 040E % CYRILLIC CAPITAL LETTER SHORT U
+\setcclcuc 040F 045F 040F % CYRILLIC CAPITAL LETTER DZHE
+\setcclcuc 0410 0430 0410 % CYRILLIC CAPITAL LETTER A
+\setcclcuc 0411 0431 0411 % CYRILLIC CAPITAL LETTER BE
+\setcclcuc 0412 0432 0412 % CYRILLIC CAPITAL LETTER VE
+\setcclcuc 0413 0433 0413 % CYRILLIC CAPITAL LETTER GHE
+\setcclcuc 0414 0434 0414 % CYRILLIC CAPITAL LETTER DE
+\setcclcuc 0415 0435 0415 % CYRILLIC CAPITAL LETTER IE
+\setcclcuc 0416 0436 0416 % CYRILLIC CAPITAL LETTER ZHE
+\setcclcuc 0417 0437 0417 % CYRILLIC CAPITAL LETTER ZE
+\setcclcuc 0418 0438 0418 % CYRILLIC CAPITAL LETTER I
+\setcclcuc 0419 0439 0419 % CYRILLIC CAPITAL LETTER SHORT I
+\setcclcuc 041A 043A 041A % CYRILLIC CAPITAL LETTER KA
+\setcclcuc 041B 043B 041B % CYRILLIC CAPITAL LETTER EL
+\setcclcuc 041C 043C 041C % CYRILLIC CAPITAL LETTER EM
+\setcclcuc 041D 043D 041D % CYRILLIC CAPITAL LETTER EN
+\setcclcuc 041E 043E 041E % CYRILLIC CAPITAL LETTER O
+\setcclcuc 041F 043F 041F % CYRILLIC CAPITAL LETTER PE
+\setcclcuc 0420 0440 0420 % CYRILLIC CAPITAL LETTER ER
+\setcclcuc 0421 0441 0421 % CYRILLIC CAPITAL LETTER ES
+\setcclcuc 0422 0442 0422 % CYRILLIC CAPITAL LETTER TE
+\setcclcuc 0423 0443 0423 % CYRILLIC CAPITAL LETTER U
+\setcclcuc 0424 0444 0424 % CYRILLIC CAPITAL LETTER EF
+\setcclcuc 0425 0445 0425 % CYRILLIC CAPITAL LETTER HA
+\setcclcuc 0426 0446 0426 % CYRILLIC CAPITAL LETTER TSE
+\setcclcuc 0427 0447 0427 % CYRILLIC CAPITAL LETTER CHE
+\setcclcuc 0428 0448 0428 % CYRILLIC CAPITAL LETTER SHA
+\setcclcuc 0429 0449 0429 % CYRILLIC CAPITAL LETTER SHCHA
+\setcclcuc 042A 044A 042A % CYRILLIC CAPITAL LETTER HARD SIGN
+\setcclcuc 042B 044B 042B % CYRILLIC CAPITAL LETTER YERU
+\setcclcuc 042C 044C 042C % CYRILLIC CAPITAL LETTER SOFT SIGN
+\setcclcuc 042D 044D 042D % CYRILLIC CAPITAL LETTER E
+\setcclcuc 042E 044E 042E % CYRILLIC CAPITAL LETTER YU
+\setcclcuc 042F 044F 042F % CYRILLIC CAPITAL LETTER YA
+\setcclcuc 0430 0430 0410 % CYRILLIC SMALL LETTER A
+\setcclcuc 0431 0431 0411 % CYRILLIC SMALL LETTER BE
+\setcclcuc 0432 0432 0412 % CYRILLIC SMALL LETTER VE
+\setcclcuc 0433 0433 0413 % CYRILLIC SMALL LETTER GHE
+\setcclcuc 0434 0434 0414 % CYRILLIC SMALL LETTER DE
+\setcclcuc 0435 0435 0415 % CYRILLIC SMALL LETTER IE
+\setcclcuc 0436 0436 0416 % CYRILLIC SMALL LETTER ZHE
+\setcclcuc 0437 0437 0417 % CYRILLIC SMALL LETTER ZE
+\setcclcuc 0438 0438 0418 % CYRILLIC SMALL LETTER I
+\setcclcuc 0439 0439 0419 % CYRILLIC SMALL LETTER SHORT I
+\setcclcuc 043A 043A 041A % CYRILLIC SMALL LETTER KA
+\setcclcuc 043B 043B 041B % CYRILLIC SMALL LETTER EL
+\setcclcuc 043C 043C 041C % CYRILLIC SMALL LETTER EM
+\setcclcuc 043D 043D 041D % CYRILLIC SMALL LETTER EN
+\setcclcuc 043E 043E 041E % CYRILLIC SMALL LETTER O
+\setcclcuc 043F 043F 041F % CYRILLIC SMALL LETTER PE
+\setcclcuc 0440 0440 0420 % CYRILLIC SMALL LETTER ER
+\setcclcuc 0441 0441 0421 % CYRILLIC SMALL LETTER ES
+\setcclcuc 0442 0442 0422 % CYRILLIC SMALL LETTER TE
+\setcclcuc 0443 0443 0423 % CYRILLIC SMALL LETTER U
+\setcclcuc 0444 0444 0424 % CYRILLIC SMALL LETTER EF
+\setcclcuc 0445 0445 0425 % CYRILLIC SMALL LETTER HA
+\setcclcuc 0446 0446 0426 % CYRILLIC SMALL LETTER TSE
+\setcclcuc 0447 0447 0427 % CYRILLIC SMALL LETTER CHE
+\setcclcuc 0448 0448 0428 % CYRILLIC SMALL LETTER SHA
+\setcclcuc 0449 0449 0429 % CYRILLIC SMALL LETTER SHCHA
+\setcclcuc 044A 044A 042A % CYRILLIC SMALL LETTER HARD SIGN
+\setcclcuc 044B 044B 042B % CYRILLIC SMALL LETTER YERU
+\setcclcuc 044C 044C 042C % CYRILLIC SMALL LETTER SOFT SIGN
+\setcclcuc 044D 044D 042D % CYRILLIC SMALL LETTER E
+\setcclcuc 044E 044E 042E % CYRILLIC SMALL LETTER YU
+\setcclcuc 044F 044F 042F % CYRILLIC SMALL LETTER YA
+\setcclcuc 0450 0450 0400 % CYRILLIC SMALL LETTER IE WITH GRAVE
+\setcclcuc 0451 0451 0401 % CYRILLIC SMALL LETTER IO
+\setcclcuc 0452 0452 0402 % CYRILLIC SMALL LETTER DJE
+\setcclcuc 0453 0453 0403 % CYRILLIC SMALL LETTER GJE
+\setcclcuc 0454 0454 0404 % CYRILLIC SMALL LETTER UKRAINIAN IE
+\setcclcuc 0455 0455 0405 % CYRILLIC SMALL LETTER DZE
+\setcclcuc 0456 0456 0406 % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\setcclcuc 0457 0457 0407 % CYRILLIC SMALL LETTER YI
+\setcclcuc 0458 0458 0408 % CYRILLIC SMALL LETTER JE
+\setcclcuc 0459 0459 0409 % CYRILLIC SMALL LETTER LJE
+\setcclcuc 045A 045A 040A % CYRILLIC SMALL LETTER NJE
+\setcclcuc 045B 045B 040B % CYRILLIC SMALL LETTER TSHE
+\setcclcuc 045C 045C 040C % CYRILLIC SMALL LETTER KJE
+\setcclcuc 045D 045D 040D % CYRILLIC SMALL LETTER I WITH GRAVE
+\setcclcuc 045E 045E 040E % CYRILLIC SMALL LETTER SHORT U
+\setcclcuc 045F 045F 040F % CYRILLIC SMALL LETTER DZHE
+\setcclcuc 0460 0461 0460 % CYRILLIC CAPITAL LETTER OMEGA
+\setcclcuc 0461 0461 0460 % CYRILLIC SMALL LETTER OMEGA
+\setcclcuc 0462 0463 0462 % CYRILLIC CAPITAL LETTER YAT
+\setcclcuc 0463 0463 0462 % CYRILLIC SMALL LETTER YAT
+\setcclcuc 0464 0465 0464 % CYRILLIC CAPITAL LETTER IOTIFIED E
+\setcclcuc 0465 0465 0464 % CYRILLIC SMALL LETTER IOTIFIED E
+\setcclcuc 0466 0467 0466 % CYRILLIC CAPITAL LETTER LITTLE YUS
+\setcclcuc 0467 0467 0466 % CYRILLIC SMALL LETTER LITTLE YUS
+\setcclcuc 0468 0469 0468 % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS
+\setcclcuc 0469 0469 0468 % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS
+\setcclcuc 046A 046B 046A % CYRILLIC CAPITAL LETTER BIG YUS
+\setcclcuc 046B 046B 046A % CYRILLIC SMALL LETTER BIG YUS
+\setcclcuc 046C 046D 046C % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS
+\setcclcuc 046D 046D 046C % CYRILLIC SMALL LETTER IOTIFIED BIG YUS
+\setcclcuc 046E 046F 046E % CYRILLIC CAPITAL LETTER KSI
+\setcclcuc 046F 046F 046E % CYRILLIC SMALL LETTER KSI
+\setcclcuc 0470 0471 0470 % CYRILLIC CAPITAL LETTER PSI
+\setcclcuc 0471 0471 0470 % CYRILLIC SMALL LETTER PSI
+\setcclcuc 0472 0473 0472 % CYRILLIC CAPITAL LETTER FITA
+\setcclcuc 0473 0473 0472 % CYRILLIC SMALL LETTER FITA
+\setcclcuc 0474 0475 0474 % CYRILLIC CAPITAL LETTER IZHITSA
+\setcclcuc 0475 0475 0474 % CYRILLIC SMALL LETTER IZHITSA
+\setcclcuc 0476 0477 0476 % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+\setcclcuc 0477 0477 0476 % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+\setcclcuc 0478 0479 0478 % CYRILLIC CAPITAL LETTER UK
+\setcclcuc 0479 0479 0478 % CYRILLIC SMALL LETTER UK
+\setcclcuc 047A 047B 047A % CYRILLIC CAPITAL LETTER ROUND OMEGA
+\setcclcuc 047B 047B 047A % CYRILLIC SMALL LETTER ROUND OMEGA
+\setcclcuc 047C 047D 047C % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO
+\setcclcuc 047D 047D 047C % CYRILLIC SMALL LETTER OMEGA WITH TITLO
+\setcclcuc 047E 047F 047E % CYRILLIC CAPITAL LETTER OT
+\setcclcuc 047F 047F 047E % CYRILLIC SMALL LETTER OT
+\setcclcuc 0480 0481 0480 % CYRILLIC CAPITAL LETTER KOPPA
+\setcclcuc 0481 0481 0480 % CYRILLIC SMALL LETTER KOPPA
+\setcclcuc 048A 048B 048A % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL
+\setcclcuc 048B 048B 048A % CYRILLIC SMALL LETTER SHORT I WITH TAIL
+\setcclcuc 048C 048D 048C % CYRILLIC CAPITAL LETTER SEMISOFT SIGN
+\setcclcuc 048D 048D 048C % CYRILLIC SMALL LETTER SEMISOFT SIGN
+\setcclcuc 048E 048F 048E % CYRILLIC CAPITAL LETTER ER WITH TICK
+\setcclcuc 048F 048F 048E % CYRILLIC SMALL LETTER ER WITH TICK
+\setcclcuc 0490 0491 0490 % CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+\setcclcuc 0491 0491 0490 % CYRILLIC SMALL LETTER GHE WITH UPTURN
+\setcclcuc 0492 0493 0492 % CYRILLIC CAPITAL LETTER GHE WITH STROKE
+\setcclcuc 0493 0493 0492 % CYRILLIC SMALL LETTER GHE WITH STROKE
+\setcclcuc 0494 0495 0494 % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK
+\setcclcuc 0495 0495 0494 % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK
+\setcclcuc 0496 0497 0496 % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER
+\setcclcuc 0497 0497 0496 % CYRILLIC SMALL LETTER ZHE WITH DESCENDER
+\setcclcuc 0498 0499 0498 % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
+\setcclcuc 0499 0499 0498 % CYRILLIC SMALL LETTER ZE WITH DESCENDER
+\setcclcuc 049A 049B 049A % CYRILLIC CAPITAL LETTER KA WITH DESCENDER
+\setcclcuc 049B 049B 049A % CYRILLIC SMALL LETTER KA WITH DESCENDER
+\setcclcuc 049C 049D 049C % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
+\setcclcuc 049D 049D 049C % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
+\setcclcuc 049E 049F 049E % CYRILLIC CAPITAL LETTER KA WITH STROKE
+\setcclcuc 049F 049F 049E % CYRILLIC SMALL LETTER KA WITH STROKE
+\setcclcuc 04A0 04A1 04A0 % CYRILLIC CAPITAL LETTER BASHKIR KA
+\setcclcuc 04A1 04A1 04A0 % CYRILLIC SMALL LETTER BASHKIR KA
+\setcclcuc 04A2 04A3 04A2 % CYRILLIC CAPITAL LETTER EN WITH DESCENDER
+\setcclcuc 04A3 04A3 04A2 % CYRILLIC SMALL LETTER EN WITH DESCENDER
+\setcclcuc 04A4 04A5 04A4 % CYRILLIC CAPITAL LIGATURE EN GHE
+\setcclcuc 04A5 04A5 04A4 % CYRILLIC SMALL LIGATURE EN GHE
+\setcclcuc 04A6 04A7 04A6 % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK
+\setcclcuc 04A7 04A7 04A6 % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK
+\setcclcuc 04A8 04A9 04A8 % CYRILLIC CAPITAL LETTER ABKHASIAN HA
+\setcclcuc 04A9 04A9 04A8 % CYRILLIC SMALL LETTER ABKHASIAN HA
+\setcclcuc 04AA 04AB 04AA % CYRILLIC CAPITAL LETTER ES WITH DESCENDER
+\setcclcuc 04AB 04AB 04AA % CYRILLIC SMALL LETTER ES WITH DESCENDER
+\setcclcuc 04AC 04AD 04AC % CYRILLIC CAPITAL LETTER TE WITH DESCENDER
+\setcclcuc 04AD 04AD 04AC % CYRILLIC SMALL LETTER TE WITH DESCENDER
+\setcclcuc 04AE 04AF 04AE % CYRILLIC CAPITAL LETTER STRAIGHT U
+\setcclcuc 04AF 04AF 04AE % CYRILLIC SMALL LETTER STRAIGHT U
+\setcclcuc 04B0 04B1 04B0 % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
+\setcclcuc 04B1 04B1 04B0 % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
+\setcclcuc 04B2 04B3 04B2 % CYRILLIC CAPITAL LETTER HA WITH DESCENDER
+\setcclcuc 04B3 04B3 04B2 % CYRILLIC SMALL LETTER HA WITH DESCENDER
+\setcclcuc 04B4 04B5 04B4 % CYRILLIC CAPITAL LIGATURE TE TSE
+\setcclcuc 04B5 04B5 04B4 % CYRILLIC SMALL LIGATURE TE TSE
+\setcclcuc 04B6 04B7 04B6 % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
+\setcclcuc 04B7 04B7 04B6 % CYRILLIC SMALL LETTER CHE WITH DESCENDER
+\setcclcuc 04B8 04B9 04B8 % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE
+\setcclcuc 04B9 04B9 04B8 % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
+\setcclcuc 04BA 04BB 04BA % CYRILLIC CAPITAL LETTER SHHA
+\setcclcuc 04BB 04BB 04BA % CYRILLIC SMALL LETTER SHHA
+\setcclcuc 04BC 04BD 04BC % CYRILLIC CAPITAL LETTER ABKHASIAN CHE
+\setcclcuc 04BD 04BD 04BC % CYRILLIC SMALL LETTER ABKHASIAN CHE
+\setcclcuc 04BE 04BF 04BE % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER
+\setcclcuc 04BF 04BF 04BE % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER
+\setcclcuc 04C0 04CF 04C0 % CYRILLIC LETTER PALOCHKA
+\setcclcuc 04C1 04C2 04C1 % CYRILLIC CAPITAL LETTER ZHE WITH BREVE
+\setcclcuc 04C2 04C2 04C1 % CYRILLIC SMALL LETTER ZHE WITH BREVE
+\setcclcuc 04C3 04C4 04C3 % CYRILLIC CAPITAL LETTER KA WITH HOOK
+\setcclcuc 04C4 04C4 04C3 % CYRILLIC SMALL LETTER KA WITH HOOK
+\setcclcuc 04C5 04C6 04C5 % CYRILLIC CAPITAL LETTER EL WITH TAIL
+\setcclcuc 04C6 04C6 04C5 % CYRILLIC SMALL LETTER EL WITH TAIL
+\setcclcuc 04C7 04C8 04C7 % CYRILLIC CAPITAL LETTER EN WITH HOOK
+\setcclcuc 04C8 04C8 04C7 % CYRILLIC SMALL LETTER EN WITH HOOK
+\setcclcuc 04C9 04CA 04C9 % CYRILLIC CAPITAL LETTER EN WITH TAIL
+\setcclcuc 04CA 04CA 04C9 % CYRILLIC SMALL LETTER EN WITH TAIL
+\setcclcuc 04CB 04CC 04CB % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE
+\setcclcuc 04CC 04CC 04CB % CYRILLIC SMALL LETTER KHAKASSIAN CHE
+\setcclcuc 04CD 04CE 04CD % CYRILLIC CAPITAL LETTER EM WITH TAIL
+\setcclcuc 04CE 04CE 04CD % CYRILLIC SMALL LETTER EM WITH TAIL
+\setcclcuc 04CF 04CF 04C0 % CYRILLIC SMALL LETTER PALOCHKA
+\setcclcuc 04D0 04D1 04D0 % CYRILLIC CAPITAL LETTER A WITH BREVE
+\setcclcuc 04D1 04D1 04D0 % CYRILLIC SMALL LETTER A WITH BREVE
+\setcclcuc 04D2 04D3 04D2 % CYRILLIC CAPITAL LETTER A WITH DIAERESIS
+\setcclcuc 04D3 04D3 04D2 % CYRILLIC SMALL LETTER A WITH DIAERESIS
+\setcclcuc 04D4 04D5 04D4 % CYRILLIC CAPITAL LIGATURE A IE
+\setcclcuc 04D5 04D5 04D4 % CYRILLIC SMALL LIGATURE A IE
+\setcclcuc 04D6 04D7 04D6 % CYRILLIC CAPITAL LETTER IE WITH BREVE
+\setcclcuc 04D7 04D7 04D6 % CYRILLIC SMALL LETTER IE WITH BREVE
+\setcclcuc 04D8 04D9 04D8 % CYRILLIC CAPITAL LETTER SCHWA
+\setcclcuc 04D9 04D9 04D8 % CYRILLIC SMALL LETTER SCHWA
+\setcclcuc 04DA 04DB 04DA % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
+\setcclcuc 04DB 04DB 04DA % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
+\setcclcuc 04DC 04DD 04DC % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
+\setcclcuc 04DD 04DD 04DC % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
+\setcclcuc 04DE 04DF 04DE % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
+\setcclcuc 04DF 04DF 04DE % CYRILLIC SMALL LETTER ZE WITH DIAERESIS
+\setcclcuc 04E0 04E1 04E0 % CYRILLIC CAPITAL LETTER ABKHASIAN DZE
+\setcclcuc 04E1 04E1 04E0 % CYRILLIC SMALL LETTER ABKHASIAN DZE
+\setcclcuc 04E2 04E3 04E2 % CYRILLIC CAPITAL LETTER I WITH MACRON
+\setcclcuc 04E3 04E3 04E2 % CYRILLIC SMALL LETTER I WITH MACRON
+\setcclcuc 04E4 04E5 04E4 % CYRILLIC CAPITAL LETTER I WITH DIAERESIS
+\setcclcuc 04E5 04E5 04E4 % CYRILLIC SMALL LETTER I WITH DIAERESIS
+\setcclcuc 04E6 04E7 04E6 % CYRILLIC CAPITAL LETTER O WITH DIAERESIS
+\setcclcuc 04E7 04E7 04E6 % CYRILLIC SMALL LETTER O WITH DIAERESIS
+\setcclcuc 04E8 04E9 04E8 % CYRILLIC CAPITAL LETTER BARRED O
+\setcclcuc 04E9 04E9 04E8 % CYRILLIC SMALL LETTER BARRED O
+\setcclcuc 04EA 04EB 04EA % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
+\setcclcuc 04EB 04EB 04EA % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
+\setcclcuc 04EC 04ED 04EC % CYRILLIC CAPITAL LETTER E WITH DIAERESIS
+\setcclcuc 04ED 04ED 04EC % CYRILLIC SMALL LETTER E WITH DIAERESIS
+\setcclcuc 04EE 04EF 04EE % CYRILLIC CAPITAL LETTER U WITH MACRON
+\setcclcuc 04EF 04EF 04EE % CYRILLIC SMALL LETTER U WITH MACRON
+\setcclcuc 04F0 04F1 04F0 % CYRILLIC CAPITAL LETTER U WITH DIAERESIS
+\setcclcuc 04F1 04F1 04F0 % CYRILLIC SMALL LETTER U WITH DIAERESIS
+\setcclcuc 04F2 04F3 04F2 % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
+\setcclcuc 04F3 04F3 04F2 % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
+\setcclcuc 04F4 04F5 04F4 % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
+\setcclcuc 04F5 04F5 04F4 % CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+\setcclcuc 04F6 04F7 04F6 % CYRILLIC CAPITAL LETTER GHE WITH DESCENDER
+\setcclcuc 04F7 04F7 04F6 % CYRILLIC SMALL LETTER GHE WITH DESCENDER
+\setcclcuc 04F8 04F9 04F8 % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
+\setcclcuc 04F9 04F9 04F8 % CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+\setcclcuc 04FA 04FB 04FA % CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK
+\setcclcuc 04FB 04FB 04FA % CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK
+\setcclcuc 04FC 04FD 04FC % CYRILLIC CAPITAL LETTER HA WITH HOOK
+\setcclcuc 04FD 04FD 04FC % CYRILLIC SMALL LETTER HA WITH HOOK
+\setcclcuc 04FE 04FF 04FE % CYRILLIC CAPITAL LETTER HA WITH STROKE
+\setcclcuc 04FF 04FF 04FE % CYRILLIC SMALL LETTER HA WITH STROKE
+\setcclcuc 0500 0501 0500 % CYRILLIC CAPITAL LETTER KOMI DE
+\setcclcuc 0501 0501 0500 % CYRILLIC SMALL LETTER KOMI DE
+\setcclcuc 0502 0503 0502 % CYRILLIC CAPITAL LETTER KOMI DJE
+\setcclcuc 0503 0503 0502 % CYRILLIC SMALL LETTER KOMI DJE
+\setcclcuc 0504 0505 0504 % CYRILLIC CAPITAL LETTER KOMI ZJE
+\setcclcuc 0505 0505 0504 % CYRILLIC SMALL LETTER KOMI ZJE
+\setcclcuc 0506 0507 0506 % CYRILLIC CAPITAL LETTER KOMI DZJE
+\setcclcuc 0507 0507 0506 % CYRILLIC SMALL LETTER KOMI DZJE
+\setcclcuc 0508 0509 0508 % CYRILLIC CAPITAL LETTER KOMI LJE
+\setcclcuc 0509 0509 0508 % CYRILLIC SMALL LETTER KOMI LJE
+\setcclcuc 050A 050B 050A % CYRILLIC CAPITAL LETTER KOMI NJE
+\setcclcuc 050B 050B 050A % CYRILLIC SMALL LETTER KOMI NJE
+\setcclcuc 050C 050D 050C % CYRILLIC CAPITAL LETTER KOMI SJE
+\setcclcuc 050D 050D 050C % CYRILLIC SMALL LETTER KOMI SJE
+\setcclcuc 050E 050F 050E % CYRILLIC CAPITAL LETTER KOMI TJE
+\setcclcuc 050F 050F 050E % CYRILLIC SMALL LETTER KOMI TJE
+\setcclcuc 0510 0511 0510 % CYRILLIC CAPITAL LETTER REVERSED ZE
+\setcclcuc 0511 0511 0510 % CYRILLIC SMALL LETTER REVERSED ZE
+\setcclcuc 0512 0513 0512 % CYRILLIC CAPITAL LETTER EL WITH HOOK
+\setcclcuc 0513 0513 0512 % CYRILLIC SMALL LETTER EL WITH HOOK
+\setcclcuc 0531 0561 0531 % ARMENIAN CAPITAL LETTER AYB
+\setcclcuc 0532 0562 0532 % ARMENIAN CAPITAL LETTER BEN
+\setcclcuc 0533 0563 0533 % ARMENIAN CAPITAL LETTER GIM
+\setcclcuc 0534 0564 0534 % ARMENIAN CAPITAL LETTER DA
+\setcclcuc 0535 0565 0535 % ARMENIAN CAPITAL LETTER ECH
+\setcclcuc 0536 0566 0536 % ARMENIAN CAPITAL LETTER ZA
+\setcclcuc 0537 0567 0537 % ARMENIAN CAPITAL LETTER EH
+\setcclcuc 0538 0568 0538 % ARMENIAN CAPITAL LETTER ET
+\setcclcuc 0539 0569 0539 % ARMENIAN CAPITAL LETTER TO
+\setcclcuc 053A 056A 053A % ARMENIAN CAPITAL LETTER ZHE
+\setcclcuc 053B 056B 053B % ARMENIAN CAPITAL LETTER INI
+\setcclcuc 053C 056C 053C % ARMENIAN CAPITAL LETTER LIWN
+\setcclcuc 053D 056D 053D % ARMENIAN CAPITAL LETTER XEH
+\setcclcuc 053E 056E 053E % ARMENIAN CAPITAL LETTER CA
+\setcclcuc 053F 056F 053F % ARMENIAN CAPITAL LETTER KEN
+\setcclcuc 0540 0570 0540 % ARMENIAN CAPITAL LETTER HO
+\setcclcuc 0541 0571 0541 % ARMENIAN CAPITAL LETTER JA
+\setcclcuc 0542 0572 0542 % ARMENIAN CAPITAL LETTER GHAD
+\setcclcuc 0543 0573 0543 % ARMENIAN CAPITAL LETTER CHEH
+\setcclcuc 0544 0574 0544 % ARMENIAN CAPITAL LETTER MEN
+\setcclcuc 0545 0575 0545 % ARMENIAN CAPITAL LETTER YI
+\setcclcuc 0546 0576 0546 % ARMENIAN CAPITAL LETTER NOW
+\setcclcuc 0547 0577 0547 % ARMENIAN CAPITAL LETTER SHA
+\setcclcuc 0548 0578 0548 % ARMENIAN CAPITAL LETTER VO
+\setcclcuc 0549 0579 0549 % ARMENIAN CAPITAL LETTER CHA
+\setcclcuc 054A 057A 054A % ARMENIAN CAPITAL LETTER PEH
+\setcclcuc 054B 057B 054B % ARMENIAN CAPITAL LETTER JHEH
+\setcclcuc 054C 057C 054C % ARMENIAN CAPITAL LETTER RA
+\setcclcuc 054D 057D 054D % ARMENIAN CAPITAL LETTER SEH
+\setcclcuc 054E 057E 054E % ARMENIAN CAPITAL LETTER VEW
+\setcclcuc 054F 057F 054F % ARMENIAN CAPITAL LETTER TIWN
+\setcclcuc 0550 0580 0550 % ARMENIAN CAPITAL LETTER REH
+\setcclcuc 0551 0581 0551 % ARMENIAN CAPITAL LETTER CO
+\setcclcuc 0552 0582 0552 % ARMENIAN CAPITAL LETTER YIWN
+\setcclcuc 0553 0583 0553 % ARMENIAN CAPITAL LETTER PIWR
+\setcclcuc 0554 0584 0554 % ARMENIAN CAPITAL LETTER KEH
+\setcclcuc 0555 0585 0555 % ARMENIAN CAPITAL LETTER OH
+\setcclcuc 0556 0586 0556 % ARMENIAN CAPITAL LETTER FEH
+\setcclcuc 0561 0561 0531 % ARMENIAN SMALL LETTER AYB
+\setcclcuc 0562 0562 0532 % ARMENIAN SMALL LETTER BEN
+\setcclcuc 0563 0563 0533 % ARMENIAN SMALL LETTER GIM
+\setcclcuc 0564 0564 0534 % ARMENIAN SMALL LETTER DA
+\setcclcuc 0565 0565 0535 % ARMENIAN SMALL LETTER ECH
+\setcclcuc 0566 0566 0536 % ARMENIAN SMALL LETTER ZA
+\setcclcuc 0567 0567 0537 % ARMENIAN SMALL LETTER EH
+\setcclcuc 0568 0568 0538 % ARMENIAN SMALL LETTER ET
+\setcclcuc 0569 0569 0539 % ARMENIAN SMALL LETTER TO
+\setcclcuc 056A 056A 053A % ARMENIAN SMALL LETTER ZHE
+\setcclcuc 056B 056B 053B % ARMENIAN SMALL LETTER INI
+\setcclcuc 056C 056C 053C % ARMENIAN SMALL LETTER LIWN
+\setcclcuc 056D 056D 053D % ARMENIAN SMALL LETTER XEH
+\setcclcuc 056E 056E 053E % ARMENIAN SMALL LETTER CA
+\setcclcuc 056F 056F 053F % ARMENIAN SMALL LETTER KEN
+\setcclcuc 0570 0570 0540 % ARMENIAN SMALL LETTER HO
+\setcclcuc 0571 0571 0541 % ARMENIAN SMALL LETTER JA
+\setcclcuc 0572 0572 0542 % ARMENIAN SMALL LETTER GHAD
+\setcclcuc 0573 0573 0543 % ARMENIAN SMALL LETTER CHEH
+\setcclcuc 0574 0574 0544 % ARMENIAN SMALL LETTER MEN
+\setcclcuc 0575 0575 0545 % ARMENIAN SMALL LETTER YI
+\setcclcuc 0576 0576 0546 % ARMENIAN SMALL LETTER NOW
+\setcclcuc 0577 0577 0547 % ARMENIAN SMALL LETTER SHA
+\setcclcuc 0578 0578 0548 % ARMENIAN SMALL LETTER VO
+\setcclcuc 0579 0579 0549 % ARMENIAN SMALL LETTER CHA
+\setcclcuc 057A 057A 054A % ARMENIAN SMALL LETTER PEH
+\setcclcuc 057B 057B 054B % ARMENIAN SMALL LETTER JHEH
+\setcclcuc 057C 057C 054C % ARMENIAN SMALL LETTER RA
+\setcclcuc 057D 057D 054D % ARMENIAN SMALL LETTER SEH
+\setcclcuc 057E 057E 054E % ARMENIAN SMALL LETTER VEW
+\setcclcuc 057F 057F 054F % ARMENIAN SMALL LETTER TIWN
+\setcclcuc 0580 0580 0550 % ARMENIAN SMALL LETTER REH
+\setcclcuc 0581 0581 0551 % ARMENIAN SMALL LETTER CO
+\setcclcuc 0582 0582 0552 % ARMENIAN SMALL LETTER YIWN
+\setcclcuc 0583 0583 0553 % ARMENIAN SMALL LETTER PIWR
+\setcclcuc 0584 0584 0554 % ARMENIAN SMALL LETTER KEH
+\setcclcuc 0585 0585 0555 % ARMENIAN SMALL LETTER OH
+\setcclcuc 0586 0586 0556 % ARMENIAN SMALL LETTER FEH
+\setcclcuc 0587 0587 0587 % ARMENIAN SMALL LIGATURE ECH YIWN
+\setcclcuc 10A0 2D00 10A0 % GEORGIAN CAPITAL LETTER AN
+\setcclcuc 10A1 2D01 10A1 % GEORGIAN CAPITAL LETTER BAN
+\setcclcuc 10A2 2D02 10A2 % GEORGIAN CAPITAL LETTER GAN
+\setcclcuc 10A3 2D03 10A3 % GEORGIAN CAPITAL LETTER DON
+\setcclcuc 10A4 2D04 10A4 % GEORGIAN CAPITAL LETTER EN
+\setcclcuc 10A5 2D05 10A5 % GEORGIAN CAPITAL LETTER VIN
+\setcclcuc 10A6 2D06 10A6 % GEORGIAN CAPITAL LETTER ZEN
+\setcclcuc 10A7 2D07 10A7 % GEORGIAN CAPITAL LETTER TAN
+\setcclcuc 10A8 2D08 10A8 % GEORGIAN CAPITAL LETTER IN
+\setcclcuc 10A9 2D09 10A9 % GEORGIAN CAPITAL LETTER KAN
+\setcclcuc 10AA 2D0A 10AA % GEORGIAN CAPITAL LETTER LAS
+\setcclcuc 10AB 2D0B 10AB % GEORGIAN CAPITAL LETTER MAN
+\setcclcuc 10AC 2D0C 10AC % GEORGIAN CAPITAL LETTER NAR
+\setcclcuc 10AD 2D0D 10AD % GEORGIAN CAPITAL LETTER ON
+\setcclcuc 10AE 2D0E 10AE % GEORGIAN CAPITAL LETTER PAR
+\setcclcuc 10AF 2D0F 10AF % GEORGIAN CAPITAL LETTER ZHAR
+\setcclcuc 10B0 2D10 10B0 % GEORGIAN CAPITAL LETTER RAE
+\setcclcuc 10B1 2D11 10B1 % GEORGIAN CAPITAL LETTER SAN
+\setcclcuc 10B2 2D12 10B2 % GEORGIAN CAPITAL LETTER TAR
+\setcclcuc 10B3 2D13 10B3 % GEORGIAN CAPITAL LETTER UN
+\setcclcuc 10B4 2D14 10B4 % GEORGIAN CAPITAL LETTER PHAR
+\setcclcuc 10B5 2D15 10B5 % GEORGIAN CAPITAL LETTER KHAR
+\setcclcuc 10B6 2D16 10B6 % GEORGIAN CAPITAL LETTER GHAN
+\setcclcuc 10B7 2D17 10B7 % GEORGIAN CAPITAL LETTER QAR
+\setcclcuc 10B8 2D18 10B8 % GEORGIAN CAPITAL LETTER SHIN
+\setcclcuc 10B9 2D19 10B9 % GEORGIAN CAPITAL LETTER CHIN
+\setcclcuc 10BA 2D1A 10BA % GEORGIAN CAPITAL LETTER CAN
+\setcclcuc 10BB 2D1B 10BB % GEORGIAN CAPITAL LETTER JIL
+\setcclcuc 10BC 2D1C 10BC % GEORGIAN CAPITAL LETTER CIL
+\setcclcuc 10BD 2D1D 10BD % GEORGIAN CAPITAL LETTER CHAR
+\setcclcuc 10BE 2D1E 10BE % GEORGIAN CAPITAL LETTER XAN
+\setcclcuc 10BF 2D1F 10BF % GEORGIAN CAPITAL LETTER JHAN
+\setcclcuc 10C0 2D20 10C0 % GEORGIAN CAPITAL LETTER HAE
+\setcclcuc 10C1 2D21 10C1 % GEORGIAN CAPITAL LETTER HE
+\setcclcuc 10C2 2D22 10C2 % GEORGIAN CAPITAL LETTER HIE
+\setcclcuc 10C3 2D23 10C3 % GEORGIAN CAPITAL LETTER WE
+\setcclcuc 10C4 2D24 10C4 % GEORGIAN CAPITAL LETTER HAR
+\setcclcuc 10C5 2D25 10C5 % GEORGIAN CAPITAL LETTER HOE
+\setcclcuc 1D00 1D00 1D00 % LATIN LETTER SMALL CAPITAL A
+\setcclcuc 1D01 1D01 1D01 % LATIN LETTER SMALL CAPITAL AE
+\setcclcuc 1D02 1D02 1D02 % LATIN SMALL LETTER TURNED AE
+\setcclcuc 1D03 1D03 1D03 % LATIN LETTER SMALL CAPITAL BARRED B
+\setcclcuc 1D04 1D04 1D04 % LATIN LETTER SMALL CAPITAL C
+\setcclcuc 1D05 1D05 1D05 % LATIN LETTER SMALL CAPITAL D
+\setcclcuc 1D06 1D06 1D06 % LATIN LETTER SMALL CAPITAL ETH
+\setcclcuc 1D07 1D07 1D07 % LATIN LETTER SMALL CAPITAL E
+\setcclcuc 1D08 1D08 1D08 % LATIN SMALL LETTER TURNED OPEN E
+\setcclcuc 1D09 1D09 1D09 % LATIN SMALL LETTER TURNED I
+\setcclcuc 1D0A 1D0A 1D0A % LATIN LETTER SMALL CAPITAL J
+\setcclcuc 1D0B 1D0B 1D0B % LATIN LETTER SMALL CAPITAL K
+\setcclcuc 1D0C 1D0C 1D0C % LATIN LETTER SMALL CAPITAL L WITH STROKE
+\setcclcuc 1D0D 1D0D 1D0D % LATIN LETTER SMALL CAPITAL M
+\setcclcuc 1D0E 1D0E 1D0E % LATIN LETTER SMALL CAPITAL REVERSED N
+\setcclcuc 1D0F 1D0F 1D0F % LATIN LETTER SMALL CAPITAL O
+\setcclcuc 1D10 1D10 1D10 % LATIN LETTER SMALL CAPITAL OPEN O
+\setcclcuc 1D11 1D11 1D11 % LATIN SMALL LETTER SIDEWAYS O
+\setcclcuc 1D12 1D12 1D12 % LATIN SMALL LETTER SIDEWAYS OPEN O
+\setcclcuc 1D13 1D13 1D13 % LATIN SMALL LETTER SIDEWAYS O WITH STROKE
+\setcclcuc 1D14 1D14 1D14 % LATIN SMALL LETTER TURNED OE
+\setcclcuc 1D15 1D15 1D15 % LATIN LETTER SMALL CAPITAL OU
+\setcclcuc 1D16 1D16 1D16 % LATIN SMALL LETTER TOP HALF O
+\setcclcuc 1D17 1D17 1D17 % LATIN SMALL LETTER BOTTOM HALF O
+\setcclcuc 1D18 1D18 1D18 % LATIN LETTER SMALL CAPITAL P
+\setcclcuc 1D19 1D19 1D19 % LATIN LETTER SMALL CAPITAL REVERSED R
+\setcclcuc 1D1A 1D1A 1D1A % LATIN LETTER SMALL CAPITAL TURNED R
+\setcclcuc 1D1B 1D1B 1D1B % LATIN LETTER SMALL CAPITAL T
+\setcclcuc 1D1C 1D1C 1D1C % LATIN LETTER SMALL CAPITAL U
+\setcclcuc 1D1D 1D1D 1D1D % LATIN SMALL LETTER SIDEWAYS U
+\setcclcuc 1D1E 1D1E 1D1E % LATIN SMALL LETTER SIDEWAYS DIAERESIZED U
+\setcclcuc 1D1F 1D1F 1D1F % LATIN SMALL LETTER SIDEWAYS TURNED M
+\setcclcuc 1D20 1D20 1D20 % LATIN LETTER SMALL CAPITAL V
+\setcclcuc 1D21 1D21 1D21 % LATIN LETTER SMALL CAPITAL W
+\setcclcuc 1D22 1D22 1D22 % LATIN LETTER SMALL CAPITAL Z
+\setcclcuc 1D23 1D23 1D23 % LATIN LETTER SMALL CAPITAL EZH
+\setcclcuc 1D24 1D24 1D24 % LATIN LETTER VOICED LARYNGEAL SPIRANT
+\setcclcuc 1D25 1D25 1D25 % LATIN LETTER AIN
+\setcclcuc 1D26 1D26 1D26 % GREEK LETTER SMALL CAPITAL GAMMA
+\setcclcuc 1D27 1D27 1D27 % GREEK LETTER SMALL CAPITAL LAMDA
+\setcclcuc 1D28 1D28 1D28 % GREEK LETTER SMALL CAPITAL PI
+\setcclcuc 1D29 1D29 1D29 % GREEK LETTER SMALL CAPITAL RHO
+\setcclcuc 1D2A 1D2A 1D2A % GREEK LETTER SMALL CAPITAL PSI
+\setcclcuc 1D2B 1D2B 1D2B % CYRILLIC LETTER SMALL CAPITAL EL
+\setcclcuc 1D62 1D62 1D62 % LATIN SUBSCRIPT SMALL LETTER I
+\setcclcuc 1D63 1D63 1D63 % LATIN SUBSCRIPT SMALL LETTER R
+\setcclcuc 1D64 1D64 1D64 % LATIN SUBSCRIPT SMALL LETTER U
+\setcclcuc 1D65 1D65 1D65 % LATIN SUBSCRIPT SMALL LETTER V
+\setcclcuc 1D66 1D66 1D66 % GREEK SUBSCRIPT SMALL LETTER BETA
+\setcclcuc 1D67 1D67 1D67 % GREEK SUBSCRIPT SMALL LETTER GAMMA
+\setcclcuc 1D68 1D68 1D68 % GREEK SUBSCRIPT SMALL LETTER RHO
+\setcclcuc 1D69 1D69 1D69 % GREEK SUBSCRIPT SMALL LETTER PHI
+\setcclcuc 1D6A 1D6A 1D6A % GREEK SUBSCRIPT SMALL LETTER CHI
+\setcclcuc 1D6B 1D6B 1D6B % LATIN SMALL LETTER UE
+\setcclcuc 1D6C 1D6C 1D6C % LATIN SMALL LETTER B WITH MIDDLE TILDE
+\setcclcuc 1D6D 1D6D 1D6D % LATIN SMALL LETTER D WITH MIDDLE TILDE
+\setcclcuc 1D6E 1D6E 1D6E % LATIN SMALL LETTER F WITH MIDDLE TILDE
+\setcclcuc 1D6F 1D6F 1D6F % LATIN SMALL LETTER M WITH MIDDLE TILDE
+\setcclcuc 1D70 1D70 1D70 % LATIN SMALL LETTER N WITH MIDDLE TILDE
+\setcclcuc 1D71 1D71 1D71 % LATIN SMALL LETTER P WITH MIDDLE TILDE
+\setcclcuc 1D72 1D72 1D72 % LATIN SMALL LETTER R WITH MIDDLE TILDE
+\setcclcuc 1D73 1D73 1D73 % LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE
+\setcclcuc 1D74 1D74 1D74 % LATIN SMALL LETTER S WITH MIDDLE TILDE
+\setcclcuc 1D75 1D75 1D75 % LATIN SMALL LETTER T WITH MIDDLE TILDE
+\setcclcuc 1D76 1D76 1D76 % LATIN SMALL LETTER Z WITH MIDDLE TILDE
+\setcclcuc 1D77 1D77 1D77 % LATIN SMALL LETTER TURNED G
+\setcclcuc 1D79 1D79 1D79 % LATIN SMALL LETTER INSULAR G
+\setcclcuc 1D7A 1D7A 1D7A % LATIN SMALL LETTER TH WITH STRIKETHROUGH
+\setcclcuc 1D7B 1D7B 1D7B % LATIN SMALL CAPITAL LETTER I WITH STROKE
+\setcclcuc 1D7C 1D7C 1D7C % LATIN SMALL LETTER IOTA WITH STROKE
+\setcclcuc 1D7D 1D7D 2C63 % LATIN SMALL LETTER P WITH STROKE
+\setcclcuc 1D7E 1D7E 1D7E % LATIN SMALL CAPITAL LETTER U WITH STROKE
+\setcclcuc 1D7F 1D7F 1D7F % LATIN SMALL LETTER UPSILON WITH STROKE
+\setcclcuc 1D80 1D80 1D80 % LATIN SMALL LETTER B WITH PALATAL HOOK
+\setcclcuc 1D81 1D81 1D81 % LATIN SMALL LETTER D WITH PALATAL HOOK
+\setcclcuc 1D82 1D82 1D82 % LATIN SMALL LETTER F WITH PALATAL HOOK
+\setcclcuc 1D83 1D83 1D83 % LATIN SMALL LETTER G WITH PALATAL HOOK
+\setcclcuc 1D84 1D84 1D84 % LATIN SMALL LETTER K WITH PALATAL HOOK
+\setcclcuc 1D85 1D85 1D85 % LATIN SMALL LETTER L WITH PALATAL HOOK
+\setcclcuc 1D86 1D86 1D86 % LATIN SMALL LETTER M WITH PALATAL HOOK
+\setcclcuc 1D87 1D87 1D87 % LATIN SMALL LETTER N WITH PALATAL HOOK
+\setcclcuc 1D88 1D88 1D88 % LATIN SMALL LETTER P WITH PALATAL HOOK
+\setcclcuc 1D89 1D89 1D89 % LATIN SMALL LETTER R WITH PALATAL HOOK
+\setcclcuc 1D8A 1D8A 1D8A % LATIN SMALL LETTER S WITH PALATAL HOOK
+\setcclcuc 1D8B 1D8B 1D8B % LATIN SMALL LETTER ESH WITH PALATAL HOOK
+\setcclcuc 1D8C 1D8C 1D8C % LATIN SMALL LETTER V WITH PALATAL HOOK
+\setcclcuc 1D8D 1D8D 1D8D % LATIN SMALL LETTER X WITH PALATAL HOOK
+\setcclcuc 1D8E 1D8E 1D8E % LATIN SMALL LETTER Z WITH PALATAL HOOK
+\setcclcuc 1D8F 1D8F 1D8F % LATIN SMALL LETTER A WITH RETROFLEX HOOK
+\setcclcuc 1D90 1D90 1D90 % LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK
+\setcclcuc 1D91 1D91 1D91 % LATIN SMALL LETTER D WITH HOOK AND TAIL
+\setcclcuc 1D92 1D92 1D92 % LATIN SMALL LETTER E WITH RETROFLEX HOOK
+\setcclcuc 1D93 1D93 1D93 % LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK
+\setcclcuc 1D94 1D94 1D94 % LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK
+\setcclcuc 1D95 1D95 1D95 % LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK
+\setcclcuc 1D96 1D96 1D96 % LATIN SMALL LETTER I WITH RETROFLEX HOOK
+\setcclcuc 1D97 1D97 1D97 % LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK
+\setcclcuc 1D98 1D98 1D98 % LATIN SMALL LETTER ESH WITH RETROFLEX HOOK
+\setcclcuc 1D99 1D99 1D99 % LATIN SMALL LETTER U WITH RETROFLEX HOOK
+\setcclcuc 1D9A 1D9A 1D9A % LATIN SMALL LETTER EZH WITH RETROFLEX HOOK
+\setcclcuc 1E00 1E01 1E00 % LATIN CAPITAL LETTER A WITH RING BELOW
+\setcclcuc 1E01 1E01 1E00 % LATIN SMALL LETTER A WITH RING BELOW
+\setcclcuc 1E02 1E03 1E02 % LATIN CAPITAL LETTER B WITH DOT ABOVE
+\setcclcuc 1E03 1E03 1E02 % LATIN SMALL LETTER B WITH DOT ABOVE
+\setcclcuc 1E04 1E05 1E04 % LATIN CAPITAL LETTER B WITH DOT BELOW
+\setcclcuc 1E05 1E05 1E04 % LATIN SMALL LETTER B WITH DOT BELOW
+\setcclcuc 1E06 1E07 1E06 % LATIN CAPITAL LETTER B WITH LINE BELOW
+\setcclcuc 1E07 1E07 1E06 % LATIN SMALL LETTER B WITH LINE BELOW
+\setcclcuc 1E08 1E09 1E08 % LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+\setcclcuc 1E09 1E09 1E08 % LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+\setcclcuc 1E0A 1E0B 1E0A % LATIN CAPITAL LETTER D WITH DOT ABOVE
+\setcclcuc 1E0B 1E0B 1E0A % LATIN SMALL LETTER D WITH DOT ABOVE
+\setcclcuc 1E0C 1E0D 1E0C % LATIN CAPITAL LETTER D WITH DOT BELOW
+\setcclcuc 1E0D 1E0D 1E0C % LATIN SMALL LETTER D WITH DOT BELOW
+\setcclcuc 1E0E 1E0F 1E0E % LATIN CAPITAL LETTER D WITH LINE BELOW
+\setcclcuc 1E0F 1E0F 1E0E % LATIN SMALL LETTER D WITH LINE BELOW
+\setcclcuc 1E10 1E11 1E10 % LATIN CAPITAL LETTER D WITH CEDILLA
+\setcclcuc 1E11 1E11 1E10 % LATIN SMALL LETTER D WITH CEDILLA
+\setcclcuc 1E12 1E13 1E12 % LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
+\setcclcuc 1E13 1E13 1E12 % LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
+\setcclcuc 1E14 1E15 1E14 % LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+\setcclcuc 1E15 1E15 1E14 % LATIN SMALL LETTER E WITH MACRON AND GRAVE
+\setcclcuc 1E16 1E17 1E16 % LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+\setcclcuc 1E17 1E17 1E16 % LATIN SMALL LETTER E WITH MACRON AND ACUTE
+\setcclcuc 1E18 1E19 1E18 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
+\setcclcuc 1E19 1E19 1E18 % LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
+\setcclcuc 1E1A 1E1B 1E1A % LATIN CAPITAL LETTER E WITH TILDE BELOW
+\setcclcuc 1E1B 1E1B 1E1A % LATIN SMALL LETTER E WITH TILDE BELOW
+\setcclcuc 1E1C 1E1D 1E1C % LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+\setcclcuc 1E1D 1E1D 1E1C % LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+\setcclcuc 1E1E 1E1F 1E1E % LATIN CAPITAL LETTER F WITH DOT ABOVE
+\setcclcuc 1E1F 1E1F 1E1E % LATIN SMALL LETTER F WITH DOT ABOVE
+\setcclcuc 1E20 1E21 1E20 % LATIN CAPITAL LETTER G WITH MACRON
+\setcclcuc 1E21 1E21 1E20 % LATIN SMALL LETTER G WITH MACRON
+\setcclcuc 1E22 1E23 1E22 % LATIN CAPITAL LETTER H WITH DOT ABOVE
+\setcclcuc 1E23 1E23 1E22 % LATIN SMALL LETTER H WITH DOT ABOVE
+\setcclcuc 1E24 1E25 1E24 % LATIN CAPITAL LETTER H WITH DOT BELOW
+\setcclcuc 1E25 1E25 1E24 % LATIN SMALL LETTER H WITH DOT BELOW
+\setcclcuc 1E26 1E27 1E26 % LATIN CAPITAL LETTER H WITH DIAERESIS
+\setcclcuc 1E27 1E27 1E26 % LATIN SMALL LETTER H WITH DIAERESIS
+\setcclcuc 1E28 1E29 1E28 % LATIN CAPITAL LETTER H WITH CEDILLA
+\setcclcuc 1E29 1E29 1E28 % LATIN SMALL LETTER H WITH CEDILLA
+\setcclcuc 1E2A 1E2B 1E2A % LATIN CAPITAL LETTER H WITH BREVE BELOW
+\setcclcuc 1E2B 1E2B 1E2A % LATIN SMALL LETTER H WITH BREVE BELOW
+\setcclcuc 1E2C 1E2D 1E2C % LATIN CAPITAL LETTER I WITH TILDE BELOW
+\setcclcuc 1E2D 1E2D 1E2C % LATIN SMALL LETTER I WITH TILDE BELOW
+\setcclcuc 1E2E 1E2F 1E2E % LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+\setcclcuc 1E2F 1E2F 1E2E % LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+\setcclcuc 1E30 1E31 1E30 % LATIN CAPITAL LETTER K WITH ACUTE
+\setcclcuc 1E31 1E31 1E30 % LATIN SMALL LETTER K WITH ACUTE
+\setcclcuc 1E32 1E33 1E32 % LATIN CAPITAL LETTER K WITH DOT BELOW
+\setcclcuc 1E33 1E33 1E32 % LATIN SMALL LETTER K WITH DOT BELOW
+\setcclcuc 1E34 1E35 1E34 % LATIN CAPITAL LETTER K WITH LINE BELOW
+\setcclcuc 1E35 1E35 1E34 % LATIN SMALL LETTER K WITH LINE BELOW
+\setcclcuc 1E36 1E37 1E36 % LATIN CAPITAL LETTER L WITH DOT BELOW
+\setcclcuc 1E37 1E37 1E36 % LATIN SMALL LETTER L WITH DOT BELOW
+\setcclcuc 1E38 1E39 1E38 % LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+\setcclcuc 1E39 1E39 1E38 % LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+\setcclcuc 1E3A 1E3B 1E3A % LATIN CAPITAL LETTER L WITH LINE BELOW
+\setcclcuc 1E3B 1E3B 1E3A % LATIN SMALL LETTER L WITH LINE BELOW
+\setcclcuc 1E3C 1E3D 1E3C % LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
+\setcclcuc 1E3D 1E3D 1E3C % LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
+\setcclcuc 1E3E 1E3F 1E3E % LATIN CAPITAL LETTER M WITH ACUTE
+\setcclcuc 1E3F 1E3F 1E3E % LATIN SMALL LETTER M WITH ACUTE
+\setcclcuc 1E40 1E41 1E40 % LATIN CAPITAL LETTER M WITH DOT ABOVE
+\setcclcuc 1E41 1E41 1E40 % LATIN SMALL LETTER M WITH DOT ABOVE
+\setcclcuc 1E42 1E43 1E42 % LATIN CAPITAL LETTER M WITH DOT BELOW
+\setcclcuc 1E43 1E43 1E42 % LATIN SMALL LETTER M WITH DOT BELOW
+\setcclcuc 1E44 1E45 1E44 % LATIN CAPITAL LETTER N WITH DOT ABOVE
+\setcclcuc 1E45 1E45 1E44 % LATIN SMALL LETTER N WITH DOT ABOVE
+\setcclcuc 1E46 1E47 1E46 % LATIN CAPITAL LETTER N WITH DOT BELOW
+\setcclcuc 1E47 1E47 1E46 % LATIN SMALL LETTER N WITH DOT BELOW
+\setcclcuc 1E48 1E49 1E48 % LATIN CAPITAL LETTER N WITH LINE BELOW
+\setcclcuc 1E49 1E49 1E48 % LATIN SMALL LETTER N WITH LINE BELOW
+\setcclcuc 1E4A 1E4B 1E4A % LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
+\setcclcuc 1E4B 1E4B 1E4A % LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
+\setcclcuc 1E4C 1E4D 1E4C % LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+\setcclcuc 1E4D 1E4D 1E4C % LATIN SMALL LETTER O WITH TILDE AND ACUTE
+\setcclcuc 1E4E 1E4F 1E4E % LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+\setcclcuc 1E4F 1E4F 1E4E % LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+\setcclcuc 1E50 1E51 1E50 % LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+\setcclcuc 1E51 1E51 1E50 % LATIN SMALL LETTER O WITH MACRON AND GRAVE
+\setcclcuc 1E52 1E53 1E52 % LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+\setcclcuc 1E53 1E53 1E52 % LATIN SMALL LETTER O WITH MACRON AND ACUTE
+\setcclcuc 1E54 1E55 1E54 % LATIN CAPITAL LETTER P WITH ACUTE
+\setcclcuc 1E55 1E55 1E54 % LATIN SMALL LETTER P WITH ACUTE
+\setcclcuc 1E56 1E57 1E56 % LATIN CAPITAL LETTER P WITH DOT ABOVE
+\setcclcuc 1E57 1E57 1E56 % LATIN SMALL LETTER P WITH DOT ABOVE
+\setcclcuc 1E58 1E59 1E58 % LATIN CAPITAL LETTER R WITH DOT ABOVE
+\setcclcuc 1E59 1E59 1E58 % LATIN SMALL LETTER R WITH DOT ABOVE
+\setcclcuc 1E5A 1E5B 1E5A % LATIN CAPITAL LETTER R WITH DOT BELOW
+\setcclcuc 1E5B 1E5B 1E5A % LATIN SMALL LETTER R WITH DOT BELOW
+\setcclcuc 1E5C 1E5D 1E5C % LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+\setcclcuc 1E5D 1E5D 1E5C % LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+\setcclcuc 1E5E 1E5F 1E5E % LATIN CAPITAL LETTER R WITH LINE BELOW
+\setcclcuc 1E5F 1E5F 1E5E % LATIN SMALL LETTER R WITH LINE BELOW
+\setcclcuc 1E60 1E61 1E60 % LATIN CAPITAL LETTER S WITH DOT ABOVE
+\setcclcuc 1E61 1E61 1E60 % LATIN SMALL LETTER S WITH DOT ABOVE
+\setcclcuc 1E62 1E63 1E62 % LATIN CAPITAL LETTER S WITH DOT BELOW
+\setcclcuc 1E63 1E63 1E62 % LATIN SMALL LETTER S WITH DOT BELOW
+\setcclcuc 1E64 1E65 1E64 % LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+\setcclcuc 1E65 1E65 1E64 % LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+\setcclcuc 1E66 1E67 1E66 % LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+\setcclcuc 1E67 1E67 1E66 % LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+\setcclcuc 1E68 1E69 1E68 % LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+\setcclcuc 1E69 1E69 1E68 % LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+\setcclcuc 1E6A 1E6B 1E6A % LATIN CAPITAL LETTER T WITH DOT ABOVE
+\setcclcuc 1E6B 1E6B 1E6A % LATIN SMALL LETTER T WITH DOT ABOVE
+\setcclcuc 1E6C 1E6D 1E6C % LATIN CAPITAL LETTER T WITH DOT BELOW
+\setcclcuc 1E6D 1E6D 1E6C % LATIN SMALL LETTER T WITH DOT BELOW
+\setcclcuc 1E6E 1E6F 1E6E % LATIN CAPITAL LETTER T WITH LINE BELOW
+\setcclcuc 1E6F 1E6F 1E6E % LATIN SMALL LETTER T WITH LINE BELOW
+\setcclcuc 1E70 1E71 1E70 % LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
+\setcclcuc 1E71 1E71 1E70 % LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
+\setcclcuc 1E72 1E73 1E72 % LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
+\setcclcuc 1E73 1E73 1E72 % LATIN SMALL LETTER U WITH DIAERESIS BELOW
+\setcclcuc 1E74 1E75 1E74 % LATIN CAPITAL LETTER U WITH TILDE BELOW
+\setcclcuc 1E75 1E75 1E74 % LATIN SMALL LETTER U WITH TILDE BELOW
+\setcclcuc 1E76 1E77 1E76 % LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
+\setcclcuc 1E77 1E77 1E76 % LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
+\setcclcuc 1E78 1E79 1E78 % LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+\setcclcuc 1E79 1E79 1E78 % LATIN SMALL LETTER U WITH TILDE AND ACUTE
+\setcclcuc 1E7A 1E7B 1E7A % LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+\setcclcuc 1E7B 1E7B 1E7A % LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+\setcclcuc 1E7C 1E7D 1E7C % LATIN CAPITAL LETTER V WITH TILDE
+\setcclcuc 1E7D 1E7D 1E7C % LATIN SMALL LETTER V WITH TILDE
+\setcclcuc 1E7E 1E7F 1E7E % LATIN CAPITAL LETTER V WITH DOT BELOW
+\setcclcuc 1E7F 1E7F 1E7E % LATIN SMALL LETTER V WITH DOT BELOW
+\setcclcuc 1E80 1E81 1E80 % LATIN CAPITAL LETTER W WITH GRAVE
+\setcclcuc 1E81 1E81 1E80 % LATIN SMALL LETTER W WITH GRAVE
+\setcclcuc 1E82 1E83 1E82 % LATIN CAPITAL LETTER W WITH ACUTE
+\setcclcuc 1E83 1E83 1E82 % LATIN SMALL LETTER W WITH ACUTE
+\setcclcuc 1E84 1E85 1E84 % LATIN CAPITAL LETTER W WITH DIAERESIS
+\setcclcuc 1E85 1E85 1E84 % LATIN SMALL LETTER W WITH DIAERESIS
+\setcclcuc 1E86 1E87 1E86 % LATIN CAPITAL LETTER W WITH DOT ABOVE
+\setcclcuc 1E87 1E87 1E86 % LATIN SMALL LETTER W WITH DOT ABOVE
+\setcclcuc 1E88 1E89 1E88 % LATIN CAPITAL LETTER W WITH DOT BELOW
+\setcclcuc 1E89 1E89 1E88 % LATIN SMALL LETTER W WITH DOT BELOW
+\setcclcuc 1E8A 1E8B 1E8A % LATIN CAPITAL LETTER X WITH DOT ABOVE
+\setcclcuc 1E8B 1E8B 1E8A % LATIN SMALL LETTER X WITH DOT ABOVE
+\setcclcuc 1E8C 1E8D 1E8C % LATIN CAPITAL LETTER X WITH DIAERESIS
+\setcclcuc 1E8D 1E8D 1E8C % LATIN SMALL LETTER X WITH DIAERESIS
+\setcclcuc 1E8E 1E8F 1E8E % LATIN CAPITAL LETTER Y WITH DOT ABOVE
+\setcclcuc 1E8F 1E8F 1E8E % LATIN SMALL LETTER Y WITH DOT ABOVE
+\setcclcuc 1E90 1E91 1E90 % LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
+\setcclcuc 1E91 1E91 1E90 % LATIN SMALL LETTER Z WITH CIRCUMFLEX
+\setcclcuc 1E92 1E93 1E92 % LATIN CAPITAL LETTER Z WITH DOT BELOW
+\setcclcuc 1E93 1E93 1E92 % LATIN SMALL LETTER Z WITH DOT BELOW
+\setcclcuc 1E94 1E95 1E94 % LATIN CAPITAL LETTER Z WITH LINE BELOW
+\setcclcuc 1E95 1E95 1E94 % LATIN SMALL LETTER Z WITH LINE BELOW
+\setcclcuc 1E96 1E96 1E96 % LATIN SMALL LETTER H WITH LINE BELOW
+\setcclcuc 1E97 1E97 1E97 % LATIN SMALL LETTER T WITH DIAERESIS
+\setcclcuc 1E98 1E98 1E98 % LATIN SMALL LETTER W WITH RING ABOVE
+\setcclcuc 1E99 1E99 1E99 % LATIN SMALL LETTER Y WITH RING ABOVE
+\setcclcuc 1E9A 1E9A 1E9A % LATIN SMALL LETTER A WITH RIGHT HALF RING
+\setcclcuc 1E9B 1E9B 1E60 % LATIN SMALL LETTER LONG S WITH DOT ABOVE
+\setcclcuc 1EA0 1EA1 1EA0 % LATIN CAPITAL LETTER A WITH DOT BELOW
+\setcclcuc 1EA1 1EA1 1EA0 % LATIN SMALL LETTER A WITH DOT BELOW
+\setcclcuc 1EA2 1EA3 1EA2 % LATIN CAPITAL LETTER A WITH HOOK ABOVE
+\setcclcuc 1EA3 1EA3 1EA2 % LATIN SMALL LETTER A WITH HOOK ABOVE
+\setcclcuc 1EA4 1EA5 1EA4 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+\setcclcuc 1EA5 1EA5 1EA4 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+\setcclcuc 1EA6 1EA7 1EA6 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+\setcclcuc 1EA7 1EA7 1EA6 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+\setcclcuc 1EA8 1EA9 1EA8 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+\setcclcuc 1EA9 1EA9 1EA8 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+\setcclcuc 1EAA 1EAB 1EAA % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+\setcclcuc 1EAB 1EAB 1EAA % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+\setcclcuc 1EAC 1EAD 1EAC % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+\setcclcuc 1EAD 1EAD 1EAC % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+\setcclcuc 1EAE 1EAF 1EAE % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+\setcclcuc 1EAF 1EAF 1EAE % LATIN SMALL LETTER A WITH BREVE AND ACUTE
+\setcclcuc 1EB0 1EB1 1EB0 % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+\setcclcuc 1EB1 1EB1 1EB0 % LATIN SMALL LETTER A WITH BREVE AND GRAVE
+\setcclcuc 1EB2 1EB3 1EB2 % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+\setcclcuc 1EB3 1EB3 1EB2 % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+\setcclcuc 1EB4 1EB5 1EB4 % LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+\setcclcuc 1EB5 1EB5 1EB4 % LATIN SMALL LETTER A WITH BREVE AND TILDE
+\setcclcuc 1EB6 1EB7 1EB6 % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+\setcclcuc 1EB7 1EB7 1EB6 % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+\setcclcuc 1EB8 1EB9 1EB8 % LATIN CAPITAL LETTER E WITH DOT BELOW
+\setcclcuc 1EB9 1EB9 1EB8 % LATIN SMALL LETTER E WITH DOT BELOW
+\setcclcuc 1EBA 1EBB 1EBA % LATIN CAPITAL LETTER E WITH HOOK ABOVE
+\setcclcuc 1EBB 1EBB 1EBA % LATIN SMALL LETTER E WITH HOOK ABOVE
+\setcclcuc 1EBC 1EBD 1EBC % LATIN CAPITAL LETTER E WITH TILDE
+\setcclcuc 1EBD 1EBD 1EBC % LATIN SMALL LETTER E WITH TILDE
+\setcclcuc 1EBE 1EBF 1EBE % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+\setcclcuc 1EBF 1EBF 1EBE % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+\setcclcuc 1EC0 1EC1 1EC0 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+\setcclcuc 1EC1 1EC1 1EC0 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+\setcclcuc 1EC2 1EC3 1EC2 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+\setcclcuc 1EC3 1EC3 1EC2 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+\setcclcuc 1EC4 1EC5 1EC4 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+\setcclcuc 1EC5 1EC5 1EC4 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+\setcclcuc 1EC6 1EC7 1EC6 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+\setcclcuc 1EC7 1EC7 1EC6 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+\setcclcuc 1EC8 1EC9 1EC8 % LATIN CAPITAL LETTER I WITH HOOK ABOVE
+\setcclcuc 1EC9 1EC9 1EC8 % LATIN SMALL LETTER I WITH HOOK ABOVE
+\setcclcuc 1ECA 1ECB 1ECA % LATIN CAPITAL LETTER I WITH DOT BELOW
+\setcclcuc 1ECB 1ECB 1ECA % LATIN SMALL LETTER I WITH DOT BELOW
+\setcclcuc 1ECC 1ECD 1ECC % LATIN CAPITAL LETTER O WITH DOT BELOW
+\setcclcuc 1ECD 1ECD 1ECC % LATIN SMALL LETTER O WITH DOT BELOW
+\setcclcuc 1ECE 1ECF 1ECE % LATIN CAPITAL LETTER O WITH HOOK ABOVE
+\setcclcuc 1ECF 1ECF 1ECE % LATIN SMALL LETTER O WITH HOOK ABOVE
+\setcclcuc 1ED0 1ED1 1ED0 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+\setcclcuc 1ED1 1ED1 1ED0 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+\setcclcuc 1ED2 1ED3 1ED2 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+\setcclcuc 1ED3 1ED3 1ED2 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+\setcclcuc 1ED4 1ED5 1ED4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+\setcclcuc 1ED5 1ED5 1ED4 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+\setcclcuc 1ED6 1ED7 1ED6 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+\setcclcuc 1ED7 1ED7 1ED6 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+\setcclcuc 1ED8 1ED9 1ED8 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+\setcclcuc 1ED9 1ED9 1ED8 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+\setcclcuc 1EDA 1EDB 1EDA % LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+\setcclcuc 1EDB 1EDB 1EDA % LATIN SMALL LETTER O WITH HORN AND ACUTE
+\setcclcuc 1EDC 1EDD 1EDC % LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+\setcclcuc 1EDD 1EDD 1EDC % LATIN SMALL LETTER O WITH HORN AND GRAVE
+\setcclcuc 1EDE 1EDF 1EDE % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+\setcclcuc 1EDF 1EDF 1EDE % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+\setcclcuc 1EE0 1EE1 1EE0 % LATIN CAPITAL LETTER O WITH HORN AND TILDE
+\setcclcuc 1EE1 1EE1 1EE0 % LATIN SMALL LETTER O WITH HORN AND TILDE
+\setcclcuc 1EE2 1EE3 1EE2 % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+\setcclcuc 1EE3 1EE3 1EE2 % LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+\setcclcuc 1EE4 1EE5 1EE4 % LATIN CAPITAL LETTER U WITH DOT BELOW
+\setcclcuc 1EE5 1EE5 1EE4 % LATIN SMALL LETTER U WITH DOT BELOW
+\setcclcuc 1EE6 1EE7 1EE6 % LATIN CAPITAL LETTER U WITH HOOK ABOVE
+\setcclcuc 1EE7 1EE7 1EE6 % LATIN SMALL LETTER U WITH HOOK ABOVE
+\setcclcuc 1EE8 1EE9 1EE8 % LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+\setcclcuc 1EE9 1EE9 1EE8 % LATIN SMALL LETTER U WITH HORN AND ACUTE
+\setcclcuc 1EEA 1EEB 1EEA % LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+\setcclcuc 1EEB 1EEB 1EEA % LATIN SMALL LETTER U WITH HORN AND GRAVE
+\setcclcuc 1EEC 1EED 1EEC % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+\setcclcuc 1EED 1EED 1EEC % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+\setcclcuc 1EEE 1EEF 1EEE % LATIN CAPITAL LETTER U WITH HORN AND TILDE
+\setcclcuc 1EEF 1EEF 1EEE % LATIN SMALL LETTER U WITH HORN AND TILDE
+\setcclcuc 1EF0 1EF1 1EF0 % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+\setcclcuc 1EF1 1EF1 1EF0 % LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+\setcclcuc 1EF2 1EF3 1EF2 % LATIN CAPITAL LETTER Y WITH GRAVE
+\setcclcuc 1EF3 1EF3 1EF2 % LATIN SMALL LETTER Y WITH GRAVE
+\setcclcuc 1EF4 1EF5 1EF4 % LATIN CAPITAL LETTER Y WITH DOT BELOW
+\setcclcuc 1EF5 1EF5 1EF4 % LATIN SMALL LETTER Y WITH DOT BELOW
+\setcclcuc 1EF6 1EF7 1EF6 % LATIN CAPITAL LETTER Y WITH HOOK ABOVE
+\setcclcuc 1EF7 1EF7 1EF6 % LATIN SMALL LETTER Y WITH HOOK ABOVE
+\setcclcuc 1EF8 1EF9 1EF8 % LATIN CAPITAL LETTER Y WITH TILDE
+\setcclcuc 1EF9 1EF9 1EF8 % LATIN SMALL LETTER Y WITH TILDE
+\setcclcuc 1F00 1F00 1F08 % GREEK SMALL LETTER ALPHA WITH PSILI
+\setcclcuc 1F01 1F01 1F09 % GREEK SMALL LETTER ALPHA WITH DASIA
+\setcclcuc 1F02 1F02 1F0A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+\setcclcuc 1F03 1F03 1F0B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+\setcclcuc 1F04 1F04 1F0C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+\setcclcuc 1F05 1F05 1F0D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+\setcclcuc 1F06 1F06 1F0E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F07 1F07 1F0F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F08 1F00 1F08 % GREEK CAPITAL LETTER ALPHA WITH PSILI
+\setcclcuc 1F09 1F01 1F09 % GREEK CAPITAL LETTER ALPHA WITH DASIA
+\setcclcuc 1F0A 1F02 1F0A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+\setcclcuc 1F0B 1F03 1F0B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+\setcclcuc 1F0C 1F04 1F0C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+\setcclcuc 1F0D 1F05 1F0D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+\setcclcuc 1F0E 1F06 1F0E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F0F 1F07 1F0F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F10 1F10 1F18 % GREEK SMALL LETTER EPSILON WITH PSILI
+\setcclcuc 1F11 1F11 1F19 % GREEK SMALL LETTER EPSILON WITH DASIA
+\setcclcuc 1F12 1F12 1F1A % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+\setcclcuc 1F13 1F13 1F1B % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+\setcclcuc 1F14 1F14 1F1C % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+\setcclcuc 1F15 1F15 1F1D % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+\setcclcuc 1F18 1F10 1F18 % GREEK CAPITAL LETTER EPSILON WITH PSILI
+\setcclcuc 1F19 1F11 1F19 % GREEK CAPITAL LETTER EPSILON WITH DASIA
+\setcclcuc 1F1A 1F12 1F1A % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+\setcclcuc 1F1B 1F13 1F1B % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+\setcclcuc 1F1C 1F14 1F1C % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+\setcclcuc 1F1D 1F15 1F1D % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+\setcclcuc 1F20 1F20 1F28 % GREEK SMALL LETTER ETA WITH PSILI
+\setcclcuc 1F21 1F21 1F29 % GREEK SMALL LETTER ETA WITH DASIA
+\setcclcuc 1F22 1F22 1F2A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+\setcclcuc 1F23 1F23 1F2B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+\setcclcuc 1F24 1F24 1F2C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+\setcclcuc 1F25 1F25 1F2D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+\setcclcuc 1F26 1F26 1F2E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F27 1F27 1F2F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F28 1F20 1F28 % GREEK CAPITAL LETTER ETA WITH PSILI
+\setcclcuc 1F29 1F21 1F29 % GREEK CAPITAL LETTER ETA WITH DASIA
+\setcclcuc 1F2A 1F22 1F2A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+\setcclcuc 1F2B 1F23 1F2B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+\setcclcuc 1F2C 1F24 1F2C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+\setcclcuc 1F2D 1F25 1F2D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+\setcclcuc 1F2E 1F26 1F2E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F2F 1F27 1F2F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F30 1F30 1F38 % GREEK SMALL LETTER IOTA WITH PSILI
+\setcclcuc 1F31 1F31 1F39 % GREEK SMALL LETTER IOTA WITH DASIA
+\setcclcuc 1F32 1F32 1F3A % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+\setcclcuc 1F33 1F33 1F3B % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+\setcclcuc 1F34 1F34 1F3C % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+\setcclcuc 1F35 1F35 1F3D % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+\setcclcuc 1F36 1F36 1F3E % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F37 1F37 1F3F % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F38 1F30 1F38 % GREEK CAPITAL LETTER IOTA WITH PSILI
+\setcclcuc 1F39 1F31 1F39 % GREEK CAPITAL LETTER IOTA WITH DASIA
+\setcclcuc 1F3A 1F32 1F3A % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+\setcclcuc 1F3B 1F33 1F3B % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+\setcclcuc 1F3C 1F34 1F3C % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+\setcclcuc 1F3D 1F35 1F3D % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+\setcclcuc 1F3E 1F36 1F3E % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F3F 1F37 1F3F % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F40 1F40 1F48 % GREEK SMALL LETTER OMICRON WITH PSILI
+\setcclcuc 1F41 1F41 1F49 % GREEK SMALL LETTER OMICRON WITH DASIA
+\setcclcuc 1F42 1F42 1F4A % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+\setcclcuc 1F43 1F43 1F4B % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+\setcclcuc 1F44 1F44 1F4C % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+\setcclcuc 1F45 1F45 1F4D % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+\setcclcuc 1F48 1F40 1F48 % GREEK CAPITAL LETTER OMICRON WITH PSILI
+\setcclcuc 1F49 1F41 1F49 % GREEK CAPITAL LETTER OMICRON WITH DASIA
+\setcclcuc 1F4A 1F42 1F4A % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+\setcclcuc 1F4B 1F43 1F4B % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+\setcclcuc 1F4C 1F44 1F4C % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+\setcclcuc 1F4D 1F45 1F4D % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+\setcclcuc 1F50 1F50 1F50 % GREEK SMALL LETTER UPSILON WITH PSILI
+\setcclcuc 1F51 1F51 1F59 % GREEK SMALL LETTER UPSILON WITH DASIA
+\setcclcuc 1F52 1F52 1F52 % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+\setcclcuc 1F53 1F53 1F5B % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+\setcclcuc 1F54 1F54 1F54 % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+\setcclcuc 1F55 1F55 1F5D % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+\setcclcuc 1F56 1F56 1F56 % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+\setcclcuc 1F57 1F57 1F5F % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+\setcclcuc 1F59 1F51 1F59 % GREEK CAPITAL LETTER UPSILON WITH DASIA
+\setcclcuc 1F5B 1F53 1F5B % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+\setcclcuc 1F5D 1F55 1F5D % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+\setcclcuc 1F5F 1F57 1F5F % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+\setcclcuc 1F60 1F60 1F68 % GREEK SMALL LETTER OMEGA WITH PSILI
+\setcclcuc 1F61 1F61 1F69 % GREEK SMALL LETTER OMEGA WITH DASIA
+\setcclcuc 1F62 1F62 1F6A % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+\setcclcuc 1F63 1F63 1F6B % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+\setcclcuc 1F64 1F64 1F6C % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+\setcclcuc 1F65 1F65 1F6D % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+\setcclcuc 1F66 1F66 1F6E % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F67 1F67 1F6F % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F68 1F60 1F68 % GREEK CAPITAL LETTER OMEGA WITH PSILI
+\setcclcuc 1F69 1F61 1F69 % GREEK CAPITAL LETTER OMEGA WITH DASIA
+\setcclcuc 1F6A 1F62 1F6A % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+\setcclcuc 1F6B 1F63 1F6B % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+\setcclcuc 1F6C 1F64 1F6C % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+\setcclcuc 1F6D 1F65 1F6D % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+\setcclcuc 1F6E 1F66 1F6E % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+\setcclcuc 1F6F 1F67 1F6F % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+\setcclcuc 1F70 1F70 1FBA % GREEK SMALL LETTER ALPHA WITH VARIA
+\setcclcuc 1F71 1F71 1FBB % GREEK SMALL LETTER ALPHA WITH OXIA
+\setcclcuc 1F72 1F72 1FC8 % GREEK SMALL LETTER EPSILON WITH VARIA
+\setcclcuc 1F73 1F73 1FC9 % GREEK SMALL LETTER EPSILON WITH OXIA
+\setcclcuc 1F74 1F74 1FCA % GREEK SMALL LETTER ETA WITH VARIA
+\setcclcuc 1F75 1F75 1FCB % GREEK SMALL LETTER ETA WITH OXIA
+\setcclcuc 1F76 1F76 1FDA % GREEK SMALL LETTER IOTA WITH VARIA
+\setcclcuc 1F77 1F77 1FDB % GREEK SMALL LETTER IOTA WITH OXIA
+\setcclcuc 1F78 1F78 1FF8 % GREEK SMALL LETTER OMICRON WITH VARIA
+\setcclcuc 1F79 1F79 1FF9 % GREEK SMALL LETTER OMICRON WITH OXIA
+\setcclcuc 1F7A 1F7A 1FEA % GREEK SMALL LETTER UPSILON WITH VARIA
+\setcclcuc 1F7B 1F7B 1FEB % GREEK SMALL LETTER UPSILON WITH OXIA
+\setcclcuc 1F7C 1F7C 1FFA % GREEK SMALL LETTER OMEGA WITH VARIA
+\setcclcuc 1F7D 1F7D 1FFB % GREEK SMALL LETTER OMEGA WITH OXIA
+\setcclcuc 1F80 1F80 1F88 % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+\setcclcuc 1F81 1F81 1F89 % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+\setcclcuc 1F82 1F82 1F8A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+\setcclcuc 1F83 1F83 1F8B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+\setcclcuc 1F84 1F84 1F8C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+\setcclcuc 1F85 1F85 1F8D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+\setcclcuc 1F86 1F86 1F8E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1F87 1F87 1F8F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1F88 1F80 1F88 % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+\setcclcuc 1F89 1F81 1F89 % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+\setcclcuc 1F8A 1F82 1F8A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+\setcclcuc 1F8B 1F83 1F8B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+\setcclcuc 1F8C 1F84 1F8C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+\setcclcuc 1F8D 1F85 1F8D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+\setcclcuc 1F8E 1F86 1F8E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+\setcclcuc 1F8F 1F87 1F8F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+\setcclcuc 1F90 1F90 1F98 % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+\setcclcuc 1F91 1F91 1F99 % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+\setcclcuc 1F92 1F92 1F9A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+\setcclcuc 1F93 1F93 1F9B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+\setcclcuc 1F94 1F94 1F9C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+\setcclcuc 1F95 1F95 1F9D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+\setcclcuc 1F96 1F96 1F9E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1F97 1F97 1F9F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1F98 1F90 1F98 % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+\setcclcuc 1F99 1F91 1F99 % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+\setcclcuc 1F9A 1F92 1F9A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+\setcclcuc 1F9B 1F93 1F9B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+\setcclcuc 1F9C 1F94 1F9C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+\setcclcuc 1F9D 1F95 1F9D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+\setcclcuc 1F9E 1F96 1F9E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+\setcclcuc 1F9F 1F97 1F9F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+\setcclcuc 1FA0 1FA0 1FA8 % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+\setcclcuc 1FA1 1FA1 1FA9 % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+\setcclcuc 1FA2 1FA2 1FAA % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+\setcclcuc 1FA3 1FA3 1FAB % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+\setcclcuc 1FA4 1FA4 1FAC % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+\setcclcuc 1FA5 1FA5 1FAD % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+\setcclcuc 1FA6 1FA6 1FAE % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1FA7 1FA7 1FAF % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1FA8 1FA0 1FA8 % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+\setcclcuc 1FA9 1FA1 1FA9 % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+\setcclcuc 1FAA 1FA2 1FAA % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+\setcclcuc 1FAB 1FA3 1FAB % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+\setcclcuc 1FAC 1FA4 1FAC % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+\setcclcuc 1FAD 1FA5 1FAD % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+\setcclcuc 1FAE 1FA6 1FAE % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+\setcclcuc 1FAF 1FA7 1FAF % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+\setcclcuc 1FB0 1FB0 1FB8 % GREEK SMALL LETTER ALPHA WITH VRACHY
+\setcclcuc 1FB1 1FB1 1FB9 % GREEK SMALL LETTER ALPHA WITH MACRON
+\setcclcuc 1FB2 1FB2 1FB2 % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+\setcclcuc 1FB3 1FB3 1FBC % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+\setcclcuc 1FB4 1FB4 1FB4 % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+\setcclcuc 1FB6 1FB6 1FB6 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI
+\setcclcuc 1FB7 1FB7 1FB7 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1FB8 1FB0 1FB8 % GREEK CAPITAL LETTER ALPHA WITH VRACHY
+\setcclcuc 1FB9 1FB1 1FB9 % GREEK CAPITAL LETTER ALPHA WITH MACRON
+\setcclcuc 1FBA 1F70 1FBA % GREEK CAPITAL LETTER ALPHA WITH VARIA
+\setcclcuc 1FBB 1F71 1FBB % GREEK CAPITAL LETTER ALPHA WITH OXIA
+\setcclcuc 1FBC 1FB3 1FBC % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+\setcclcuc 1FBE 1FBE 0399 % GREEK PROSGEGRAMMENI
+\setcclcuc 1FC2 1FC2 1FC2 % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+\setcclcuc 1FC3 1FC3 1FCC % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+\setcclcuc 1FC4 1FC4 1FC4 % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+\setcclcuc 1FC6 1FC6 1FC6 % GREEK SMALL LETTER ETA WITH PERISPOMENI
+\setcclcuc 1FC7 1FC7 1FC7 % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1FC8 1F72 1FC8 % GREEK CAPITAL LETTER EPSILON WITH VARIA
+\setcclcuc 1FC9 1F73 1FC9 % GREEK CAPITAL LETTER EPSILON WITH OXIA
+\setcclcuc 1FCA 1F74 1FCA % GREEK CAPITAL LETTER ETA WITH VARIA
+\setcclcuc 1FCB 1F75 1FCB % GREEK CAPITAL LETTER ETA WITH OXIA
+\setcclcuc 1FCC 1FC3 1FCC % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+\setcclcuc 1FD0 1FD0 1FD8 % GREEK SMALL LETTER IOTA WITH VRACHY
+\setcclcuc 1FD1 1FD1 1FD9 % GREEK SMALL LETTER IOTA WITH MACRON
+\setcclcuc 1FD2 1FD2 1FD2 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+\setcclcuc 1FD3 1FD3 1FD3 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
+\setcclcuc 1FD6 1FD6 1FD6 % GREEK SMALL LETTER IOTA WITH PERISPOMENI
+\setcclcuc 1FD7 1FD7 1FD7 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+\setcclcuc 1FD8 1FD0 1FD8 % GREEK CAPITAL LETTER IOTA WITH VRACHY
+\setcclcuc 1FD9 1FD1 1FD9 % GREEK CAPITAL LETTER IOTA WITH MACRON
+\setcclcuc 1FDA 1F76 1FDA % GREEK CAPITAL LETTER IOTA WITH VARIA
+\setcclcuc 1FDB 1F77 1FDB % GREEK CAPITAL LETTER IOTA WITH OXIA
+\setcclcuc 1FE0 1FE0 1FE8 % GREEK SMALL LETTER UPSILON WITH VRACHY
+\setcclcuc 1FE1 1FE1 1FE9 % GREEK SMALL LETTER UPSILON WITH MACRON
+\setcclcuc 1FE2 1FE2 1FE2 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+\setcclcuc 1FE3 1FE3 1FE3 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
+\setcclcuc 1FE4 1FE4 1FE4 % GREEK SMALL LETTER RHO WITH PSILI
+\setcclcuc 1FE5 1FE5 1FEC % GREEK SMALL LETTER RHO WITH DASIA
+\setcclcuc 1FE6 1FE6 1FE6 % GREEK SMALL LETTER UPSILON WITH PERISPOMENI
+\setcclcuc 1FE7 1FE7 1FE7 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+\setcclcuc 1FE8 1FE0 1FE8 % GREEK CAPITAL LETTER UPSILON WITH VRACHY
+\setcclcuc 1FE9 1FE1 1FE9 % GREEK CAPITAL LETTER UPSILON WITH MACRON
+\setcclcuc 1FEA 1F7A 1FEA % GREEK CAPITAL LETTER UPSILON WITH VARIA
+\setcclcuc 1FEB 1F7B 1FEB % GREEK CAPITAL LETTER UPSILON WITH OXIA
+\setcclcuc 1FEC 1FE5 1FEC % GREEK CAPITAL LETTER RHO WITH DASIA
+\setcclcuc 1FF2 1FF2 1FF2 % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+\setcclcuc 1FF3 1FF3 1FFC % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+\setcclcuc 1FF4 1FF4 1FF4 % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+\setcclcuc 1FF6 1FF6 1FF6 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI
+\setcclcuc 1FF7 1FF7 1FF7 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+\setcclcuc 1FF8 1F78 1FF8 % GREEK CAPITAL LETTER OMICRON WITH VARIA
+\setcclcuc 1FF9 1F79 1FF9 % GREEK CAPITAL LETTER OMICRON WITH OXIA
+\setcclcuc 1FFA 1F7C 1FFA % GREEK CAPITAL LETTER OMEGA WITH VARIA
+\setcclcuc 1FFB 1F7D 1FFB % GREEK CAPITAL LETTER OMEGA WITH OXIA
+\setcclcuc 1FFC 1FF3 1FFC % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+\setcclcuc 2071 2071 2071 % SUPERSCRIPT LATIN SMALL LETTER I
+\setcclcuc 207F 207F 207F % SUPERSCRIPT LATIN SMALL LETTER N
+\setcclcuc 2102 2102 2102 % DOUBLE-STRUCK CAPITAL C
+\setcclcuc 2107 2107 2107 % EULER CONSTANT
+\setcclcuc 210A 210A 210A % SCRIPT SMALL G
+\setcclcuc 210B 210B 210B % SCRIPT CAPITAL H
+\setcclcuc 210C 210C 210C % BLACK-LETTER CAPITAL H
+\setcclcuc 210D 210D 210D % DOUBLE-STRUCK CAPITAL H
+\setcclcuc 210E 210E 210E % PLANCK CONSTANT
+\setcclcuc 210F 210F 210F % PLANCK CONSTANT OVER TWO PI
+\setcclcuc 2110 2110 2110 % SCRIPT CAPITAL I
+\setcclcuc 2111 2111 2111 % BLACK-LETTER CAPITAL I
+\setcclcuc 2112 2112 2112 % SCRIPT CAPITAL L
+\setcclcuc 2113 2113 2113 % SCRIPT SMALL L
+\setcclcuc 2115 2115 2115 % DOUBLE-STRUCK CAPITAL N
+\setcclcuc 2119 2119 2119 % DOUBLE-STRUCK CAPITAL P
+\setcclcuc 211A 211A 211A % DOUBLE-STRUCK CAPITAL Q
+\setcclcuc 211B 211B 211B % SCRIPT CAPITAL R
+\setcclcuc 211C 211C 211C % BLACK-LETTER CAPITAL R
+\setcclcuc 211D 211D 211D % DOUBLE-STRUCK CAPITAL R
+\setcclcuc 2124 2124 2124 % DOUBLE-STRUCK CAPITAL Z
+\setcclcuc 2126 03C9 2126 % OHM SIGN
+\setcclcuc 2128 2128 2128 % BLACK-LETTER CAPITAL Z
+\setcclcuc 212A 006B 212A % KELVIN SIGN
+\setcclcuc 212B 00E5 212B % ANGSTROM SIGN
+\setcclcuc 212C 212C 212C % SCRIPT CAPITAL B
+\setcclcuc 212D 212D 212D % BLACK-LETTER CAPITAL C
+\setcclcuc 212F 212F 212F % SCRIPT SMALL E
+\setcclcuc 2130 2130 2130 % SCRIPT CAPITAL E
+\setcclcuc 2131 2131 2131 % SCRIPT CAPITAL F
+\setcclcuc 2132 214E 2132 % TURNED CAPITAL F
+\setcclcuc 2133 2133 2133 % SCRIPT CAPITAL M
+\setcclcuc 2134 2134 2134 % SCRIPT SMALL O
+\setcclcuc 2139 2139 2139 % INFORMATION SOURCE
+\setcclcuc 213C 213C 213C % DOUBLE-STRUCK SMALL PI
+\setcclcuc 213D 213D 213D % DOUBLE-STRUCK SMALL GAMMA
+\setcclcuc 213E 213E 213E % DOUBLE-STRUCK CAPITAL GAMMA
+\setcclcuc 213F 213F 213F % DOUBLE-STRUCK CAPITAL PI
+\setcclcuc 2145 2145 2145 % DOUBLE-STRUCK ITALIC CAPITAL D
+\setcclcuc 2146 2146 2146 % DOUBLE-STRUCK ITALIC SMALL D
+\setcclcuc 2147 2147 2147 % DOUBLE-STRUCK ITALIC SMALL E
+\setcclcuc 2148 2148 2148 % DOUBLE-STRUCK ITALIC SMALL I
+\setcclcuc 2149 2149 2149 % DOUBLE-STRUCK ITALIC SMALL J
+\setcclcuc 214E 214E 2132 % TURNED SMALL F
+\setcclcuc 2183 2184 2183 % ROMAN NUMERAL REVERSED ONE HUNDRED
+\setcclcuc 2184 2184 2183 % LATIN SMALL LETTER REVERSED C
+\setcclcuc 2C00 2C30 2C00 % GLAGOLITIC CAPITAL LETTER AZU
+\setcclcuc 2C01 2C31 2C01 % GLAGOLITIC CAPITAL LETTER BUKY
+\setcclcuc 2C02 2C32 2C02 % GLAGOLITIC CAPITAL LETTER VEDE
+\setcclcuc 2C03 2C33 2C03 % GLAGOLITIC CAPITAL LETTER GLAGOLI
+\setcclcuc 2C04 2C34 2C04 % GLAGOLITIC CAPITAL LETTER DOBRO
+\setcclcuc 2C05 2C35 2C05 % GLAGOLITIC CAPITAL LETTER YESTU
+\setcclcuc 2C06 2C36 2C06 % GLAGOLITIC CAPITAL LETTER ZHIVETE
+\setcclcuc 2C07 2C37 2C07 % GLAGOLITIC CAPITAL LETTER DZELO
+\setcclcuc 2C08 2C38 2C08 % GLAGOLITIC CAPITAL LETTER ZEMLJA
+\setcclcuc 2C09 2C39 2C09 % GLAGOLITIC CAPITAL LETTER IZHE
+\setcclcuc 2C0A 2C3A 2C0A % GLAGOLITIC CAPITAL LETTER INITIAL IZHE
+\setcclcuc 2C0B 2C3B 2C0B % GLAGOLITIC CAPITAL LETTER I
+\setcclcuc 2C0C 2C3C 2C0C % GLAGOLITIC CAPITAL LETTER DJERVI
+\setcclcuc 2C0D 2C3D 2C0D % GLAGOLITIC CAPITAL LETTER KAKO
+\setcclcuc 2C0E 2C3E 2C0E % GLAGOLITIC CAPITAL LETTER LJUDIJE
+\setcclcuc 2C0F 2C3F 2C0F % GLAGOLITIC CAPITAL LETTER MYSLITE
+\setcclcuc 2C10 2C40 2C10 % GLAGOLITIC CAPITAL LETTER NASHI
+\setcclcuc 2C11 2C41 2C11 % GLAGOLITIC CAPITAL LETTER ONU
+\setcclcuc 2C12 2C42 2C12 % GLAGOLITIC CAPITAL LETTER POKOJI
+\setcclcuc 2C13 2C43 2C13 % GLAGOLITIC CAPITAL LETTER RITSI
+\setcclcuc 2C14 2C44 2C14 % GLAGOLITIC CAPITAL LETTER SLOVO
+\setcclcuc 2C15 2C45 2C15 % GLAGOLITIC CAPITAL LETTER TVRIDO
+\setcclcuc 2C16 2C46 2C16 % GLAGOLITIC CAPITAL LETTER UKU
+\setcclcuc 2C17 2C47 2C17 % GLAGOLITIC CAPITAL LETTER FRITU
+\setcclcuc 2C18 2C48 2C18 % GLAGOLITIC CAPITAL LETTER HERU
+\setcclcuc 2C19 2C49 2C19 % GLAGOLITIC CAPITAL LETTER OTU
+\setcclcuc 2C1A 2C4A 2C1A % GLAGOLITIC CAPITAL LETTER PE
+\setcclcuc 2C1B 2C4B 2C1B % GLAGOLITIC CAPITAL LETTER SHTA
+\setcclcuc 2C1C 2C4C 2C1C % GLAGOLITIC CAPITAL LETTER TSI
+\setcclcuc 2C1D 2C4D 2C1D % GLAGOLITIC CAPITAL LETTER CHRIVI
+\setcclcuc 2C1E 2C4E 2C1E % GLAGOLITIC CAPITAL LETTER SHA
+\setcclcuc 2C1F 2C4F 2C1F % GLAGOLITIC CAPITAL LETTER YERU
+\setcclcuc 2C20 2C50 2C20 % GLAGOLITIC CAPITAL LETTER YERI
+\setcclcuc 2C21 2C51 2C21 % GLAGOLITIC CAPITAL LETTER YATI
+\setcclcuc 2C22 2C52 2C22 % GLAGOLITIC CAPITAL LETTER SPIDERY HA
+\setcclcuc 2C23 2C53 2C23 % GLAGOLITIC CAPITAL LETTER YU
+\setcclcuc 2C24 2C54 2C24 % GLAGOLITIC CAPITAL LETTER SMALL YUS
+\setcclcuc 2C25 2C55 2C25 % GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL
+\setcclcuc 2C26 2C56 2C26 % GLAGOLITIC CAPITAL LETTER YO
+\setcclcuc 2C27 2C57 2C27 % GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS
+\setcclcuc 2C28 2C58 2C28 % GLAGOLITIC CAPITAL LETTER BIG YUS
+\setcclcuc 2C29 2C59 2C29 % GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS
+\setcclcuc 2C2A 2C5A 2C2A % GLAGOLITIC CAPITAL LETTER FITA
+\setcclcuc 2C2B 2C5B 2C2B % GLAGOLITIC CAPITAL LETTER IZHITSA
+\setcclcuc 2C2C 2C5C 2C2C % GLAGOLITIC CAPITAL LETTER SHTAPIC
+\setcclcuc 2C2D 2C5D 2C2D % GLAGOLITIC CAPITAL LETTER TROKUTASTI A
+\setcclcuc 2C2E 2C5E 2C2E % GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE
+\setcclcuc 2C30 2C30 2C00 % GLAGOLITIC SMALL LETTER AZU
+\setcclcuc 2C31 2C31 2C01 % GLAGOLITIC SMALL LETTER BUKY
+\setcclcuc 2C32 2C32 2C02 % GLAGOLITIC SMALL LETTER VEDE
+\setcclcuc 2C33 2C33 2C03 % GLAGOLITIC SMALL LETTER GLAGOLI
+\setcclcuc 2C34 2C34 2C04 % GLAGOLITIC SMALL LETTER DOBRO
+\setcclcuc 2C35 2C35 2C05 % GLAGOLITIC SMALL LETTER YESTU
+\setcclcuc 2C36 2C36 2C06 % GLAGOLITIC SMALL LETTER ZHIVETE
+\setcclcuc 2C37 2C37 2C07 % GLAGOLITIC SMALL LETTER DZELO
+\setcclcuc 2C38 2C38 2C08 % GLAGOLITIC SMALL LETTER ZEMLJA
+\setcclcuc 2C39 2C39 2C09 % GLAGOLITIC SMALL LETTER IZHE
+\setcclcuc 2C3A 2C3A 2C0A % GLAGOLITIC SMALL LETTER INITIAL IZHE
+\setcclcuc 2C3B 2C3B 2C0B % GLAGOLITIC SMALL LETTER I
+\setcclcuc 2C3C 2C3C 2C0C % GLAGOLITIC SMALL LETTER DJERVI
+\setcclcuc 2C3D 2C3D 2C0D % GLAGOLITIC SMALL LETTER KAKO
+\setcclcuc 2C3E 2C3E 2C0E % GLAGOLITIC SMALL LETTER LJUDIJE
+\setcclcuc 2C3F 2C3F 2C0F % GLAGOLITIC SMALL LETTER MYSLITE
+\setcclcuc 2C40 2C40 2C10 % GLAGOLITIC SMALL LETTER NASHI
+\setcclcuc 2C41 2C41 2C11 % GLAGOLITIC SMALL LETTER ONU
+\setcclcuc 2C42 2C42 2C12 % GLAGOLITIC SMALL LETTER POKOJI
+\setcclcuc 2C43 2C43 2C13 % GLAGOLITIC SMALL LETTER RITSI
+\setcclcuc 2C44 2C44 2C14 % GLAGOLITIC SMALL LETTER SLOVO
+\setcclcuc 2C45 2C45 2C15 % GLAGOLITIC SMALL LETTER TVRIDO
+\setcclcuc 2C46 2C46 2C16 % GLAGOLITIC SMALL LETTER UKU
+\setcclcuc 2C47 2C47 2C17 % GLAGOLITIC SMALL LETTER FRITU
+\setcclcuc 2C48 2C48 2C18 % GLAGOLITIC SMALL LETTER HERU
+\setcclcuc 2C49 2C49 2C19 % GLAGOLITIC SMALL LETTER OTU
+\setcclcuc 2C4A 2C4A 2C1A % GLAGOLITIC SMALL LETTER PE
+\setcclcuc 2C4B 2C4B 2C1B % GLAGOLITIC SMALL LETTER SHTA
+\setcclcuc 2C4C 2C4C 2C1C % GLAGOLITIC SMALL LETTER TSI
+\setcclcuc 2C4D 2C4D 2C1D % GLAGOLITIC SMALL LETTER CHRIVI
+\setcclcuc 2C4E 2C4E 2C1E % GLAGOLITIC SMALL LETTER SHA
+\setcclcuc 2C4F 2C4F 2C1F % GLAGOLITIC SMALL LETTER YERU
+\setcclcuc 2C50 2C50 2C20 % GLAGOLITIC SMALL LETTER YERI
+\setcclcuc 2C51 2C51 2C21 % GLAGOLITIC SMALL LETTER YATI
+\setcclcuc 2C52 2C52 2C22 % GLAGOLITIC SMALL LETTER SPIDERY HA
+\setcclcuc 2C53 2C53 2C23 % GLAGOLITIC SMALL LETTER YU
+\setcclcuc 2C54 2C54 2C24 % GLAGOLITIC SMALL LETTER SMALL YUS
+\setcclcuc 2C55 2C55 2C25 % GLAGOLITIC SMALL LETTER SMALL YUS WITH TAIL
+\setcclcuc 2C56 2C56 2C26 % GLAGOLITIC SMALL LETTER YO
+\setcclcuc 2C57 2C57 2C27 % GLAGOLITIC SMALL LETTER IOTATED SMALL YUS
+\setcclcuc 2C58 2C58 2C28 % GLAGOLITIC SMALL LETTER BIG YUS
+\setcclcuc 2C59 2C59 2C29 % GLAGOLITIC SMALL LETTER IOTATED BIG YUS
+\setcclcuc 2C5A 2C5A 2C2A % GLAGOLITIC SMALL LETTER FITA
+\setcclcuc 2C5B 2C5B 2C2B % GLAGOLITIC SMALL LETTER IZHITSA
+\setcclcuc 2C5C 2C5C 2C2C % GLAGOLITIC SMALL LETTER SHTAPIC
+\setcclcuc 2C5D 2C5D 2C2D % GLAGOLITIC SMALL LETTER TROKUTASTI A
+\setcclcuc 2C5E 2C5E 2C2E % GLAGOLITIC SMALL LETTER LATINATE MYSLITE
+\setcclcuc 2C60 2C61 2C60 % LATIN CAPITAL LETTER L WITH DOUBLE BAR
+\setcclcuc 2C61 2C61 2C60 % LATIN SMALL LETTER L WITH DOUBLE BAR
+\setcclcuc 2C62 026B 2C62 % LATIN CAPITAL LETTER L WITH MIDDLE TILDE
+\setcclcuc 2C63 1D7D 2C63 % LATIN CAPITAL LETTER P WITH STROKE
+\setcclcuc 2C64 027D 2C64 % LATIN CAPITAL LETTER R WITH TAIL
+\setcclcuc 2C65 2C65 023A % LATIN SMALL LETTER A WITH STROKE
+\setcclcuc 2C66 2C66 023E % LATIN SMALL LETTER T WITH DIAGONAL STROKE
+\setcclcuc 2C67 2C68 2C67 % LATIN CAPITAL LETTER H WITH DESCENDER
+\setcclcuc 2C68 2C68 2C67 % LATIN SMALL LETTER H WITH DESCENDER
+\setcclcuc 2C69 2C6A 2C69 % LATIN CAPITAL LETTER K WITH DESCENDER
+\setcclcuc 2C6A 2C6A 2C69 % LATIN SMALL LETTER K WITH DESCENDER
+\setcclcuc 2C6B 2C6C 2C6B % LATIN CAPITAL LETTER Z WITH DESCENDER
+\setcclcuc 2C6C 2C6C 2C6B % LATIN SMALL LETTER Z WITH DESCENDER
+\setcclcuc 2C74 2C74 2C74 % LATIN SMALL LETTER V WITH CURL
+\setcclcuc 2C75 2C76 2C75 % LATIN CAPITAL LETTER HALF H
+\setcclcuc 2C76 2C76 2C75 % LATIN SMALL LETTER HALF H
+\setcclcuc 2C77 2C77 2C77 % LATIN SMALL LETTER TAILLESS PHI
+\setcclcuc 2C80 2C81 2C80 % COPTIC CAPITAL LETTER ALFA
+\setcclcuc 2C81 2C81 2C80 % COPTIC SMALL LETTER ALFA
+\setcclcuc 2C82 2C83 2C82 % COPTIC CAPITAL LETTER VIDA
+\setcclcuc 2C83 2C83 2C82 % COPTIC SMALL LETTER VIDA
+\setcclcuc 2C84 2C85 2C84 % COPTIC CAPITAL LETTER GAMMA
+\setcclcuc 2C85 2C85 2C84 % COPTIC SMALL LETTER GAMMA
+\setcclcuc 2C86 2C87 2C86 % COPTIC CAPITAL LETTER DALDA
+\setcclcuc 2C87 2C87 2C86 % COPTIC SMALL LETTER DALDA
+\setcclcuc 2C88 2C89 2C88 % COPTIC CAPITAL LETTER EIE
+\setcclcuc 2C89 2C89 2C88 % COPTIC SMALL LETTER EIE
+\setcclcuc 2C8A 2C8B 2C8A % COPTIC CAPITAL LETTER SOU
+\setcclcuc 2C8B 2C8B 2C8A % COPTIC SMALL LETTER SOU
+\setcclcuc 2C8C 2C8D 2C8C % COPTIC CAPITAL LETTER ZATA
+\setcclcuc 2C8D 2C8D 2C8C % COPTIC SMALL LETTER ZATA
+\setcclcuc 2C8E 2C8F 2C8E % COPTIC CAPITAL LETTER HATE
+\setcclcuc 2C8F 2C8F 2C8E % COPTIC SMALL LETTER HATE
+\setcclcuc 2C90 2C91 2C90 % COPTIC CAPITAL LETTER THETHE
+\setcclcuc 2C91 2C91 2C90 % COPTIC SMALL LETTER THETHE
+\setcclcuc 2C92 2C93 2C92 % COPTIC CAPITAL LETTER IAUDA
+\setcclcuc 2C93 2C93 2C92 % COPTIC SMALL LETTER IAUDA
+\setcclcuc 2C94 2C95 2C94 % COPTIC CAPITAL LETTER KAPA
+\setcclcuc 2C95 2C95 2C94 % COPTIC SMALL LETTER KAPA
+\setcclcuc 2C96 2C97 2C96 % COPTIC CAPITAL LETTER LAULA
+\setcclcuc 2C97 2C97 2C96 % COPTIC SMALL LETTER LAULA
+\setcclcuc 2C98 2C99 2C98 % COPTIC CAPITAL LETTER MI
+\setcclcuc 2C99 2C99 2C98 % COPTIC SMALL LETTER MI
+\setcclcuc 2C9A 2C9B 2C9A % COPTIC CAPITAL LETTER NI
+\setcclcuc 2C9B 2C9B 2C9A % COPTIC SMALL LETTER NI
+\setcclcuc 2C9C 2C9D 2C9C % COPTIC CAPITAL LETTER KSI
+\setcclcuc 2C9D 2C9D 2C9C % COPTIC SMALL LETTER KSI
+\setcclcuc 2C9E 2C9F 2C9E % COPTIC CAPITAL LETTER O
+\setcclcuc 2C9F 2C9F 2C9E % COPTIC SMALL LETTER O
+\setcclcuc 2CA0 2CA1 2CA0 % COPTIC CAPITAL LETTER PI
+\setcclcuc 2CA1 2CA1 2CA0 % COPTIC SMALL LETTER PI
+\setcclcuc 2CA2 2CA3 2CA2 % COPTIC CAPITAL LETTER RO
+\setcclcuc 2CA3 2CA3 2CA2 % COPTIC SMALL LETTER RO
+\setcclcuc 2CA4 2CA5 2CA4 % COPTIC CAPITAL LETTER SIMA
+\setcclcuc 2CA5 2CA5 2CA4 % COPTIC SMALL LETTER SIMA
+\setcclcuc 2CA6 2CA7 2CA6 % COPTIC CAPITAL LETTER TAU
+\setcclcuc 2CA7 2CA7 2CA6 % COPTIC SMALL LETTER TAU
+\setcclcuc 2CA8 2CA9 2CA8 % COPTIC CAPITAL LETTER UA
+\setcclcuc 2CA9 2CA9 2CA8 % COPTIC SMALL LETTER UA
+\setcclcuc 2CAA 2CAB 2CAA % COPTIC CAPITAL LETTER FI
+\setcclcuc 2CAB 2CAB 2CAA % COPTIC SMALL LETTER FI
+\setcclcuc 2CAC 2CAD 2CAC % COPTIC CAPITAL LETTER KHI
+\setcclcuc 2CAD 2CAD 2CAC % COPTIC SMALL LETTER KHI
+\setcclcuc 2CAE 2CAF 2CAE % COPTIC CAPITAL LETTER PSI
+\setcclcuc 2CAF 2CAF 2CAE % COPTIC SMALL LETTER PSI
+\setcclcuc 2CB0 2CB1 2CB0 % COPTIC CAPITAL LETTER OOU
+\setcclcuc 2CB1 2CB1 2CB0 % COPTIC SMALL LETTER OOU
+\setcclcuc 2CB2 2CB3 2CB2 % COPTIC CAPITAL LETTER DIALECT-P ALEF
+\setcclcuc 2CB3 2CB3 2CB2 % COPTIC SMALL LETTER DIALECT-P ALEF
+\setcclcuc 2CB4 2CB5 2CB4 % COPTIC CAPITAL LETTER OLD COPTIC AIN
+\setcclcuc 2CB5 2CB5 2CB4 % COPTIC SMALL LETTER OLD COPTIC AIN
+\setcclcuc 2CB6 2CB7 2CB6 % COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE
+\setcclcuc 2CB7 2CB7 2CB6 % COPTIC SMALL LETTER CRYPTOGRAMMIC EIE
+\setcclcuc 2CB8 2CB9 2CB8 % COPTIC CAPITAL LETTER DIALECT-P KAPA
+\setcclcuc 2CB9 2CB9 2CB8 % COPTIC SMALL LETTER DIALECT-P KAPA
+\setcclcuc 2CBA 2CBB 2CBA % COPTIC CAPITAL LETTER DIALECT-P NI
+\setcclcuc 2CBB 2CBB 2CBA % COPTIC SMALL LETTER DIALECT-P NI
+\setcclcuc 2CBC 2CBD 2CBC % COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI
+\setcclcuc 2CBD 2CBD 2CBC % COPTIC SMALL LETTER CRYPTOGRAMMIC NI
+\setcclcuc 2CBE 2CBF 2CBE % COPTIC CAPITAL LETTER OLD COPTIC OOU
+\setcclcuc 2CBF 2CBF 2CBE % COPTIC SMALL LETTER OLD COPTIC OOU
+\setcclcuc 2CC0 2CC1 2CC0 % COPTIC CAPITAL LETTER SAMPI
+\setcclcuc 2CC1 2CC1 2CC0 % COPTIC SMALL LETTER SAMPI
+\setcclcuc 2CC2 2CC3 2CC2 % COPTIC CAPITAL LETTER CROSSED SHEI
+\setcclcuc 2CC3 2CC3 2CC2 % COPTIC SMALL LETTER CROSSED SHEI
+\setcclcuc 2CC4 2CC5 2CC4 % COPTIC CAPITAL LETTER OLD COPTIC SHEI
+\setcclcuc 2CC5 2CC5 2CC4 % COPTIC SMALL LETTER OLD COPTIC SHEI
+\setcclcuc 2CC6 2CC7 2CC6 % COPTIC CAPITAL LETTER OLD COPTIC ESH
+\setcclcuc 2CC7 2CC7 2CC6 % COPTIC SMALL LETTER OLD COPTIC ESH
+\setcclcuc 2CC8 2CC9 2CC8 % COPTIC CAPITAL LETTER AKHMIMIC KHEI
+\setcclcuc 2CC9 2CC9 2CC8 % COPTIC SMALL LETTER AKHMIMIC KHEI
+\setcclcuc 2CCA 2CCB 2CCA % COPTIC CAPITAL LETTER DIALECT-P HORI
+\setcclcuc 2CCB 2CCB 2CCA % COPTIC SMALL LETTER DIALECT-P HORI
+\setcclcuc 2CCC 2CCD 2CCC % COPTIC CAPITAL LETTER OLD COPTIC HORI
+\setcclcuc 2CCD 2CCD 2CCC % COPTIC SMALL LETTER OLD COPTIC HORI
+\setcclcuc 2CCE 2CCF 2CCE % COPTIC CAPITAL LETTER OLD COPTIC HA
+\setcclcuc 2CCF 2CCF 2CCE % COPTIC SMALL LETTER OLD COPTIC HA
+\setcclcuc 2CD0 2CD1 2CD0 % COPTIC CAPITAL LETTER L-SHAPED HA
+\setcclcuc 2CD1 2CD1 2CD0 % COPTIC SMALL LETTER L-SHAPED HA
+\setcclcuc 2CD2 2CD3 2CD2 % COPTIC CAPITAL LETTER OLD COPTIC HEI
+\setcclcuc 2CD3 2CD3 2CD2 % COPTIC SMALL LETTER OLD COPTIC HEI
+\setcclcuc 2CD4 2CD5 2CD4 % COPTIC CAPITAL LETTER OLD COPTIC HAT
+\setcclcuc 2CD5 2CD5 2CD4 % COPTIC SMALL LETTER OLD COPTIC HAT
+\setcclcuc 2CD6 2CD7 2CD6 % COPTIC CAPITAL LETTER OLD COPTIC GANGIA
+\setcclcuc 2CD7 2CD7 2CD6 % COPTIC SMALL LETTER OLD COPTIC GANGIA
+\setcclcuc 2CD8 2CD9 2CD8 % COPTIC CAPITAL LETTER OLD COPTIC DJA
+\setcclcuc 2CD9 2CD9 2CD8 % COPTIC SMALL LETTER OLD COPTIC DJA
+\setcclcuc 2CDA 2CDB 2CDA % COPTIC CAPITAL LETTER OLD COPTIC SHIMA
+\setcclcuc 2CDB 2CDB 2CDA % COPTIC SMALL LETTER OLD COPTIC SHIMA
+\setcclcuc 2CDC 2CDD 2CDC % COPTIC CAPITAL LETTER OLD NUBIAN SHIMA
+\setcclcuc 2CDD 2CDD 2CDC % COPTIC SMALL LETTER OLD NUBIAN SHIMA
+\setcclcuc 2CDE 2CDF 2CDE % COPTIC CAPITAL LETTER OLD NUBIAN NGI
+\setcclcuc 2CDF 2CDF 2CDE % COPTIC SMALL LETTER OLD NUBIAN NGI
+\setcclcuc 2CE0 2CE1 2CE0 % COPTIC CAPITAL LETTER OLD NUBIAN NYI
+\setcclcuc 2CE1 2CE1 2CE0 % COPTIC SMALL LETTER OLD NUBIAN NYI
+\setcclcuc 2CE2 2CE3 2CE2 % COPTIC CAPITAL LETTER OLD NUBIAN WAU
+\setcclcuc 2CE3 2CE3 2CE2 % COPTIC SMALL LETTER OLD NUBIAN WAU
+\setcclcuc 2CE4 2CE4 2CE4 % COPTIC SYMBOL KAI
+\setcclcuc 2D00 2D00 10A0 % GEORGIAN SMALL LETTER AN
+\setcclcuc 2D01 2D01 10A1 % GEORGIAN SMALL LETTER BAN
+\setcclcuc 2D02 2D02 10A2 % GEORGIAN SMALL LETTER GAN
+\setcclcuc 2D03 2D03 10A3 % GEORGIAN SMALL LETTER DON
+\setcclcuc 2D04 2D04 10A4 % GEORGIAN SMALL LETTER EN
+\setcclcuc 2D05 2D05 10A5 % GEORGIAN SMALL LETTER VIN
+\setcclcuc 2D06 2D06 10A6 % GEORGIAN SMALL LETTER ZEN
+\setcclcuc 2D07 2D07 10A7 % GEORGIAN SMALL LETTER TAN
+\setcclcuc 2D08 2D08 10A8 % GEORGIAN SMALL LETTER IN
+\setcclcuc 2D09 2D09 10A9 % GEORGIAN SMALL LETTER KAN
+\setcclcuc 2D0A 2D0A 10AA % GEORGIAN SMALL LETTER LAS
+\setcclcuc 2D0B 2D0B 10AB % GEORGIAN SMALL LETTER MAN
+\setcclcuc 2D0C 2D0C 10AC % GEORGIAN SMALL LETTER NAR
+\setcclcuc 2D0D 2D0D 10AD % GEORGIAN SMALL LETTER ON
+\setcclcuc 2D0E 2D0E 10AE % GEORGIAN SMALL LETTER PAR
+\setcclcuc 2D0F 2D0F 10AF % GEORGIAN SMALL LETTER ZHAR
+\setcclcuc 2D10 2D10 10B0 % GEORGIAN SMALL LETTER RAE
+\setcclcuc 2D11 2D11 10B1 % GEORGIAN SMALL LETTER SAN
+\setcclcuc 2D12 2D12 10B2 % GEORGIAN SMALL LETTER TAR
+\setcclcuc 2D13 2D13 10B3 % GEORGIAN SMALL LETTER UN
+\setcclcuc 2D14 2D14 10B4 % GEORGIAN SMALL LETTER PHAR
+\setcclcuc 2D15 2D15 10B5 % GEORGIAN SMALL LETTER KHAR
+\setcclcuc 2D16 2D16 10B6 % GEORGIAN SMALL LETTER GHAN
+\setcclcuc 2D17 2D17 10B7 % GEORGIAN SMALL LETTER QAR
+\setcclcuc 2D18 2D18 10B8 % GEORGIAN SMALL LETTER SHIN
+\setcclcuc 2D19 2D19 10B9 % GEORGIAN SMALL LETTER CHIN
+\setcclcuc 2D1A 2D1A 10BA % GEORGIAN SMALL LETTER CAN
+\setcclcuc 2D1B 2D1B 10BB % GEORGIAN SMALL LETTER JIL
+\setcclcuc 2D1C 2D1C 10BC % GEORGIAN SMALL LETTER CIL
+\setcclcuc 2D1D 2D1D 10BD % GEORGIAN SMALL LETTER CHAR
+\setcclcuc 2D1E 2D1E 10BE % GEORGIAN SMALL LETTER XAN
+\setcclcuc 2D1F 2D1F 10BF % GEORGIAN SMALL LETTER JHAN
+\setcclcuc 2D20 2D20 10C0 % GEORGIAN SMALL LETTER HAE
+\setcclcuc 2D21 2D21 10C1 % GEORGIAN SMALL LETTER HE
+\setcclcuc 2D22 2D22 10C2 % GEORGIAN SMALL LETTER HIE
+\setcclcuc 2D23 2D23 10C3 % GEORGIAN SMALL LETTER WE
+\setcclcuc 2D24 2D24 10C4 % GEORGIAN SMALL LETTER HAR
+\setcclcuc 2D25 2D25 10C5 % GEORGIAN SMALL LETTER HOE
+\setcclcuc FB00 FB00 FB00 % LATIN SMALL LIGATURE FF
+\setcclcuc FB01 FB01 FB01 % LATIN SMALL LIGATURE FI
+\setcclcuc FB02 FB02 FB02 % LATIN SMALL LIGATURE FL
+\setcclcuc FB03 FB03 FB03 % LATIN SMALL LIGATURE FFI
+\setcclcuc FB04 FB04 FB04 % LATIN SMALL LIGATURE FFL
+\setcclcuc FB05 FB05 FB05 % LATIN SMALL LIGATURE LONG S T
+\setcclcuc FB06 FB06 FB06 % LATIN SMALL LIGATURE ST
+\setcclcuc FB13 FB13 FB13 % ARMENIAN SMALL LIGATURE MEN NOW
+\setcclcuc FB14 FB14 FB14 % ARMENIAN SMALL LIGATURE MEN ECH
+\setcclcuc FB15 FB15 FB15 % ARMENIAN SMALL LIGATURE MEN INI
+\setcclcuc FB16 FB16 FB16 % ARMENIAN SMALL LIGATURE VEW NOW
+\setcclcuc FB17 FB17 FB17 % ARMENIAN SMALL LIGATURE MEN XEH
+\setcclcuc FF21 FF41 FF21 % FULLWIDTH LATIN CAPITAL LETTER A
+\setcclcuc FF22 FF42 FF22 % FULLWIDTH LATIN CAPITAL LETTER B
+\setcclcuc FF23 FF43 FF23 % FULLWIDTH LATIN CAPITAL LETTER C
+\setcclcuc FF24 FF44 FF24 % FULLWIDTH LATIN CAPITAL LETTER D
+\setcclcuc FF25 FF45 FF25 % FULLWIDTH LATIN CAPITAL LETTER E
+\setcclcuc FF26 FF46 FF26 % FULLWIDTH LATIN CAPITAL LETTER F
+\setcclcuc FF27 FF47 FF27 % FULLWIDTH LATIN CAPITAL LETTER G
+\setcclcuc FF28 FF48 FF28 % FULLWIDTH LATIN CAPITAL LETTER H
+\setcclcuc FF29 FF49 FF29 % FULLWIDTH LATIN CAPITAL LETTER I
+\setcclcuc FF2A FF4A FF2A % FULLWIDTH LATIN CAPITAL LETTER J
+\setcclcuc FF2B FF4B FF2B % FULLWIDTH LATIN CAPITAL LETTER K
+\setcclcuc FF2C FF4C FF2C % FULLWIDTH LATIN CAPITAL LETTER L
+\setcclcuc FF2D FF4D FF2D % FULLWIDTH LATIN CAPITAL LETTER M
+\setcclcuc FF2E FF4E FF2E % FULLWIDTH LATIN CAPITAL LETTER N
+\setcclcuc FF2F FF4F FF2F % FULLWIDTH LATIN CAPITAL LETTER O
+\setcclcuc FF30 FF50 FF30 % FULLWIDTH LATIN CAPITAL LETTER P
+\setcclcuc FF31 FF51 FF31 % FULLWIDTH LATIN CAPITAL LETTER Q
+\setcclcuc FF32 FF52 FF32 % FULLWIDTH LATIN CAPITAL LETTER R
+\setcclcuc FF33 FF53 FF33 % FULLWIDTH LATIN CAPITAL LETTER S
+\setcclcuc FF34 FF54 FF34 % FULLWIDTH LATIN CAPITAL LETTER T
+\setcclcuc FF35 FF55 FF35 % FULLWIDTH LATIN CAPITAL LETTER U
+\setcclcuc FF36 FF56 FF36 % FULLWIDTH LATIN CAPITAL LETTER V
+\setcclcuc FF37 FF57 FF37 % FULLWIDTH LATIN CAPITAL LETTER W
+\setcclcuc FF38 FF58 FF38 % FULLWIDTH LATIN CAPITAL LETTER X
+\setcclcuc FF39 FF59 FF39 % FULLWIDTH LATIN CAPITAL LETTER Y
+\setcclcuc FF3A FF5A FF3A % FULLWIDTH LATIN CAPITAL LETTER Z
+\setcclcuc FF41 FF41 FF21 % FULLWIDTH LATIN SMALL LETTER A
+\setcclcuc FF42 FF42 FF22 % FULLWIDTH LATIN SMALL LETTER B
+\setcclcuc FF43 FF43 FF23 % FULLWIDTH LATIN SMALL LETTER C
+\setcclcuc FF44 FF44 FF24 % FULLWIDTH LATIN SMALL LETTER D
+\setcclcuc FF45 FF45 FF25 % FULLWIDTH LATIN SMALL LETTER E
+\setcclcuc FF46 FF46 FF26 % FULLWIDTH LATIN SMALL LETTER F
+\setcclcuc FF47 FF47 FF27 % FULLWIDTH LATIN SMALL LETTER G
+\setcclcuc FF48 FF48 FF28 % FULLWIDTH LATIN SMALL LETTER H
+\setcclcuc FF49 FF49 FF29 % FULLWIDTH LATIN SMALL LETTER I
+\setcclcuc FF4A FF4A FF2A % FULLWIDTH LATIN SMALL LETTER J
+\setcclcuc FF4B FF4B FF2B % FULLWIDTH LATIN SMALL LETTER K
+\setcclcuc FF4C FF4C FF2C % FULLWIDTH LATIN SMALL LETTER L
+\setcclcuc FF4D FF4D FF2D % FULLWIDTH LATIN SMALL LETTER M
+\setcclcuc FF4E FF4E FF2E % FULLWIDTH LATIN SMALL LETTER N
+\setcclcuc FF4F FF4F FF2F % FULLWIDTH LATIN SMALL LETTER O
+\setcclcuc FF50 FF50 FF30 % FULLWIDTH LATIN SMALL LETTER P
+\setcclcuc FF51 FF51 FF31 % FULLWIDTH LATIN SMALL LETTER Q
+\setcclcuc FF52 FF52 FF32 % FULLWIDTH LATIN SMALL LETTER R
+\setcclcuc FF53 FF53 FF33 % FULLWIDTH LATIN SMALL LETTER S
+\setcclcuc FF54 FF54 FF34 % FULLWIDTH LATIN SMALL LETTER T
+\setcclcuc FF55 FF55 FF35 % FULLWIDTH LATIN SMALL LETTER U
+\setcclcuc FF56 FF56 FF36 % FULLWIDTH LATIN SMALL LETTER V
+\setcclcuc FF57 FF57 FF37 % FULLWIDTH LATIN SMALL LETTER W
+\setcclcuc FF58 FF58 FF38 % FULLWIDTH LATIN SMALL LETTER X
+\setcclcuc FF59 FF59 FF39 % FULLWIDTH LATIN SMALL LETTER Y
+\setcclcuc FF5A FF5A FF3A % FULLWIDTH LATIN SMALL LETTER Z
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/filt-ini.tex b/Master/texmf-dist/tex/context/base/filt-ini.tex
index d6e03f9684a..9e2af2c6e6e 100644
--- a/Master/texmf-dist/tex/context/base/filt-ini.tex
+++ b/Master/texmf-dist/tex/context/base/filt-ini.tex
@@ -64,6 +64,16 @@
2: filtre -- inconnu
\stopmessages
+% We need the {\??ot::#1} check because otherwise aleph will crash. Taco's
+% torture test:
+%
+% \ocp\ArabicContext = contextual
+%
+% \dorecurse {5000} {
+% \message{[\recurselevel]}
+% \ocplist\Arabic=\addbeforeocplist 1 \ArabicContext \nullocplist
+% }
+
%D \macros
%D {definefiltersynonym}
@@ -82,11 +92,15 @@
%D \macros
%D {definefiltersequence}
-\def\definefiltersequence%
+\def\definefiltersequence
{\dodoubleargument\dodefinefiltersequence}
+% \def\dodefinefiltersequence[#1][#2]%
+% {\setvalue{\??ot#1}{#2}}
+
\def\dodefinefiltersequence[#1][#2]%
- {\setvalue{\??ot#1}{#2}}
+ {\setxvalue{\??ot#1}{#2}%
+ \letgvalue{\??ot::#1}\v!stop}
%D \macros
%D {usefiltersequence}
@@ -121,13 +135,22 @@
\expandafter\noexpand\csname\??or:\!!stringa\endcsname
\to \scratchtoks}
+% \unexpanded\def\usefiltersequence[#1]%
+% {\edef\currentfiltersequence{\getvalue{\??ot#1}}%
+% \scratchtoks\emptytoks
+% \processcommacommand[\currentfiltersequence]\dodousefiltersequence
+% % \showthe\scratchtoks
+% \expanded{\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist
+% \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}
+
\unexpanded\def\usefiltersequence[#1]%
- {\edef\currentfiltersequence{\getvalue{\??ot#1}}%
- \scratchtoks\emptytoks
- \processcommacommand[\currentfiltersequence]\dodousefiltersequence
- % \showthe\scratchtoks
- \expanded{\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist
- \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}
+ {\doifdefined{\??ot::#1}%
+ {\doifvalue{\??ot::#1}\v!stop
+ {\scratchtoks\emptytoks
+ \expanded{\processcommalist[\getvalue{\??ot#1}]}\dodousefiltersequence
+ \expanded{\global\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist
+ \letgvalue{\??ot::#1}\v!start}%
+ \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}}
%D \macros
%D {usefilter}
diff --git a/Master/texmf-dist/tex/context/base/font-ini.tex b/Master/texmf-dist/tex/context/base/font-ini.tex
index 8e620309e67..dda16084534 100644
--- a/Master/texmf-dist/tex/context/base/font-ini.tex
+++ b/Master/texmf-dist/tex/context/base/font-ini.tex
@@ -64,14 +64,14 @@
\def\savefont
{\edef\savedfont{\the\font}%
\pushmacro\savedfont
- \pushmacro\characterregime
+ \pushmacro\currentregime
\pushmacro\charactermapping
\pushmacro\characterencoding}
\def\restorefont
{\popmacro\characterencoding
\popmacro\charactermapping
- \popmacro\characterregime
+ \popmacro\currentregime
\popmacro\savedfont
\savedfont}
@@ -734,6 +734,8 @@
%D although for instance unboxing goes ok. Therefore we
%D introduce:
+% best can go to math-ini and make \mf a hook then
+
% better use \dowithnextboxcontent
\def\normalmbox
@@ -1526,8 +1528,8 @@
%D
%D For special purposes, we provide a hook.
-\newevery \everyfont \relax
-\newevery \everyfontswitch \relax
+% \newevery \everyfont \relax
+% \newevery \everyfontswitch \relax
% safer but sometimes introducing newlines in the log
%
@@ -2038,14 +2040,14 @@
\def\definefontsize[#1]% sneller met toks
{\addtocommalist{#1}\sizelist
- \def\docommando##1%
- {\def\dodocommando####1%
- {\def\dododocommando########1%
+ \def\docommand##1%
+ {\def\dodocommand####1%
+ {\def\dododocommand########1%
%{\checkbodyfont{}{########1}{####1}{##1}}%
{\checkbodyfont{########1}{####1}{##1}}%
- \processcommacommand[\stylelist]\dododocommando}%
- \processcommacommand[\alternativelist]\dodocommando}%
- \processcommacommand[\sizelist]\docommando}
+ \processcommacommand[\stylelist]\dododocommand}%
+ \processcommacommand[\alternativelist]\dodocommand}%
+ \processcommacommand[\sizelist]\docommand}
\def\alternativetextlist{\c!tf,\c!bf,\c!it,\c!sl,\c!bs,\c!bi,\c!sc}
\def\alternativemathlist{\c!mr,\c!mi,\c!sy,\c!ex,\c!ma,\c!mb}
@@ -2218,12 +2220,12 @@
\def\dododefinebodyfontenvironment[#1][#2][#3]% size class settings
{\@@beginfontdef
\doifundefined{\??ft#2#1\c!em} % \s!text goes wrong in testing because
- {\def\docommando##1% % the 12pt alternative will called when
+ {\def\docommand##1% % the 12pt alternative will called when
{\scratchdimen#1\relax % typesetting the test (or so)
\scratchdimen\csname\??ft\s!default##1\endcsname\scratchdimen
\normalizebodyfontsize\scratchdimen\to\tempbodyfontsize
\setevalue{\??ft#2#1##1}{\tempbodyfontsize}}%
- \processcommacommand[\fontsizelist]\docommando
+ \processcommacommand[\fontsizelist]\docommand
\copyparameters
[\??ft#2#1][\??ft\s!default]
[\c!interlinespace,\c!em]}%
@@ -2554,14 +2556,14 @@
% {\let\c!savedtext\c!text
% \let\c!text\s!text
% \donefalse
-% \def\docommando##1%
+% \def\docommand##1%
% {\doifdefined{\??ft\s!default##1}
% {\donetrue
% \scratchdimen#1\relax
% \scratchdimen\csname\??ft\s!default##1\endcsname\scratchdimen
% \normalizebodyfontsize\scratchdimen\to\!!stringa
% \letvalue{\??ft#1##1}\!!stringa}}%
-% \processcommacommand[\fontsizelist]\docommando
+% \processcommacommand[\fontsizelist]\docommand
% \let\c!text\c!savedtext
% \ifdone
% \donefalse
@@ -2680,9 +2682,9 @@
%D in other modules. Here we only provide the hooks that
%D garantees their handling.
-\ifx\everybodyfont\undefined % permits reloading
- \newevery \everybodyfont \EveryBodyFont
-\fi
+% \ifx\everybodyfont\undefined % permits reloading
+% \newevery \everybodyfont \EveryBodyFont
+% \fi
%D At the system level one can initialize thing like:
%D
@@ -3083,6 +3085,8 @@
%
% For Taco: optional fall backs:
+\ifx\checkfontclass\undefined \let\checkfontclass\gobbleoneargument \fi % implemented in type-ini
+
\def\setcurrentfontstyle#1%
{%\message{[3 #1]}%
\checkfontclass{#1}%
@@ -3090,8 +3094,6 @@
\ifmmode\mr\fi % otherwise \rm not downward compatible
\synchronizefont}
-\let\checkfontclass\gobbleoneargument % implemented in type-ini
-
\def\setcurrentfontbodyalternative#1#2%
{%\message{[4 #1 #2]}%
\edef\fontbody{#1}%
@@ -3351,10 +3353,10 @@
{\addtocommalist{#2}\stylelist
\showmessage\m!fonts8{#2 (#1)}}%
% check kan hier
- \def\docommando##1%
+ \def\docommand##1%
{\setvalue{\@shortstyle@##1}{#2}%
\setvalue{\@style@##1}{\csname#2\endcsname}}%
- \processcommalist[#1]\docommando}
+ \processcommalist[#1]\docommand}
\def\definefontstyle
{\dodoubleargument\dodefinefontstyle}
@@ -3706,8 +3708,8 @@
%D because \PLAIN\ \TEX\ is english anyway.
\def\dodefinebodyfontswitch[#1][#2]%
- {\def\docommando##1{\setvalue{##1}{\switchtobodyfont[#2]}}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\setvalue{##1}{\switchtobodyfont[#2]}}%
+ \processcommalist[#1]\docommand}
\def\definebodyfontswitch
{\dodoubleargument\dodefinebodyfontswitch}
@@ -3811,8 +3813,9 @@
% old mechanism
%
-% \def\infofont%
-% {\getvalue{\!!sixpoint\c!tt\c!tf}\the\everybodyfont}
+% \def\infofont{\getvalue{\!!sixpoint\c!tt\c!tf}\the\everybodyfont}
+
+\let\infofont\relax % satisfy dep checker
\definefont [infofont] [Mono at 6pt] % todo \the\everybodyfont
@@ -3847,11 +3850,11 @@
%D arguments.
\def\dodefinealternativestyle[#1][#2][#3]%
- {\def\docommando##1%
+ {\def\docommand##1%
{\doifundefined{##1}{\setvalue{##1}{\groupedcommand{#2}{}}}%
\setvalue{\@letter@ ##1}{#2}%
\setvalue{\@noletter@##1}{#3}}%
- \processcommalist[#1]\docommando}
+ \processcommalist[#1]\docommand}
\def\definealternativestyle
{\dotripleempty\dodefinealternativestyle}
@@ -3920,7 +3923,7 @@
{\doifdefinedelse{#1}\getvalue \firstofoneargument}%
{#1}} % {#2}}
-\let\doconvertfont=\dodoconvertfont
+\let\doconvertfont\dodoconvertfont
\def\noconvertfont#1% #2%
{\doifdefinedelse{\@noletter@#1}
@@ -3978,7 +3981,7 @@
\unexpanded\def\em
{\relax
- \ifdim\fontdimen1\font>\zeropoint
+ \ifdim\slantperpoint>\zeropoint
\settrue\emneeded
\else
\setfalse\emneeded
@@ -4514,12 +4517,12 @@
\unexpanded\def\moveaccent#1#2%
{\smashaccent
- {\dimen0\fontdimen5\font
+ {\dimen0\exheight
\dimen2\dimen0
\advance\dimen2 -#1%
- \fontdimen5\font\dimen2
+ \exheight\dimen2
#2\relax
- \fontdimen5\font\dimen0}}
+ \exheight\dimen0}}
%D Personally I think that using \TEX\ is complicated by the
%D way fonts are handled. Apart from the many encodings, we
diff --git a/Master/texmf-dist/tex/context/base/font-run.tex b/Master/texmf-dist/tex/context/base/font-run.tex
index d657aa40208..c3fde77918a 100644
--- a/Master/texmf-dist/tex/context/base/font-run.tex
+++ b/Master/texmf-dist/tex/context/base/font-run.tex
@@ -148,7 +148,7 @@
{\tf\vbox to 2.5em
{\vss
\hbox to 2.5em
- {\dummy\ifdim\fontdimen2\font=\zeropoint
+ {\dummy\ifdim\interwordspace=\zeropoint
\setbox\scratchbox\hbox
{\raise.5\dp\scratchbox\hbox
{\lower.5\ht\scratchbox\copy\scratchbox}}%
@@ -204,7 +204,7 @@
\bgroup
\raggedright
\switchtobodyfont[#1]
- \def\dodocommando##1##2%
+ \def\dodocommand##1##2%
{\starttextrule{\tttf #1 ##1 ##2}
\nobreak \getvalue{##2}%
\dorecurse{255}
@@ -213,9 +213,9 @@
\fi}
\par \nobreak
\stoptextrule}
- \def\docommando##1%
- {\getvalue{##1}\processcommacommand[#3]{\dodocommando{##1}}}
- \processcommalist[#2]\docommando
+ \def\docommand##1%
+ {\getvalue{##1}\processcommacommand[#3]{\dodocommand{##1}}}
+ \processcommalist[#2]\docommand
\egroup
\else\ifsecondargument
\showfontstyle[#1][#2][\alternativetextlist]%
diff --git a/Master/texmf-dist/tex/context/base/hand-ini.tex b/Master/texmf-dist/tex/context/base/hand-ini.tex
index cef84d0e6bd..814e4c0e332 100644
--- a/Master/texmf-dist/tex/context/base/hand-ini.tex
+++ b/Master/texmf-dist/tex/context/base/hand-ini.tex
@@ -290,12 +290,12 @@
% keep this
% \def\redodefineprotrudefactor#1%
- % {\ifdim\fontdimen6\font>\protrudethreshold
- % \divide\scratchdimen\fontdimen6\font
+ % {\ifdim\emwidth>\protrudethreshold
+ % \divide\scratchdimen\emwidth
% \multiply\scratchdimen\fontcharwd\handledfont#1\relax
% \else
% \multiply\scratchdimen\fontcharwd\handledfont#1\relax
- % \divide\scratchdimen\fontdimen6\font
+ % \divide\scratchdimen\emwidth
% \fi}
% \def\dododefineprotrudefactor#1#2#3%
@@ -313,19 +313,19 @@
\def\dododefineprotrudefactor#1#2#3%
{\lpcode\handledfont#1\dimexpr#2\lproddimen
\ifembasedprotruding \else
- \ifdim\fontdimen6\font>\protrudethreshold
- /\fontdimen6\font*\fontcharwd\handledfont#1%
+ \ifdim\emwidth>\protrudethreshold
+ /\emwidth*\fontcharwd\handledfont#1%
\else
- *\fontcharwd\handledfont#1/\fontdimen6\font
+ *\fontcharwd\handledfont#1/\emwidth
\fi
\fi
\relax
\rpcode\handledfont#1\dimexpr#3\rproddimen
\ifembasedprotruding \else
- \ifdim\fontdimen6\font>\protrudethreshold
- /\fontdimen6\font*\fontcharwd\handledfont#1%
+ \ifdim\emwidth>\protrudethreshold
+ /\emwidth*\fontcharwd\handledfont#1%
\else
- *\fontcharwd\handledfont#1/\fontdimen6\font
+ *\fontcharwd\handledfont#1/\emwidth
\fi
\fi
\relax}
@@ -339,12 +339,12 @@
\def\protrudethreshold{36\onepoint}
\def\redodefineprotrudefactor
- {\ifdim\fontdimen6\font>\protrudethreshold
- \divide\scratchdimen\fontdimen6\font
+ {\ifdim\emwidth>\protrudethreshold
+ \divide\scratchdimen\emwidth
\multiply\scratchdimen\wd\charbox
\else
\multiply\scratchdimen\wd\charbox
- \divide\scratchdimen\fontdimen6\font
+ \divide\scratchdimen\emwidth
\fi}
\def\dododefineprotrudefactor#1#2#3%
diff --git a/Master/texmf-dist/tex/context/base/java-ini.tex b/Master/texmf-dist/tex/context/base/java-ini.tex
index d2821162e2d..d9fe3c9022a 100644
--- a/Master/texmf-dist/tex/context/base/java-ini.tex
+++ b/Master/texmf-dist/tex/context/base/java-ini.tex
@@ -235,24 +235,6 @@
%D
%D After this call, the code is available in \type{\JScode}.
-\def\setverbosecscharacter#1%
- {\edef#1{\string#1}}
-
-\def\setverbosecscharacters % temporary hack
- {\setverbosecscharacter |\setverbosecscharacter ~%
- \setverbosecscharacter\:\setverbosecscharacter\;%
- \setverbosecscharacter\+\setverbosecscharacter\-%
- \setverbosecscharacter\[\setverbosecscharacter\]%
- \setverbosecscharacter\.\setverbosecscharacter\\%
- \setverbosecscharacter\)\setverbosecscharacter\(%
- \setverbosecscharacter\0\setverbosecscharacter\1%
- \setverbosecscharacter\2\setverbosecscharacter\3%
- \setverbosecscharacter\4\setverbosecscharacter\5%
- \setverbosecscharacter\6\setverbosecscharacter\7%
- \setverbosecscharacter\8\setverbosecscharacter\9%
- \setverbosecscharacter\n\setverbosecscharacter\s%
- \setverbosecscharacter\/}
-
\newif\ifdirectJScode
\def\presetJScode#1#2% #1=operation #2=arguments
@@ -267,7 +249,7 @@
\ifx\!!stringa\empty \else
\processcommacommand[\!!stringa]\dopresetJSvariables
\fi
- \def\docommando##1%
+ \def\docommand##1%
{\doifundefinedelse{\r!java\r!java##1}
{\showmessage\m!javascript2{##1}}
{\useJSpreamblenow{##1}}}%
@@ -276,7 +258,7 @@
\def\do##1##2%
{\xdef\JScode{\ifdirectJScode#1(\JScode)\else\JScode##2\fi}%
%\xdef\JScode{JS\string_N=\the\scratchcounter;\JScode}%
- \processcommalist[##1]\docommando}%
+ \processcommalist[##1]\docommand}%
\getvalue{\r!java#1}}
\def\dopresetJSvariables#1%
@@ -450,7 +432,7 @@
\globallet\JSpreamble\empty
\def\@@collectedJSpreamble{\r!java\r!java collected}%
\letvalue{\@@collectedJSpreamble}=\empty
- \def\docommando##1%
+ \def\docommand##1%
{\xdef\JScode{\getvalue{\r!java\r!java##1}}%
\ifoneJSpreamble % \global\letcdcsname
\@EA\setxvalue\@EA\@@collectedJSpreamble\@EA
@@ -458,7 +440,7 @@
\else
\setxvalue{\r!java\r!java##1}{\JScode}%
\fi}%
- \processcommacommand[\allJSpreambles]\docommando
+ \processcommacommand[\allJSpreambles]\docommand
\ifoneJSpreamble
\gdef\allJSpreambles{collected}%
\fi
@@ -726,14 +708,10 @@
\currentreferenceoperation
\currentreferencearguments
\egroup
- \dostartgoto
- \data
- {#2}%
- \start
- \dostartgotoJS\buttonwidth\buttonheight\JScode
- \stop
- \dostopgotoJS
- \dostopgoto
+ \dohandlegoto
+ {#2}%
+ {\dostartgotoJS\buttonwidth\buttonheight\JScode}%
+ {\dostopgotoJS}%
\egroup
\else
{#2}%
diff --git a/Master/texmf-dist/tex/context/base/lang-frq.tex b/Master/texmf-dist/tex/context/base/lang-frq.tex
index 82441f9c09d..7c70b7454f1 100644
--- a/Master/texmf-dist/tex/context/base/lang-frq.tex
+++ b/Master/texmf-dist/tex/context/base/lang-frq.tex
@@ -66,17 +66,17 @@
\def\charfreq#1 #2 % character fraction
{+(\ifcase\charwidthmethod
- #2\dimexpr(100\onepoint)%
+ #2\dimexpr100\onepoint\relax
\or
- #2\dimexpr(.5em)% \fontdimen6\font/2
+ #2\dimexpr.5em\relax % \emwidth/2
\or
- #2\dimexpr(\fontdimen5\font)%
+ #2\dimexpr\exheight\relax
\or
#2\fontcharwd\font`#1%
\or
- \dimexpr(100\fontcharwd\font`#1/\charactertsize\charwidthlanguage)% ugly hack
+ \dimexpr100\fontcharwd\font`#1/\charactertsize\charwidthlanguage\relax % ugly hack
\else
- #2\dimexpr(\fontdimen5\font)%
+ #2\dimexpr\exheight\relax
\fi)}
%D \macros
@@ -123,7 +123,7 @@
\beginTEX
- \def\averagecharwidth{\the\fontdimen6\font}
+ \def\averagecharwidth{\the\emwidth}
\endTEX
diff --git a/Master/texmf-dist/tex/context/base/lang-ger.tex b/Master/texmf-dist/tex/context/base/lang-ger.tex
index 4434b7dbaa1..211c1bf692c 100644
--- a/Master/texmf-dist/tex/context/base/lang-ger.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ger.tex
@@ -165,38 +165,6 @@
\installlanguage [norwegian] [\s!no]
\installlanguage [norsk] [\s!no] % bonus switch
-%% NORWEGIAN
-%
-% These three letters (in this order) are the
-% last in the norwegian alphabet (and hence should
-% come after z in the latin alphabet).
-% I'm not sure about the syntax for
-% \definesortkey so I left some of it open ...
-%
-% \startlanguagespecifics[\s!no]
-%
-% \definesortkey {\ae}{z}{b}{\ae}
-% \definesortkey {\AE}{z}{b}{\AE}
-% \definesortkey {\o}{z} {c}{\o}
-% \definesortkey {\O}{z} {c}{\O}
-% \definesortkey {\aa}{z}{d}{\aa}
-% \definesortkey {\aring}{z}{d}{\aring}
-% \definesortkey {\AA}{z}{d}{\AA}
-% \definesortkey {\Aring}{z}{d}{\Aring}
-%
-% \stoplanguagespecifics
-%
-% \startencoding[texnansi]
-% \startlanguagespecifics[\s!no]%
-% \defineactivecharacter æ {\ae{}}
-% \defineactivecharacter Æ {\AE{}}
-% \defineactivecharacter ø {\o{}}
-% \defineactivecharacter Ø {\O{}}
-% \defineactivecharacter å {\aa{}}
-% \defineactivecharacter Å {\AA{}}
-% \stoplanguagespecifics
-% \stopencoding
-
\setupheadtext [\s!en] [\v!content=Contents]
\setupheadtext [\s!nl] [\v!content=Inhoud]
\setupheadtext [\s!de] [\v!content=Inhalt]
diff --git a/Master/texmf-dist/tex/context/base/lang-ini.tex b/Master/texmf-dist/tex/context/base/lang-ini.tex
index f47a4e9147f..d9f79b6fc16 100644
--- a/Master/texmf-dist/tex/context/base/lang-ini.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ini.tex
@@ -20,8 +20,6 @@
\writestatus{loading}{Context Language Macros / Initialization}
-\unprotect
-
\startmessages dutch library: linguals
title: taal
1: afbreekpatronen -- voor -- geladen (n=--,e=--,m=--)
@@ -136,6 +134,11 @@
10: motifs -- chargés
\stopmessages
+\unprotect
+
+\ifx\nonfrenchspacing\undefined \let\nonfrenchspacing\relax \fi
+\ifx\frenchspacing \undefined \let\frenchspacing \relax \fi
+
%D When loading hyphenation patterns, \TEX\ assign a number to
%D each loaded table, starting with~0. Switching to a specific
%D table is done by assigning the relevant number to the
@@ -344,8 +347,7 @@
\enableregime[utf]}
\beginXETEX
- \def\setuphyppatencoding
- {\pathypsettings}
+ \def\setuphyppatencoding{\pathypsettings}
\endXETEX
\def\dodoloadpatterns#1#2#3#4% beware, loaded language also incr
@@ -980,4 +982,8 @@
\appendtoks\showmessage\m!linguals9\currentlanguage\to\everyjob
+%D Brrr:
+
+% \ifx\@@ladefault\undefined \let\@@ladefault\s!en \fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-lab.tex b/Master/texmf-dist/tex/context/base/lang-lab.tex
index 350ae2dfcef..38af4f78375 100644
--- a/Master/texmf-dist/tex/context/base/lang-lab.tex
+++ b/Master/texmf-dist/tex/context/base/lang-lab.tex
@@ -48,16 +48,16 @@
\def\setuplabeltext{\dosetupsometextprefix[\c!label]}
\def\dosetupsometextprefix
- {\let\dodocommando\xdosetupsometextprefix
+ {\let\dodocommand\xdosetupsometextprefix
\dotripleempty\dodosetupsometextprefix}
\def\dodosetupsometextprefix[#1][#2][#3]%
{\ifthirdargument
- \def\docommando##1{\dodocommando[#1#2][##1]}%
- \processcommalist[#3]\docommando
+ \def\docommand##1{\dodocommand[#1#2][##1]}%
+ \processcommalist[#3]\docommand
\else
- \def\docommando##1{\dodocommando[#1\currentmainlanguage][##1]}%
- \processcommalist[#2]\docommando
+ \def\docommand##1{\dodocommand[#1\currentmainlanguage][##1]}%
+ \processcommalist[#2]\docommand
\fi}
\def\doassignsometextprefix[#1][#2,#3,#4]%
@@ -99,6 +99,8 @@
\def\labellanguage{\defaultlanguage\currentmainlanguage}
\def\headlanguage {\defaultlanguage\currentmainlanguage}
+\appendtoks \let\labellanguage\currentlanguage \to \everycurrentdate
+
\unexpanded\def\headtext
{\let\handletextprefix\firstoftwoarguments
\let\reporttextprefixerror\doreporttextprefixerror
@@ -216,7 +218,7 @@
{\ifundefined{#1#2}\doassignsometextprefix[#1#2][#3,,]\fi}
\def\dopresetsometextprefix
- {\let\dodocommando\xdopresetsometextprefix
+ {\let\dodocommand\xdopresetsometextprefix
\dotripleempty\dodosetupsometextprefix}
\def\presetheadtext {\dopresetsometextprefix[\c!title]}
diff --git a/Master/texmf-dist/tex/context/base/lang-mis.tex b/Master/texmf-dist/tex/context/base/lang-mis.tex
new file mode 100644
index 00000000000..5feb6c542b2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lang-mis.tex
@@ -0,0 +1,853 @@
+%D \module
+%D [ file=lang-mis,
+%D version=1997.03.20, % used to be supp-lan.tex
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Language Options,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Language Macros / Compounds}
+
+%D \gdef\starttest
+%D {\blank
+%D \noindent
+%D \halign\bgroup\tt##\hskip2em&##\hskip2em&##\cr}
+%D
+%D \gdef\stoptest
+%D {\egroup
+%D \blank}
+%D
+%D \gdef\test#1%
+%D {\convertargument#1\to\ascii\ascii&\hyphenatedword{#1}&#1\cr}
+
+\unprotect
+
+%D One of \TEX's strong points in building paragraphs is the way
+%D hyphenations are handled. Although for real good hyphenation
+%D of non||english languages some extensions to the program are
+%D needed, fairly good results can be reached with the standard
+%D mechanisms and an additional macro, at least in Dutch.
+
+%D \CONTEXT\ originates in the wish to typeset educational
+%D materials, especially in a technical environment. In
+%D production oriented environments, a lot of compound words
+%D are used. Because the Dutch language poses no limits on
+%D combining words, we often favor putting dashes between those
+%D words, because it facilitates reading, at least for those
+%D who are not that accustomed to it.
+%D
+%D In \TEX\ compound words, separated by a hyphen, are not
+%D hyphenated at all. In spite of the multiple pass paragraph
+%D typesetting this can lead to parts of words sticking into
+%D the margin. The solution lays in saying \type
+%D {spoelwater||terugwinunit} instead of \type
+%D {spoelwater-terugwinunit}. By using a one character command
+%D like \type {|}, delimited by the same character \type {|},
+%D we get ourselves both a decent visualization (in \TEXEDIT\
+%D and colored verbatim we color these commands yellow) and an
+%D efficient way of combining words.
+%D
+%D The sequence \type{||} simply leads to two words connected by
+%D a hyphen. Because we want to distinguish such a hyphen from
+%D the one inserted when \TEX\ hyphenates a word, we use a bit
+%D longer one.
+%D
+%D \hyphenation {spoel-wa-ter te-rug-win-unit}
+%D
+%D \starttest
+%D \test {spoelwater||terugwinunit}
+%D \stoptest
+%D
+%D As we already said, the \type{|} is a command. This commands
+%D accepts an optional argument before it's delimiter, which is
+%D also a \type{|}.
+%D
+%D \hyphenation {po-ly-meer che-mie}
+%D
+%D \starttest
+%D \test {polymeer|*|chemie}
+%D \stoptest
+%D
+%D Arguments like \type{*} are not interpreted and inserted
+%D directly, in contrary to arguments like:
+%D
+%D \starttest
+%D \test {polymeer|~|chemie}
+%D \test {|(|polymeer|)|chemie}
+%D \test {polymeer|(|chemie|)| }
+%D \stoptest
+%D
+%D Although such situations seldom occur |<|we typeset thousands
+%D of pages before we encountered one that forced us to enhance
+%D this mechanism|>| we also have to take care of comma's.
+%D
+%D \hyphenation {uit-stel-len}
+%D
+%D \starttest
+%D \test {op||, in|| en uitstellen}
+%D \stoptest
+%D
+%D The next special case (concerning quotes) was brought to my
+%D attention by Piet Tutelaers, one of the driving forces
+%D behind rebuilding hyphenation patterns for the dutch
+%D language.\footnote{In 1996 the spelling of the dutch
+%D language has been slightly reformed which made this topic
+%D actual again.} We'll also take care of this case.
+%D
+%D \starttest
+%D \test {AOW|'|er}
+%D \test {cd|'|tje}
+%D \test {ex|-|PTT|'|er}
+%D \test {rock|-|'n|-|roller}
+%D \stoptest
+%D
+%D Tobias Burnus pointed out that I should also support
+%D something like
+%D
+%D \starttest
+%D \test {well|_|known}
+%D \stoptest
+%D
+%D to stress the compoundness of hyphenated words.
+%D
+%D Of course we also have to take care of the special case:
+%D
+%D \starttest
+%D \test {text||color and ||font}
+%D \stoptest
+
+%D \macros
+%D {installdiscretionaries}
+%D
+%D The mechanism described here is one of the older inner parts
+%D of \CONTEXT. The most recent extensions concerns some
+%D special cases as well as the possibility to install other
+%D characters as delimiters. The prefered way of specifying
+%D compound words is using \type{||}, which is installed by:
+%D
+%D \starttyping
+%D \installdiscretionaries || -
+%D \stoptyping
+%D
+%D Some alternative definitions are:
+%D
+%D \startbuffer
+%D \installdiscretionaries ** -
+%D \installdiscretionaries ++ -
+%D \installdiscretionaries // -
+%D \installdiscretionaries ~~ -
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D after which we can say:
+%D
+%D \bgroup
+%D \getbuffer
+%D \starttest
+%D \test {test**test**test}
+%D \test {test++test++test}
+%D \test {test//test//test}
+%D \test {test~~test~~test}
+%D \stoptest
+%D \egroup
+
+%D \macros
+%D {compoundhyphen,
+%D beginofsubsentence,endofsubsentence}
+%D
+%D Now let's go to the macros. First we define some variables.
+%D In the main \CONTEXT\ modules these can be tuned by a setup
+%D command. Watch the (maybe) better looking compound hyphen.
+
+\ifx\compoundhyphen \undefined \def\compoundhyphen{\hbox{-\kern-.25ex-}} \fi
+
+\ifx\beginofsubsentence \undefined \def\beginofsubsentence{\hbox{---}} \fi
+\ifx\endofsubsentence \undefined \def\endofsubsentence {\hbox{---}} \fi
+
+%D The last two variables are needed for subsentences
+%D |<|like this one|>| which we did not yet mention.
+%D
+%D We want to enable breaking but at the same time don't want
+%D compound characters like |-| or || to be separated from the
+%D words. \TEX\ hackers will recognise the next two macro's:
+
+\ifx\prewordbreak \undefined \def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi
+\ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount\prewordbreak} \fi
+
+\ifx\hspaceamount \undefined \def\hspaceamount#1#2{\kern.16667em} \fi % language specific
+
+%D \macros
+%D {beginofsubsentencespacing,endofsubsentencespacing}
+%D
+%D In the previous macros we provided two hooks which can be
+%D used to support nested sub||sentences. In \CONTEXT\ these
+%D hooks are used to insert a small space when needed.
+
+\ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi
+\ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi
+
+%D The following piece of code is a torture test compound
+%D hndling. The \type {\relax} before the \type {\ifmmode} is
+%D needed because of the alignment scanner (in \ETEX\ this
+%D problem is not present because there a protected macro is
+%D not expanded. Thanks to Tobias Burnus for providing this
+%D example.
+%D
+%D \startformula
+%D \left|f(x_n)-{1\over2}\right| =
+%D {\cases{|{1\over2}-x_n| &for $0\le x_n < {1\over2}$\cr
+%D |x_n-{1\over2}| &for ${1\over2}<x_n\le1$ \cr}}
+%D \stopformula
+
+\def\@tmd@action@{@tmd@a@}
+\def\@tmd@text@ {@tmd@t@}
+\def\@tmd@math@ {@tmd@m@}
+\def\@tmd@both@ {@tmd@b@}
+
+% \def\installdiscretionary#1#2%
+% {\setevalue{\@tmd@math@\detokenize{#1}}{\detokenize{#1}}%
+% \setvalue {\@tmd@text@\detokenize{#1}}{#2}%
+% \catcode`#1=\@@active % \catcode\expandafter`\detokenize{#1}=\@@active
+% \scratchcounter=\the\uccode`\~
+% \uccode`\~=`#1\relax % \uccode`\~=\expandafter`\detokenize{#1}\relax
+% \uppercase{\unexpanded\def~{\discretionarycommand~}}%
+% \uccode`\~=\scratchcounter}
+
+\def\installdiscretionary#1#2%
+ {\setevalue{\@tmd@math@\detokenize{#1}}{\detokenize{#1}}%
+ \setvalue {\@tmd@text@\detokenize{#1}}{#2}%
+ \setvalue {\@tmd@both@\detokenize{#1}}{\discretionarycommand#1}%
+ \scratchcounter\expandafter`\detokenize{#1}%
+ \@EA\letcatcodecommand\@EA\ctxcatcodes\@EA\scratchcounter\csname\@tmd@both@\detokenize{#1}\endcsname}
+
+\def\handlemathmodediscretionary#1{\executeifdefined{\@tmd@math@\detokenize{#1}}\donothing}
+\def\handletextmodediscretionary#1{\executeifdefined{\@tmd@text@\detokenize{#1}}\donothing}
+
+\def\installdiscretionaries#1#2{\writestatus\m!systems{use \string \installdiscretionary}} % obsolete
+
+\chardef\discretionarymode\plusone
+
+\def\ignorediscretionaries
+ {\chardef\discretionarymode\zerocount}
+
+\def\discretionarycommand
+ {% if direct if, we need \relax for lookahead in math mode
+ \csname
+ \ifcase\discretionarymode
+ \strippedcsname\dononemodediscretionary
+ \else\ifmmode
+ \strippedcsname\domathmodediscretionary
+ \else
+ \strippedcsname\dotextmodediscretionary
+ \fi\fi
+ \endcsname}
+
+\def\dononemodediscretionary#1%
+ {\detokenize{#1}}
+
+%D The macro \type{\checkbeforediscretionary} takes care of
+%D loners like \type{||word}, while it counterpart
+%D \type{\checkafterdiscretionary} is responsible for handling
+%D the comma.
+
+\def\checkbeforediscretionary
+ {\ifvmode\dontleavehmode\fi
+ \ifhmode
+ \begingroup
+ \setbox\scratchbox\lastbox
+ \ifzeropt\wd\scratchbox
+ \let\postwordbreak\prewordbreak
+ \fi
+ \box\scratchbox\relax
+ \endgroup
+ \fi}
+
+\def\checkafterdiscretionary
+ {\ifx,\nextnext
+ \def\nextnextnext{\afterassignment\egroup\let\next=}%
+ \else
+ \let\nextnext\relax
+ \fi}
+
+\newsignal\compoundbreakpoint
+
+\let\domathmodediscretionary\handlemathmodediscretionary
+
+\def\dotextmodediscretionary#1%
+ {\bgroup
+ \let\nextnextnext\egroup
+ \def\next##1#1%
+ {\def\next{\activedododotextmodediscretionary#1{##1}}%
+ \futurelet\nextnext\next}%
+ \next}
+
+\def\activedododotextmodediscretionary#1#2%
+ {\edef\discretionarytoken{\detokenize{#2}}%
+ \def\textmodediscretionary{\handletextmodediscretionary{#1}}%
+ \ifx\discretionarytoken\empty
+ \ifx#1\nextnext % takes care of ||| and +++ and ......
+ \prewordbreak\discretionary{\hbox{$#1$}}{}{\hbox{$#1$}}%
+ \allowbreak\postwordbreak
+ \def\nextnextnext{\afterassignment\egroup\let\next=}%
+ \else
+ \checkafterdiscretionary
+ \bgroup
+ \checkbeforediscretionary
+ % the next line has been changed (20050203)
+ % \prewordbreak\hbox{\textmodediscretionary\nextnext}\allowbreak\postwordbreak
+ % but an hbox blocks a possible \discretionary
+ \prewordbreak\textmodediscretionary\nextnext\allowbreak\postwordbreak
+ \egroup
+ \fi
+ \else\expandafter\ifx\csname\@tmd@action@\discretionarytoken\endcsname\relax
+ \checkafterdiscretionary
+ \bgroup
+ \checkbeforediscretionary
+ \prewordbreak
+ \discretionary{\hbox{#2}}{}{\hbox{#2}}%
+ \allowbreak\postwordbreak
+ \egroup
+ \else\ifx\nextnextnext\egroup % so we can properly do things afterward
+ \@EA\egroup
+ \@EA\let\@EA\nextnextnext\@EA\empty
+ \csname\@tmd@action@\discretionarytoken\endcsname
+ \else
+ \csname\@tmd@action@\discretionarytoken\endcsname
+ \fi\fi\fi
+ \nextnextnext} % lookahead in commands
+
+
+%D \macros
+%D {directdiscretionary}
+%D
+%D In those situations where the nature of characters is
+%D less predictable, we can use the more direct approach:
+
+\unexpanded\def\directdiscretionary#1%
+ {\edef\discretionarytoken{\detokenize{#1}}%
+ \let\textmodediscretionary\compoundhyphen
+ \executeifdefined{\@tmd@action@\discretionarytoken}{\indirectdiscretionary{#1}}}
+
+\unexpanded\def\indirectdiscretionary#1%
+ {\prewordbreak\discretionary{\hbox{#1}}{}{\hbox{#1}}\allowbreak\postwordbreak}
+
+\def\definetextmodediscretionary #1
+ {\setvalue{\@tmd@action@\detokenize{#1}}}
+
+\definetextmodediscretionary {} % empty case, also handled in parser
+ {\prewordbreak\compoundhyphen\allowbreak\postwordbreak}
+
+\definetextmodediscretionary ~
+ {\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak}
+
+\definetextmodediscretionary _
+ {\prewordbreak
+ \discretionary{\compoundhyphen}{\compoundhyphen}{\compoundhyphen}%
+ \prewordbreak}
+
+\definetextmodediscretionary (
+ {\ifdim\lastskip>\zeropoint
+ (\prewordbreak
+ \else
+ \prewordbreak\discretionary{}{(-}{(}\prewordbreak
+ \fi}
+
+\definetextmodediscretionary )
+ {\ifx\nextnext\blankspace
+ \prewordbreak)\relax
+ \else\ifx\nextnext\space
+ \prewordbreak)\relax
+ \else
+ \prewordbreak\discretionary{-)}{}{)}\prewordbreak
+ \fi\fi}
+
+\definetextmodediscretionary '
+ {\prewordbreak\discretionary{-}{}{'}\postwordbreak}
+
+\definetextmodediscretionary <
+ {\beginofsubsentence\prewordbreak\beginofsubsentencespacing}
+
+\definetextmodediscretionary >
+ {\endofsubsentencespacing\prewordbreak\endofsubsentence}
+
+% \definetextmodediscretionary . % not yet definitive
+% {\prewordbreak\midsentence\prewordbreak}
+
+\definetextmodediscretionary =
+ {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen}
+
+\definetextmodediscretionary ^
+ {\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}%
+ \allowbreak\postwordbreak}
+
+% french
+
+\definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:}
+\definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};}
+\definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?}
+\definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!}
+
+\definetextmodediscretionary *
+ {\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak}
+
+% spanish
+
+\definetextmodediscretionary ?? {\prewordbreak\questiondown}
+\definetextmodediscretionary !! {\prewordbreak\exclamdown}
+
+% \ifx\normalcompound\undefined \let\normalcompound=| \fi
+
+%D \installdiscretionary | +
+%D \installdiscretionary + =
+
+\def\defaultdiscretionaryhyphen{\compoundhyphen}
+
+\installdiscretionary | \defaultdiscretionaryhyphen % installs in ctx and prt will fall back on it
+
+%D \macros
+%D {fakecompoundhyphen}
+%D
+%D In headers and footers as well as in active pieces of text
+%D we need a dirty hack. Try to imagine what is needed to
+%D savely break the next text across a line and at the same
+%D time make the words interactive.
+%D
+%D \starttyping
+%D \goto{Some||Long||Word}
+%D \stoptyping
+
+\def\fakecompoundhyphen
+ {\def\|{\mathortext\vert\dofakecompoundhyphen}}
+
+\def\dofakecompoundhyphen
+ {\def##1|%
+ {\doifelsenothing{##1}\compoundhyphen{##1}%
+ \kern\compoundbreakpoint\allowbreak}}
+
+%D \macros
+%D {midworddiscretionary}
+%D
+%D If needed, one can add a discretionary hyphen using \type
+%D {\midworddiscretionary}. This macro does the same as
+%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented
+%D earlier, this one also looks ahead for spaces and grouping
+%D tokens.
+
+\def\midworddiscretionary
+ {\futurelet\next\domidworddiscretionary}
+
+\def\domidworddiscretionary
+ {\ifx\next\blankspace\else
+ \ifx\next\bgroup \else
+ \ifx\next\egroup \else
+ \discretionary{-}{}{}%
+ \fi\fi\fi}
+
+%D \macros
+%D {installcompoundcharacter}
+%D
+%D When Tobias Burnus started translating the dutch manual of
+%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support
+%D the \type{german.sty} method of handling compound
+%D characters, especially the umlaut. This package is meant for
+%D use with \PLAIN\ \TEX\ as well as \LATEX.
+%D
+%D I decided to implement compound character support as
+%D versatile as possible. As a result one can define his own
+%D compound character support, like:
+%D
+%D \starttyping
+%D \installcompoundcharacter "a {\"a}
+%D \installcompoundcharacter "e {\"e}
+%D \installcompoundcharacter "i {\"i}
+%D \installcompoundcharacter "u {\"u}
+%D \installcompoundcharacter "o {\"o}
+%D \installcompoundcharacter "s {\SS}
+%D \stoptyping
+%D
+%D or even
+%D
+%D \starttyping
+%D \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}}
+%D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}}
+%D \stoptyping
+%D
+%D The support is not limited to alphabetic characters, so the
+%D next definition is also valid.
+%D
+%D \starttyping
+%D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}}
+%D \stoptyping
+%D
+%D The implementation looks familiar and uses the same tricks as
+%D mentioned earlier in this module. We take care of two
+%D arguments, which complicates things a bit.
+
+\def\@nc@{@nc@} % normal character
+\def\@cc@{@cc@} % compound character
+\def\@cs@{@cs@} % compound characters
+\def\@cx@{@cx@} % compound definition
+
+%D When we started working on MK IV code, we needed a different
+%D approach for defining the active character itself. In MK II as
+%D well as in MK IV we now use the catcode vectors.
+
+\chardef\compoundcharactermode\plusone
+
+\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping
+ {\ifcase\compoundcharactermode
+ % ignore mode
+ \else
+ \chardef\thecompoundcharacter`#1%
+ \@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter
+ \def\!!stringa{#3}%
+ \@EA\def\csname\ifx\!!stringa\empty\@cc@\else\@cs@\fi\detokenize{#1#2#3}\endcsname{#4}%
+ \setevalue{\@cx@\detokenize{#1}}{\noexpand\handlecompoundcharacter{\detokenize{#1}}}% beter nr's
+% \@EA\letcatcodecommand\@EA\prtcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname
+% \@EA\letcatcodecommand\@EA\texcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname
+ \@EA\letcatcodecommand\@EA\ctxcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname
+ \fi}
+
+%D In order to serve the language specific well, we will introduce
+%D a namespace:
+
+% \ifx\currentlanguage\undefined
+ \let\compoundcharacterclass\empty
+% \else
+% \def\compoundcharacterclass{\currentlanguage}
+% \fi
+
+\def\@cc@{@cc@\compoundcharacterclass} % compound character
+\def\@cs@{@cs@\compoundcharacterclass} % compound characters
+
+%D We can also ignore definitions (needed in for instance \XML). Beware,
+%D this macro is supposed to be used grouped!
+
+\def\ignorecompoundcharacter
+ {\chardef\compoundcharactermode\zerocount}
+
+\let\restorecompoundcharacter \gobbleoneargument % obsolete
+\let\enableactivediscretionaries\relax % obsolete
+
+%D In handling the compound characters we have to take care of
+%D \type{\bgroup} and \type{\egroup} tokens, so we end up with
+%D a multi||step interpretation macro. We look ahead for a
+%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being
+%D no user of this mechanism, the credits for testing them goes
+%D to Tobias Burnus, the first german user of \CONTEXT.
+%D
+%D We define these macros as \type{\long} because we can
+%D expect \type{\par} tokens. We need to look into the future
+%D with \type{\futurelet} to prevent spaces from
+%D disappearing.
+
+\def\handlecompoundcharacter#1%
+ {\def\xhandlecompoundcharacter{\dohandlecompoundcharacter{#1}}%
+ \futurelet\next\xhandlecompoundcharacter}
+
+\def\dohandlecompoundcharacter
+ {\ifx\next\bgroup
+ %\@EA\dodohandlecompoundcharacter % handle "{ee} -> \"ee
+ %\@EA\gobbleoneargument % forget "{ee} -> ee
+ \@EA\handlecompoundcharacterone % ignore "{ee} -> "ee
+ \else\ifx\next\egroup
+ \@EAEAEA\donohandlecompoundcharacter
+ \else\ifx\next\blankspace
+ \@EA\@EAEAEA\@EA\donohandlecompoundcharacter
+ \else
+ \@EA\@EAEAEA\@EA\dodohandlecompoundcharacter
+ \fi\fi\fi}
+
+\def\donohandlecompoundcharacter#1{\csname\@nc@\string#1\endcsname}
+
+\def\dododohandlecompoundcharacter
+ {\ifx\next\bgroup
+ \@EA\handlecompoundcharacterone
+ \else\ifx\next\egroup
+ \@EAEAEA\handlecompoundcharacterone
+ \else\ifx\next\blankspace
+ \@EA\@EAEAEA\@EA\handlecompoundcharacterone
+ \else
+ \@EA\@EAEAEA\@EA\handlecompoundcharactertwo
+ \fi\fi\fi}
+
+\def\dodohandlecompoundcharacter#1#2% preserve space
+ {\def\xdodohandlecompoundcharacter{\dododohandlecompoundcharacter#1#2}%
+ \futurelet\next\xdodohandlecompoundcharacter}
+
+%D Besides taken care of the grouping and space tokens, we have
+%D to deal with three situations. First we look if the next
+%D character equals the first one, if so, then we just insert
+%D the original. Next we look if indeed a compound character is
+%D defined. We either execute the compound character or just
+%D insert the first. So we have
+%D
+%D \starttyping
+%D <key><key> <key><known> <key><unknown>
+%D \stoptyping
+%D
+%D In later modules we will see how these commands are used.
+
+\long\def\handlecompoundcharacterone#1#2%
+ {\if\string#1\string#2% was: \ifx#1#2%
+ \def\next{\csname\@nc@\string#1\endcsname}%
+ \else\ifcsname\@cc@\string#1\string#2\endcsname
+ \def\next{\csname\@cc@\string#1\string#2\endcsname}%
+ \else
+ \def\next{\csname\@nc@\string#1\endcsname#2}%
+ \fi\fi
+ \next}
+
+\long\def\handlecompoundcharactertwo#1#2#3%
+ {\if\string#1\string#2%
+ \def\next{\csname\@nc@\string#1\endcsname#3}%
+ \else\ifcsname\@cs@\string#1\string#2\string#3\endcsname
+ \def\next{\csname\@cs@\string#1\string#2\string#3\endcsname}%
+ \else\ifcsname\@cc@\string#1\string#2\endcsname
+ \def\next{\csname\@cc@\string#1\string#2\endcsname#3}%
+ \else
+ \def\next{\csname\@nc@\string#1\endcsname#2#3}%
+ \fi\fi\fi
+ \next}
+
+%D For very obscure applications (see for an application \type
+%D {lang-sla.tex}) we provide:
+
+\def\simplifiedcompoundcharacter#1#2%
+ {\ifcsname\@cc@\string#1\string#2\endcsname
+ \@EA\@EA\@EA\firstofoneargument\csname\@cc@\string#1\string#2\endcsname
+ \else
+ #2%
+ \fi}
+
+%D \macros
+%D {disablediscretionaries,disablecompoundcharacter}
+%D
+%D Occasionally we need to disable this mechanism. For the
+%D moment we assume that \type {|} is used.
+
+\let\disablediscretionaries \ignorediscretionaries
+\let\disablecompoundcharacters\ignorecompoundcharacter
+
+%D \macros
+%D {normalcompound}
+%D
+%D Handy in for instance XML. (Kind of obsolete)
+
+\ifx\normalcompound\undefined \let\normalcompound=| \fi
+
+%D ! ! This will be reimplemented !!
+
+%D \macros
+%D {hyphenatedurl}
+%D
+%D For those who want to put full \URL's in a text, we offer
+%D
+%D \startbuffer
+%D \hyphenatedurl{http://optimist.optimist/optimist/optimist.optimist#optimist}
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D which breaks at the appropriate places. Watch the \type{#}
+%D hack.
+%D
+%D When passed as argument, like in \type {\goto}, one needs
+%D to substitute a \type {\\} for each \type{#}.
+%D
+%D \startbuffer
+%D \hyphenatedurl{http://this.is.a.rather/strange/reference#indeed}
+%D \stopbuffer
+%D
+%D \typebuffer
+
+\ifx\\\undefined \let\\\crlf \fi
+
+\chardef\urlsplitmode=1
+
+% 0 => don't split
+% 1 => . : na, rest voor
+% 2 => alles na
+% 3 => alles voor
+
+% \bgroup \catcode`\~=\active \catcode`\/=\active
+
+% Why not convert to ascii first? I will redo this one!
+
+\bgroup \catcode`\~=\active \catcode`\/=\active
+
+\unexpanded\gdef\hyphenatedurl#1% {}{} handles accents
+ {\bgroup
+ \ifnum\hyphenpenalty<10000 \else
+ \def\discretionary##1##2##3{##1\allowbreak##2}%
+ \fi
+ \obeyhyphens
+ \def\splitbefore##1%
+ {\setbox\scratchbox=\hbox{##1{}{}}%
+ \ifcase\urlsplitmode
+ \box\scratchbox
+ \or
+ \postwordbreak\box\scratchbox\prewordbreak
+ \or
+ \prewordbreak\discretionary{\box\scratchbox}{}{\box\scratchbox}\prewordbreak
+ \else
+ \postwordbreak\box\scratchbox\prewordbreak
+ \fi}%
+ \def\splitafter##1%
+ {\ifcase\urlsplitmode
+ ##1{}{}%
+ \or
+ \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
+ \or
+ \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
+ \else
+ \prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak
+ \fi}%
+ \def\splitanyway##1%
+ {\prewordbreak##1\prewordbreak}%
+ \def\flushurl%
+ {\savedurl\let\savedurl\empty}%
+ \def\\%
+ {\spliturl\#}%
+ \let\~=\lettertilde\let~=\~%
+ \let\/=\letterslash\let/=\/%
+ \let\savedurl\empty
+ \scratchcounter\zerocount % used for hyphenmethod
+ \handletokens#1\with\scanurl\savedurl
+ \egroup}
+
+\egroup
+
+%D This would be better, but it spoils \type {\~} and so:
+%D
+%D \starttyping
+%D \convertargument#1\to\ascii
+%D \expandafter\handletokens\ascii\with\scanurl
+%D \stoptyping
+
+\chardef\urlhyphenmethod=0
+
+\def\scanurl#1%
+ {\advance\scratchcounter\plusone
+ \ifx#1\blankspace
+ \flushurl\splitanyway\normalspace
+ \else\ifx#1\ %
+ \flushurl\splitanyway\normalspace
+ \else\ifx#1\space
+ \flushurl\splitanyway\normalspace
+ \else\ifx#1\~%
+ \flushurl\splitbefore\~%
+ \else\ifx#1\#%
+ \flushurl\splitbefore\#%
+ \else\ifx#1\&%
+ \flushurl\splitbefore\&%
+ \else\ifx#1\%%
+ \flushurl\splitbefore\%%
+ \else\ifx#1\_%
+ \flushurl\splitbefore\_%
+ \else\if\noexpand#1\relax
+ #1%
+ \else\ifnum\catcode`#1=8
+ \flushurl\splitbefore\_%
+ \else\ifnum\catcode`#1=6
+ \flushurl\splitbefore\#%
+ \else\ifnum\catcode`#1=4
+ \flushurl\splitbefore\&%
+ \else\expandafter\if\string#1\lettertilde
+ \flushurl\splitbefore\~%
+ \else\expandafter\if\string#1\letterpercent
+ \flushurl\splitbefore\%%
+ \else\expandafter\if\string#1\letterunderscore
+ \flushurl\splitbefore\_%
+ \else\expandafter\if\string#1\letterquestionmark
+ \flushurl\splitafter\letterquestionmark
+ \else\expandafter\if\string#1\letterat
+ \flushurl\splitafter\letterat
+ \else\expandafter\if\string#1\letterslash
+ \edef\savedurl{\savedurl\letterslash}%
+ \else\expandafter\if\string#1+%
+ \flushurl\splitafter+%
+ \else\expandafter\if\string#1:%
+ \flushurl\splitafter:%
+ \else\expandafter\if\string#1.%
+ \flushurl\splitafter.%
+ \else\expandafter\if\string#1(%
+ \flushurl\splitbefore(%
+ \else\expandafter\if\string#1)%
+ \flushurl\splitafter)%
+ \else
+ \ifx\savedurl\empty\else
+ \splitbefore\savedurl
+ \let\savedurl\empty
+ \fi
+ \ifcase\urlhyphenmethod
+ \string#1%
+ \else
+ \ifnum\scratchcounter>\plusthree % so, \http: will not break
+ \edef\savedurl{\string#1}%
+ \else
+ \string#1%
+ \fi
+ \fi
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+% \setupinteraction[state=start]
+% \def\gotoURL#1{\useURL[foo][#1]\goto{\url[foo]}[url(foo)]}
+% \starttext
+% \endgraf \chardef\urlhyphenmethod=0
+% \hsize1pt\gotoURL{http://www.physik.fu-berlin.de/SomeVeryVeryVeryLongDirectory/And/AQuiteLongFileName.html}
+% \endgraf \chardef\urlhyphenmethod=1
+% \hsize1pt\gotoURL{http://www.physik.fu-berlin.de/SomeVeryVeryVeryLongDirectory/And/AQuiteLongFileName.html}
+% \stoptext
+
+% \useencoding[ffr]
+% \mainlanguage[fr]
+% \starttext
+% \hyphenatedurl{http://somewhere.to/go}
+% \stoptext
+
+%D When Joop Susan asked (on the \CONTEXT\ mailing list) how
+%D to handle url's passed as argument, the following solutions
+%D came to my mind:
+%D
+%D \starttyping
+%D \def\whateverurl#1%
+%D {{\def~{\string~}\useURL[dummy][#1]\goto{\url[dummy]}[URL(dummy)]}}
+%D
+%D \def\whateverurl#1%
+%D {{\let~\lettertilde\useURL[dummy][#1]\goto{\url[dummy]}[URL(dummy)]}}
+%D
+%D \def\whateverurl#1%
+%D {\convertargument#1\to\ascii
+%D \expanded{\useURL[dummy][\ascii]}\goto{\url[dummy]}[URL(dummy)]}
+%D \stoptyping
+
+%D \macros
+%D {hyphenatedfile}
+%D
+%D For the moment we treat filenames in a similar way,
+%D
+%D \starttyping
+%D \hyphenatedfile{here/there/filename.suffix}
+%D \stoptyping
+
+\let\hyphenatedfile\hyphenatedurl
+
+% to be finished
+%
+% \def\hyphenatedstring#1%
+% {\bgroup
+% \nohyphens
+% \def\next##1{##1\doif{##1}{-}{\allowbreak}}%
+% \handletokens#1\with\next
+% \egroup}
+%
+% {\hsize1cm\hyphenatedstring{ABXXXXXXXXXXC-12345-12345}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-sla.mkii b/Master/texmf-dist/tex/context/base/lang-sla.mkii
new file mode 100644
index 00000000000..62483aeb689
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lang-sla.mkii
@@ -0,0 +1,30 @@
+%D \module
+%D [ file=lang-sla,
+%D version=1999.09.13, % 1997.09.03
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Slavic Languages,
+%D author=Hans Hagen / Tobias Burnus,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\def\sloveniancharacter#1%
+ {\ifcase#1\unknowncharacter
+ \or a\or b\or c\or \ccaron\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
+ \or n\or o\or p\or r\or s\or \scaron\or t\or u\or v\or z\or \zcaron
+ \else
+ \unknowncharacter
+ \fi}
+
+\def\slovenianCharacter#1%
+ {\ifcase#1\unknowncharacter
+ \or A\or B\or C\or \Ccaron\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
+ \or N\or O\or P\or R\or S\or \Scaron\or T\or U\or V\or Z\or \Zcaron
+ \else
+ \unknowncharacter
+ \fi}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-sla.tex b/Master/texmf-dist/tex/context/base/lang-sla.tex
index f517fe7ff96..b9749d93013 100644
--- a/Master/texmf-dist/tex/context/base/lang-sla.tex
+++ b/Master/texmf-dist/tex/context/base/lang-sla.tex
@@ -90,7 +90,7 @@
\c!rightquote=\upperrightsinglesixquote,
\c!leftquotation=\lowerleftdoubleninequote,
\c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year},
+ \c!date={\v!day,{.\,},\v!month,\ ,\v!year},
\c!state=\v!stop]
\installlanguage
@@ -104,7 +104,7 @@
\c!rightquote=\upperrightsingleninequote,
\c!leftquotation=\upperleftdoublesixquote,
\c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day},
+ \c!date={\v!day,{.\,},\v!month,\ ,\v!year},
\c!state=\v!stop]
\installlanguage
@@ -275,25 +275,25 @@
\setuplabeltext [\s!sl] [\v!subsubsubsection=]
\setuplabeltext [\s!pl] [\v!appendix=] % Dodatek
-\setuplabeltext [\s!cz] [\v!appendix=P\rcaron\iacute loha]
-\setuplabeltext [\s!sk] [\v!appendix=Pr\iacute loha]
+\setuplabeltext [\s!cz] [\v!appendix=P\rcaron\iacute loha ]
+\setuplabeltext [\s!sk] [\v!appendix=Pr\iacute loha ]
\setuplabeltext [\s!hr] [\v!appendix=Dodatak ]
\setuplabeltext [\s!sl] [\v!appendix=Dodatek ]
-\setuplabeltext [\s!pl] [\v!part=Ust\eogonek p]
-\setuplabeltext [\s!cz] [\v!part=\Ccaron \aacute st]
-\setuplabeltext [\s!sk] [\v!part=\Ccaron as\tcaron{}]
-\setuplabeltext [\s!hr] [\v!part=Dio]
+\setuplabeltext [\s!pl] [\v!part=Ust\eogonek p ]
+\setuplabeltext [\s!cz] [\v!part=\Ccaron \aacute st ]
+\setuplabeltext [\s!sk] [\v!part=\Ccaron as\tcaron{} ]
+\setuplabeltext [\s!hr] [\v!part=Dio ]
\setuplabeltext [\s!sl] [\v!part=Del ]
\setuplabeltext [\s!pl] [\v!line=wiersz ]
-\setuplabeltext [\s!cz] [\v!line=\rcaron\aacute dek]
+\setuplabeltext [\s!cz] [\v!line=\rcaron\aacute dek ]
\setuplabeltext [\s!sk] [\v!line=riadok ]
\setuplabeltext [\s!hr] [\v!line=red ]
\setuplabeltext [\s!sl] [\v!line=vrstica ]
\setuplabeltext [\s!pl] [\v!lines=wiersze ]
-\setuplabeltext [\s!cz] [\v!lines=\rcaron\aacute dky]
+\setuplabeltext [\s!cz] [\v!lines=\rcaron\aacute dky ]
\setuplabeltext [\s!sk] [\v!lines=riadky ]
\setuplabeltext [\s!hr] [\v!lines=redovi ]
\setuplabeltext [\s!sl] [\v!lines=vrstice ]
@@ -431,7 +431,7 @@
%D \ShowAllLanguageValues [\s!hr] [croatian] {Croatian} {heartthrob}
%D \ShowAllLanguageValues [\s!sl] [slovenian] {Slovenian} {mountains}
-%D A present from Brooks Moses and Hans hagen for Mojca Miklavec:
+%D A present from Brooks Moses and Hans Hagen for Mojca Miklavec:
\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}}
@@ -461,22 +461,13 @@
\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters]
\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters]
-%D This may move to \type {core-con.tex}.
+% this will become more generic : \languagecharacters{sl}{..}
-\def\sloveniancharacter#1%
- {\ifcase#1\unknowncharacter
- \or a\or b\or c\or \ccaron\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
- \or n\or o\or p\or r\or s\or \scaron\or t\or u\or v\or z\or \zcaron
- \else
- \unknowncharacter
- \fi}
+\let\sloveniancharacter\gobbleoneargument
+\let\slovenianCharacter\gobbleoneargument
-\def\slovenianCharacter#1%
- {\ifcase#1\unknowncharacter
- \or A\or B\or C\or \Ccaron\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
- \or N\or O\or P\or R\or S\or \Scaron\or T\or U\or V\or Z\or \Zcaron
- \else
- \unknowncharacter
- \fi}
+%D Plugins:
+
+\loadmarkfile{lang-sla}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-spa.tex b/Master/texmf-dist/tex/context/base/lang-spa.tex
index 83a4d52ab71..1ec45cd69d6 100644
--- a/Master/texmf-dist/tex/context/base/lang-spa.tex
+++ b/Master/texmf-dist/tex/context/base/lang-spa.tex
@@ -37,8 +37,6 @@
\definehspace [\s!fr] [\string !] [.16667em]
\definehspace [\s!fr] [\string ?] [.16667em]
-\protect
-
%D Alternative discretionary handlers:
\definetextmodediscretionary :
diff --git a/Master/texmf-dist/tex/context/base/lang-spe.tex b/Master/texmf-dist/tex/context/base/lang-spe.tex
index ed6becb6002..b88b1ad774b 100644
--- a/Master/texmf-dist/tex/context/base/lang-spe.tex
+++ b/Master/texmf-dist/tex/context/base/lang-spe.tex
@@ -79,6 +79,9 @@
%D precautions that will prevent spurious spaces to creep into
%D the list.
+% We should use token registers, but alas, we run out of them and
+% \ETEX\ has a bug. Well, let's use a token register now (2006).
+
\def\startlanguagespecifics% % we use double to
{\bgroup
\catcode`\^^I=\@@ignore
@@ -97,40 +100,15 @@
\characterencoding-%
\fi}
-% \long\def\dostartlanguagespecifics[#1][#2]#3\stoplanguagespecifics%
-% {\egroup
-% \long\def\docommando##1%
-% {\doifdefinedelse{\??la\languageencoding##1\??la}
-% {\long\def\do####1####2####3%
-% {\setvalue{\??la\languageencoding####1\??la}{\do{####1}{####2####3}}}%
-% \getvalue{\??la\languageencoding##1\??la}{#3}}
-% {\setvalue{\??la\languageencoding##1\??la}{\do{##1}{#3}}}%
-% \bgroup
-% \setbox0\hbox{\enablelanguagespecifics[##1]}%
-% \ifdim\wd0>\zeropoint
-% \showmessage\m!linguals7{\currentencoding-##1,\the\wd0\space}\wait
-% \else
-% \showmessage\m!linguals8{\currentencoding-##1}%
-% \fi
-% \egroup
-% \doif{##1}{\currentmainlanguage}
-% {\enablelanguagespecifics[##1]}}%
-% \processcommalist[#1]\docommando}
-
-% This saves 3K in the fmt file.
-
-% This should be a token register, but alas, we run out of them and
-% \ETEX\ has a bug.
-
\long\def\dostartlanguagespecifics[#1][#2]#3\stoplanguagespecifics
{\egroup
\processcommalist[#1]{\dosetlanguagespecifics{#3}}}
% \long\def\dosetlanguagespecifics#1#2%
-% {\doifdefinedelse{\??la\languageencoding#2\??la}
-% {\long\def\do##1##2##3{\setvalue{\??la\languageencoding##1\??la}{\do{##1}{##2##3}}}%
-% \getvalue{\??la\languageencoding#2\??la}{#1}}
-% {\setvalue{\??la\languageencoding#2\??la}{\do{#2}{#1}}}%
+% {\ifundefined{\??la\languageencoding#2\??la}\forgetlanguagespecifics[#2]\fi
+% % the next line catches the case that specifics are enabled *before* they are defined
+% \expandafter\ifx\csname\??la\languageencoding#2\??la\endcsname\relax\forgetlanguagespecifics[#2]\fi
+% \appendvalue{\??la\languageencoding#2\??la}{#1}%
% \bgroup
% \setbox\scratchbox\hbox{\enablelanguagespecifics[#2]}%
% \ifdim\wd\scratchbox>\zeropoint
@@ -139,15 +117,15 @@
% \showmessage\m!linguals8{\currentencoding-#2}%
% \fi
% \egroup
-% \doif{#2}\currentmainlanguage
-% {\enablelanguagespecifics[#2]}}
+% \doif{#2}\currentmainlanguage{\enablelanguagespecifics[#2]}}
+
+\def\languagespectag#1{\??la\languageencoding#1\??la}
\long\def\dosetlanguagespecifics#1#2%
- {%ifundefined{\??la\languageencoding#2\??la}\letvalue{\??la\languageencoding#2\??la}\empty\fi
- \ifundefined{\??la\languageencoding#2\??la}\forgetlanguagespecifics[#2]\fi
- % the next line catches the case that specifics are enabled *before* they are defined
- \expandafter\ifx\csname\??la\languageencoding#2\??la\endcsname\relax\forgetlanguagespecifics[#2]\fi
- \appendvalue{\??la\languageencoding#2\??la}{#1}%
+ {\ifcsname\languagespectag{#2}\endcsname \else
+ \expandafter\newtoks\csname\languagespectag{#2}\endcsname
+ \fi
+ \csname\languagespectag{#2}\endcsname\@EA{\the\csname\languagespectag{#2}\endcsname#1}%
\bgroup
\setbox\scratchbox\hbox{\enablelanguagespecifics[#2]}%
\ifdim\wd\scratchbox>\zeropoint
@@ -158,58 +136,52 @@
\egroup
\doif{#2}\currentmainlanguage{\enablelanguagespecifics[#2]}}
+% \def\forgetlanguagespecifics[#1]%
+% {\letvalue{\??la\languageencoding#1\??la}\empty}
+
\def\forgetlanguagespecifics[#1]%
- {\letvalue{\??la\languageencoding#1\??la}\empty}
+ {\csname\languagespectag{#1}\endcsname\emptytoks}
%D Enabling them is rather straightforward. We only have to
%D define \type{\do} in such a way that \type{{ }} is removed
%D and the language key is gobbled.
-%\def\enablelanguagespecifics[#1]%
-% {\let\do\secondoftwoarguments
-% \doifvaluesomething{\??la#1\c!default}
-% {\getvalue{\??la\getvalue{\??la#1\c!default}\??la}%
-% \getvalue{\??la\languageencoding\??la}}%
-% \getvalue{\??la#1\??la}%
-% \getvalue{\??la\languageencoding#1\??la}}
-%
-% sped up since used often:
-
\def\enablelanguagespecifics[#1]%
- {%\let\do\secondoftwoarguments
- \csname
- \??la
+ {\the\executeifdefined{\??la
\@EA\ifx\csname\??la#1\c!default\endcsname\relax
\languageencoding
\else
\csname\??la#1\c!default\endcsname
\fi
- \??la
- \endcsname
- \csname\??la#1\??la\endcsname
- \csname\??la\languageencoding#1\??la\endcsname} % dup ?
+ \??la}\emptytoks
+ \the\executeifdefined{\??la#1\??la}\emptytoks
+ \the\executeifdefined{\??la\languageencoding#1\??la}\emptytoks} % dup ?
+
+% check:
+
+% \def\enablelanguagespecifics[#1]%
+% {\the\executeifdefined{\??la\executeifdefined{\??la#1\c!default}\languageencoding\??la}\emptytoks
+% \the\executeifdefined{\??la#1\??la}\emptytoks
+% \the\executeifdefined{\??la\languageencoding#1\??la}\emptytoks} % dup ?
%D \macros
%D {deactivatelanguagespecific}
%D
%D The next code makes it possible to disable the specifics.
-\def\deactivatelanguagespecific#1%
- {\ifundefined{l g s \string#1}%
- \letgvalueempty{l g s \string#1}% signal to prevent dup def
- \bgroup
- \catcode`#1=\@@active
- \uccode`~=`#1
- \uppercase{\doglobal\appendtoks\dodeactivatetoken{~}\to\everyresetlanguagespecifics}%
- \egroup
- \expanded{\doglobal\noexpand\appendtoks{#1}{\the\catcode`#1}}\to\everyresetlanguagespecifics
- \fi}
+% \def\deactivatelanguagespecific#1%
+% {\ifundefined{l g s \string#1}%
+% \letgvalueempty{l g s \string#1}% signal to prevent dup def
+% \bgroup
+% \catcode`#1=\@@active
+% \uccode`~=`#1
+% \uppercase{\doglobal\appendtoks\dodeactivatetoken{~}\to\everyresetlanguagespecifics}%
+% \egroup
+% \expanded{\doglobal\noexpand\appendtoks{#1}{\the\catcode`#1}}\to\everyresetlanguagespecifics
+% \fi}
-% \def\dodeactivatetoken#1#2#3%
-% {\def#1{#2}\catcode`#2=#3\relax}
-
-\def\dodeactivatetoken#1#2#3% test needed to avoid clash with \unprotect
- {\def#1{#2}\ifnum\catcode`#2=\@@active\catcode`#2=#3\relax\fi}
+% \def\dodeactivatetoken#1#2#3% test needed to avoid clash with \unprotect
+% {\def#1{#2}\ifnum\catcode`#2=\@@active\catcode`#2=#3\relax\fi}
%D We cannot hook this into the installer since language
%D specifics can be anything. So far, we have the following
@@ -221,12 +193,12 @@
\protect
-\deactivatelanguagespecific "
-\deactivatelanguagespecific /
-\deactivatelanguagespecific :
-\deactivatelanguagespecific ;
-\deactivatelanguagespecific ?
-\deactivatelanguagespecific !
+% \deactivatelanguagespecific "
+% \deactivatelanguagespecific /
+% \deactivatelanguagespecific :
+% \deactivatelanguagespecific ;
+% \deactivatelanguagespecific ?
+% \deactivatelanguagespecific !
\unprotect
@@ -243,8 +215,11 @@
%D difficult to implement. Fortunately dates never exceed the
%D number~31.
-\def\highordinalstr#1{\high{\nocap{#1}}}
-\def\ordinalstr #1{\nocap{#1}}
+\ifx\high \undefined \let\high \firstofoneargument \fi % todo
+\ifx\notsmallcapped\undefined \let\notsmallcapped\firstofoneargument \fi % todo
+
+\def\highordinalstr#1{\high{\notsmallcapped{#1}}}
+\def\ordinalstr #1{\notsmallcapped{#1}}
\def\ordinaldaynumber#1% \strippedcsname\ordinaldaynumber
{\expanded{\executeifdefined{\currentlanguage ordinaldaynumber}%
diff --git a/Master/texmf-dist/tex/context/base/m-arabtex.tex b/Master/texmf-dist/tex/context/base/m-arabtex.tex
index 6220835f505..af721338765 100644
--- a/Master/texmf-dist/tex/context/base/m-arabtex.tex
+++ b/Master/texmf-dist/tex/context/base/m-arabtex.tex
@@ -248,7 +248,7 @@
\def\ARABTEXsh@ft#1%
{\dimen@.00#1ex
- \multiply\dimen@\fontdimen1\font
+ \multiply\dimen@\slantperpoint
\kern-.0156\dimen@}
\appendtoks
@@ -378,13 +378,6 @@
%D perfect instrument to cross cultural and linguistic
%D borders. So, let's load Hebrew support as well:
-% \unexpanded\def\sethebrewfont#1% strange font dimensions / scale
-% {\scratchdimen=10\bodyfontsize
-% \font\hebfont=\truefontname{Hebrew#1} at \currentfontscale\scratchdimen
-% \fontdimen5\hebfont=.8\fontdimen2\hebfont
-% \fontdimen6\hebfont=3\fontdimen5\hebfont
-% \hebfont}
-
\unexpanded\def\sethebrewfont#1%
{\setx@skels
\newfonttrue
diff --git a/Master/texmf-dist/tex/context/base/m-chart.tex b/Master/texmf-dist/tex/context/base/m-chart.tex
index cc9114ff654..2a29333b197 100644
--- a/Master/texmf-dist/tex/context/base/m-chart.tex
+++ b/Master/texmf-dist/tex/context/base/m-chart.tex
@@ -13,7 +13,7 @@
% to do: \localpushmacro/\localpopmacro (dohandleflowchart etc)
-% will be redone with layers
+% will be redone with layers and dimexpr
%D This is an experimental module. Pieces of code will be moved
%D to other modules. More features are possible but will be
@@ -1049,8 +1049,8 @@
\fi}
\def\setgetFLOWchart[#1][#2][#3]%
- {\def\docommando##1{}% cell line focus ?
- \processcommalist[#2]\docommando
+ {\def\docommand##1{}% cell line focus ?
+ \processcommalist[#2]\docommand
\getFLOWchart[#1][#3]}
\def\doFLOWchart[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/m-cweb.tex b/Master/texmf-dist/tex/context/base/m-cweb.tex
index 1d3455acf9e..9aa630aa6ff 100644
--- a/Master/texmf-dist/tex/context/base/m-cweb.tex
+++ b/Master/texmf-dist/tex/context/base/m-cweb.tex
@@ -176,18 +176,18 @@
% \parskip = 0pt % no stretch between paragraphs
% \parindent = 1em % for paragraphs and for the first line of C text
-% \font\ninerm = cmr9
-% \let\mc = \ninerm % medium caps
-% \font\eightrm = cmr8
-% \let\sc = \eightrm % small caps (NOT a caps-and-small-caps font)
-% \let\mainfont = \tenrm
-% \let\cmntfont = \tenrm
-% \font\tenss = cmss10
-% \let\cmntfont = \tenss % alternative comment font
-% \font\titlefont = cmr7 scaled \magstep4 % title on the contents page
-% \font\ttitlefont = cmtt10 scaled \magstep2 % typewriter type in title
-% \font\tentex = cmtex10 % TeX extended character set (used in strings)
-% \fontdimen7\tentex = 0pt % no double space after sentences
+% \font\ninerm = cmr9
+% \let\mc = \ninerm % medium caps
+% \font\eightrm = cmr8
+% \let\sc = \eightrm % small caps (NOT a caps-and-small-caps font)
+% \let\mainfont = \tenrm
+% \let\cmntfont = \tenrm
+% \font\tenss = cmss10
+% \let\cmntfont = \tenss % alternative comment font
+% \font\titlefont = cmr7 scaled \magstep4 % title on the contents page
+% \font\ttitlefont = cmtt10 scaled \magstep2 % typewriter type in title
+% \font\tentex = cmtex10 % TeX extended character set (used in strings)
+% \fontextraspace\tentex = 0pt % no double space after sentences
%D \macros{mc,sc,cmntfont,eightrm}{}
%D
@@ -212,7 +212,7 @@
\defCWEBmacro\tentex%
{\font\next=cmtex10 at \textface
- \fontdimen7\next=0pt
+ \fontextraspace\next\zeropoint
\next}
\defCWEBmacro\sevenrm {\getvalue{\scriptface rmtf}}
@@ -1007,20 +1007,20 @@
% {\bgroup
% \def\CWEBcomma%
% {\def\CWEBcomma{, }}%
-% \def\docommando##1%
+% \def\docommand##1%
% {\bgroup
% \def\[####1]{####1}%
% \xdef\CWEBreference{##1}%
% \egroup
% \CWEBcomma{\naar{\donottest{##1}}[web:\CWEBreference]}}%
-% \processcommalist[{#1}]\docommando
+% \processcommalist[{#1}]\docommand
% \egroup}
% \def\processCWEBsectionnumbers[#1]%
% {\bgroup
% \def\CWEBcomma%
% {\def\CWEBcomma{, }}%
-% \def\docommando##1%
+% \def\docommand##1%
% {\bgroup
% \def\(####1){####1}%
% \xdef\CWEBreference{##1}%
@@ -1031,20 +1031,20 @@
% \def\[##1]{\(##1)}\let\(=\relax\xdef\CWEBreferences{#1}%
% \egroup
% \unexpanded\def\(##1){\[##1]}%
-% \processcommacommand[\CWEBreferences]\docommando
+% \processcommacommand[\CWEBreferences]\docommand
% \egroup}
\def\processCWEBsectionnumbers[#1]%
{\bgroup
\def\CWEBcomma%
{\def\CWEBcomma{, }}%
- \def\docommando##1%
+ \def\docommand##1%
{\bgroup
\def\[####1]{####1}%
\xdef\CWEBreference{##1}%
\egroup
\CWEBcomma{\localcolortrue\goto{\donottest{##1}}[web:\CWEBreference]}}%
- \processlist{(}{)}{,}\docommando(#1)
+ \processlist{(}{)}{,}\docommand(#1)
\egroup}
\def\processCWEBsectionnotes%
diff --git a/Master/texmf-dist/tex/context/base/m-database.tex b/Master/texmf-dist/tex/context/base/m-database.tex
index b707a8ecc3a..0486a062f50 100644
--- a/Master/texmf-dist/tex/context/base/m-database.tex
+++ b/Master/texmf-dist/tex/context/base/m-database.tex
@@ -32,14 +32,14 @@
%D following one:
%D
%D \starttyping
-%D \processquotedlist{beginsym}{endsym}{separator}\docommando list
+%D \processquotedlist{beginsym}{endsym}{separator}\docommand list
%D \stoptyping
%D
%D This one supports arbitrary open and close symbols as well
%D as user defined separators.
%D
%D \starttyping
-%D \processquotedlist(){,}{"}\docommando(a=>b=>c=>d)
+%D \processquotedlist(){,}{"}\docommand(a=>b=>c=>d)
%D \stoptyping
\def\processquotedlist#1#2#3#4#5%
diff --git a/Master/texmf-dist/tex/context/base/m-gnuplot.tex b/Master/texmf-dist/tex/context/base/m-gnuplot.tex
index 8da9317b664..5e612257f7f 100644
--- a/Master/texmf-dist/tex/context/base/m-gnuplot.tex
+++ b/Master/texmf-dist/tex/context/base/m-gnuplot.tex
@@ -64,15 +64,6 @@
\def\redouseGNUPLOTgraphic[#1][#2]#3%
{\dodouseGNUPLOTgraphic[#3][]}
-% \bgroup
-% \obeylines
-% \gdef\fixGNUPLOTnewlines%
-% {\def\par{;\@@svline}%
-% \def ^^M{;\@@svline}}
-% \egroup
-
-\ifx\systemendofline\undefined \def\systemendofline{\rawcharacter{10}} \fi
-
\newtoks\everyGNUPLOTgraphic
% gnuplot only seems to handle lf so we cannot use \mappartolineend
@@ -81,12 +72,12 @@
\appendtoks
\obeylines
- \def\obeyedline{;\systemendofline}%
+ \def\obeyedline{;\outputnewlinechar}%
\to \everyGNUPLOTgraphic
\appendtoks
\let\%\letterpercent
- \def\ {\letterbackslash\systemendofline}%
+ \def\ {\letterbackslash\outputnewlinechar}%
\to \everyGNUPLOTgraphic
\def\dodouseGNUPLOTgraphic[#1][#2]%
diff --git a/Master/texmf-dist/tex/context/base/m-narrowtt.tex b/Master/texmf-dist/tex/context/base/m-narrowtt.tex
index 3a83b7d940f..b11aaefb5dd 100644
--- a/Master/texmf-dist/tex/context/base/m-narrowtt.tex
+++ b/Master/texmf-dist/tex/context/base/m-narrowtt.tex
@@ -32,7 +32,7 @@
[narrowtt] [tt]
[mono] [modern-cond] [default] [encoding=\defaultencoding]
-\definetyping[n\v!typing][\v!typing] \setuptyping[n\v!typing][style=\narrowtt]
-\definetype [n\v!type] [\v!type] \setuptype [n\v!type] [style=\narrowtt]
+\definetyping[n\v!typing] \setuptyping[n\v!typing][style=\narrowtt]
+\definetype [n\v!type] \setuptype [n\v!type] [style=\narrowtt]
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/m-r.tex b/Master/texmf-dist/tex/context/base/m-r.tex
index 244b62c3653..bf7b07a14d0 100644
--- a/Master/texmf-dist/tex/context/base/m-r.tex
+++ b/Master/texmf-dist/tex/context/base/m-r.tex
@@ -19,44 +19,6 @@
%D We can combine both variants in one macro definition. Also, we
%D can minimize the number of runs by checking for a change.
-%D \starttyping
-%D \newcounter\Rnumber
-%D \newtoks\everyR
-%D
-%D \appendtoks
-%D \obeylines
-%D \to \everyR
-%D
-%D \def\startR {\dostartR\stopR \plusone}
-%D \def\startRhidden{\dostartR\stopRhidden\zerocount}
-%D
-%D \def\dostartR#1#2%
-%D {\bgroup
-%D \ifcase#2\relax\let\typeRout\relax\fi
-%D \obeylines
-%D \catcode`\%=\@@letter
-%D \catcode`\#=\@@letter
-%D \def\dostartR##1#1%
-%D {\doglobal\increment\Rnumber
-%D \edef\Rfile{\bufferprefix R-\Rnumber}%
-%D \bgroup
-%D \the\everyR
-%D \def\par{\rawcharacter{10}}%
-%D \immediate\openout\scratchwrite=\Rfile.r
-%D \immediate\write\scratchwrite{##1}%
-%D \immediate\closeout\scratchwrite
-%D \egroup
-%D \doifmode{*\v!first}\runR
-%D \typefile{\Rfile.rout}%
-%D \egroup}%
-%D \doifnextcharelse\relax\dostartR\dostartR}
-%D
-%D \def\runR
-%D {\executesystemcommand{texmfstart
-%D --ifchanged=\Rfile.r bin:R
-%D "-q --save --restore < \Rfile.r > \Rfile.rout"}}
-%D \stoptyping
-
%D JS: The call to R has \type {-q} in order to prevent banner,
%D \type {--save} to make sure it saves the workspace after the run,
%D \type {--restore} to make sure it reads any workspace from a
@@ -65,6 +27,7 @@
%D An easier and better solution is to use the buffering mechanisms:
\def\Rbufferprefix{r-}
+
\newcounter\nofRfiles
\def\Rfile{\TEXbufferfile{\Rbufferprefix\nofRfiles}}%
@@ -84,11 +47,6 @@
\def\stopRhidden
{\doifmode{*\v!first}\runR}
-% \def\runR % " " needed to preserve < >
-% {\executesystemcommand{texmfstart
-% --ifchanged=\Rfile\space --direct R
-% "-q --save --restore < \Rfile\space > \Rfile.out"}}
-
\def\runR
{\executesystemcommand{texmfstart
--ifchanged=\Rfile\space --direct R
diff --git a/Master/texmf-dist/tex/context/base/m-streams.tex b/Master/texmf-dist/tex/context/base/m-streams.tex
index 181c82d331c..c1ef994ff55 100644
--- a/Master/texmf-dist/tex/context/base/m-streams.tex
+++ b/Master/texmf-dist/tex/context/base/m-streams.tex
@@ -105,8 +105,13 @@
\unprotect
+\def\overloadtextwidth#1%
+ {\makeupwidth#1\relax
+ \textwidth\makeupwidth
+ \hsize\makeupwidth}
+
\startsetups streamlayer:default:settings
- % set hsize etc
+ % set hsize etc, like \overloadtextwidth{12cm}
\stopsetups
\startsetups streamlayer:default:extras
@@ -127,7 +132,6 @@
{\outputstreamcopy[\currentstreamlayer]}%
\stopsetups
-
\startsetups streamlayer:default:reset
\outputstreambox[\currentstreamlayer]
\stopsetups
diff --git a/Master/texmf-dist/tex/context/base/m-tryout.tex b/Master/texmf-dist/tex/context/base/m-tryout.tex
index 89ffc46782b..4aa50376d42 100644
--- a/Master/texmf-dist/tex/context/base/m-tryout.tex
+++ b/Master/texmf-dist/tex/context/base/m-tryout.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\endinput
+
\unprotect
%D The following macros make sure that active colons work well
@@ -24,8 +26,6 @@
\startmode[activecolon]
-\endinput
-
% this is now default
\gdef\sectionseparator{-}
diff --git a/Master/texmf-dist/tex/context/base/m-visual.tex b/Master/texmf-dist/tex/context/base/m-visual.tex
index 5ff273f5c3a..1622e5e63f6 100644
--- a/Master/texmf-dist/tex/context/base/m-visual.tex
+++ b/Master/texmf-dist/tex/context/base/m-visual.tex
@@ -57,6 +57,10 @@
\stopcolor
\allowbreak}
+\def\dorandomrecurse#1%
+ {\getrandomcount\scratchcounter{1}{#1}%
+ \dorecurse\scratchcounter}
+
% can be used in hbox, so %'s are really needed
\unexpanded\def\fakelines#1#2% min max / 3 10
diff --git a/Master/texmf-dist/tex/context/base/math-ams.tex b/Master/texmf-dist/tex/context/base/math-ams.tex
index 3df63ff489a..29fe19e0b58 100644
--- a/Master/texmf-dist/tex/context/base/math-ams.tex
+++ b/Master/texmf-dist/tex/context/base/math-ams.tex
@@ -300,9 +300,9 @@
\startmathcollection [default]
-\definemathcommand [dashrightarrow] [rel] {\dabar@\dabar@ \mathchar"0C4B}%
-\definemathcommand [dashleftarrow] [rel] {\mathchar"0C4C\dabar@ \dabar@}%
-\definemathcommand [dasharrow] [rel] {\dabar@\dabar@ \mathchar"0C4B}%
+\definemathcommand [dashrightarrow] [rel] {\dabar@\dabar@ \mathchar"0C4B}
+\definemathcommand [dashleftarrow] [rel] {\mathchar"0C4C\dabar@ \dabar@}
+\definemathcommand [dasharrow] [rel] {\dabar@\dabar@ \mathchar"0C4B}
\definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-13.8mu\mathchar"0D6E}
\definemathcommand [implies] [rel] {\;\Longrightarrow\;}
\definemathcommand [impliedby] [rel] {\;\Longleftarrow\;}
diff --git a/Master/texmf-dist/tex/context/base/math-cow.tex b/Master/texmf-dist/tex/context/base/math-cow.tex
index 016221f2da2..f0fc811c871 100644
--- a/Master/texmf-dist/tex/context/base/math-cow.tex
+++ b/Master/texmf-dist/tex/context/base/math-cow.tex
@@ -13,8 +13,9 @@
\unprotect
-\let\COWsqrt\mthsqrt
-\let\COWfrac\mthfrac
+\def\COWsqrt {\mthsqrt{\char"7A}{\char"7B}}
+\def\COWfrac {\mthfrac{\char"7C}{\char"7A}{\char"7B}}
+\def\COWarrowfill{\mtharrowfill 1001}
\startmathcollection [cow]
% todo
diff --git a/Master/texmf-dist/tex/context/base/math-eul.tex b/Master/texmf-dist/tex/context/base/math-eul.tex
index 6acc33356ca..7552957a866 100644
--- a/Master/texmf-dist/tex/context/base/math-eul.tex
+++ b/Master/texmf-dist/tex/context/base/math-eul.tex
@@ -244,4 +244,34 @@
\stopmathcollection
+%D Aditya's additionl definitions:
+
+\startmathcollection[eul:texnansi]
+ \definemathsymbol [acute] [accent] [tf] ["13]
+ \definemathsymbol [grave] [accent] [tf] ["12]
+ \definemathsymbol [ddot] [accent] [tf] ["A8]
+ \definemathsymbol [tilde] [accent] [tf] ["98]
+ \definemathsymbol [bar] [accent] [tf] ["16]
+ \definemathsymbol [breve] [accent] [tf] ["15]
+ \definemathsymbol [check] [accent] [tf] ["14]
+ \definemathsymbol [hat] [accent] [tf] ["88]
+ \definemathsymbol [dot] [accent] [tf] ["5]
+ % Why is mathring not defined??
+ \definemathsymbol [mathring] [accent] [tf] ["17]
+\stopmathcollection
+
+\startmathcollection[eul:ec]
+ \definemathsymbol [acute] [accent] [tf] ["1]
+ \definemathsymbol [grave] [accent] [tf] ["0]
+ \definemathsymbol [ddot] [accent] [tf] ["4]
+ \definemathsymbol [tilde] [accent] [tf] ["3]
+ \definemathsymbol [bar] [accent] [tf] ["9]
+ \definemathsymbol [breve] [accent] [tf] ["8]
+ \definemathsymbol [check] [accent] [tf] ["7]
+ \definemathsymbol [hat] [accent] [tf] ["2]
+ \definemathsymbol [dot] [accent] [tf] ["A]
+ % Why is mathring not defined??
+ \definemathsymbol [mathring] [accent] [tf] ["6]
+\stopmathcollection
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-ext.tex b/Master/texmf-dist/tex/context/base/math-ext.tex
index 9f74ce4a9d9..177e3c8a4a9 100644
--- a/Master/texmf-dist/tex/context/base/math-ext.tex
+++ b/Master/texmf-dist/tex/context/base/math-ext.tex
@@ -132,19 +132,23 @@
\def\redefinebotharrow#1#2#3% real dirty, this overload!
{\doifdefined{#1}
- {\pushmacro\dotripleempty
- \def\dotripleempty##1[##2][##3]{\setvalue{#1}{\dotripleempty\xmtharrow[#2][##3]}}%
+ {\pushmacro\dohandlemtharrow
+ \def\dohandlemtharrow[##1][##2]{\setvalue{#1}{\dohandlemtharrow[#2][##2]}}%
+ % == \def\dohandlemtharrow[##1][##2]{\dodefinebotharrow{#1}{#2}{##2}}%
\getvalue{#1}%
- \popmacro\dotripleempty}}
+ \popmacro\dohandlemtharrow}}
\def\dodefinebotharrow#1#2#3%
- {\setvalue{#1}{\dotripleempty\xmtharrow[#2][#3]}}
+ {\setvalue{#1}{\dohandlemtharrow[#2][#3]}}
-\def\xmtharrow[#1][#2][#3]% #3 == optional arg
- {\def\doxmtharrow{\dodoxmtharrow[#1,\empty,\empty][#2,\empty,\empty][#3]}% {##1}{##2}
- \dodoublegroupempty\doxmtharrow}
+\def\dohandlemtharrow
+ {\dotripleempty\doxmtharrow}
-\def\dodoxmtharrow[#1,#2,#3][#4,#5,#6][#7]#8#9% [3] is the optional arg
+\def\doxmtharrow[#1][#2][#3]% #3 == optional arg
+ {\def\dodoxmtharrow{\dododoxmtharrow[#1,\empty,\empty][#2,\empty,\empty][#3]}% {##1}{##2}
+ \dodoublegroupempty\dodoxmtharrow}
+
+\def\dododoxmtharrow[#1,#2,#3][#4,#5,#6][#7]#8#9% [3] is the optional arg
{\edef\!!stringa{#2}%
\ifx\!!stringa\empty
\ifsecondargument
@@ -189,7 +193,6 @@
\def\leftharpoondownfill {\defaultmtharrowfill \leftharpoondown \relbar \relbar }
\def\leftharpoonupfill {\defaultmtharrowfill \leftharpoonup \relbar \relbar }
-
\def\hookleftfill {\defaultmtharrowfill \leftarrow \relbar{\relbar\joinrel\rhook}}
\def\hookrightfill{\defaultmtharrowfill{\lhook\joinrel\relbar}\relbar \rightarrow}
diff --git a/Master/texmf-dist/tex/context/base/math-ini.tex b/Master/texmf-dist/tex/context/base/math-ini.tex
index 7f50749470d..1c9cc651f5e 100644
--- a/Master/texmf-dist/tex/context/base/math-ini.tex
+++ b/Master/texmf-dist/tex/context/base/math-ini.tex
@@ -100,8 +100,8 @@
\ifx\dohandlecommand\undefined \wait \fi % troubles !
-\let\mathcharacter\dohandlemathtoken
-\let\textcharacter\dohandlecommand % better \dohandletexttoken
+\def\mathcharacter\dohandlemathtoken
+\def\textcharacter\dohandlecommand % better \dohandletexttoken
% More clever layout:
%
@@ -235,6 +235,45 @@
%D Now we redefine the text encoding handler.
+%D A better fallback:
+
+% Just ETEX which is the default nowadays.
+
+\beginETEX \ifcsname
+
+\def\dohandlemathtoken#1%
+ {\csname
+ \ifmmode
+ \ifcsname\@mt@\mathcollection:\outerencoding#1\endcsname
+ \@mt@\mathcollection:\outerencoding
+ \else\ifcsname\@mt@\mathcollection#1\endcsname
+ \@mt@\mathcollection
+ \else\ifcsname\@mt@\nomathcollection#1\endcsname
+ \@mt@\nomathcollection
+ \else\ifcsname\characterencoding#1\endcsname
+ \characterencoding
+ \else
+ \nocharacterencoding
+ \fi\fi\fi\fi
+ \else
+ \ifcsname\characterencoding#1\endcsname
+ \characterencoding
+ \else\ifcsname\nocharacterencoding#1\endcsname
+ \nocharacterencoding
+ \else\ifcsname\@mt@\mathcollection:\outerencoding#1\endcsname
+ \@mt@\mathcollection:\outerencoding
+ \else\ifcsname\@mt@\mathcollection#1\endcsname
+ \strippedcsname\mathematics\expandafter\endcsname\csname\@mt@\mathcollection
+ \else\ifcsname\@mt@\nomathcollection#1\endcsname
+ \strippedcsname\mathematics\expandafter\endcsname\csname\@mt@\nomathcollection
+ \else
+ \nocharacterencoding
+ \fi\fi\fi\fi\fi
+ \fi
+ #1\endcsname}
+
+\endETEX
+
\let\dohandlecommand\dohandlemathtoken
\def\definefamilysynonym
@@ -678,43 +717,3 @@
\setupbodyfont[ams] \enablemathcollection[default] \input math-ams \page
\setupbodyfont[lbr] \enablemathcollection[lbr] \input math-lbr \page
\setupbodyfont[eul] \enablemathcollection[eul] \input math-eul \stoptext
-
-% to be checked, overloads supp-lan !
-
-\def\defineactivecharacter #1 #2%
-% {\scratchcounter=\the\uccode`~
- {\scratchcounter\uccode`~\relax
- \expandafter\doifnumberelse\expandafter{\string#1}
- {\catcode #1=\@@active \uccode`~= #1\relax}
- {\catcode`#1=\@@active \uccode`~=`#1\relax}%
- \uppercase{\def\next{~}}%
- % unexpanded goes wrong in pdfdoc
- %\expandafter\unexpanded\expandafter\def\next{#2}%
- % better
- %\expandafter\def\next{#2}%
- % math aware
- \expandafter\def\next{\dohandleactivecharacter{#1}{#2}}% new
- \uccode`~=\scratchcounter}
-
-\def\dohandleactivecharacter
- {\ifmmode
- \expandafter\dohandleactivemathcharacter
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\dohandleactivemathcharacter#1#2#3%
- {\ifundefined{@ma@\string#2}%
- \expandafter\firstofoneargument
- \else
- \getvalue{@ma@\string#2}%
- \expandafter\gobbleoneargument
- \fi{#3}}
-
-% \def\dohandleactivemathcharacter#1#2%
-% {\ifcsname @ma@\string#1\endcsname
-% \csname @ma@\string#1\expandafter\endcsname
-% \expandafter\gobbleoneargument
-% \else
-% \expandafter\firstofoneargument
-% \fi{#2}}
diff --git a/Master/texmf-dist/tex/context/base/math-pln.tex b/Master/texmf-dist/tex/context/base/math-pln.tex
index b8148491f1f..386b67d9bcf 100644
--- a/Master/texmf-dist/tex/context/base/math-pln.tex
+++ b/Master/texmf-dist/tex/context/base/math-pln.tex
@@ -51,7 +51,7 @@
\def\sh@ft#1% kern by #1 times the current slant
{\dimen@#1%
- \kern\expandafter\getf@ctor\the\fontdimen1\font
+ \kern\expandafter\getf@ctor\the\slantperpoint
\dimen@}
% \def\copyright % will be overloaded
diff --git a/Master/texmf-dist/tex/context/base/meta-dum.tex b/Master/texmf-dist/tex/context/base/meta-dum.tex
index 10ce6d99a3f..d6a4525b253 100644
--- a/Master/texmf-dist/tex/context/base/meta-dum.tex
+++ b/Master/texmf-dist/tex/context/base/meta-dum.tex
@@ -36,7 +36,7 @@
% June 22, 2003, this definition was patched to adapt itself
% to transparent colors
-\startuseMPgraphic{placeholder}{width,height,color}
+\startuseMPgraphic{placeholder}{width,height,reduction,color}
numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ;
t := is_transparent(\MPvar{color}) ;
c := not_transparent(\MPvar{color}) ;
diff --git a/Master/texmf-dist/tex/context/base/meta-fig.tex b/Master/texmf-dist/tex/context/base/meta-fig.tex
index 6d4d304f9cd..3edd73b5749 100644
--- a/Master/texmf-dist/tex/context/base/meta-fig.tex
+++ b/Master/texmf-dist/tex/context/base/meta-fig.tex
@@ -78,12 +78,10 @@
\def\MPfigure#1#2% test for dup figure
{\bgroup
\getfiguredimensionsonly[#1]% [\c!object=\v!no] already set
- \freezedimenmacro\naturalfigurewidth
- \freezedimenmacro\naturalfigureheight
\startMPcode
externalfigure "#1"
- xscaled \naturalfigurewidth\space
- yscaled \naturalfigureheight\space
+ xscaled \figurewidth\space
+ yscaled \figureheight\space
#2 ;
\stopMPcode
\egroup}
diff --git a/Master/texmf-dist/tex/context/base/meta-ini.tex b/Master/texmf-dist/tex/context/base/meta-ini.tex
index 3353a9a0bd6..d00a8a6b196 100644
--- a/Master/texmf-dist/tex/context/base/meta-ini.tex
+++ b/Master/texmf-dist/tex/context/base/meta-ini.tex
@@ -406,9 +406,9 @@
%D
%D \starttyping
%D \def\extendMPoverlaystamp#1%
-%D {\def\docommando##1%
+%D {\def\docommand##1%
%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}%
-%D \processcommalist[#1]\docommando}
+%D \processcommalist[#1]\docommand}
%D \stoptyping
%D Since we need to feed \METAPOST\ with expanded dimensions,
@@ -589,6 +589,11 @@
\resetMPenvironment
+\def\useMPenvironmentbuffer[#1]%
+ {\expanded{\startMPenvironment\noexpand\readfile{\TEXbufferfile{\jobname}}{}{}}\stopMPenvironment}
+
+\useMPenvironmentbuffer[mp]
+
%D This command takes \type {[reset]} as optional
%D argument.
%D
@@ -747,8 +752,8 @@
CurrentWidth:=\the\hsize;
CurrentHeight:=\the\vsize;
%
- EmWidth:=\the\fontdimen6\font;
- ExHeight:=\the\fontdimen5\font;
+ EmWidth:=\the\emwidth;
+ ExHeight:=\the\exheight;
%
PageNumber:=\the\pageno;
RealPageNumber:=\the\realpageno;
@@ -756,7 +761,7 @@
\stopMPinitializations
\appendtoks
- \expanded{\definecolor[currentcolor][\currentcolor]}%
+ \expanded{\definecolor[currentcolor][\currentcolorname]}%
\to \everyMPgraphic
\appendtoks
@@ -765,40 +770,13 @@
\topskip 1\topskip
\to \everyMPgraphic
-% this will become (more efficient)
-%
-% \startuseMPgraphic{init data}
-% tx1 := \the\baselineskip ;
-% tx2 := \the\baselineskip ;
-% tx3 := \the\bodyfontsize ;
-% tx4 := \strutheight ;
-% tx5 := \strutdepth ;
-% tx6 := \the\hsize ;
-% tx7 := \the\vsize ;
-% tx8 := \the\fontdimen6\font ;
-% tx9 := \the\fontdimen5\font ;
-% \stopuseMPgraphic
-%
-% def map_tx_variables =
-% BaseLineSkip := tx1 ;
-% LineHeight := tx2 ;
-% BodyFontSize := tx3 ;
-% StrutHeight := tx4 ;
-% StrutDepth := tx5 ;
-% CurrentWidth := tx6 ;
-% Currentheight := tx7 ;
-% EmWidth := tx8 ;
-% ExHeight := tx9 ;
-% enddef ;
-%
-% extra_begin_fig ....
-
%D Alas, the prologue settings differ per driver.
\ifx\undefined\MPprologues \def\MPprologues{0} \fi
\startMPinitializations
prologues:=\MPprologues;
+ mpprocset:=1;
\stopMPinitializations
\appendtoks
@@ -855,16 +833,18 @@
\def\insertMPfile#1#2% in context #2 is empty
{\doifelsenothing{#2}{\doinsertMPfile{#1}}{\insertMPfileARG{#1}{#2}}}
-\def\includeMPasEPS#1%
+\def\includeMPasEPS#1% untested !!
{\bgroup
\message{[MP as EPS #1]}%
\the\everyinsertMPfile
\dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb
\setbox\scratchbox\vbox to \!!heightb
{\vfill
- \doinsertfile
- {\c!mps,\c!mps}{#1,\empty}{100}{100}%
- \!!widtha\!!heighta\!!widthb\!!heightb\zerocount}%
+ \let \@@DriverImageType \c!mps
+ \def \@@DriverImageFile {#1}%
+ \edef\@@DriverImageWidth {\the\!!widthb }%
+ \edef\@@DriverImageHeight{\the\!!heightb}%
+ \doinsertfile}%
\wd\scratchbox\!!widthb
\dp\scratchbox\zeropoint
\box\scratchbox
diff --git a/Master/texmf-dist/tex/context/base/meta-mis.tex b/Master/texmf-dist/tex/context/base/meta-mis.tex
new file mode 100644
index 00000000000..6b39fa0dd55
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/meta-mis.tex
@@ -0,0 +1,54 @@
+%D \module
+%D [ file=meta-mis,
+%D version=2006.06.06,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Misc Test Graphics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+% p/s 1/false 1/true 2/false 2/true
+%
+% MKII 8.5 8.0 8.8 8.5
+% MKIV 16.1 7.2 16.3 7.4
+
+\startuseMPgraphic{mptopdf-test}
+ prologues := 2;
+ mpprocset := 1 ;
+ fill fullcircle scaled 3cm withcolor red ;
+ fill fullcircle scaled 2cm withcolor green ;
+ fill fullcircle scaled 1cm withcolor blue ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ;
+ fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ;
+ fill fullcircle scaled 1cm withcolor cmyk(0,0,1,0) ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ draw fullcircle scaled 3cm dashed evenly ;
+ draw fullcircle scaled 2cm dashed withdots ;
+ draw origin withpen pencircle scaled 3mm;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red);
+ fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red);
+ fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green);
+ fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5));
+ currentpicture := currentpicture shifted (12cm,-4cm) ;
+ draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ % bug: shift
+ draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ;
+ draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ;
+ filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ;
+ currentpicture := currentpicture shifted (-4cm,0) ;
+ % shade cannot handle shift
+ circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ;
+ circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ;
+ filldraw boundingbox currentpicture enlarged (-bbheight(currentpicture)/2+2.5mm) withpen pencircle scaled 1pt withcolor .5white ;
+\stopuseMPgraphic
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/meta-pag.tex b/Master/texmf-dist/tex/context/base/meta-pag.tex
index cda7dbd96cb..1ed7db7f90c 100644
--- a/Master/texmf-dist/tex/context/base/meta-pag.tex
+++ b/Master/texmf-dist/tex/context/base/meta-pag.tex
@@ -92,12 +92,9 @@
\def\freezeMPpagelayout
{\doifbothsides
- \def\MPonrightpage{true}%
- \orsideone
- \def\MPonrightpage{true}%
- \orsidetwo
- \def\MPonrightpage{false}%
- \od
+ {\def\MPonrightpage{true}}
+ {\def\MPonrightpage{true}}
+ {\def\MPonrightpage{false}}%
\edef\MPonoddpage{\doifoddpageelse{true}{false}}}
\let\freezeMPlayout\relax % obsolete
diff --git a/Master/texmf-dist/tex/context/base/meta-pdf.mkii b/Master/texmf-dist/tex/context/base/meta-pdf.mkii
new file mode 100644
index 00000000000..3060de539d6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/meta-pdf.mkii
@@ -0,0 +1,1908 @@
+%D \module
+%D [ file=meta-pdf,
+%D version=2006.06.07,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=\METAPOST\ to \PDF\ conversion,
+%D author=Hans Hagen \& others (see text),
+%D date=\currentdate,
+%D copyright=\PRAGMA]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D These are the main macros.
+
+\def\mkconvertMPtoPDF % #1#2#3%
+ {\vbox\bgroup
+ \forgetall
+ \offinterlineskip
+ \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
+ \global\let\MPheight\!!zeropoint
+ \global\let\MPwidth \!!zeropoint
+ \setbox\scratchbox\vbox\bgroup
+ \message{[MP to PDF]}%
+ \startMPresources
+ \PDFcomment{mps begin}%
+ \PDFcode{q}%
+ \PDFcode{1 0 0 1 0 0 cm}%
+ \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi
+ \doprocessMPtoPDFfile}
+
+\def\doprocessMPtoPDFfile
+ {\setMPspecials
+ \setMPextensions
+ \the\everyMPtoPDFconversion
+ \catcode`\^^M=\@@endofline
+ \startMPscanning
+ \let\do\empty
+ \donefalse
+ \let\handleMPsequence\dohandleMPsequence
+ \input\MPfilename\relax}
+
+\def\finishMPgraphic
+ {\PDFcode{Q}%
+ \PDFcomment{mps end}%
+ \stopMPresources
+ \egroup
+ \setbox\scratchbox\hbox\bgroup
+ \hskip-\MPllx\onebasepoint
+ \raise-\MPlly\onebasepoint
+ \box\scratchbox
+ \egroup
+ \setbox\scratchbox\vbox to \MPheight\bgroup
+ \vfill
+ \hsize\MPwidth
+ \smashbox\scratchbox
+ \box\scratchbox
+ \egroup
+ \wd\scratchbox\MPwidth
+ \ht\scratchbox\MPheight
+ \dopackageMPgraphic\scratchbox
+ \egroup
+ \endinput}
+
+\def\mkprocessMPtoPDFfile % file xscale yscale / obsolete
+ {\bgroup
+ \let\finishMPgraphic\egroup
+ \doprocessMPtoPDFfile}
+
+%D Because we want to test as fast as possible, we first
+%D define the \POSTSCRIPT\ operators that \METAPOST\ uses.
+%D We don't define irrelevant ones, because these are
+%D skipped anyway.
+
+%D The converter can be made a bit faster by replacing the
+%D two test macros (the ones with the many \type {\if's}) by
+%D a call to named branch macros (something \typ {\getvalue
+%D {xPSmoveto}}. For everyday documents with relatively
+%D small graphics the gain in speed can be neglected.
+
+\def \PScurveto {curveto}
+\def \PSlineto {lineto}
+\def \PSmoveto {moveto}
+\def \PSshowpage {showpage}
+\def \PSnewpath {newpath}
+\def \PSfshow {fshow}
+\def \PSclosepath {closepath}
+\def \PSfill {fill}
+\def \PSstroke {stroke}
+\def \PSclip {clip}
+\def \PSrlineto {rlineto}
+\def \PSsetlinejoin {setlinejoin}
+\def \PSsetlinecap {setlinecap}
+\def \PSsetmiterlimit {setmiterlimit}
+\def \PSsetgray {setgray}
+\def \PSsetrgbcolor {setrgbcolor}
+\def \PSsetcmykcolor {setcmykcolor}
+\def \PSsetdash {setdash}
+\def \PSgsave {gsave}
+\def \PSgrestore {grestore}
+\def \PStranslate {translate}
+\def \PSscale {scale}
+\def \PSconcat {concat}
+\def \PSdtransform {dtransform}
+\def \PSsetlinewidth {setlinewidth}
+\def \PSpop {pop}
+
+\def \PSnfont {nfont} % was needed for TUG98 proceedings
+\def \PSspecial {special} % extensions to MetaPost
+
+%D A previous version set \type {%} to ignore, which
+%D simplified the following definitions. At the start of
+%D conversion the percent character was made active again.
+%D Because the whole graphic is one paragraph (there are no
+%D empty lines) this does not give the desired effect. This
+%D went unnoticed untill Scott Pakin sent me a test file
+%D percent characters in a string. So, from now on we have
+%D to prefix the following strings with percentages.
+
+%D Some day I'll figure out a better solution (line by line reading
+%D using \ETEX).
+
+\edef \PSBoundingBox {\letterpercent\letterpercent BoundingBox:}
+\edef \PSHiResBoundingBox {\letterpercent\letterpercent HiResBoundingBox:}
+\edef \PSExactBoundingBox {\letterpercent\letterpercent ExactBoundingBox:}
+\edef \PSMetaPostSpecial {\letterpercent\letterpercent MetaPostSpecial:}
+\edef \PSMetaPostSpecials {\letterpercent\letterpercent MetaPostSpecials:}
+\edef \PSPage {\letterpercent\letterpercent Page:}
+\edef \PSBeginProlog {\letterpercent\letterpercent BeginProlog}
+\edef \PSEndProlog {\letterpercent\letterpercent EndProlog}
+\edef \PSEof {\letterpercent\letterpercent EOF}
+
+%D By the way, the \type {setcmykcolor} operator is not
+%D output by \METAPOST\ but can result from converting the
+%D \cap{RGB} color specifications, as implemented in
+%D \type{supp-mps}.
+
+%D In \POSTSCRIPT\ arguments precede the operators. Due to the
+%D fact that in some translations we need access to those
+%D arguments, and also because sometimes we have to skip them,
+%D we stack them up. The stack is one||dimensional for non path
+%D operators and two||dimensional for operators inside a path.
+%D This is because we have to save the whole path for
+%D (optional) postprocessing. Values are pushed onto the stack
+%D by:
+%D
+%D \starttyping
+%D \setMPargument {value}
+%D \stoptyping
+%D
+%D They can be retrieved by the short named macros:
+%D
+%D \starttyping
+%D \gMPa {number}
+%D \gMPs {number}
+%D \stoptyping
+%D
+%D When scanning a path specification, we also save the
+%D operator, using
+%D
+%D \starttyping
+%D \setMPkeyword {n}
+%D \stoptyping
+%D
+%D The path drawing operators are coded for speed: \type{clip},
+%D \type{stroke}, \type{fill} and \type{fillstroke} become
+%D 1, 2, 3 and~4.
+%D
+%D When processing the path this code can be retrieved
+%D using
+%D
+%D \starttyping
+%D \getMPkeyword % {n}
+%D \stoptyping
+%D
+%D When setting an argument, the exact position on the stack
+%D depends on the current value of the \COUNTERS\
+%D \type{\nofMPsegments} and \type{\nofMParguments}.
+
+\newcount\nofMPsegments
+\newcount\nofMParguments
+
+%D These variables hold the coordinates. The argument part of
+%D the stack is reset by:
+%D
+%D \starttyping
+%D \resetMPstack
+%D \stoptyping
+%D
+%D We use the prefix \type{@@MP} to keep the stack from
+%D conflicting with existing macros. To speed up things a bit
+%D more, we use the constant \type{\@@MP}.
+
+\def\@@MP{@@MP}
+
+\def\setMPargument% #1%
+ {\advance\nofMParguments \plusone
+ \expandafter\def\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1}
+
+\def\letMPargument
+ {\advance\nofMParguments \plusone
+ \expandafter\let\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname}
+
+\def\setMPsequence#1 %
+ {\advance\nofMParguments \plusone
+ \expandafter\def\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}%
+ \handleMPsequence}
+
+\def\gMPa#1%
+ {\csname\@@MP0\number#1\endcsname}
+
+\def\gMPs#1%
+ {\csname\@@MP\the\nofMPsegments\number#1\endcsname}
+
+\def\dogMPa#1%
+ {\@EAEAEA\do\csname\@@MP0\number#1\endcsname}
+
+\def\setMPkeyword#1 %
+ {\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}%
+ \advance\nofMPsegments \plusone
+ \nofMParguments\zerocount}
+
+\def\getMPkeyword% #1%
+ {\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname}
+
+\def\docleanupMPargument#1% we need this because args can have [ or ] pre/appended
+ {\expandafter\edef\csname\@@MP\the\nofMPsegments\number#1\endcsname
+ {\csname\@@MP\the\nofMPsegments\number#1\endcsname}}
+
+%D When we reset the stack, we can assume that all further
+%D comment is to be ignored and handled in strings.
+%D By redefining the reset macro after the first call, we
+%D save some run time. Only use this macro after all
+%D comments are processed and use the simple alternative
+%D when dealing with comments.
+
+\def\doresetMPstack
+ {\nofMParguments\zerocount}
+
+\def\resetMPstack
+ {\let\handleMPgraphic\handleMPendgraphic
+ \let\resetMPstack\doresetMPstack
+ \resetMPstack}
+
+%D The arguments are saved with the preceding command
+%D \type{\do}. By default this command expands to nothing, but
+%D when we deal with strings it's used to strip off the
+%D \type{(} and \type{)}.
+%D
+%D Strings are kind of tricky, because characters can be
+%D passed verbatim \type{(hello)}, by octal number
+%D \type{(\005)} or as command \type{(\()}. We therefore
+%D cannot simply ignore \type{(} and \type{)}, the way we do
+%D with \type{[} and \type{]}. Another complication is that
+%D strings may contain characters that normally have a
+%D special meaning in \TEX, like \type{$} and \type{{}}.
+%D
+%D A previous solution made \type{\} an active character and
+%D let it look ahead for a number or characters. We had to
+%D abandon this scheme because of the need for verbatim
+%D support. The next solution involved some \CATCODE\
+%D trickery but works well.
+
+\def\octalMPcharacter#1#2#3%
+ {\char'#1#2#3\relax}
+
+%D curly braces and squarly brackets are stored in the argument stack
+%D as part of strings, for instance in:
+%D
+%D \starttyping
+%D /fshow {exch findfont exch scalefont setfont show}bind def
+%D [3 3 ] 0 setdash
+%D \stoptyping
+%D
+%D but we need to keep them in situation like
+%D
+%D \starttyping
+%D ([bla bla] bla bla) ec-lmr10 9.96265 fshow
+%D ({bla bla} bla bla) ec-lmr10 9.96265 fshow
+%D \stoptyping
+%D
+%D So, when we store the snippets, we keep the special tokens, and
+%D when needed we either ignore or obey them
+
+%D We could use a catcodetable here.
+
+\bgroup
+\catcode`\|=\@@comment
+\catcode`\%=\@@active
+\catcode`\[=\@@active
+\catcode`\]=\@@active
+\catcode`\{=\@@active
+\catcode`\}=\@@active
+\catcode`B=\@@begingroup
+\catcode`E=\@@endgroup
+\gdef\keepMPspecials|
+ B\let%\letterpercent|
+ \def[B\noexpand[E|
+ \def]B\noexpand]E|
+ \def{B\noexpand{E|
+ \def}B\noexpand}EE
+\gdef\ignoreMPspecials|
+ B\let%\letterpercent|
+ \def[BE|
+ \def]BE|
+ \def{BE|
+ \def}BEE
+\gdef\obeyMPspecials|
+ B\def%B\char 37\relax E|
+ \def[B\char 91\relax E|
+ \def]B\char 93\relax E|
+ \def{B\char123\relax E|
+ \def}B\char125\relax EE
+\gdef\setMPspecials|
+ B\setnaturalcatcodes
+ \catcode`\\=\@@escape
+ \catcode`\%=\@@active
+ \catcode`\[=\@@active
+ \catcode`\]=\@@active
+ \catcode`\{=\@@active
+ \catcode`\}=\@@active
+ \lccode`\-=0 | latex sets this to `\-
+ \lccode`\%=`\%| otherwise it's seen as a number
+ \def\(B\char40\relax E|
+ \def\)B\char41\relax E|
+ \def\\B\char92\relax E|
+ \def\0B\octalMPcharacter0E|
+ \def\1B\octalMPcharacter1E|
+ \def\2B\octalMPcharacter2E|
+ \def\3B\octalMPcharacter3E|
+ \def\4B\octalMPcharacter4E|
+ \def\5B\octalMPcharacter5E|
+ \def\6B\octalMPcharacter6E|
+ \def\7B\octalMPcharacter7E|
+ \def\8B\octalMPcharacter8E|
+ \def\9B\octalMPcharacter9EE
+\egroup
+
+%D We use the comment symbol as a sort of trigger. Beware!
+%D The whole graphic is seen as on eparagraph, which means
+%D that we cannot change the catcodes in between.
+
+\bgroup
+\catcode`\%=\@@active
+\gdef\startMPscanning{\let%=\startMPconversion}
+\egroup
+
+%D In earlier versions we used the sequence
+%D
+%D \starttyping
+%D \expandafter\handleMPsequence\input filename\relax
+%D \stoptyping
+%D
+%D Persistent problems in \LATEX\ however forced us to use a
+%D different scheme. Every \POSTSCRIPT\ file starts with a
+%D \type{%}, so we temporary make this an active character
+%D that starts the scanning and redefines itself. (The problem
+%D originates in the redefinition by \LATEX\ of the
+%D \type{\input} primitive.)
+
+\def\startMPconversion
+ {\keepMPspecials
+ \handleMPsequence}
+
+%D Here comes the main loop. Most arguments are numbers. This
+%D means that they can be recognized by their \type{\lccode}.
+%D This method saves a lot of processing time. We could
+%D speed up the conversion by handling the \type{path}
+%D seperately.
+
+\def\dohandleMPsequence#1%
+ {\ifdone
+ \ifcase\lccode`#1\relax
+ \@EAEAEA\dohandleMPsequenceA
+ \else
+ \@EAEAEA\dohandleMPsequenceB
+ \fi
+ \else
+ \@EA\dohandleMPsequenceC
+ \fi#1}
+
+\let\dohandleMPsequenceA\setMPsequence
+
+\def\installMPSkeywordN#1#2%
+ {\expandafter\def\csname\@@MP:N:#1\endcsname{#2}}
+
+\def\installMPSshortcutN#1#2% todo: \let
+ {\expandafter\let\csname\@@MP:N:#1\expandafter\endcsname\csname\@@MP:N:#2\endcsname}
+
+\def\dohandleMPsequenceB#1 %
+ {\edef\somestring{#1}%
+ \executeifdefined{\@@MP:N:\somestring}\handleMPgraphic
+ \handleMPsequence}
+
+\installMPSkeywordN \PSmoveto
+ {\edef\lastMPmoveX{\gMPa1}%
+ \edef\lastMPmoveY{\gMPa2}%
+ \resetMPstack}
+\installMPSkeywordN \PSnewpath
+ {\let\handleMPsequence\handleMPpath}
+\installMPSkeywordN \PSgsave
+ {\PDFcode{q}%
+ \resetMPstack}
+\installMPSkeywordN \PSgrestore
+ {\PDFcode{Q}%
+ \resetMPstack}
+\installMPSkeywordN \PSdtransform % == setlinewidth
+ {\let\handleMPsequence\handleMPdtransform}
+ % after that we will encounter more tokens until setlinewidth+pop
+ % or pop+setlinewidth which we catch next; we explicitly need to
+ % reset the stack since [] n setdash may follow; a more clever
+ % approach would be to read on till the condition is met, but it's
+ % the only pop / setlinewidth we will encounter so ...
+\installMPSkeywordN \PSsetlinewidth
+ {% already handled in dtransform
+ \resetMPstack}
+\installMPSkeywordN \PSpop
+ {% already handled in dtransform
+ \resetMPstack}
+\installMPSkeywordN \PSconcat
+ {\cleanupMPconcat
+ \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
+ \resetMPstack}
+\installMPSkeywordN \PSsetrgbcolor
+ {\handleMPrgbcolor
+ \resetMPstack}
+\installMPSkeywordN \PSsetcmykcolor
+ {\handleMPcmykcolor
+ \resetMPstack}
+\installMPSkeywordN \PSsetgray
+ {\handleMPgraycolor
+ \resetMPstack}
+\installMPSkeywordN \PStranslate
+ {\PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
+ \resetMPstack}
+\installMPSkeywordN \PSsetdash
+ {\handleMPsetdash
+ \resetMPstack}
+\installMPSkeywordN \PSsetlinejoin
+ {\PDFcode{\gMPa1 j}%
+ \resetMPstack}
+\installMPSkeywordN \PSsetmiterlimit
+ {\PDFcode{\gMPa1 M}%
+ \resetMPstack}
+\installMPSkeywordN \PSfshow
+ {%\PDFcode{n}% removed !
+ \handleMPfshow
+ \resetMPstack}
+\installMPSkeywordN \PSsetlinecap
+ {\PDFcode{\gMPa1 J}%
+ \resetMPstack}
+\installMPSkeywordN \PSrlineto
+ {\flushMPmoveto
+ \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
+ \resetMPmoveto
+ \resetMPstack}
+\installMPSkeywordN \PSscale
+ {\PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
+ \resetMPstack}
+\installMPSkeywordN \PSspecial
+ {\handleMPspecialcommand
+ \resetMPstack}
+
+\installMPSshortcutN {n} \PSnewpath
+\installMPSshortcutN {p} \PSclosepath
+\installMPSshortcutN {l} \PSlineto
+\installMPSshortcutN {r} \PSrlineto
+\installMPSshortcutN {m} \PSmoveto
+\installMPSshortcutN {c} \PScurveto
+\installMPSshortcutN {C} \PSsetcmykcolor
+\installMPSshortcutN {G} \PSsetgray
+\installMPSshortcutN {R} \PSsetrgbcolor
+\installMPSshortcutN {lj} \PSsetlinejoin
+\installMPSshortcutN {ml} \PSsetmiterlimit
+\installMPSshortcutN {lc} \PSsetlinecap
+\installMPSshortcutN {sd} \PSsetdash
+\installMPSshortcutN {S} \PSstroke
+\installMPSshortcutN {F} \PSfill
+\installMPSshortcutN {W} \PSclip
+
+\installMPSshortcutN {q} \PSgsave
+\installMPSshortcutN {Q} \PSgrestore
+
+\installMPSshortcutN {s} \PSscale
+\installMPSshortcutN {t} \PSconcat
+\installMPSshortcutN {P} \PSshowpage
+
+\installMPSkeywordN {hlw} {\PDFcode{\gMPa1 w}\resetMPstack}
+\installMPSkeywordN {vlw} {\PDFcode{\gMPa1 w}\resetMPstack}
+\installMPSkeywordN {rd} {\PDFcode{[] 0 d}\resetMPstack}
+
+\def\dohandleMPsequenceC#1 %
+ {\edef\somestring{#1}%
+ \handleMPgraphic
+ \handleMPsequence}
+
+%D Since colors are not sensitive to transformations, they
+%D are sometimes used for signaling. Therefore, we handle them
+%D separately. The next macro can be redefined if needed.
+
+\def\handleMPrgbcolor
+ {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg
+ \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 RG}}
+
+\def\handleMPcmykcolor
+ {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k
+ \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 K}}
+
+\def\handleMPgraycolor
+ {\PDFcode{\!MPgMPa1 g
+ \!MPgMPa1 G}}
+
+\def\handleMPspotcolor
+ {\PDFcode{0 g
+ 0 G}}
+
+%D Beginning and ending the graphics is taken care of by the
+%D macro \type{\handleMPgraphic}, which is redefined when
+%D the first graphics operator is met.
+
+\def\handleMPendgraphic % #1%
+ {\ifx\somestring\PSshowpage
+ \let\handleMPsequence\finishMPgraphic
+ \else\ifx\somestring\PSEof
+ \let\handleMPsequence\finishMPgraphic
+ \else
+ \letMPargument\somestring % {#1}%
+ \fi\fi}
+
+\def\handleMPbegingraphic % #1%
+ {\ifx\somestring\PSBoundingBox
+ \def\handleMPsequence{\handleMPboundingbox1}%
+ \else\ifx\somestring\PSHiResBoundingBox
+ \def\handleMPsequence{\handleMPboundingbox2}%
+ \else\ifx\somestring\PSExactBoundingBox
+ \def\handleMPsequence{\handleMPboundingbox3}%
+ \else\ifx\somestring\PSshowpage
+ \let\handleMPsequence\finishMPgraphic
+ \else\ifx\somestring\PSEof
+ \let\handleMPsequence\finishMPgraphic
+ \else\ifx\somestring\PSPage
+ \let\handleMPsequence\handleMPpage
+ \else\ifx\somestring\PSMetaPostSpecials
+ \let\handleMPsequence\handleMPspecialscomment
+ \else\ifx\somestring\PSMetaPostSpecial
+ \let\handleMPsequence\handleMPspecialcomment
+ \else\ifx\somestring\PSBeginProlog
+ \let\handleMPsequence\handleMPprolog
+ \else
+ \letMPargument\somestring % {#1}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
+\let\handleMPgraphic=\handleMPbegingraphic
+
+%D New: we can best filter the prolog because nowdays it can contain
+%D quite some code.
+
+% hm, catcode mess, so we need to tweak %'s catcode here
+% \long\expandafter\def\expandafter\handleMPprolog\expandafter#\expandafter1\PSEndProlog%
+% but today i'm not in the mood for ugly stuff
+
+\long\def\handleMPprolog#1EndProlog %
+ {\doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+%D We check for three kind of bounding boxes: the normal one
+%D and two high precision ones:
+%D
+%D \starttyping
+%D BoundingBox: llx lly ucx ucy
+%D HiResBoundingBox: llx lly ucx ucy
+%D ExactBoundingBox: llx lly ucx ucy
+%D \stoptyping
+%D
+%D The original as well as the recalculated dimensions are
+%D saved for later use.
+
+\newif\ifskipemptyMPgraphic \skipemptyMPgraphicfalse
+
+\chardef\currentMPboundingbox=0
+
+\def\handleMPboundingbox#1#2 #3 #4 #5
+ {\ifnum#1>\currentMPboundingbox
+ \chardef\currentMPboundingbox#1\relax
+ \xdef\MPllx {#2}%
+ \xdef\MPlly {#3}%
+ \xdef\MPurx {#4}%
+ \xdef\MPury {#5}%
+ \xdef\MPwidth {\the\dimexpr\MPurx\onebasepoint-\MPllx\onebasepoint\relax}%
+ \xdef\MPheight{\the\dimexpr\MPury\onebasepoint-\MPlly\onebasepoint\relax}%
+ \fi
+ \doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \let\next\handleMPsequence
+ \ifskipemptyMPgraphic
+ \ifdim\MPheight=\zeropoint\ifdim\MPwidth=\zeropoint
+ \def\next{\endinput\finishMPgraphic}%
+ \fi\fi
+ \fi
+ \next}
+
+%D Unless defined otherwise, we simply ignore specialcomments.
+
+\def\handleMPspecialcomment
+ {\doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+\let\handleMPspecialscomment\handleMPspecialcomment
+
+%D We use the \type{page} comment as a signal that
+%D stackbuilding can be started.
+
+\def\handleMPpage #1 #2
+ {\doresetMPstack
+ \donetrue
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+%D The same applies to the special extensions.
+
+\def\handleMPspecialcommand
+ {\doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+%D \METAPOST\ draws its dots by moving to a location and
+%D invoking \type{0 0 rlineto}. This operator is not
+%D available in \PDF. Our solution is straightforward: we draw
+%D a line from $(current\_x, current\_y)$ to itself. This
+%D means that the arguments of the preceding \type{moveto} have
+%D to be saved.
+
+%D These saved coordinates are also used when we handle the
+%D texts. Text handling proved to be a bit of a nuisance, but
+%D finally I saw the light. It proved that we also had to
+%D take care of \type{(split arguments)}.
+
+\def\setMPfshowfont#1#2%
+ {\font\temp=#1\space at #2\relax\temp}
+
+\let\MPfshowcommand\empty
+
+\def\dohandleMPfshow
+ {\setbox\scratchbox\hbox
+ {\obeyMPspecials
+ \edef\MPtextsize{\gMPa\nofMParguments}%
+ \def\do(##1){##1}%
+ \edef\MPtextdata{\dogMPa1}% beware, stack can have more
+ \handleMPtext}%
+ \setbox\scratchbox\hbox
+ {\hskip\lastMPmoveX\onebasepoint
+ \raise\lastMPmoveY\onebasepoint
+ \box\scratchbox}%
+ \smashbox\scratchbox
+ \box\scratchbox}
+
+\def\handleMPtext {\handleMPtextnormal} % so we can overload this one later
+\def\handleMPfshow{\dohandleMPfshow } % so we can overload this one later
+
+\def\handleMPtext
+ {\ifnum\nofMParguments>\plusthree
+ \handleMPtextnormal
+ \else
+ \convertcommand\MPtextdata\to\MPtextdata
+ \expanded{\splitstring\MPtextdata}\at::::\to\MPtexttag\and\MPtextnumber
+ \executeifdefined{handleMPtext\MPtexttag}\handleMPtextnormal
+ \fi}
+
+% elsewhere we will implement \handleMPtextmptxt
+
+\def\handleMPtextnormal
+ {\let\ \relax % mp breaks long lines and appends a \
+ \ifx\MPtextsize\PSnfont % round font size (to pt)
+ \advance\nofMParguments \minusone
+ \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
+ \ifdim\scratchdimen<\onepoint
+ \def\MPtextsize{1pt}%
+ \else
+ \advance\scratchdimen .5\onepoint
+ \def\MPtextsize##1.##2\relax{\def\MPtextsize{##1pt}}%
+ \expandafter\MPtextsize\the\scratchdimen\relax
+ \fi
+ \else
+ \edef\MPtextsize{\MPtextsize bp}%
+ \fi
+ \advance\nofMParguments \minusone
+ \setMPfshowfont{\gMPa\nofMParguments}\MPtextsize
+ \advance\nofMParguments \minusone
+ \temp
+ \MPfshowcommand
+ {\ifnum\nofMParguments=\plusone
+ \def\do(##1){##1}%
+ \dogMPa1%
+ \else
+ % we need to catch ( a ) (a a a) (\123 \123 \123) etc
+ \scratchcounter\plusone
+ \def\dodo##1% Andreas Fieger's bug: (\304...)
+ {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
+ \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
+ \def\do(##1{\dodo{##1}}%
+ \dogMPa\scratchcounter\MPspacechar
+ \let\do\relax
+ \loop
+ \advance\scratchcounter \plusone
+ \ifnum\scratchcounter<\nofMParguments\relax
+ \gMPa\scratchcounter\MPspacechar
+ \repeat
+ \def\do##1){\dodo{##1}}%
+ \dogMPa\scratchcounter
+ \fi
+ \unskip}}
+
+%D You could consider the following definition to be the most
+%D natural one.
+
+% \def\MPspacechar{\space} % normal case
+
+\def\MPspacechar{\char32\relax} % old solution does not work with math
+
+%D However, the following implementation is more robust, since
+%D some fonts have funny visible spaces in the space slot. This
+%D gives a mismatch between the space that \METAPOST\ took into
+%D account and the \quote {natural} space. This only happens in
+%D labels, since \type {btex}||\type {etex} thingies don't have
+%D spaces. This phenomena showed up when preparing the
+%D \METAFUN\ manual, where Palatino fonts are used. We can
+%D safely assume that \METAPOST\ considers \type {\char32} to
+%D be the space.
+
+\def\MPspacechar{\setbox\scratchbox\hbox{\char32}\kern\wd\scratchbox}
+
+%D Well, this does not work with math fonts, so:
+
+\def\MPspacechar{\char32\relax}
+
+%D Most operators are just converted and keep their
+%D arguments. Dashes however need a bit different treatment,
+%D otherwise \PDF\ viewers complain loudly. Another
+%D complication is that one argument comes after the \type{]}.
+%D When reading the data, we simply ignore the array boundary
+%D characters. We save ourselves some redundant newlines and
+%D at the same time keep the output readable by packing the
+%D literals.
+
+\def\handleMPsetdash
+ {\bgroup
+ \ignoreMPspecials
+ \let\somestring\empty
+ \scratchcounter\plusone
+ \loop
+ \ifnum\scratchcounter<\nofMParguments
+ \edef\somestring{\somestring\space\gMPa\scratchcounter}%
+ \advance\scratchcounter \plusone
+ \repeat
+ \edef\somestring{[\somestring]\space\gMPa\scratchcounter\space d}%
+ \PDFcode{\somestring}%
+ \egroup}
+
+%D The \type{setlinewidth} commands looks a bit complicated. There are
+%D two alternatives, that result in a similar look in both
+%D $x$- and $y$-dorection. As John Hobby says:
+%D
+%D \startnarrower \switchtobodyfont[ss]
+%D \starttyping
+%D x 0 dtransform exch truncate exch idtransform pop setlinewidth
+%D 0 y dtransform truncate idtransform setlinewidth pop
+%D \stoptyping
+%D
+%D These are just fancy versions of \type{x setlinewidth} and
+%D \type{y setlinewidth}. The \type{x 0 ...} form is used if
+%D the path is {\em primarily vertical}. It rounds the width
+%D so that vertical lines come out an integer number of pixels
+%D wide in device space. The \type{0 y ...} form does the same
+%D for paths that are {\em primarily horizontal}. The reason
+%D why I did this is Knuth insists on getting exactly the
+%D widths \TEX\ intends for the horizontal and vertical rules
+%D in \type{btex...etex} output. (Note that PostScript scan
+%D conversion rules cause a horizontal or vertical line of
+%D integer width $n$ in device space to come out $n+1$ pixels
+%D wide, regardless of the phase relative to the pixel grid.)
+%D \stopnarrower
+%D
+%D The common operator in these sequences is \type{dtransform},
+%D so we can use this one to trigger setting the linewidth.
+
+\def\handleMPdtransform
+ {\ifdim\gMPa1\onepoint>\zeropoint
+ \PDFcode{\gMPa1 w}%
+ \def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}%
+ \else
+ \PDFcode{\gMPa2 w}%
+ \def\next##1 ##2 ##3 ##4 {\handleMPsequence}%
+ \fi
+ \let\handleMPsequence\dohandleMPsequence
+ \resetMPstack
+ \next}
+
+%D The most complicated command is \type{concat}. \METAPOST\
+%D applies this operator to \type{stroke}. At that moment the
+%D points set by \type{curveto} and \type{moveto}, are already
+%D fixed. In \PDF\ however the \type{cm} operator affects the
+%D points as well as the pen (stroke). Like more \PDF\
+%D operators, \type{cm} is defined in a bit ambiguous way.
+%D The only save route for non||circular penshapes, is saving
+%D the path, recalculating the points and applying the
+%D transformation matrix in such a way that we can be sure
+%D that its behavior is well defined. This comes down to
+%D inverting the path and applying \type{cm} to that path as
+%D well as the pen. This all means that we have to save the
+%D path.
+
+%D In \METAPOST\ there are three ways to handle a path $p$:
+%D
+%D \starttyping
+%D draw p; fill p; filldraw p;
+%D \stoptyping
+%D
+%D The last case outputs a \type{gsave fill grestore} before
+%D \type{stroke}. Handling the path outside the main loops
+%D saves about 40\% run time.\footnote{We can save some more by
+%D following the \METAPOST\ output routine, but for the moment
+%D we keep things simple.} Switching between the main loop and
+%D the path loop is done by means of the recursely called
+%D macro \type{\handleMPsequence}.
+
+\def\handleMPpath
+ {\chardef\finiMPpath\zerocount
+ \let\closeMPpath\relax
+ \let\flushMPpath\flushnormalMPpath
+ \resetMPstack
+ \nofMPsegments\plusone
+ \let\handleMPsequence\dohandleMPpath
+ \dohandleMPpath}
+
+%D Most paths are drawn with simple round pens. Therefore we've
+%D split up the routine in two.
+
+\def\resetMPmoveto
+ {\let\lastMPmoveX\empty
+ \let\lastMPmoveY\empty}
+
+\resetMPmoveto
+
+\def\flushMPmoveto
+ {\ifx\lastMPmoveX\empty \else
+ \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space m}%
+ \fi}
+
+\def\flushnormalMPsegment
+ {\ifcase\getMPkeyword\relax
+ \flushMPmoveto
+ \resetMPmoveto
+ \PDFcode{\!MPgMPs1 \!MPgMPs2 l}%
+ \or
+ \flushMPmoveto
+ \resetMPmoveto
+ \PDFcode{\!MPgMPs1 \!MPgMPs2 \!MPgMPs3 \!MPgMPs4 \!MPgMPs5 \!MPgMPs6 c}%
+ \or
+ \ifx\lastMPmoveX\empty \else % bugged
+ \flushMPmoveto
+ \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space l S}%
+ \resetMPmoveto
+ \fi
+ \or
+ % \flushMPmoveto
+ % \resetMPmoveto
+ \fi}
+
+\def\flushMPconcatmoveto
+ {\ifx\lastMPmoveX\empty\else
+ \doMPconcat\lastMPmoveX\lastMPmoveX\lastMPmoveY\lastMPmoveY
+ \flushMPmoveto
+ \fi}
+
+\def\flushconcatMPsegment
+ {\ifcase\getMPkeyword\relax
+ \flushMPconcatmoveto
+ \resetMPmoveto
+ \doMPconcat{\gMPs1}\a{\gMPs2}\b%
+ \PDFcode{\!MP\a\space\!MP\b\space l}%
+ \or
+ \flushMPconcatmoveto
+ \resetMPmoveto
+ \doMPconcat{\gMPs1}\a{\gMPs2}\b%
+ \doMPconcat{\gMPs3}\c{\gMPs4}\d%
+ \doMPconcat{\gMPs5}\e{\gMPs6}\f%
+ \PDFcode{\!MP\a\space\!MP\b\space
+ \!MP\c\space\!MP\d\space
+ \!MP\e\space\!MP\f\space c}%
+ \or
+ \bgroup
+ \noMPtranslate
+ \flushMPconcatmoveto
+ \resetMPmoveto
+ \PDFcode{\!MP\a\space\!MP\b\space l S}%
+ \egroup
+ \or
+% \flushMPconcatmoveto
+% \resetMPmoveto
+ \fi}
+
+\def\doflushsomeMPpath
+ {\dodoflushsomeMPpath
+ \advance\nofMPsegments \plusone
+ \ifnum\nofMPsegments<\scratchcounter
+ \expandafter\doflushsomeMPpath
+ \fi}
+
+\def\flushsomeMPpath
+ {\scratchcounter\nofMPsegments
+ \nofMPsegments\plusone
+ \doflushsomeMPpath}
+
+\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath}
+
+%OLD \def\flushconcatMPpath{\let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath}
+
+%NEW pre-calculate 1/D so it needn't be repeated for each control point.
+
+\def\flushconcatMPpath
+ {\MPreciprocaldeterminant
+ \let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath}
+
+%D The transformation of the coordinates is handled by one of
+%D the macros Tanmoy posted to the \PDFTEX\ mailing list.
+%D I rewrote and optimized the original macro to suit the other
+%D macros in this module.
+%D
+%D \starttyping
+%D \doMPconcat {x position} \xresult {y position} \yresult
+%D \stoptyping
+%D
+%D By setting the auxiliary \DIMENSIONS\ \type{\dimen0} upto
+%D \type{\dimen10} only once per path, we save over 20\% run
+%D time. Some more speed was gained by removing some parameter
+%D passing. These macros can be optimized a bit more by using
+%D more constants. There is however not much need for further
+%D optimization because penshapes usually are round and
+%D therefore need no transformation. Nevertheless we move the
+%D factor to the outer level and use a bit different \type{pt}
+%D removal macro. Although the values represent base points,
+%D we converted them to pure points, simply because those can
+%D be converted back.
+
+%OLD \mathchardef\MPconcatfactor=256 % beware don't remove spaces before it
+
+%OLD \def\doMPreducedimen#1
+%OLD {\count0\MPconcatfactor
+%OLD \advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\count0
+%OLD \divide\dimen#1 \count0\relax}
+
+%OLD % too inaccurate (see old pragma logo)
+%OLD
+%OLD \def\doMPreducedimen#1
+%OLD {\count0=\MPconcatfactor
+%OLD \divide\dimen#1 \count0\relax}
+
+%OLD \def\doMPreducedimen#1
+%OLD {\advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\MPconcatfactor
+%OLD \divide\dimen#1 \MPconcatfactor}
+
+%D The transformation code is rewritten by Daniel H. Luecking who
+%D describes his patch as follows:
+%D
+%D We would like to divide 1 by $X$, but all divisions are integer so
+%D for accuracy we want to convert to large integers and make sure the
+%D integer quotient has as many significant digits as possible. Thus we
+%D need to replace $1/X$ with $M/N$ where $N$ is as large as possible
+%D and $M/N$ is as large as possible. Also for simplicity $M$ should be
+%D a power of 2. So we make $M = 2^{30}$ \footnote{$2^{31} - 1$ is the
+%D largest legal integer. Using it (and simply ignoring the inaccuracy
+%D caused by $-1$) turns out to be at least as accurate in all cases,
+%D and more accurate in some.} (largest legal power of 2) and adjust
+%D $X$ downward (if necessary) to the the range $1-2^{16}$. This gives
+%D at least 15 significant binary digits, (almost as accurate as
+%D \METAPOST\ for numbers near 1) or almost 5 significant figures
+%D (decimal).
+
+\newcount\MPscratchCnt
+\newdimen\MPscratchDim % will be assigned global
+
+\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt
+ {\MPscratchCnt\zerocount
+ \doMPadjustdimen}
+
+\def\doMPadjustdimen
+ {\ifdim\MPscratchDim>\onepoint
+ \divide \MPscratchDim\plustwo
+ \advance\MPscratchCnt\plusone
+ \expandafter\doMPadjustdimen
+ \fi}
+
+%OLD \def\doMPexpanddimen#1
+%OLD {\multiply\dimen#1 \MPconcatfactor\relax}
+
+%D DHL: When viewed as an integer, $1 \hbox{pt}=2^{16}$ so $2^{32}/X$
+%D is the right way to do $(1 \hbox{pt})/(X \hbox{pt})$ and get the
+%D answer in points. But we are limited to $2^{30}/X$. However, we
+%D actually do $[ 2^{30} / (X/2^K) ]*2^{2-K}$ where $K$ is the number
+%D of halvings it takes to bring $X$ below $1 \hbox{pt}$. If $K$ is 0
+%D or 1 we readjust by multiplying by 4 or 2, otherwise by halving
+%D $(K-2)$ times \type {\MPscratchCnt} holds the value of $K$ from
+%D \type {\MPadjustdimen}.
+
+\def\MPreadjustdimen % acts on \MPscratchDim and MPscratchCnt
+ {\ifcase\MPscratchCnt
+ \multiply\scratchdimen \plusfour
+ \or
+ \multiply\scratchdimen \plustwo
+ \else
+ \expandafter\doMPreadjustdimen
+ \fi}
+
+\def\doMPreadjustdimen
+ {\ifnum\MPscratchCnt>\plustwo
+ \divide \scratchdimen\plustwo
+ \advance\MPscratchCnt\minusone
+ \expandafter\doMPreadjustdimen
+ \fi}
+
+\def\MPreciprocaldeterminant
+ {\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y
+ \advance\scratchdimen -\withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y
+ \ifdim\scratchdimen<\zeropoint % we need a positive dimension
+ \scratchdimen-\scratchdimen % for \MPadjustdimen (?)
+ \doMPreciprocal
+ \scratchdimen-\scratchdimen
+ \else
+ \doMPreciprocal
+ \fi
+ \edef\MPreciprocal{\withoutpt\the\scratchdimen}}
+
+\newcount\MPnumerator \MPnumerator = 1073741824 % 2^{30}
+
+% todo: dimexpr
+
+\def\doMPreciprocal % replace \scratchdimen with its reciprocal
+ {\ifdim\scratchdimen=\onepoint \else
+ \MPadjustdimen
+ \scratchcounter\MPnumerator
+ \divide\scratchcounter\scratchdimen
+ \scratchdimen1\scratchcounter % 1 needed
+ \MPreadjustdimen
+ \fi}
+
+%OLD \def\presetMPconcat
+%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0 % r_x
+%OLD \dimen 2=\gMPs2\onepoint \doMPreducedimen 2 % s_x
+%OLD \dimen 4=\gMPs3\onepoint \doMPreducedimen 4 % s_y
+%OLD \dimen 6=\gMPs4\onepoint \doMPreducedimen 6 % r_y
+%OLD \dimen 8=\gMPs5\onepoint \doMPreducedimen 8 % t_x
+%OLD \dimen10=\gMPs6\onepoint \doMPreducedimen10 } % t_y
+%OLD
+%OLD \def\presetMPscale
+%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0
+%OLD \dimen 2 \zeropoint
+%OLD \dimen 4 \zeropoint
+%OLD \dimen 6=\gMPs2\onepoint \doMPreducedimen 6
+%OLD \dimen 8 \zeropoint
+%OLD \dimen10 \zeropoint}
+
+\def\cleanupMPconcat
+ {\ignoreMPspecials
+ \docleanupMPargument1%
+ \docleanupMPargument6%
+ \keepMPspecials}
+
+\def\presetMPconcat
+ {\dimen 0=\gMPs1\onepoint % s_x
+ \dimen 2=\gMPs2\onepoint % r_x
+ \dimen 4=\gMPs3\onepoint % r_y
+ \dimen 6=\gMPs4\onepoint % s_y
+ \dimen 8=\gMPs5\onepoint % t_x
+ \dimen10=\gMPs6\onepoint} % t_y
+
+\def\presetMPscale
+ {\dimen 0=\gMPs1\onepoint
+ \dimen 2 \zeropoint
+ \dimen 4 \zeropoint
+ \dimen 6=\gMPs2\onepoint
+ \dimen 8 \zeropoint
+ \dimen10 \zeropoint}
+
+\def\noMPtranslate % use this one grouped
+ {\dimen 8 \zeropoint % t_x
+ \dimen10 \zeropoint} % t_y
+
+%D \starttyping
+%D \def\doMPconcat#1#2#3#4%
+%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
+%D \dimen14=#3 pt \doMPreducedimen14 % p_y
+%D %
+%D \dimen16 \dimen 0
+%D \multiply \dimen16 \dimen 6
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen16 -\dimen20
+%D %
+%D \dimen18 \dimen12
+%D \multiply \dimen18 \dimen 6
+%D \dimen20 \dimen14
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen18 -\dimen20
+%D \dimen20 \dimen 4
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen18 \dimen20
+%D \dimen20 \dimen 6
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen18 -\dimen20
+%D %
+%D \multiply \dimen12 -\dimen 2
+%D \multiply \dimen14 \dimen 0
+%D \advance \dimen12 \dimen14
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen12 \dimen20
+%D \dimen20 \dimen 0
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen12 -\dimen20
+%D %
+%D \doMPreducedimen16
+%D \divide \dimen18 \dimen16 \doMPexpanddimen18
+%D \divide \dimen12 \dimen16 \doMPexpanddimen12
+%D %
+%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
+%D \stoptyping
+
+%D The following optimization resulted from some tests by
+%D and email exchanges with Sanjoy Mahajan.
+%D
+%D \starttyping
+%D \def\doMPconcat#1#2#3#4%
+%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
+%D \dimen14=#3 pt \doMPreducedimen14 % p_y
+%D %
+%D \dimen16 \dimen 0
+%D \multiply \dimen16 \dimen 6
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen16 -\dimen20
+%D %
+%D \dimen18 \dimen12
+%D \multiply \dimen18 \dimen 6
+%D \dimen20 \dimen14
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen18 -\dimen20
+%D \dimen20 \dimen 4
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen18 \dimen20
+%D \dimen20 \dimen 6
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen18 -\dimen20
+%D %
+%D \multiply \dimen12 -\dimen 2
+%D \multiply \dimen14 \dimen 0
+%D \advance \dimen12 \dimen14
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen12 \dimen20
+%D \dimen20 \dimen 0
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen12 -\dimen20
+%D %
+%D %\ifdim\dimen16>\onepoint % oeps, can be < 1pt too
+%D \ifdim\dimen16=\onepoint \else
+%D \ifdim\dimen16>\MPconcatfactor pt
+%D \doMPreducedimen16
+%D \divide \dimen18 \dimen16 \doMPexpanddimen18
+%D \divide \dimen12 \dimen16 \doMPexpanddimen12
+%D \else
+%D \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18
+%D \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12
+%D \fi
+%D \fi
+%D %
+%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
+%D \stoptyping
+%D
+%D But, this one is still too inaccurate, so we now have:
+
+%D We cannot use \type {\beginETEX} here since in plain we
+%D get \type {\outer} problems, sigh.
+
+%OLD \beginTEX
+%OLD
+%OLD \def\MPcriteriumA {512pt} % scale
+%OLD \def\MPcriteriumB {2pt} % scale
+%OLD
+%OLD \endTEX
+%OLD
+%OLD \ifx\MPcriteriumA\undefined
+%OLD
+%OLD \newdimen\MPcriteriumA \MPcriteriumA=512pt
+%OLD \newdimen\MPcriteriumB \MPcriteriumB= 2pt
+%OLD
+%OLD \fi
+
+%OLD \def\doMPconcat#1#2#3#4%
+%OLD {\dimen12=#1\onepoint % p_x
+%OLD \dimen14=#3\onepoint % p_y
+%OLD %
+%OLD \chardef\MPfactor\zerocount
+%OLD \ifdim\dimen4<\MPcriteriumB\ifdim\dimen4>-\MPcriteriumB
+%OLD \ifdim\dimen6<\MPcriteriumB\ifdim\dimen6>-\MPcriteriumB
+%OLD \ifdim\dimen8<\MPcriteriumB\ifdim\dimen8>-\MPcriteriumB
+%OLD \ifdim\dimen10<\MPcriteriumB\ifdim\dimen10>-\MPcriteriumB
+%OLD \chardef\MPfactor\plusone
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \ifcase\MPfactor % spurious 0 removed
+%OLD \chardef\MPfactor\plusone
+%OLD \ifdim\dimen12<\MPcriteriumA\ifdim\dimen12>-\MPcriteriumA
+%OLD \ifdim\dimen14<\MPcriteriumA\ifdim\dimen14>-\MPcriteriumA
+%OLD \chardef\MPfactor16
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \fi
+%OLD %
+%OLD \multiply\dimen12 \MPfactor
+%OLD \multiply\dimen14 \MPfactor
+%OLD %
+%OLD \doMPreducedimen12
+%OLD \doMPreducedimen14
+%OLD %
+%OLD \dimen16 \dimen 0
+%OLD \multiply \dimen16 \dimen 6
+%OLD \dimen20 \dimen 2
+%OLD \multiply \dimen20 \dimen 4
+%OLD \advance \dimen16 -\dimen20
+%OLD %
+%OLD \dimen18 \dimen12
+%OLD \multiply \dimen18 \dimen 6
+%OLD \dimen20 \dimen14
+%OLD \multiply \dimen20 \dimen 4
+%OLD \advance \dimen18 -\dimen20
+%OLD \dimen20 \dimen 4
+%OLD \multiply \dimen20 \dimen10
+%OLD \advance \dimen18 \dimen20
+%OLD \dimen20 \dimen 6
+%OLD \multiply \dimen20 \dimen 8
+%OLD \advance \dimen18 -\dimen20
+%OLD %
+%OLD \multiply \dimen12 -\dimen 2
+%OLD \multiply \dimen14 \dimen 0
+%OLD \advance \dimen12 \dimen14
+%OLD \dimen20 \dimen 2
+%OLD \multiply \dimen20 \dimen 8
+%OLD \advance \dimen12 \dimen20
+%OLD \dimen20 \dimen 0
+%OLD \multiply \dimen20 \dimen10
+%OLD \advance \dimen12 -\dimen20
+%OLD %
+%OLD \ifdim\dimen16=\onepoint \else
+%OLD \ifdim\dimen16>\MPconcatfactor \onepoint \relax
+%OLD \doMPreducedimen16
+%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18
+%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12
+%OLD \else
+%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18
+%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12
+%OLD \fi
+%OLD \fi
+%OLD %
+%OLD \divide\dimen18 \MPfactor
+%OLD \divide\dimen12 \MPfactor
+%OLD %
+%OLD \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+%OLD \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
+
+%D DHL: Ideally, $r_x$, $r_y$, $s_x$, $s_y$ should be in macros, not
+%D dimensions (they are scalar quantities after all, not lengths). I
+%D suppose the authors decided to do calculations with integer
+%D arithmetic instead of using real factors because it's faster.
+%D However, the actual macros test slower, possibly because I've
+%D omitted three nested loops. In my test files, my approach is more
+%D accurate. It is also far simpler and overflow does not seem to be a
+%D significant concern. The scale factors written by Metapost are (?)
+%D always $<=1$ (it scales coordinates internally) and coordinates are
+%D always likely to be less than \type {\maxdimen}.
+%D
+%D If this should ever cause problems, the scale factors can be reduced.
+
+% the original:
+%
+% \def\doMPconcat#1#2#3#4%
+% {\dimen12=#1\onepoint% p_x % #1\onepoint
+% \dimen14=#3\onepoint% p_y % #3\onepoint
+% \advance\dimen12 -\dimen8 % p_x - t_x
+% \advance\dimen14 -\dimen10 % p_y - t_y
+% \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
+% \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y)
+% \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y)
+% \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x)
+% % \MPreciprocal contains precomputed 1/D:
+% \dimen18=\MPreciprocal\dimen18
+% \dimen14=\MPreciprocal\dimen14
+% \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+% \edef#4{\withoutpt\the\dimen14}} % p_y^\prime
+%
+% faster but not that often used
+
+\def\doMPconcat#1#2#3#4%
+ {\dimen12\dimexpr#1\points-\dimen 8\relax % p_x-t_x
+ \dimen14\dimexpr#3\points-\dimen10\relax % p_y-t_y
+ \dimen18\dimexpr\withoutpt\the\dimen6\dimen12-\withoutpt\the\dimen4\dimen14\relax % s_y(p_x-t_x)-r_y(p_y-t_y)
+ \dimen14\dimexpr\withoutpt\the\dimen0\dimen14-\withoutpt\the\dimen2\dimen12\relax % s_x(p_y-t_y)-r_x(p_x-t_x)
+ \edef#2{\withoutpt\the\dimexpr\MPreciprocal\dimen18\relax}% % p_x^\prime
+ \edef#4{\withoutpt\the\dimexpr\MPreciprocal\dimen14\relax}} % p_y^\prime
+
+%D One reason for Daniel to write this patch was that at small sizes
+%D the accuracy was less than optimal. Here is a test that demonstrates
+%D that his alternative is pretty good:
+%D
+%D \startlinecorrection
+%D \startMPcode
+%D for i = 5cm,1cm,5mm,1mm,.5mm,.1mm,.01mm :
+%D draw fullcircle scaled i withpen pencircle xscaled (i/10) yscaled (i/20) rotated 45 ;
+%D endfor ;
+%D \stopMPcode
+%D \stoplinecorrection
+
+%D The following explanation of the conversion process was
+%D posted to the \PDFTEX\ mailing list by Tanmoy. The original
+%D macro was part of a set of macro's that included sinus and
+%D cosinus calculations as well as scaling and translating. The
+%D \METAPOST\ to \PDF\ conversion however only needs
+%D transformation.
+
+%M \start \switchtobodyfont [ss]
+
+%D Given a point $(U_x, U_y)$ in user coordinates, the business
+%D of \POSTSCRIPT\ is to convert it to device space. Let us say
+%D that the device space coordinates are $(D_x, D_y)$. Then, in
+%D \POSTSCRIPT\ $(D_x, D_y)$ can be written in terms of
+%D $(U_x, U_y)$ in matrix notation, either as
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_x&D_y&1\cr} = \pmatrix{U_x&U_y&1\cr}
+%D \pmatrix{s_x&r_x&0\cr
+%D r_y&s_y&0\cr
+%D t_x&t_y&1\cr}
+%D \stopformula
+%D
+%D or
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x&r_y&t_x\cr
+%D r_x&s_y&t_y\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{U_x\cr
+%D U_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D both of which is a shorthand for the same set of equations:
+%D
+%D \placeformula
+%D \startformula
+%D D_x = s_x U_x + r_y U_y + t_x
+%D \stopformula
+%D
+%D \placeformula
+%D \startformula
+%D D_y = r_x U_x + s_y U_y + t_y
+%D \stopformula
+%D
+%D which define what is called an `affine transformation'.
+%D
+%D \POSTSCRIPT\ represents the `transformation matrix' as a
+%D six element matrix instead of a $3\times 3$ array because
+%D three of the elements are always~0, 0 and~1. Thus the above
+%D transformation is written in postscript as $[s_x\, r_x\,
+%D r_y\, s_y\, t_x\, t_y]$. However, when doing any
+%D calculations, it is useful to go back to the original
+%D matrix notation (whichever: I will use the second) and
+%D continue from there.
+%D
+%D As an example, if the current transformation matrix is
+%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ and you say \typ{[a b
+%D c d e f] concat}, this means:
+%D
+%D \startnarrower
+%D Take the user space coordinates and transform them to an
+%D intermediate set of coordinates using array $[a\, b\, c\, d\,
+%D e\, f]$ as the transformation matrix.
+%D
+%D Take the intermediate set of coordinates and change them to
+%D device coordinates using array $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$
+%D as the transformation matrix.
+%D \stopnarrower
+%D
+%D Well, what is the net effect? In matrix notation, it is
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{I_x\cr I_y\cr 1\cr} = \pmatrix{a&c&e\cr
+%D b&d&f\cr
+%D 0&0&1\cr}
+%D \pmatrix{U_x\cr
+%D U_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_y\cr D_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr
+%D r_x&s_y&t_y\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{I_x\cr
+%D I_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D where $(I_x, I_y)$ is the intermediate coordinate.
+%D
+%D Now, the beauty of the matrix notation is that when there is
+%D a chain of such matrix equations, one can always compose
+%D them into one matrix equation using the standard matrix
+%D composition law. The composite matrix from two matrices can
+%D be derived very easily: the element in the $i$\high{th}
+%D horizontal row and $j$\high{th} vertical column is
+%D calculated by`multiplying' the $i$\high{th} row of the first
+%D matrix and the $j$\high{th} column of the second matrix (and
+%D summing over the elements). Thus, in the above:
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr
+%D r_x^\prime&s_y^\prime&t_y^\prime\cr
+%D 0 &0 &0 \cr}
+%D \pmatrix{U_x\cr
+%D U_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D with
+%D
+%D \placeformula
+%D \startformula
+%D \eqalign
+%D {s_x^\prime & = s_x a + r_y b \cr
+%D r_x^\prime & = r_x a + s_y b \cr
+%D r_y^\prime & = s_x c + r_y d \cr
+%D s_y^\prime & = r_x c + s_y d \cr
+%D t_x^\prime & = s_x e + r_y f + t_x \cr
+%D t_y^\prime & = r_x e + s_y f + t_y \cr}
+%D \stopformula
+
+%D In fact, the same rule is true not only when one is going
+%D from user coordinates to device coordinates, but whenever
+%D one is composing two `transformations' together
+%D (transformations are `associative'). Note that the formula
+%D is not symmetric: you have to keep track of which
+%D transformation existed before (i.e.\ the equivalent of
+%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$) and which was
+%D specified later (i.e.\ the equivalent of $[a\, b\, c\, d\,
+%D e\, f]$). Note also that the language can be rather
+%D confusing: the one specified later `acts earlier',
+%D converting the user space coordinates to intermediate
+%D coordinates, which are then acted upon by the pre||existing
+%D transformation. The important point is that order of
+%D transformation matrices cannot be flipped (transformations
+%D are not `commutative').
+%D
+%D Now what does it mean to move a transformation matrix
+%D before a drawing? What it means is that given a point
+%D $(P_x, P_y)$ we need a different set of coordinates
+%D $(P_x^\prime, P_y^\prime)$ such that if the transformation
+%D acts on $(P_x^\prime, P_y^\prime)$, they produce $(P_x,
+%D P_y)$. That is we need to solve the set of equations:
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{P_x\cr P_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr
+%D r_x&s_y&t_y\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{P_x^\prime\cr
+%D P_y^\prime\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D Again matrix notation comes in handy (i.e. someone has
+%D already solved the problem for us): we need the inverse
+%D transformation matrix. The inverse transformation matrix can
+%D be calculated very easily:
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{P_x^\prime\cr P_y^\prime\cr 1\cr} =
+%D \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr
+%D r_x^\prime&s_y^\prime&t_y^\prime\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{P_x\cr
+%D P_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D where, the inverse transformation matrix is given by
+%D
+%D \placeformula
+%D \startformula
+%D \eqalign
+%D {D & = s_x s_y - r_x r_y \cr
+%D s_x^\prime & = s_y / D \cr
+%D s_y^\prime & = s_x / D \cr
+%D r_x^\prime & = - r_x / D \cr
+%D r_y^\prime & = - r_y / D \cr
+%D t_x^\prime & = ( - s_y t_x + r_y t_y ) / D \cr
+%D t_y^\prime & = ( r_x t_x - s_x t_y ) / D \cr}
+%D \stopformula
+%D
+%D And you can see that when expanded out, this does
+%D give the formulas:
+%D
+%D \placeformula
+%D \startformula
+%D P_x^\prime = { { s_y(p_x-t_x) + r_y(t_y-p_y) } \over
+%D { s_x s_y-r_x r_y } }
+%D \stopformula
+%D
+%D \placeformula
+%D \startformula
+%D P_y^\prime = { { s_x(p_y-t_y) + r_x(t_x-p_x) } \over
+%D { s_x*s_y-r_x*r_y } }
+%D \stopformula
+%D
+%D The code works by representing a real number by converting
+%D it to a dimension to be put into a \DIMENSION\ register: 2.3 would
+%D be represented as 2.3pt for example. In this scheme,
+%D multiplying two numbers involves multiplying the \DIMENSION\
+%D registers and dividing by 65536. Accuracy demands that the
+%D division be done as late as possible, but overflow
+%D considerations need early division.
+%D
+%D Division involves dividing the two \DIMENSION\ registers and
+%D multiplying the result by 65536. Again, accuracy would
+%D demand that the numerator be multiplied (and|/|or the
+%D denominator divided) early: but that can lead to overflow
+%D which needs to be avoided.
+%D
+%D If nothing is known about the numbers to start with (in
+%D concat), I have chosen to divide the 65536 as a 256 in each
+%D operand. However, in the series calculating the sine and
+%D cosine, I know that the terms are small (because I never
+%D have an angle greater than 45 degrees), so I chose to
+%D apportion the factor in a different way.
+
+%M \stop
+
+%D The path is output using the values saved on the stack. If
+%D needed, all coordinates are recalculated.
+
+\def\finishMPpath
+ {\PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\fi}}
+
+\def\processMPpath
+ {\checkMPpath
+ \ifcase\nofMPsegments\else
+ \flushMPpath
+ \closeMPpath
+ \finishMPpath
+ \fi
+ \let\handleMPsequence\dohandleMPsequence
+ \resetMPstack
+ \nofMPsegments\zerocount
+ \handleMPsequence}
+
+%D The following \METAPOST\ code is quite valid but, when
+%D processed and converted to \PDF, will make a file
+%D unprintable on a Hewlett Packard printer (from Acrobat
+%D $v<=5$). Who is to blame, the driver of the OS layer in
+%D between, is hard to determine, so we add an additional
+%D check.
+%D
+%D \starttyping
+%D clip currentpicture to origin -- cycle ;
+%D setbounds currentpicture to fullsquare scaled 5cm ;
+%D \stoptyping
+
+\def\checkMPpath
+ {\ifcase\finiMPpath
+ \ifnum\nofMPsegments<\plusthree % n is one ahead
+ \message{omitting zero clip path}%
+ \nofMPsegments\zerocount
+ \fi
+ \fi}
+
+%D In \PDF\ the \type{cm} operator must precede the path
+%D specification. We therefore can output the \type{cm} at
+%D the moment we encounter it.
+
+\def\handleMPpathconcat
+ {\presetMPconcat
+ \PDFcode{\gMPs1 \gMPs2 \gMPs3 \gMPs4 \gMPs5 \gMPs6 cm}%
+ \resetMPstack}
+
+\def\handleMPpathscale
+ {\presetMPscale
+ \PDFcode{\gMPs1 0 0 \gMPs2 0 0 cm}%
+ \resetMPstack}
+
+%D This macro interprets the path and saves it as compact as
+%D possible.
+
+\def\dohandleMPpath#1%
+ {\ifcase\lccode`#1\relax
+ \@EA\dohandleMPpathA
+ \else
+ \@EA\dohandleMPpathB
+ \fi#1}
+
+\let\dohandleMPpathA\setMPsequence
+
+\def\installMPSkeywordP#1#2%
+ {\expandafter\def\csname\@@MP:P:#1\endcsname{#2}}
+
+\def\installMPSshortcutP#1#2% todo: \let
+ {\expandafter\let\csname\@@MP:P:#1\expandafter\endcsname\csname\@@MP:P:#2\endcsname}
+
+\def\dohandleMPpathB#1 %
+ {\def\somestring{#1}%
+ \executeifdefined{\@@MP:P:\somestring}\relax
+ \handleMPsequence}
+
+\installMPSkeywordP \PSlineto
+ {\setMPkeyword0 }
+\installMPSkeywordP \PScurveto
+ {\setMPkeyword1 }
+\installMPSkeywordP \PSrlineto
+ {\setMPkeyword2 }
+\installMPSkeywordP \PSmoveto
+ {\edef\lastMPmoveX{\gMPs1}%
+ \edef\lastMPmoveY{\gMPs2}%
+ \resetMPstack
+ \setMPkeyword3 }
+\installMPSkeywordP \PSclip
+ {% \chardef\finiMPpath\zerocount % already
+ \let\handleMPsequence\processMPpath}
+\installMPSkeywordP \PSgsave
+ {\chardef\finiMPpath\plusthree}
+\installMPSkeywordP \PSgrestore
+ {}
+\installMPSkeywordP \PSfill
+ {\ifcase\finiMPpath
+ \chardef\finiMPpath\plustwo
+ \let\handleMPsequence\processMPpath
+ \fi}
+\installMPSkeywordP \PSstroke
+ {\ifcase\finiMPpath
+ \chardef\finiMPpath\plusone
+ \fi
+ \let\handleMPsequence\processMPpath}
+\installMPSkeywordP \PSclosepath
+ {\def\closeMPpath{\PDFcode{h}}}
+\installMPSkeywordP \PSconcat
+ {\cleanupMPconcat
+ \let\flushMPpath\flushconcatMPpath
+ \handleMPpathconcat}
+\installMPSkeywordP \PSscale
+ {\let\flushMPpath\flushconcatMPpath
+ \handleMPpathscale}
+
+\installMPSshortcutP {l} \PSlineto
+\installMPSshortcutP {r} \PSrlineto
+\installMPSshortcutP {m} \PSmoveto
+\installMPSshortcutP {c} \PScurveto
+
+\installMPSshortcutP {q} \PSgsave
+\installMPSshortcutP {Q} \PSgrestore
+\installMPSshortcutP {S} \PSstroke
+\installMPSshortcutP {F} \PSfill
+\installMPSshortcutP {B} \PSgsave
+\installMPSshortcutP {W} \PSclip
+\installMPSshortcutP {p} \PSclosepath
+
+\installMPSshortcutP {s} \PSscale
+\installMPSshortcutP {t} \PSconcat
+
+%D \macros
+%D {twodigitMPoutput}
+%D
+%D We can limit the precision to two digits after the comma
+%D by saying:
+%D
+%D \starttyping
+%D \twodigitMPoutput
+%D \stoptyping
+%D
+%D This option only works in \CONTEXT\ combined with \ETEX.
+
+\def\twodigitMPoutput
+ {\let\!MP \twodigitrounding
+ \def\!MPgMPs##1{\twodigitrounding{\gMPs##1}}%
+ \def\!MPgMPa##1{\twodigitrounding{\gMPa##1}}}
+
+\let\!MP \empty
+\let\!MPgMPa\gMPa
+\let\!MPgMPs\gMPs
+
+%D Here comes the special-specific code:
+
+\def\setMPextensions
+ {\ifconditional\manyMPspecials
+ \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##10000.00000\relax}%
+ \def\doMPrgbnumber##1.##2##3##4##5##6\relax{##2##3##4##5}%
+ \else
+ \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##1000.0000\relax}%
+ \def\doMPrgbnumber##1.##2##3##4##5\relax{##2##3##4}%
+ \fi}
+
+% \settrue\manyMPspecials \setMPextensions
+
+%D This macro handles the special definitions that are
+%D passed as comment.
+
+%D The implementation below saves the data on the stack in
+%D a way similar to the macros in \type {supp-pdf.tex}, and
+%D just overload a few already defined handlers. That way,
+%D the existing macros are still generic. \footnote {Actually,
+%D the macros here are just as generic.}
+%D
+%D Currently the only extension concerns shading, which is
+%D accomplished by handling yet another value of \type
+%D {\finiMPpath}. The recource disctionary is stored and
+%D later picked up by the general \CONTEXT\ figure inclusion
+%D macros.
+
+%D The \type {%%MetaPostSpecials: version.revision signal} line
+%D triggers this module into handling color specifications kind
+%D of special. We need this safeguard for non||special
+%D usage.
+
+%D When defined inline, we use another macro to handle the
+%D definitions. Actually, this macro is called by the
+%D previous ones.
+
+\chardef\MPspecialversion = 0 % specials when >1
+\chardef\MPspecialrevision = 0 % specials when >1
+\chardef\MPspecialsignal = 0 % passed on by graphic
+
+\chardef\inlineMPspecials = 1 % only needed for stack resetting
+
+\def\dohandleMPspecialcomment#1
+ {\setMPargument{#1}%
+ \advance\scratchcounter \minusone
+ \ifcase\scratchcounter
+ \handleMPspecialcommand
+ \donetrue
+ \doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \expandafter\handleMPsequence
+ \else
+ \expandafter\dohandleMPspecialcomment
+ \fi}
+
+\def\handleMPspecialcomment #1 % number of arguments
+ {\doresetMPstack
+ \scratchcounter#1\relax
+ \ifcase\scratchcounter % when zero, inline shading is used
+ \chardef\inlineMPspecials\plusone
+ \let\handleMPsequence\dohandleMPsequence
+ \expandafter\handleMPsequence
+ \else
+ \chardef\inlineMPspecials\zerocount
+ \expandafter\dohandleMPspecialcomment
+ \fi}
+
+%D When defined inline, we use another macro to handle the
+%D definitions. Actually, this macro is called by the
+%D previous ones.
+
+\def\handleMPspecialcommand
+ {\ifcase\inlineMPspecials\or
+ \advance\nofMParguments \minusone % pop the size
+ \fi
+ \ifundefined\MPspecial
+ \message{[unknown \MPspecial]}%
+ \else
+ \csname\MPspecial\endcsname
+ \fi
+ \ifcase\inlineMPspecials
+ \doresetMPstack % 0
+ \else
+ \resetMPstack % 1
+ \fi}
+
+\def\handleMPspecialscomment #1.#2 #3 % version.revision signal #4=div=1000|10000
+ {\doresetMPstack
+ \chardef\MPspecialversion #1%
+ \chardef\MPspecialrevision#2%
+ \chardef\MPspecialsignal #3%
+ \let\handleMPsequence\dohandleMPsequence
+ \ifnum#1=\plusone
+ \expandafter\handleMPsequence
+ \else
+ \expandafter\handleMPspecialscommentx
+ \fi}
+
+\def\handleMPspecialscommentx #1 % version 2
+ {\ifnum10000=0#1\relax
+ \settrue \manyMPspecials
+ \else
+ \setfalse\manyMPspecials
+ \fi
+ \setMPextensions
+ \handleMPsequence}
+
+\def\handleMPrgbcolor
+ {\edef\lastMPrvalue{\csname\@@MP01\endcsname}%{\gMPs1}%
+ \edef\lastMPgvalue{\csname\@@MP02\endcsname}%{\gMPs2}%
+ \edef\lastMPbvalue{\csname\@@MP03\endcsname}%{\gMPs3}%
+ \ifnum\MPrgbnumber\lastMPrvalue=123\relax
+ \csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname
+ \else
+ \dohandleMPrgb\lastMPrvalue\lastMPgvalue\lastMPbvalue
+ \fi}
+
+\def\handleMPgraycolor{\dohandleMPgray{\gMPs1}}
+\def\handleMPcmykcolor{\dohandleMPcmyk{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}}
+\def\handleMPspotcolor{\dohandleMPspot{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}}
+
+% \newcontitional\ignoreMPpath
+
+\def\finishMPpath
+ {\ifconditional\ignoreMPpath
+ \PDFcode{W n\space}%
+ \else
+ \PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\else W n\fi}%
+ \fi
+ \ifx\extraMPpathcode\empty\else
+ \PDFcode{\extraMPpathcode}%
+ \let\extraMPpathcode\empty
+ \fi
+ \setfalse\ignoreMPpath}
+
+\def\processMPpath
+ {\checkMPpath % !
+ \flushMPpath
+ \closeMPpath
+ \finishMPpath
+ \let\handleMPsequence\dohandleMPsequence
+ \resetMPstack
+ \nofMPsegments\zerocount
+ \handleMPsequence}
+
+\protect \endinput
+
+% When i'm bored ...
+
+% \newcatcodetable\mpscatcodes
+
+% \startcatcodetable \mpscatcodes
+% \catcode`\| \@@comment
+% \catcode`\% \@@active
+% \catcode`\[ \@@active
+% \catcode`\] \@@active
+% \catcode`\{ \@@active
+% \catcode`\} \@@active
+% \stopcatcodetable
+
+% \def\keepMPspecials
+% {\setcatcodecommand \mpscatcodes `\% \letterpercent
+% \setcatcodecommand \mpscatcodes `\[ \letterleftbracket
+% \setcatcodecommand \mpscatcodes `\] \letterrightbracket
+% \setcatcodecommand \mpscatcodes `\{ \letterleftbrace
+% \setcatcodecommand \mpscatcodes `\} \letterrightbrace}
+
+% \def\ignoreMPspecials
+% {\setcatcodecommand \mpscatcodes `\% \letterpercent
+% \setcatcodecommand \mpscatcodes `\[ \empty
+% \setcatcodecommand \mpscatcodes `\] \empty
+% \setcatcodecommand \mpscatcodes `\{ \empty
+% \setcatcodecommand \mpscatcodes `\} \empty}
+
+% \def\obeyMPspecials
+% {\setcatcodecommand \mpscatcodes `\% \letterpercent
+% \setcatcodecommand \mpscatcodes `\[ \letterleftbracket
+% \setcatcodecommand \mpscatcodes `\] \letterrightbracket
+% \setcatcodecommand \mpscatcodes `\{ \letterleftbrace
+% \setcatcodecommand \mpscatcodes `\} \letterrightbrace}
+
+% \gdef\setMPspecials|
+% {\setcatcodetable\mpscatcodes
+% \lccode`\-=\zerocount % to be sure, it could be a letter
+% \lccode`\%=`\%% % otherwise it's seen as a number
+% \def\({\char40\relax }%
+% \def\){\char41\relax }%
+% \def\\{\char92\relax }%
+% \def\0{\octalMPcharacter0}%
+% \def\1{\octalMPcharacter1}%
+% \def\2{\octalMPcharacter2}%
+% \def\3{\octalMPcharacter3}%
+% \def\4{\octalMPcharacter4}%
+% \def\5{\octalMPcharacter5}%
+% \def\6{\octalMPcharacter6}%
+% \def\7{\octalMPcharacter7}%
+% \def\8{\octalMPcharacter8}%
+% \def\9{\octalMPcharacter9}}
diff --git a/Master/texmf-dist/tex/context/base/meta-pdf.tex b/Master/texmf-dist/tex/context/base/meta-pdf.tex
index bddf932efaf..ad4a57fd942 100644
--- a/Master/texmf-dist/tex/context/base/meta-pdf.tex
+++ b/Master/texmf-dist/tex/context/base/meta-pdf.tex
@@ -11,32 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D In due time this file will replace \type {supp-pdf} and
-%D \type {supp-mpe}.
-
-% \input supp-pdf
-% \input supp-mpe
-%
-% \endinput
-
-% we're going to experiment a bit with new code
-
-%D To be tested: texopt.rb on this file.
-
-%D Prelude to an optimized version:
-
-%D \module
-%D [ file=supp-pdf,
-%D version=2004.12.16,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=\METAPOST\ to \PDF\ conversion,
-%D author=Hans Hagen \& others (see text),
-%D date=\currentdate,
-%D copyright=\PRAGMA]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%D Formerly known as supp-pdf.tex and supp-mpe.tex.
%D These macros are written as generic as possible. Some
%D general support macro's are loaded from a small module
@@ -52,10 +27,10 @@
%D his initials. (We keep the old code around because it's a
%D nice illustration on how a module like this evolves.)
-% Beware, we cannot use \zeropoint here since it may be
+% Beware, we cannot use 0pt here by defaukt since it may be
% defined in the range \dimen 0 - 20 which we happen to use
-% as scratch registers; inside context we may consider
-% using dedicated registers.
+% as scratch registers; for this reason we start allocating
+% scratch registers > 20
%D This module handles some \PDF\ conversion and insertions
%D topics. By default, the macros use the \PDFTEX\ primitive
@@ -63,23 +38,12 @@
%D default engine for \TEX\ distributions, we need a more complex
%D test.
-\writestatus{loading}{Context Support Macros / PDF (2004.03.26)}
+\writestatus{loading}{Context Support Macros / MPS to PDF}
\unprotect
-\ifx\PDFcode\undefined
- \ifx\pdfliteral\undefined
- \def\PDFcode#1{\special{PDF: #1}}
- \else\ifx\pdfoutput\undefined
- \def\PDFcode#1{\special{PDF: #1}}
- \else\ifcase\pdfoutput
- \def\PDFcode#1{\special{PDF: #1}}
- \else % pdftex as well as in pdf mode
- \let\PDFcode\pdfliteral
- \fi\fi\fi
-\else
- % we probably use context
-\fi
+\ifx\PDFcode \undefined \let\PDFcode \gobbleoneargument \fi
+\ifx\PDFcomment\undefined \def\PDFcomment#1{\PDFcode{\letterpercent\space#1}} \fi
%D First we define a handy constant:
@@ -122,11 +86,8 @@
\def\dopdfimages#1#2#3%
{\immediate\pdfximage#1{#2}%
- \immediate\pdfobj
- {[ << /Image \the\pdflastximage\space0 R
- /DefaultForPrinting true >> ]}%
- \immediate\pdfximage#1
- attr {/Alternates \the\pdflastobj\space0 R}{#3}%
+ \immediate\pdfobj{[ << /Image \the\pdflastximage\space0 R /DefaultForPrinting true >> ]}%
+ \immediate\pdfximage#1 attr {/Alternates \the\pdflastobj\space0 R}{#3}%
\pdfrefximage\pdflastximage}
\def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom}
@@ -135,14 +96,9 @@
\def\dopdfclippedimage#1#2#3#4#5#6%
{\bgroup
\pdfximage#1{#2}%
- \setbox\scratchbox\hbox
- {\pdfrefximage\pdflastximage}%
- \hsize\wd\scratchbox
- \advance\hsize -#3%
- \advance\hsize -#4%
- \vsize\ht\scratchbox
- \advance\vsize -#5%
- \advance\vsize -#6%
+ \setbox\scratchbox\hbox{\pdfrefximage\pdflastximage}%
+ \hsize\dimexpr\wd\scratchbox-#3-#4\relax
+ \vsize\dimexpr\ht\scratchbox-#5-#6\relax
\setbox\scratchbox\vbox to \vsize
{\vskip-#5\hbox to \hsize{\hskip-#3\box\scratchbox\hss}}%
\pdfxform\scratchbox
@@ -151,1635 +107,11 @@
\fi \fi
-%D If you want to save a few hash entries, you may prefer the
-%D less readable alternatives, like:
-%D
-%D \starttyping
-%D \def\pdfimage#1#% This one is less readable but needs no additional
-%D {\bgroup % hash entry for the second stage macro.
-%D \def\pdfimage##1%
-%D {\immediate\pdfximage##1{#2}%
-%D \pdfrefximage\pdflastximage\egroup}}
-%D \stoptyping
-
%D \macros
%D {convertMPtoPDF}
%D
%D The next set of macros implements \METAPOST\ to \PDF\
-%D conversion. Because we want to test as fast as possible, we
-%D first define the \POSTSCRIPT\ operators that \METAPOST\
-%D uses. We don't define irrelevant ones, because these are
-%D skipped anyway.
-
-%D The converter can be made a bit faster by replacing the
-%D two test macros (the ones with the many \type {\if's}) by
-%D a call to named branch macros (something \typ {\getvalue
-%D {xPSmoveto}}. For everyday documents with relatively
-%D small graphics the gain in speed can be neglected.
-
-\def \PScurveto {curveto}
-\def \PSlineto {lineto}
-\def \PSmoveto {moveto}
-\def \PSshowpage {showpage}
-\def \PSnewpath {newpath}
-\def \PSfshow {fshow}
-\def \PSclosepath {closepath}
-\def \PSfill {fill}
-\def \PSstroke {stroke}
-\def \PSclip {clip}
-\def \PSrlineto {rlineto}
-\def \PSsetlinejoin {setlinejoin}
-\def \PSsetlinecap {setlinecap}
-\def \PSsetmiterlimit {setmiterlimit}
-\def \PSsetgray {setgray}
-\def \PSsetrgbcolor {setrgbcolor}
-\def \PSsetcmykcolor {setcmykcolor}
-\def \PSsetdash {setdash}
-\def \PSgsave {gsave}
-\def \PSgrestore {grestore}
-\def \PStranslate {translate}
-\def \PSscale {scale}
-\def \PSconcat {concat}
-\def \PSdtransform {dtransform}
-\def \PSsetlinewidth {setlinewidth}
-\def \PSpop {pop}
-
-\def \PSnfont {nfont} % was needed for TUG98 proceedings
-\def \PSspecial {special} % extensions to MetaPost
-
-%D A previous version set \type {%} to ignore, which
-%D simplified the following definitions. At the start of
-%D conversion the percent character was made active again.
-%D Because the whole graphic is one paragraph (there are no
-%D empty lines) this does not give the desired effect. This
-%D went unnoticed untill Scott Pakin sent me a test file
-%D percent characters in a string. So, from now on we have
-%D to prefix the following strings with percentages.
-
-%D Some day I'll figure out a better solution (line by line reading
-%D using \ETEX).
-
-\edef \PSBoundingBox {\letterpercent\letterpercent BoundingBox:}
-\edef \PSHiResBoundingBox {\letterpercent\letterpercent HiResBoundingBox:}
-\edef \PSExactBoundingBox {\letterpercent\letterpercent ExactBoundingBox:}
-\edef \PSMetaPostSpecial {\letterpercent\letterpercent MetaPostSpecial:}
-\edef \PSMetaPostSpecials {\letterpercent\letterpercent MetaPostSpecials:}
-\edef \PSPage {\letterpercent\letterpercent Page:}
-
-%D By the way, the \type {setcmykcolor} operator is not
-%D output by \METAPOST\ but can result from converting the
-%D \cap{RGB} color specifications, as implemented in
-%D \type{supp-mps}.
-
-%D In \POSTSCRIPT\ arguments precede the operators. Due to the
-%D fact that in some translations we need access to those
-%D arguments, and also because sometimes we have to skip them,
-%D we stack them up. The stack is one||dimensional for non path
-%D operators and two||dimensional for operators inside a path.
-%D This is because we have to save the whole path for
-%D (optional) postprocessing. Values are pushed onto the stack
-%D by:
-%D
-%D \starttyping
-%D \setMPargument {value}
-%D \stoptyping
-%D
-%D They can be retrieved by the short named macros:
-%D
-%D \starttyping
-%D \gMPa {number}
-%D \gMPs {number}
-%D \stoptyping
-%D
-%D When scanning a path specification, we also save the
-%D operator, using
-%D
-%D \starttyping
-%D \setMPkeyword {n}
-%D \stoptyping
-%D
-%D The path drawing operators are coded for speed: \type{clip},
-%D \type{stroke}, \type{fill} and \type{fillstroke} become
-%D 1, 2, 3 and~4.
-%D
-%D When processing the path this code can be retrieved
-%D using
-%D
-%D \starttyping
-%D \getMPkeyword % {n}
-%D \stoptyping
-%D
-%D When setting an argument, the exact position on the stack
-%D depends on the current value of the \COUNTERS\
-%D \type{\nofMPsegments} and \type{\nofMParguments}.
-
-\newcount\nofMPsegments
-\newcount\nofMParguments
-
-%D These variables hold the coordinates. The argument part of
-%D the stack is reset by:
-%D
-%D \starttyping
-%D \resetMPstack
-%D \stoptyping
-%D
-%D We use the prefix \type{@@MP} to keep the stack from
-%D conflicting with existing macros. To speed up things a bit
-%D more, we use the constant \type{\@@MP}.
-
-\def\@@MP{@@MP}
-
-\def\setMPargument% #1%
- {\advance\nofMParguments \plusone
- \expandafter\def
- \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1}
-
-\def\letMPargument
- {\advance\nofMParguments \plusone
- \expandafter\let
- \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname}
-
-\def\setMPsequence#1 %
- {\advance\nofMParguments \plusone
- \expandafter\def
- \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}%
- \handleMPsequence}
-
-\def\gMPa#1%
- {\csname\@@MP0\number#1\endcsname}
-
-\def\gMPs#1%
- {\csname\@@MP\the\nofMPsegments\number#1\endcsname}
-
-\def\dogMPa#1%
- {\@EAEAEA\do\csname\@@MP0\number#1\endcsname}
-
-\def\setMPkeyword#1 %
- {\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}%
- \advance\nofMPsegments \plusone
- \nofMParguments\zerocount}
-
-\def\getMPkeyword% #1%
- {\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname}
-
-\def\docleanupMPargument#1% we need this because args can have [ or ] pre/appended
- {\expandafter\edef\csname\@@MP\the\nofMPsegments\number#1\endcsname
- {\csname\@@MP\the\nofMPsegments\number#1\endcsname}}
-
-%D When we reset the stack, we can assume that all further
-%D comment is to be ignored and handled in strings.
-%D By redefining the reset macro after the first call, we
-%D save some run time. Only use this macro after all
-%D comments are processed and use the simple alternative
-%D when dealing with comments.
-
-\def\doresetMPstack
- {\nofMParguments\zerocount}
-
-\def\resetMPstack
- {\let\handleMPgraphic\handleMPendgraphic
- \let\resetMPstack\doresetMPstack
- \resetMPstack}
-
-%D The arguments are saved with the preceding command
-%D \type{\do}. By default this command expands to nothing, but
-%D when we deal with strings it's used to strip off the
-%D \type{(} and \type{)}.
-%D
-%D Strings are kind of tricky, because characters can be
-%D passed verbatim \type{(hello)}, by octal number
-%D \type{(\005)} or as command \type{(\()}. We therefore
-%D cannot simply ignore \type{(} and \type{)}, the way we do
-%D with \type{[} and \type{]}. Another complication is that
-%D strings may contain characters that normally have a
-%D special meaning in \TEX, like \type{$} and \type{{}}.
-%D
-%D A previous solution made \type{\} an active character and
-%D let it look ahead for a number or characters. We had to
-%D abandon this scheme because of the need for verbatim
-%D support. The next solution involved some \CATCODE\
-%D trickery but works well.
-
-\def\octalMPcharacter#1#2#3%
- {\char'#1#2#3\relax}
-
-%D curly braces and squarly brackets are stored in the argument stack
-%D as part of strings, for instance in:
-%D
-%D \starttyping
-%D /fshow {exch findfont exch scalefont setfont show}bind def
-%D [3 3 ] 0 setdash
-%D \stoptyping
-%D
-%D but we need to keep them in situation like
-%D
-%D \starttyping
-%D ([bla bla] bla bla) ec-lmr10 9.96265 fshow
-%D ({bla bla} bla bla) ec-lmr10 9.96265 fshow
-%D \stoptyping
-%D
-%D So, when we store the snippets, we keep the special tokens, and
-%D when needed we either ignore or obey them
-
-\bgroup
-\catcode`\|=\@@comment
-\catcode`\%=\@@active
-\catcode`\[=\@@active
-\catcode`\]=\@@active
-\catcode`\{=\@@active
-\catcode`\}=\@@active
-\catcode`B=\@@begingroup
-\catcode`E=\@@endgroup
-\gdef\keepMPspecials|
- B\let%\letterpercent|
- \def[B\noexpand[E|
- \def]B\noexpand]E|
- \def{B\noexpand{E|
- \def}B\noexpand}EE
-\gdef\ignoreMPspecials|
- B\let%\letterpercent|
- \def[BE|
- \def]BE|
- \def{BE|
- \def}BEE
-\gdef\obeyMPspecials|
- B\def%B\char 37\relax E|
- \def[B\char 91\relax E|
- \def]B\char 93\relax E|
- \def{B\char123\relax E|
- \def}B\char125\relax EE
-\gdef\setMPspecials|
- B\setnaturalcatcodes
- \catcode`\\=\@@escape
- \catcode`\%=\@@active
- \catcode`\[=\@@active
- \catcode`\]=\@@active
- \catcode`\{=\@@active
- \catcode`\}=\@@active
- \lccode`\-=0 | latex sets this to `\-
- \lccode`\%=`\% | otherwise it's seen as a number
- \def\(B\char40\relax E|
- \def\)B\char41\relax E|
- \def\\B\char92\relax E|
- \def\0B\octalMPcharacter0E|
- \def\1B\octalMPcharacter1E|
- \def\2B\octalMPcharacter2E|
- \def\3B\octalMPcharacter3E|
- \def\4B\octalMPcharacter4E|
- \def\5B\octalMPcharacter5E|
- \def\6B\octalMPcharacter6E|
- \def\7B\octalMPcharacter7E|
- \def\8B\octalMPcharacter8E|
- \def\9B\octalMPcharacter9EE
-\egroup
-
-%D We use the comment symbol as a sort of trigger. Beware!
-%D The whole graphic is seen as on eparagraph, which means
-%D that we cannot change the catcodes in between.
-
-\bgroup
-\catcode`\%=\@@active
-\gdef\startMPscanning{\let%=\startMPconversion}
-\egroup
-
-%D In earlier versions we used the sequence
-%D
-%D \starttyping
-%D \expandafter\handleMPsequence\input filename\relax
-%D \stoptyping
-%D
-%D Persistent problems in \LATEX\ however forced us to use a
-%D different scheme. Every \POSTSCRIPT\ file starts with a
-%D \type{%}, so we temporary make this an active character
-%D that starts the scanning and redefines itself. (The problem
-%D originates in the redefinition by \LATEX\ of the
-%D \type{\input} primitive.)
-
-\def\startMPconversion
- {\keepMPspecials
- \handleMPsequence}
-
-%D Here comes the main loop. Most arguments are numbers. This
-%D means that they can be recognized by their \type{\lccode}.
-%D This method saves a lot of processing time. We could
-%D speed up the conversion by handling the \type{path}
-%D seperately.
-
-\def\@EAEAEA{\expandafter\expandafter\expandafter} % to be sure
-
-\def\dohandleMPsequence#1%
- {\ifdone
- \ifcase\lccode`#1\relax
- \@EAEAEA\dohandleMPsequenceA
- \else
- \@EAEAEA\dohandleMPsequenceB
- \fi
- \else
- \@EA\dohandleMPsequenceC
- \fi#1}
-
-\let\dohandleMPsequenceA\setMPsequence
-
-\def\dohandleMPsequenceB#1 %
- {\edef\somestring{#1}%
- \ifx\somestring\PSmoveto
- \edef\lastMPmoveX{\gMPa1}%
- \edef\lastMPmoveY{\gMPa2}%
- \PDFcode{\!MPgMPa1 \!MPgMPa2 m}%
- \resetMPstack
- \else\ifx\somestring\PSnewpath
- \let\handleMPsequence\handleMPpath
- \else\ifx\somestring\PSgsave
- \PDFcode{q}%
- \resetMPstack
- \else\ifx\somestring\PSgrestore
- \PDFcode{Q}%
- \resetMPstack
- \else\ifx\somestring\PSdtransform % == setlinewidth
- \let\handleMPsequence\handleMPdtransform
- % after that we will encounter more tokens until setlinewidth+pop
- % or pop+setlinewidth which we catch next; we explicitly need to
- % reset the stack since [] n setdash may follow; a more clever
- % approach would be to read on till the condition is met, but it's
- % the only pop / setlinewidth we will encounter so ...
- \else\ifx\somestring\PSsetlinewidth
- % already handled in dtransform
- \resetMPstack
- \else\ifx\somestring\PSpop
- % already handled in dtransform
- \resetMPstack
- \else\ifx\somestring\PSconcat
- \cleanupMPconcat
- \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
- \resetMPstack
- \else\ifx\somestring\PSsetrgbcolor
- \handleMPrgbcolor
- \resetMPstack
- \else\ifx\somestring\PSsetcmykcolor
- \handleMPcmykcolor
- \resetMPstack
- \else\ifx\somestring\PSsetgray
- \handleMPgraycolor
- \resetMPstack
- \else\ifx\somestring\PStranslate
- \PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
- \resetMPstack
- \else\ifx\somestring\PSsetdash
- \handleMPsetdash
- \resetMPstack
- \else\ifx\somestring\PSsetlinejoin
- \PDFcode{\gMPa1 j}%
- \resetMPstack
- \else\ifx\somestring\PSsetmiterlimit
- \PDFcode{\gMPa1 M}%
- \resetMPstack
- \else\ifx\somestring\PSfshow
- \PDFcode{n}%
- \handleMPfshow
- \resetMPstack
- \else\ifx\somestring\PSsetlinecap
- \PDFcode{\gMPa1 J}%
- \resetMPstack
- \else\ifx\somestring\PSrlineto
- \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
- \resetMPstack
- \else\ifx\somestring\PSscale
- \PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
- \resetMPstack
- \else\ifx\somestring\PSspecial
- \handleMPspecialcommand
- \resetMPstack
- \else
- \handleMPgraphic% {#1}%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \handleMPsequence}
-
-\def\dohandleMPsequenceC#1 %
- {\edef\somestring{#1}%
- \handleMPgraphic % {#1}%
- \handleMPsequence}
-
-%D Since colors are not sensitive to transformations, they
-%D are sometimes used for signaling. Therefore, we handle them
-%D separately. The next macro can be redefined if needed.
-
-\def\handleMPrgbcolor
- {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg
- \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 RG}}
-
-\def\handleMPcmykcolor
- {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k
- \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 K}}
-
-\def\handleMPgraycolor
- {\PDFcode{\!MPgMPa1 g
- \!MPgMPa1 G}}
-
-\def\handleMPspotcolor
- {\PDFcode{0 g
- 0 G}}
-
-%D Beginning and ending the graphics is taken care of by the
-%D macro \type{\handleMPgraphic}, which is redefined when
-%D the first graphics operator is met.
-
-\def\handleMPendgraphic % #1%
- {\ifx\somestring\PSshowpage
- \let\handleMPsequence\finishMPgraphic
- \else
- \letMPargument\somestring % {#1}%
- \fi}
-
-\def\handleMPbegingraphic % #1%
- {\ifx\somestring\PSBoundingBox
- \def\handleMPsequence{\handleMPboundingbox1}%
- \else\ifx\somestring\PSHiResBoundingBox
- \def\handleMPsequence{\handleMPboundingbox2}%
- \else\ifx\somestring\PSExactBoundingBox
- \def\handleMPsequence{\handleMPboundingbox3}%
- \else\ifx\somestring\PSshowpage
- \let\handleMPsequence\finishMPgraphic
- \else\ifx\somestring\PSPage
- \let\handleMPsequence\handleMPpage
- \else\ifx\somestring\PSMetaPostSpecials
- \let\handleMPsequence\handleMPspecialscomment
- \else\ifx\somestring\PSMetaPostSpecial
- \let\handleMPsequence\handleMPspecialcomment
- \else
- \letMPargument\somestring % {#1}%
- \fi\fi\fi\fi\fi\fi\fi}
-
-\let\handleMPgraphic=\handleMPbegingraphic
-
-%D We check for three kind of bounding boxes: the normal one
-%D and two high precision ones:
-%D
-%D \starttyping
-%D BoundingBox: llx lly ucx ucy
-%D HiResBoundingBox: llx lly ucx ucy
-%D ExactBoundingBox: llx lly ucx ucy
-%D \stoptyping
-%D
-%D The original as well as the recalculated dimensions are
-%D saved for later use.
-
-\newif\ifskipemptyMPgraphic \skipemptyMPgraphicfalse
-
-\chardef\currentMPboundingbox=0
-
-\def\handleMPboundingbox#1#2 #3 #4 #5
- {\ifnum#1>\currentMPboundingbox
- \xdef\MPllx{#2}\xdef\MPlly{#3}%
- \xdef\MPurx{#4}\xdef\MPury{#5}%
- \dimen0=#2\onepoint
- \dimen0=-\MPxscale\dimen0
- \dimen2=#3\onepoint
- \dimen2=-\MPyscale\dimen2
- \xdef\MPxoffset{\withoutpt\the\dimen0}%
- \xdef\MPyoffset{\withoutpt\the\dimen2}%
- \dimen0=#2\onebasepoint
- \dimen0=-\dimen0
- \dimen2=#3\onebasepoint
- \dimen2=-\dimen2
- \advance\dimen0 #4\onebasepoint
- \dimen0=\MPxscale\dimen0
- \xdef\MPwidth{\the\dimen0}%
- \advance\dimen2 #5\onebasepoint
- \xdef\MPyshift{\the\dimen2}% unscaled
- \dimen2=\MPyscale\dimen2
- \xdef\MPheight{\the\dimen2}%
- \chardef\currentMPboundingbox#1\relax
- \fi
- \doresetMPstack
- \let\handleMPsequence\dohandleMPsequence
- \let\next\handleMPsequence
- \ifskipemptyMPgraphic
- \ifdim\MPheight=\zeropoint\relax\ifdim\MPwidth=\zeropoint\relax
- \def\next{\endinput\finishMPgraphic}%
- \fi\fi
- \fi
- \next}
-
-%D Unless defined otherwise, we simply ignore specialcomments.
-
-\def\handleMPspecialcomment
- {\doresetMPstack
- \let\handleMPsequence\dohandleMPsequence
- \handleMPsequence}
-
-\let\handleMPspecialscomment\handleMPspecialcomment
-
-%D We use the \type{page} comment as a signal that
-%D stackbuilding can be started.
-
-\def\handleMPpage #1 #2
- {\doresetMPstack
- \donetrue
- \let\handleMPsequence\dohandleMPsequence
- \handleMPsequence}
-
-%D The same applies to the special extensions.
-
-\def\handleMPspecialcommand
- {\doresetMPstack
- \let\handleMPsequence\dohandleMPsequence
- \handleMPsequence}
-
-%D \METAPOST\ draws its dots by moving to a location and
-%D invoking \type{0 0 rlineto}. This operator is not
-%D available in \PDF. Our solution is straightforward: we draw
-%D a line from $(current\_x, current\_y)$ to itself. This
-%D means that the arguments of the preceding \type{moveto} have
-%D to be saved.
-
-\def\lastMPmoveX{0}
-\def\lastMPmoveY{0}
-
-%D These saved coordinates are also used when we handle the
-%D texts. Text handling proved to be a bit of a nuisance, but
-%D finally I saw the light. It proved that we also had to
-%D take care of \type{(split arguments)}.
-
-\def\setMPfshowfont#1#2%
- {\font\temp=#1\space at #2\relax\temp}
-
-\let\MPfshowcommand\empty
-
-% \def\dohandleMPfshow
-% {\bgroup
-% \setbox\scratchbox\hbox
-% {\obeyMPspecials
-% \let\ \relax % mp breaks long lines and appends a \
-% \edef\size{\gMPa\nofMParguments}%
-% \ifx\size\PSnfont % round font size (to pt)
-% \advance\nofMParguments \minusone
-% \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
-% \ifdim\scratchdimen<\onepoint
-% \def\size{1pt}%
-% \else
-% \advance\scratchdimen .5\onepoint
-% \def\size##1.##2\relax{\def\size{##1pt}}%
-% \expandafter\size\the\scratchdimen\relax
-% \fi
-% \else
-% \edef\size{\size bp}%
-% \fi
-% \advance\nofMParguments \minusone
-% %\font\temp=\gMPa\nofMParguments\space at \size
-% \let\temp\relax % to be sure
-% \setMPfshowfont{\gMPa\nofMParguments}\size
-% \advance\nofMParguments \minusone
-% \temp
-% \MPfshowcommand
-% {\ifnum\nofMParguments=\plusone
-% \def\do(##1){##1}%
-% \dogMPa1%
-% \else
-% % we need to catch ( a ) (a a a) (\123 \123 \123) etc
-% \scratchcounter\plusone
-% \def\dodo##1% Andreas Fieger's bug: (\304...)
-% {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
-% \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
-% \def\do(##1{\dodo{##1}}%
-% \dogMPa\scratchcounter\MPspacechar
-% \let\do\relax
-% \loop
-% \advance\scratchcounter \plusone
-% \ifnum\scratchcounter<\nofMParguments\relax
-% \gMPa\scratchcounter\MPspacechar
-% \repeat
-% \def\do##1){\dodo{##1}}%
-% \dogMPa\scratchcounter
-% \fi
-% \unskip}}%
-% %
-% % this fails in some versions of pdftex
-% %
-% % \dimen0=\lastMPmoveY bp
-% % \advance\dimen0 by \ht0
-% % \ScaledPointsToBigPoints{\number\dimen0}\lastMPmoveY
-% % \PDFcode{n q 1 0 0 1 \lastMPmoveX\space\lastMPmoveY\space cm}%
-% % \dimen0=\ht0
-% % \advance\dimen0 by \dp0
-% % \box0
-% % \vskip-\dimen0
-% % \PDFcode{Q}%
-% % \egroup}
-% %
-% \setbox\scratchbox\hbox
-% {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint\box\scratchbox}%
-% \ht\scratchbox\zeropoint
-% \dp\scratchbox\zeropoint
-% \wd\scratchbox\zeropoint
-% \box\scratchbox
-% \egroup}
-%
-% \let\handleMPfshow\dohandleMPfshow % so we can overload this one later
-%
-% we will support plug-ins:
-
-\def\dohandleMPfshow
- {\setbox\scratchbox\hbox
- {\obeyMPspecials
- \edef\MPtextsize{\gMPa\nofMParguments}%
- \def\do(##1){##1}%
- \edef\MPtextdata{\dogMPa1}% beware, stack can have more
- \handleMPtext}%
- \setbox\scratchbox\hbox
- {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint
- \box\scratchbox}%
- %
- % this fails in some versions of pdftex
- %
- % \dimen0=\lastMPmoveY bp
- % \advance\dimen0 by \ht0
- % \ScaledPointsToBigPoints{\number\dimen0}\lastMPmoveY
- % \PDFcode{n q 1 0 0 1 \lastMPmoveX\space\lastMPmoveY\space cm}%
- % \dimen0=\ht0
- % \advance\dimen0 by \dp0
- % \box0
- % \vskip-\dimen0
- % \PDFcode{Q}%
- % \egroup}
- %
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \wd\scratchbox\zeropoint
- \box\scratchbox}
-
-\def\handleMPtext {\handleMPtextnormal} % so we can overload this one later
-\def\handleMPfshow{\dohandleMPfshow } % so we can overload this one later
-
-\def\handleMPtext
- {\ifnum\nofMParguments>\plusthree
- \handleMPtextnormal
- \else
- \convertcommand\MPtextdata\to\MPtextdata
- \expanded{\splitstring\MPtextdata}\at::::\to\MPtexttag\and\MPtextnumber
- \executeifdefined{handleMPtext\MPtexttag}\handleMPtextnormal
- \fi}
-
-% elsewhere we will implement \handleMPtextmptxt
-
-\def\handleMPtextnormal
- {\let\ \relax % mp breaks long lines and appends a \
- \ifx\MPtextsize\PSnfont % round font size (to pt)
- \advance\nofMParguments \minusone
- \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
- \ifdim\scratchdimen<\onepoint
- \def\MPtextsize{1pt}%
- \else
- \advance\scratchdimen .5\onepoint
- \def\MPtextsize##1.##2\relax{\def\MPtextsize{##1pt}}%
- \expandafter\MPtextsize\the\scratchdimen\relax
- \fi
- \else
- \edef\MPtextsize{\MPtextsize bp}%
- \fi
- \advance\nofMParguments \minusone
- \font\temp=\gMPa\nofMParguments\space at \MPtextsize
- \let\temp\relax % to be sure
- \setMPfshowfont{\gMPa\nofMParguments}\MPtextsize
- \advance\nofMParguments \minusone
- \temp
- \MPfshowcommand
- {\ifnum\nofMParguments=\plusone
- \def\do(##1){##1}%
- \dogMPa1%
- \else
- % we need to catch ( a ) (a a a) (\123 \123 \123) etc
- \scratchcounter\plusone
- \def\dodo##1% Andreas Fieger's bug: (\304...)
- {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
- \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
- \def\do(##1{\dodo{##1}}%
- \dogMPa\scratchcounter\MPspacechar
- \let\do\relax
- \loop
- \advance\scratchcounter \plusone
- \ifnum\scratchcounter<\nofMParguments\relax
- \gMPa\scratchcounter\MPspacechar
- \repeat
- \def\do##1){\dodo{##1}}%
- \dogMPa\scratchcounter
- \fi
- \unskip}}
-
-%D You could consider the following definition to be the most
-%D natural one.
-
-% \def\MPspacechar{\space} % normal case
-
-\def\MPspacechar{\char32\relax} % old solution does not work with math
-
-%D However, the following implementation is more robust, since
-%D some fonts have funny visible spaces in the space slot. This
-%D gives a mismatch between the space that \METAPOST\ took into
-%D account and the \quote {natural} space. This only happens in
-%D labels, since \type {btex}||\type {etex} thingies don't have
-%D spaces. This phenomena showed up when preparing the
-%D \METAFUN\ manual, where Palatino fonts are used. We can
-%D safely assume that \METAPOST\ considers \type {\char32} to
-%D be the space.
-
-\def\MPspacechar{\setbox\scratchbox\hbox{\char32}\kern\wd\scratchbox}
-
-%D Well, this does not work with math fonts, so:
-
-\def\MPspacechar{\char32\relax}
-
-%D Most operators are just converted and keep their
-%D arguments. Dashes however need a bit different treatment,
-%D otherwise \PDF\ viewers complain loudly. Another
-%D complication is that one argument comes after the \type{]}.
-%D When reading the data, we simply ignore the array boundary
-%D characters. We save ourselves some redundant newlines and
-%D at the same time keep the output readable by packing the
-%D literals.
-
-\def\handleMPsetdash
- {\bgroup
- \ignoreMPspecials
- \def\somestring{[}%
- \scratchcounter\plusone
- \loop
- \ifnum\scratchcounter<\nofMParguments
- \edef\somestring{\somestring\space\gMPa\scratchcounter}%
- \advance\scratchcounter \plusone
- \repeat
- \edef\somestring{\somestring]\gMPa\scratchcounter\space d}%
- \PDFcode{\somestring}%
- \egroup}
-
-%D The \type{setlinewidth} commands looks a bit complicated. There are
-%D two alternatives, that result in a similar look in both
-%D $x$- and $y$-dorection. As John Hobby says:
-%D
-%D \startnarrower \switchtobodyfont[ss]
-%D \starttyping
-%D x 0 dtransform exch truncate exch idtransform pop setlinewidth
-%D 0 y dtransform truncate idtransform setlinewidth pop
-%D \stoptyping
-%D
-%D These are just fancy versions of \type{x setlinewidth} and
-%D \type{y setlinewidth}. The \type{x 0 ...} form is used if
-%D the path is {\em primarily vertical}. It rounds the width
-%D so that vertical lines come out an integer number of pixels
-%D wide in device space. The \type{0 y ...} form does the same
-%D for paths that are {\em primarily horizontal}. The reason
-%D why I did this is Knuth insists on getting exactly the
-%D widths \TEX\ intends for the horizontal and vertical rules
-%D in \type{btex...etex} output. (Note that PostScript scan
-%D conversion rules cause a horizontal or vertical line of
-%D integer width $n$ in device space to come out $n+1$ pixels
-%D wide, regardless of the phase relative to the pixel grid.)
-%D \stopnarrower
-%D
-%D The common operator in these sequences is \type{dtransform},
-%D so we can use this one to trigger setting the linewidth.
-
-\def\handleMPdtransform
- {\ifdim\gMPa1\onepoint>\zeropoint
- \PDFcode{\gMPa1 w}%
- \def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}%
- \else
- \PDFcode{\gMPa2 w}%
- \def\next##1 ##2 ##3 ##4 {\handleMPsequence}%
- \fi
- \let\handleMPsequence\dohandleMPsequence
- \resetMPstack
- \next}
-
-%D The most complicated command is \type{concat}. \METAPOST\
-%D applies this operator to \type{stroke}. At that moment the
-%D points set by \type{curveto} and \type{moveto}, are already
-%D fixed. In \PDF\ however the \type{cm} operator affects the
-%D points as well as the pen (stroke). Like more \PDF\
-%D operators, \type{cm} is defined in a bit ambiguous way.
-%D The only save route for non||circular penshapes, is saving
-%D the path, recalculating the points and applying the
-%D transformation matrix in such a way that we can be sure
-%D that its behavior is well defined. This comes down to
-%D inverting the path and applying \type{cm} to that path as
-%D well as the pen. This all means that we have to save the
-%D path.
-
-%D In \METAPOST\ there are three ways to handle a path $p$:
-%D
-%D \starttyping
-%D draw p; fill p; filldraw p;
-%D \stoptyping
-%D
-%D The last case outputs a \type{gsave fill grestore} before
-%D \type{stroke}. Handling the path outside the main loops
-%D saves about 40\% run time.\footnote{We can save some more by
-%D following the \METAPOST\ output routine, but for the moment
-%D we keep things simple.} Switching between the main loop and
-%D the path loop is done by means of the recursely called
-%D macro \type{\handleMPsequence}.
-
-\def\handleMPpath
- {\chardef\finiMPpath0
- \let\closeMPpath\relax
- \let\flushMPpath\flushnormalMPpath
- \resetMPstack
- \nofMPsegments\plusone
- \let\handleMPsequence\dohandleMPpath
- \dohandleMPpath}
-
-%D Most paths are drawn with simple round pens. Therefore we've
-%D split up the routine in two.
-
-\def\flushnormalMPsegment
- {\ifcase\getMPkeyword\relax
- \PDFcode{\!MPgMPs1 \!MPgMPs2 l}%
- \or
- \PDFcode{\!MPgMPs1 \!MPgMPs2 \!MPgMPs3 \!MPgMPs4 \!MPgMPs5 \!MPgMPs6 c}%
- \or
- \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
- \or
- \edef\lastMPmoveX{\gMPs1}% evt \!MP here
- \edef\lastMPmoveY{\gMPs2}%
- \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space m}%
- \fi}
-
-\def\flushconcatMPsegment
- {\ifcase\getMPkeyword\relax
- \doMPconcat{\gMPs1}\a{\gMPs2}\b%
- \PDFcode{\!MP\a\space\!MP\b\space l}%
- \or
- \doMPconcat{\gMPs1}\a{\gMPs2}\b%
- \doMPconcat{\gMPs3}\c{\gMPs4}\d%
- \doMPconcat{\gMPs5}\e{\gMPs6}\f%
- \PDFcode{\!MP\a\space\!MP\b\space
- \!MP\c\space\!MP\d\space
- \!MP\e\space\!MP\f\space c}%
- \or
- \bgroup
- \noMPtranslate
- \doMPconcat\lastMPmoveX\a\lastMPmoveY\b%
- \PDFcode{\!MP\a\space\!MP\b\space l S}%
- \egroup
- \or
- \edef\lastMPmoveX{\gMPs1}%
- \edef\lastMPmoveY{\gMPs2}%
- \doMPconcat\lastMPmoveX\a\lastMPmoveY\b%
- \PDFcode{\!MP\a\space\!MP\b\space m}%
- \fi}
-
-\def\doflushsomeMPpath
- {\dodoflushsomeMPpath
- \advance\nofMPsegments \plusone
- \ifnum\nofMPsegments<\scratchcounter
- \expandafter\doflushsomeMPpath
- \fi}
-
-\def\flushsomeMPpath
- {\scratchcounter\nofMPsegments
- \nofMPsegments\plusone
- \doflushsomeMPpath}
-
-\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath}
-
-%OLD \def\flushconcatMPpath{\let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath}
-
-%NEW pre-calculate 1/D so it needn't be repeated for each control point.
-
-\def\flushconcatMPpath
- {\MPreciprocaldeterminant
- \let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath}
-
-%D The transformation of the coordinates is handled by one of
-%D the macros Tanmoy posted to the \PDFTEX\ mailing list.
-%D I rewrote and optimized the original macro to suit the other
-%D macros in this module.
-%D
-%D \starttyping
-%D \doMPconcat {x position} \xresult {y position} \yresult
-%D \stoptyping
-%D
-%D By setting the auxiliary \DIMENSIONS\ \type{\dimen0} upto
-%D \type{\dimen10} only once per path, we save over 20\% run
-%D time. Some more speed was gained by removing some parameter
-%D passing. These macros can be optimized a bit more by using
-%D more constants. There is however not much need for further
-%D optimization because penshapes usually are round and
-%D therefore need no transformation. Nevertheless we move the
-%D factor to the outer level and use a bit different \type{pt}
-%D removal macro. Although the values represent base points,
-%D we converted them to pure points, simply because those can
-%D be converted back.
-
-%OLD \mathchardef\MPconcatfactor=256 % beware don't remove spaces before it
-
-%OLD \def\doMPreducedimen#1
-%OLD {\count0\MPconcatfactor
-%OLD \advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\count0
-%OLD \divide\dimen#1 \count0\relax}
-
-%OLD % too inaccurate (see old pragma logo)
-%OLD
-%OLD \def\doMPreducedimen#1
-%OLD {\count0=\MPconcatfactor
-%OLD \divide\dimen#1 \count0\relax}
-
-%OLD \def\doMPreducedimen#1
-%OLD {\advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\MPconcatfactor
-%OLD \divide\dimen#1 \MPconcatfactor}
-
-%D The transformation code is rewritten by Daniel H. Luecking who
-%D describes his patch as follows:
-%D
-%D We would like to divide 1 by $X$, but all divisions are integer so
-%D for accuracy we want to convert to large integers and make sure the
-%D integer quotient has as many significant digits as possible. Thus we
-%D need to replace $1/X$ with $M/N$ where $N$ is as large as possible
-%D and $M/N$ is as large as possible. Also for simplicity $M$ should be
-%D a power of 2. So we make $M = 2^{30}$ \footnote{$2^{31} - 1$ is the
-%D largest legal integer. Using it (and simply ignoring the inaccuracy
-%D caused by $-1$) turns out to be at least as accurate in all cases,
-%D and more accurate in some.} (largest legal power of 2) and adjust
-%D $X$ downward (if necessary) to the the range $1-2^{16}$. This gives
-%D at least 15 significant binary digits, (almost as accurate as
-%D \METAPOST\ for numbers near 1) or almost 5 significant figures
-%D (decimal).
-
-\newcount\MPscratchCnt
-\newdimen\MPscratchDim % will be assigned global
-
-\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt
- {\MPscratchCnt\zerocount
- \doMPadjustdimen}
-
-\def\doMPadjustdimen
- {\ifdim\MPscratchDim>\onepoint
- \divide\MPscratchDim 2
- \advance\MPscratchCnt \plusone
- \expandafter\doMPadjustdimen
- \fi}
-
-%OLD \def\doMPexpanddimen#1
-%OLD {\multiply\dimen#1 \MPconcatfactor\relax}
-
-%D DHL: When viewed as an integer, $1 \hbox{pt}=2^{16}$ so $2^{32}/X$
-%D is the right way to do $(1 \hbox{pt})/(X \hbox{pt})$ and get the
-%D answer in points. But we are limited to $2^{30}/X$. However, we
-%D actually do $[ 2^{30} / (X/2^K) ]*2^{2-K}$ where $K$ is the number
-%D of halvings it takes to bring $X$ below $1 \hbox{pt}$. If $K$ is 0
-%D or 1 we readjust by multiplying by 4 or 2, otherwise by halving
-%D $(K-2)$ times \type {\MPscratchCnt} holds the value of $K$ from
-%D \type {\MPadjustdimen}.
-
-\def\MPreadjustdimen % acts on \MPscratchDim and MPscratchCnt
- {\ifcase\MPscratchCnt
- \multiply\scratchdimen 4
- \or
- \multiply\scratchdimen 2
- \else
- \expandafter\doMPreadjustdimen
- \fi}
-
-\def\doMPreadjustdimen
- {\ifnum\MPscratchCnt>2
- \divide\scratchdimen 2
- \advance\MPscratchCnt \minusone
- \expandafter\doMPreadjustdimen
- \fi}
-
-\def\MPreciprocaldeterminant
- {\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y
- \advance\scratchdimen - \withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y
- \ifdim\scratchdimen<\zeropoint % we need a positive dimension
- \scratchdimen-\scratchdimen % for \MPadjustdimen (?)
- \doMPreciprocal
- \scratchdimen-\scratchdimen
- \else
- \doMPreciprocal
- \fi
- \edef\MPreciprocal{\withoutpt\the\scratchdimen}}
-
-\newcount\MPnumerator \MPnumerator = 1073741824 % 2^{30}
-
-% todo: dimexpr
-
-\def\doMPreciprocal % replace \scratchdimen with its reciprocal
- {\ifdim\scratchdimen=\onepoint \else
- \MPadjustdimen
- \scratchcounter\MPnumerator
- \divide\scratchcounter\scratchdimen
- \scratchdimen1\scratchcounter % 1 needed !
- \MPreadjustdimen
- \fi}
-
-%OLD \def\presetMPconcat
-%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0 % r_x
-%OLD \dimen 2=\gMPs2\onepoint \doMPreducedimen 2 % s_x
-%OLD \dimen 4=\gMPs3\onepoint \doMPreducedimen 4 % s_y
-%OLD \dimen 6=\gMPs4\onepoint \doMPreducedimen 6 % r_y
-%OLD \dimen 8=\gMPs5\onepoint \doMPreducedimen 8 % t_x
-%OLD \dimen10=\gMPs6\onepoint \doMPreducedimen10 } % t_y
-%OLD
-%OLD \def\presetMPscale
-%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0
-%OLD \dimen 2 \zeropoint
-%OLD \dimen 4 \zeropoint
-%OLD \dimen 6=\gMPs2\onepoint \doMPreducedimen 6
-%OLD \dimen 8 \zeropoint
-%OLD \dimen10 \zeropoint}
-
-\def\cleanupMPconcat
- {\ignoreMPspecials
- \docleanupMPargument1%
- \docleanupMPargument6%
- \keepMPspecials}
-
-\def\presetMPconcat
- {\dimen 0=\gMPs1\onepoint % s_x
- \dimen 2=\gMPs2\onepoint % r_x
- \dimen 4=\gMPs3\onepoint % r_y
- \dimen 6=\gMPs4\onepoint % s_y
- \dimen 8=\gMPs5\onepoint % t_x
- \dimen10=\gMPs6\onepoint} % t_y
-
-\def\presetMPscale
- {\dimen 0=\gMPs1\onepoint
- \dimen 2 \zeropoint
- \dimen 4 \zeropoint
- \dimen 6=\gMPs2\onepoint
- \dimen 8 \zeropoint
- \dimen10 \zeropoint}
-
-\def\noMPtranslate % use this one grouped
- {\dimen 8 \zeropoint % t_x
- \dimen10 \zeropoint} % t_y
-
-%D \starttyping
-%D \def\doMPconcat#1#2#3#4%
-%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
-%D \dimen14=#3 pt \doMPreducedimen14 % p_y
-%D %
-%D \dimen16 \dimen 0
-%D \multiply \dimen16 \dimen 6
-%D \dimen20 \dimen 2
-%D \multiply \dimen20 \dimen 4
-%D \advance \dimen16 -\dimen20
-%D %
-%D \dimen18 \dimen12
-%D \multiply \dimen18 \dimen 6
-%D \dimen20 \dimen14
-%D \multiply \dimen20 \dimen 4
-%D \advance \dimen18 -\dimen20
-%D \dimen20 \dimen 4
-%D \multiply \dimen20 \dimen10
-%D \advance \dimen18 \dimen20
-%D \dimen20 \dimen 6
-%D \multiply \dimen20 \dimen 8
-%D \advance \dimen18 -\dimen20
-%D %
-%D \multiply \dimen12 -\dimen 2
-%D \multiply \dimen14 \dimen 0
-%D \advance \dimen12 \dimen14
-%D \dimen20 \dimen 2
-%D \multiply \dimen20 \dimen 8
-%D \advance \dimen12 \dimen20
-%D \dimen20 \dimen 0
-%D \multiply \dimen20 \dimen10
-%D \advance \dimen12 -\dimen20
-%D %
-%D \doMPreducedimen16
-%D \divide \dimen18 \dimen16 \doMPexpanddimen18
-%D \divide \dimen12 \dimen16 \doMPexpanddimen12
-%D %
-%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
-%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
-%D \stoptyping
-
-%D The following optimization resulted from some tests by
-%D and email exchanges with Sanjoy Mahajan.
-%D
-%D \starttyping
-%D \def\doMPconcat#1#2#3#4%
-%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
-%D \dimen14=#3 pt \doMPreducedimen14 % p_y
-%D %
-%D \dimen16 \dimen 0
-%D \multiply \dimen16 \dimen 6
-%D \dimen20 \dimen 2
-%D \multiply \dimen20 \dimen 4
-%D \advance \dimen16 -\dimen20
-%D %
-%D \dimen18 \dimen12
-%D \multiply \dimen18 \dimen 6
-%D \dimen20 \dimen14
-%D \multiply \dimen20 \dimen 4
-%D \advance \dimen18 -\dimen20
-%D \dimen20 \dimen 4
-%D \multiply \dimen20 \dimen10
-%D \advance \dimen18 \dimen20
-%D \dimen20 \dimen 6
-%D \multiply \dimen20 \dimen 8
-%D \advance \dimen18 -\dimen20
-%D %
-%D \multiply \dimen12 -\dimen 2
-%D \multiply \dimen14 \dimen 0
-%D \advance \dimen12 \dimen14
-%D \dimen20 \dimen 2
-%D \multiply \dimen20 \dimen 8
-%D \advance \dimen12 \dimen20
-%D \dimen20 \dimen 0
-%D \multiply \dimen20 \dimen10
-%D \advance \dimen12 -\dimen20
-%D %
-%D %\ifdim\dimen16>1pt % oeps, can be < 1pt too
-%D \ifdim\dimen16=1pt \else
-%D \ifdim\dimen16>\MPconcatfactor pt
-%D \doMPreducedimen16
-%D \divide \dimen18 \dimen16 \doMPexpanddimen18
-%D \divide \dimen12 \dimen16 \doMPexpanddimen12
-%D \else
-%D \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18
-%D \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12
-%D \fi
-%D \fi
-%D %
-%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
-%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
-%D \stoptyping
-%D
-%D But, this one is still too inaccurate, so we now have:
-
-%D We cannot use \type {\beginETEX} here since in plain we
-%D get \type {\outer} problems, sigh.
-
-%OLD \beginTEX
-%OLD
-%OLD \def\MPcriteriumA {512pt} % scale
-%OLD \def\MPcriteriumB {2pt} % scale
-%OLD
-%OLD \endTEX
-%OLD
-%OLD \ifx\MPcriteriumA\undefined
-%OLD
-%OLD \newdimen\MPcriteriumA \MPcriteriumA=512pt
-%OLD \newdimen\MPcriteriumB \MPcriteriumB= 2pt
-%OLD
-%OLD \fi
-
-%OLD \def\doMPconcat#1#2#3#4%
-%OLD {\dimen12=#1pt % p_x
-%OLD \dimen14=#3pt % p_y
-%OLD %
-%OLD \chardef\MPfactor\zerocount
-%OLD \ifdim\dimen4<\MPcriteriumB\ifdim\dimen4>-\MPcriteriumB
-%OLD \ifdim\dimen6<\MPcriteriumB\ifdim\dimen6>-\MPcriteriumB
-%OLD \ifdim\dimen8<\MPcriteriumB\ifdim\dimen8>-\MPcriteriumB
-%OLD \ifdim\dimen10<\MPcriteriumB\ifdim\dimen10>-\MPcriteriumB
-%OLD \chardef\MPfactor\plusone
-%OLD \fi\fi
-%OLD \fi\fi
-%OLD \fi\fi
-%OLD \fi\fi
-%OLD \ifcase\MPfactor % spurious 0 removed
-%OLD \chardef\MPfactor\plusone
-%OLD \ifdim\dimen12<\MPcriteriumA\ifdim\dimen12>-\MPcriteriumA
-%OLD \ifdim\dimen14<\MPcriteriumA\ifdim\dimen14>-\MPcriteriumA
-%OLD \chardef\MPfactor16
-%OLD \fi\fi
-%OLD \fi\fi
-%OLD \fi
-%OLD %
-%OLD \multiply\dimen12 \MPfactor
-%OLD \multiply\dimen14 \MPfactor
-%OLD %
-%OLD \doMPreducedimen12
-%OLD \doMPreducedimen14
-%OLD %
-%OLD \dimen16 \dimen 0
-%OLD \multiply \dimen16 \dimen 6
-%OLD \dimen20 \dimen 2
-%OLD \multiply \dimen20 \dimen 4
-%OLD \advance \dimen16 -\dimen20
-%OLD %
-%OLD \dimen18 \dimen12
-%OLD \multiply \dimen18 \dimen 6
-%OLD \dimen20 \dimen14
-%OLD \multiply \dimen20 \dimen 4
-%OLD \advance \dimen18 -\dimen20
-%OLD \dimen20 \dimen 4
-%OLD \multiply \dimen20 \dimen10
-%OLD \advance \dimen18 \dimen20
-%OLD \dimen20 \dimen 6
-%OLD \multiply \dimen20 \dimen 8
-%OLD \advance \dimen18 -\dimen20
-%OLD %
-%OLD \multiply \dimen12 -\dimen 2
-%OLD \multiply \dimen14 \dimen 0
-%OLD \advance \dimen12 \dimen14
-%OLD \dimen20 \dimen 2
-%OLD \multiply \dimen20 \dimen 8
-%OLD \advance \dimen12 \dimen20
-%OLD \dimen20 \dimen 0
-%OLD \multiply \dimen20 \dimen10
-%OLD \advance \dimen12 -\dimen20
-%OLD %
-%OLD \ifdim\dimen16=\onepoint \else
-%OLD \ifdim\dimen16>\MPconcatfactor \onepoint \relax
-%OLD \doMPreducedimen16
-%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18
-%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12
-%OLD \else
-%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18
-%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12
-%OLD \fi
-%OLD \fi
-%OLD %
-%OLD \divide\dimen18 \MPfactor
-%OLD \divide\dimen12 \MPfactor
-%OLD %
-%OLD \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
-%OLD \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
-
-%D DHL: Ideally, $r_x$, $r_y$, $s_x$, $s_y$ should be in macros, not
-%D dimensions (they are scalar quantities after all, not lengths). I
-%D suppose the authors decided to do calculations with integer
-%D arithmetic instead of using real factors because it's faster.
-%D However, the actual macros test slower, possibly because I've
-%D omitted three nested loops. In my test files, my approach is more
-%D accurate. It is also far simpler and overflow does not seem to be a
-%D significant concern. The scale factors written by Metapost are (?)
-%D always $<=1$ (it scales coordinates internally) and coordinates are
-%D always likely to be less than \type {\maxdimen}.
-%D
-%D If this should ever cause problems, the scale factors can be reduced.
-
-\def\doMPconcat#1#2#3#4%
- {\dimen12=#1pt % p_x % #1\onepoint
- \dimen14=#3pt % p_y % #3\onepoint
- \advance\dimen12 -\dimen8 % p_x - t_x
- \advance\dimen14 -\dimen10 % p_y - t_y
- \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
- \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y)
- \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y)
- \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x)
- % \MPreciprocal contains precomputed 1/D:
- \dimen18=\MPreciprocal\dimen18
- \dimen14=\MPreciprocal\dimen14
- \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
- \edef#4{\withoutpt\the\dimen14}} % p_y^\prime
-
-% faster but not that often used
-%
-% \def\doMPconcat#1#2#3#4%
-% {\dimen12\dimexpr#1\points-\dimen 8\relax % p_x-t_x
-% \dimen14\dimexpr#3\points-\dimen10\relax % p_y-t_y
-% \dimen18\dimexpr\withoutpt\the\dimen6\dimen12-\withoutpt\the\dimen4\dimen14\relax % s_y(p_x-t_x)-r_y(p_y-t_y)
-% \dimen14\dimexpr\withoutpt\the\dimen0\dimen14-\withoutpt\the\dimen2\dimen12\relax % s_x(p_y-t_y)-r_x(p_x-t_x)
-% \edef#2{\withoutpt\the\dimexpr\MPreciprocal\dimen18\relax}% % p_x^\prime
-% \edef#4{\withoutpt\the\dimexpr\MPreciprocal\dimen14\relax}} % p_y^\prime
-
-%D One reason for Daniel to write this patch was that at small sizes
-%D the accuracy was less than optimal. Here is a test that demonstrates
-%D that his alternative is pretty good:
-%D
-%D \startlinecorrection
-%D \startMPcode
-%D for i = 5cm,1cm,5mm,1mm,.5mm,.1mm,.01mm :
-%D draw fullcircle scaled i withpen pencircle xscaled (i/10) yscaled (i/20) rotated 45 ;
-%D endfor ;
-%D \stopMPcode
-%D \stoplinecorrection
-
-%D The following explanation of the conversion process was
-%D posted to the \PDFTEX\ mailing list by Tanmoy. The original
-%D macro was part of a set of macro's that included sinus and
-%D cosinus calculations as well as scaling and translating. The
-%D \METAPOST\ to \PDF\ conversion however only needs
-%D transformation.
-
-%M \start \switchtobodyfont [ss]
-
-%D Given a point $(U_x, U_y)$ in user coordinates, the business
-%D of \POSTSCRIPT\ is to convert it to device space. Let us say
-%D that the device space coordinates are $(D_x, D_y)$. Then, in
-%D \POSTSCRIPT\ $(D_x, D_y)$ can be written in terms of
-%D $(U_x, U_y)$ in matrix notation, either as
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{D_x&D_y&1\cr} = \pmatrix{U_x&U_y&1\cr}
-%D \pmatrix{s_x&r_x&0\cr
-%D r_y&s_y&0\cr
-%D t_x&t_y&1\cr}
-%D \stopformula
-%D
-%D or
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x&r_y&t_x\cr
-%D r_x&s_y&t_y\cr
-%D 0 &0 &1 \cr}
-%D \pmatrix{U_x\cr
-%D U_y\cr
-%D 1 \cr}
-%D \stopformula
-%D
-%D both of which is a shorthand for the same set of equations:
-%D
-%D \placeformula
-%D \startformula
-%D D_x = s_x U_x + r_y U_y + t_x
-%D \stopformula
-%D
-%D \placeformula
-%D \startformula
-%D D_y = r_x U_x + s_y U_y + t_y
-%D \stopformula
-%D
-%D which define what is called an `affine transformation'.
-%D
-%D \POSTSCRIPT\ represents the `transformation matrix' as a
-%D six element matrix instead of a $3\times 3$ array because
-%D three of the elements are always~0, 0 and~1. Thus the above
-%D transformation is written in postscript as $[s_x\, r_x\,
-%D r_y\, s_y\, t_x\, t_y]$. However, when doing any
-%D calculations, it is useful to go back to the original
-%D matrix notation (whichever: I will use the second) and
-%D continue from there.
-%D
-%D As an example, if the current transformation matrix is
-%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ and you say \typ{[a b
-%D c d e f] concat}, this means:
-%D
-%D \startnarrower
-%D Take the user space coordinates and transform them to an
-%D intermediate set of coordinates using array $[a\, b\, c\, d\,
-%D e\, f]$ as the transformation matrix.
-%D
-%D Take the intermediate set of coordinates and change them to
-%D device coordinates using array $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$
-%D as the transformation matrix.
-%D \stopnarrower
-%D
-%D Well, what is the net effect? In matrix notation, it is
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{I_x\cr I_y\cr 1\cr} = \pmatrix{a&c&e\cr
-%D b&d&f\cr
-%D 0&0&1\cr}
-%D \pmatrix{U_x\cr
-%D U_y\cr
-%D 1 \cr}
-%D \stopformula
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{D_y\cr D_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr
-%D r_x&s_y&t_y\cr
-%D 0 &0 &1 \cr}
-%D \pmatrix{I_x\cr
-%D I_y\cr
-%D 1 \cr}
-%D \stopformula
-%D
-%D where $(I_x, I_y)$ is the intermediate coordinate.
-%D
-%D Now, the beauty of the matrix notation is that when there is
-%D a chain of such matrix equations, one can always compose
-%D them into one matrix equation using the standard matrix
-%D composition law. The composite matrix from two matrices can
-%D be derived very easily: the element in the $i$\high{th}
-%D horizontal row and $j$\high{th} vertical column is
-%D calculated by`multiplying' the $i$\high{th} row of the first
-%D matrix and the $j$\high{th} column of the second matrix (and
-%D summing over the elements). Thus, in the above:
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr
-%D r_x^\prime&s_y^\prime&t_y^\prime\cr
-%D 0 &0 &0 \cr}
-%D \pmatrix{U_x\cr
-%D U_y\cr
-%D 1 \cr}
-%D \stopformula
-%D
-%D with
-%D
-%D \placeformula
-%D \startformula
-%D \eqalign
-%D {s_x^\prime & = s_x a + r_y b \cr
-%D r_x^\prime & = r_x a + s_y b \cr
-%D r_y^\prime & = s_x c + r_y d \cr
-%D s_y^\prime & = r_x c + s_y d \cr
-%D t_x^\prime & = s_x e + r_y f + t_x \cr
-%D t_y^\prime & = r_x e + s_y f + t_y \cr}
-%D \stopformula
-
-%D In fact, the same rule is true not only when one is going
-%D from user coordinates to device coordinates, but whenever
-%D one is composing two `transformations' together
-%D (transformations are `associative'). Note that the formula
-%D is not symmetric: you have to keep track of which
-%D transformation existed before (i.e.\ the equivalent of
-%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$) and which was
-%D specified later (i.e.\ the equivalent of $[a\, b\, c\, d\,
-%D e\, f]$). Note also that the language can be rather
-%D confusing: the one specified later `acts earlier',
-%D converting the user space coordinates to intermediate
-%D coordinates, which are then acted upon by the pre||existing
-%D transformation. The important point is that order of
-%D transformation matrices cannot be flipped (transformations
-%D are not `commutative').
-%D
-%D Now what does it mean to move a transformation matrix
-%D before a drawing? What it means is that given a point
-%D $(P_x, P_y)$ we need a different set of coordinates
-%D $(P_x^\prime, P_y^\prime)$ such that if the transformation
-%D acts on $(P_x^\prime, P_y^\prime)$, they produce $(P_x,
-%D P_y)$. That is we need to solve the set of equations:
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{P_x\cr P_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr
-%D r_x&s_y&t_y\cr
-%D 0 &0 &1 \cr}
-%D \pmatrix{P_x^\prime\cr
-%D P_y^\prime\cr
-%D 1 \cr}
-%D \stopformula
-%D
-%D Again matrix notation comes in handy (i.e. someone has
-%D already solved the problem for us): we need the inverse
-%D transformation matrix. The inverse transformation matrix can
-%D be calculated very easily:
-%D
-%D \placeformula
-%D \startformula
-%D \pmatrix{P_x^\prime\cr P_y^\prime\cr 1\cr} =
-%D \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr
-%D r_x^\prime&s_y^\prime&t_y^\prime\cr
-%D 0 &0 &1 \cr}
-%D \pmatrix{P_x\cr
-%D P_y\cr
-%D 1 \cr}
-%D \stopformula
-%D
-%D where, the inverse transformation matrix is given by
-%D
-%D \placeformula
-%D \startformula
-%D \eqalign
-%D {D & = s_x s_y - r_x r_y \cr
-%D s_x^\prime & = s_y / D \cr
-%D s_y^\prime & = s_x / D \cr
-%D r_x^\prime & = - r_x / D \cr
-%D r_y^\prime & = - r_y / D \cr
-%D t_x^\prime & = ( - s_y t_x + r_y t_y ) / D \cr
-%D t_y^\prime & = ( r_x t_x - s_x t_y ) / D \cr}
-%D \stopformula
-%D
-%D And you can see that when expanded out, this does
-%D give the formulas:
-%D
-%D \placeformula
-%D \startformula
-%D P_x^\prime = { { s_y(p_x-t_x) + r_y(t_y-p_y) } \over
-%D { s_x s_y-r_x r_y } }
-%D \stopformula
-%D
-%D \placeformula
-%D \startformula
-%D P_y^\prime = { { s_x(p_y-t_y) + r_x(t_x-p_x) } \over
-%D { s_x*s_y-r_x*r_y } }
-%D \stopformula
-%D
-%D The code works by representing a real number by converting
-%D it to a dimension to be put into a \DIMENSION\ register: 2.3 would
-%D be represented as 2.3pt for example. In this scheme,
-%D multiplying two numbers involves multiplying the \DIMENSION\
-%D registers and dividing by 65536. Accuracy demands that the
-%D division be done as late as possible, but overflow
-%D considerations need early division.
-%D
-%D Division involves dividing the two \DIMENSION\ registers and
-%D multiplying the result by 65536. Again, accuracy would
-%D demand that the numerator be multiplied (and|/|or the
-%D denominator divided) early: but that can lead to overflow
-%D which needs to be avoided.
-%D
-%D If nothing is known about the numbers to start with (in
-%D concat), I have chosen to divide the 65536 as a 256 in each
-%D operand. However, in the series calculating the sine and
-%D cosine, I know that the terms are small (because I never
-%D have an angle greater than 45 degrees), so I chose to
-%D apportion the factor in a different way.
-
-%M \stop
-
-%D The path is output using the values saved on the stack. If
-%D needed, all coordinates are recalculated.
-
-\def\finishMPpath
- {\PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\fi}}
-
-\def\processMPpath
- {\checkMPpath
- \ifcase\nofMPsegments\else
- \flushMPpath
- \closeMPpath
- \finishMPpath
- \fi
- \let\handleMPsequence\dohandleMPsequence
- \resetMPstack
- \nofMPsegments\zerocount
- \handleMPsequence}
-
-%D The following \METAPOST\ code is quite valid but, when
-%D processed and converted to \PDF, will make a file
-%D unprintable on a Hewlett Packard printer (from Acrobat
-%D $v<=5$). Who is to blame, the driver of the OS layer in
-%D between, is hard to determine, so we add an additional
-%D check.
-%D
-%D \starttyping
-%D clip currentpicture to origin -- cycle ;
-%D setbounds currentpicture to fullsquare scaled 5cm ;
-%D \stoptyping
-
-\def\checkMPpath
- {\ifcase\finiMPpath
- \ifnum\nofMPsegments<3 % n is one ahead
- \message{omitting zero clip path}%
- \nofMPsegments\zerocount
- \fi
- \fi}
-
-%D In \PDF\ the \type{cm} operator must precede the path
-%D specification. We therefore can output the \type{cm} at
-%D the moment we encounter it.
-
-\def\handleMPpathconcat
- {\presetMPconcat
- \PDFcode{\gMPs1 \gMPs2 \gMPs3 \gMPs4 \gMPs5 \gMPs6 cm}%
- \resetMPstack}
-
-\def\handleMPpathscale
- {\presetMPscale
- \PDFcode{\gMPs1 0 0 \gMPs2 0 0 cm}%
- \resetMPstack}
-
-%D This macro interprets the path and saves it as compact as
-%D possible.
-
-\def\dohandleMPpath#1%
- {\ifcase\lccode`#1\relax
- \@EA\dohandleMPpathA
- \else
- \@EA\dohandleMPpathB
- \fi#1}
-
-\let\dohandleMPpathA\setMPsequence
-
-\def\dohandleMPpathB#1 %
- {\def\somestring{#1}%
- \ifx\somestring\PSlineto
- \setMPkeyword0
- \else\ifx\somestring\PScurveto
- \setMPkeyword1
- \else\ifx\somestring\PSrlineto
- \setMPkeyword2
- \else\ifx\somestring\PSmoveto
- \setMPkeyword3
- \else\ifx\somestring\PSclip
- % \chardef\finiMPpath0 % already
- \let\handleMPsequence\processMPpath
- \else\ifx\somestring\PSgsave
- \chardef\finiMPpath3
- \else\ifx\somestring\PSgrestore
- \else\ifx\somestring\PSfill
- \ifcase\finiMPpath
- \chardef\finiMPpath2
- \let\handleMPsequence\processMPpath
- \fi
- \else\ifx\somestring\PSstroke
- \ifcase\finiMPpath
- \chardef\finiMPpath1
- \fi
- \let\handleMPsequence\processMPpath
- \else\ifx\somestring\PSclosepath
- \def\closeMPpath{\PDFcode{h}}%
- \else\ifx\somestring\PSconcat
- \cleanupMPconcat
- \let\flushMPpath\flushconcatMPpath
- \handleMPpathconcat
- \else\ifx\somestring\PSscale
- \let\flushMPpath\flushconcatMPpath
- \handleMPpathscale
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \handleMPsequence}
+%D conversion. The traditional method is in the MkII file.
%D The main conversion command is:
%D
@@ -1815,147 +147,46 @@
%D The last object number used is avaliable in the macro
%D \type {\lastPDFMPobject}.
-\ifx\makeMPintoPDFobject\undefined \chardef\makeMPintoPDFobject=0 \fi
+\ifx\makeMPintoPDFobject \undefined \chardef\makeMPintoPDFobject \zerocount \fi
+\ifx\blackoutMPgraphic \undefined \chardef\blackoutMPgraphic \plusone \fi
+\ifx\everyMPtoPDFconversion\undefined \newtoks\everyMPtoPDFconversion \fi
-\def\lastPDFMPobject{0}
+\let\lastPDFMPobject \!!zerocount
+\let\currentPDFresources\empty
+\let\setMPextensions \relax
-%D The additional code needed can be made available in the
-%D (global) macro \type {\currentPDFresources}.
+\def\PDFMPformoffset
+ {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
-\let\currentPDFresources\empty
+\def\resetMPvariables#1#2#3%
+ {\global\let\MPwidth \!!zeropoint
+ \global\let\MPheight\!!zeropoint
+ \global\let\MPllx \!!zerocount
+ \global\let\MPlly \!!zerocount
+ \global\let\MPurx \!!zerocount
+ \global\let\MPury \!!zerocount
+ \xdef\MPxscale {#2}\ifx\MPxscale\empty\let\MPxscale\!!plusone\fi
+ \xdef\MPyscale {#3}\ifx\MPyscale\empty\let\MPyscale\!!plusone\fi
+ \xdef\MPfilename {#1}}
-\newtoks\everyMPtoPDFconversion
+%D The main macro:
-\def\convertMPtoPDF % #1#2#3%
- {\bgroup
- \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
- \setbox\scratchbox\vbox\bgroup
- \xdef\MPheight{\zeropoint}%
- \xdef\MPwidth {\zeropoint}%
- \forgetall
- \offinterlineskip
- \startMPresources
- \doprocessMPtoPDFfile} %
-
-%D The next one is kind of private and probably will become obsolete):
-
-\def\processMPtoPDFfile % file xscale yscale
- {\bgroup
- \let\finishMPgraphic\egroup
- \doprocessMPtoPDFfile}
-
-\let\setMPextensions\relax
-
-\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
- {% the following line is needed for latex where onepoint is not
- % onepoint but a number (maxdimen); some day i'll make a latex
- % variant of this file so that i no longer have to deal with such
- % issues; then i'll also speed up this module using a few context
- % tricks
- %
- \let\onepoint\onerealpoint
- %
- \setMPspecials
- \setMPextensions
- \the\everyMPtoPDFconversion
- \catcode`\^^M=\@@endofline
- \startMPscanning
- \let\do\empty
- \xdef\MPxscale{#2}%
- \xdef\MPyscale{#3}%
- \xdef\MPxoffset{0}%
- \xdef\MPyoffset{0}%
- \xdef\MPyshift{\zeropoint}%
- \donefalse
- \let\handleMPsequence\dohandleMPsequence
- \message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway
- \input#1\relax}
-
-% strange rounding/clip in pdftex/viewer
-%
-% \def\finishMPgraphic
-% {\stopMPresources
-% \egroup
-% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
-% \chardef\makeMPintoPDFobject=0
-% \fi\fi
-% \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
-% \chardef\makeMPintoPDFobject=1
-% \fi\fi
-% \setbox\scratchbox=\vbox
-% {\forgetall
-% \hbox
-% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
-% \lower\MPyshift\box\scratchbox % unscaled shift
-% \PDFcode{Q}}}%
-% \ht\scratchbox\MPheight
-% \wd\scratchbox\MPwidth
-% \dp\scratchbox\zeropoint
-% \ifcase\makeMPintoPDFobject
-% \box\scratchbox
-% \or
-% \immediate\pdfxform resources{\currentPDFresources}\scratchbox
-% \xdef\lastPDFMPobject{\the\pdflastxform}%
-% \pdfrefxform\lastPDFMPobject
-% \global\let\currentPDFresources\empty
-% \else
-% \box\scratchbox
-% \fi
-% \egroup}
-%
-% funny clip in viewer
-%
-% \setbox\scratchbox=\vbox
-% {\forgetall
-% \dimen0=\MPllx bp
-% \dimen2=\MPlly bp
-% \setbox\scratchbox=\hbox{\hskip-\dimen0\raise-\dimen2\box\scratchbox}%
-% \ht\scratchbox=\zeropoint
-% \dp\scratchbox=\zeropoint
-% \wd\scratchbox=\zeropoint
-% \hbox
-% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space 0 0 cm}%
-% \lower\MPshift\box\scratchbox
-% \PDFcode{Q}}}%
-
-% \let\PDFMPformoffset\zeropoint
+\def\convertMPtoPDF#1#2#3%
+ {\resetMPvariables{#1}{#2}{#3}%
+ \mkconvertMPtoPDF}
-\def\PDFMPformoffset
- {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
+\def\processMPtoPDFfile#1#2#3% obsolete
+ {\resetMPvariables{#1}{#2}{#3}%
+ \mkprocessMPtoPDFfile}
-\chardef\blackoutMPgraphic\plusone % in supp-pdf it's \zerocount
+%D A common hook.
-\def\finishMPgraphic
- {\stopMPresources
- \egroup
- \setbox\scratchbox\vbox
- {\forgetall
- \hbox
- {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
- \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi
- \lower\MPyshift\box\scratchbox % unscaled shift
- \PDFcode{Q}}}%
- \ht\scratchbox\MPheight
- \wd\scratchbox\MPwidth
- \dp\scratchbox\zeropoint\relax
- \dopackageMPgraphic\scratchbox
- \egroup
- \endinput}
+\let\MPfshowcommand\empty
-%D Alternative for \PDFTEX. We cannot come up with something more contexy
-%D because this module is also used in \LATEX.
+%D Objects.
\def\dopackageMPgraphic#1% #1 = boxregister
- {%\ifx\pdfxform\undefined
- % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
- %\else\ifx\pdftexversion\undefined
- % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
- %\else\ifnum\pdftexversion<14
- % \chardef\makeMPintoPDFobject\zerocount % no resource support
- %\else
- % % keep the default value
- %\fi\fi\fi
- \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
+ {\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
% an existing value of 2 signals object support (set elsewhere)
\chardef\makeMPintoPDFobject\plusone
\fi\fi
@@ -1998,8 +229,6 @@
%D {deleteMPgraphic,
%D startMPresources,
%D stopMPresources}
-%D
-%D Here are a few hooks for \CONTEXT\ specific things.
\ifx\deleteMPgraphic\undefined
\def\deleteMPgraphic#1{}
@@ -2010,77 +239,6 @@
\let\stopMPresources\relax
\fi
-%D \macros
-%D {twodigitMPoutput}
-%D
-%D We can limit the precision to two digits after the comma
-%D by saying:
-%D
-%D \starttyping
-%D \twodigitMPoutput
-%D \stoptyping
-%D
-%D This option only works in \CONTEXT\ combined with \ETEX.
-
-\def\twodigitMPoutput
- {\let\!MP \twodigitrounding
- \def\!MPgMPs##1{\twodigitrounding{\gMPs##1}}%
- \def\!MPgMPa##1{\twodigitrounding{\gMPa##1}}}
-
-\let\!MP \empty
-\let\!MPgMPa\gMPa
-\let\!MPgMPs\gMPs
-
-%D This kind of conversion is possible because \METAPOST\
-%D does all the calculations. Converting other \POSTSCRIPT\
-%D files would drive both me and \TEX\ crazy.
-
-\ifx\undefined\StopLatexHack \else \StopLatexHack \fi
-
-\protect % \endinput
-
-%D \module
-%D [ file=supp-mpe,
-%D version=1999.07.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=METAPOST Special Extensions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% fuzzy and complicating is the fact that we need to support
-% context as well as mptopdf, so we cannot fall back on the
-% special drivers and color module (although there may be
-% good reasons to use a smaller context instead); also,
-% shading is handled here while it should move to the special
-% driver - to do!
-
-%D This module is still experimental and deals with some
-%D extensions to \METAPOST. When using \POSTSCRIPT\ output,
-%D these extensions can be supplied by means of proper
-%D preamble definitions, but when producing \PDF\ we have to
-%D set up the appropriate datastructures ourselves. It acts as
-%D a plug in into \type {supp-pdf}. As soon as we need more
-%D extensions, we will generalize these macro. Some
-%D definitions will move to the special drivers.
-
-%D For usage in plain \TEX, say something:
-%D
-%D \starttyping
-%D \input supp-pdf
-%D \input supp-mpe
-%D
-%D \MPcmykcolorstrue
-%D \MPspotcolorstrue
-%D \chardef\makeMPintoPDFobject\plusone
-%D \stoptyping
-
-\writestatus{loading}{MetaPost Special Extensions}
-
%D We implement extensions by using the \METAPOST\ special
%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones
%D are flushed before or after the graphic data, but thereby
@@ -2124,107 +282,8 @@
%D from to n inner_r g b x y outer_r g b x y
%D from to n inner_r g b x y radius outer_r g b x y radius
%D \stoptyping
-%D
-%D The implementation below saves the data on the stack in
-%D a way similar to the macros in \type {supp-pdf.tex}, and
-%D just overload a few already defined handlers. That way,
-%D the existing macros are still generic. \footnote {Actually,
-%D the macros here are just as generic.}
-%D
-%D Currently the only extension concerns shading, which is
-%D accomplished by handling yet another value of \type
-%D {\finiMPpath}. The recource disctionary is stored and
-%D later picked up by the general \CONTEXT\ figure inclusion
-%D macros.
-
-\unprotect
-
-%D The \type {%%MetaPostSpecials: version.revision signal} line
-%D triggers this module into handling color specifications kind
-%D of special. We need this safeguard for non||special
-%D usage.
-
-\chardef\MPspecialversion = 0 % specials when >1
-\chardef\MPspecialrevision = 0 % specials when >1
-\chardef\MPspecialsignal = 0 % passed on by graphic
-
-\chardef\inlineMPspecials = 1 % only needed for stack resetting
-
-%D This macro handles the special definitions that are
-%D passed as comment.
-
-\def\dohandleMPspecialcomment#1
- {\setMPargument{#1}%
- \advance\scratchcounter \minusone
- \ifcase\scratchcounter
- \handleMPspecialcommand
- \donetrue
- \doresetMPstack
- \let\handleMPsequence\dohandleMPsequence
- \expandafter\handleMPsequence
- \else
- \expandafter\dohandleMPspecialcomment
- \fi}
-
-\def\handleMPspecialcomment #1 % number of arguments
- {\doresetMPstack
- \scratchcounter#1\relax
- \ifcase\scratchcounter % when zero, inline shading is used
- \chardef\inlineMPspecials\plusone
- \let\handleMPsequence\dohandleMPsequence
- \expandafter\handleMPsequence
- \else
- \chardef\inlineMPspecials\zerocount
- \expandafter\dohandleMPspecialcomment
- \fi}
-
-%D When defined inline, we use another macro to handle the
-%D definitions. Actually, this macro is called by the
-%D previous ones.
-
-\def\handleMPspecialcommand
- {\ifcase\inlineMPspecials\or
- \advance\nofMParguments \minusone % pop the size
- \fi
- \ifundefined\MPspecial
- \message{[unknown \MPspecial]}%
- \else
- \csname\MPspecial\endcsname
- \fi
- \ifcase\inlineMPspecials
- \doresetMPstack % 0
- \else
- \resetMPstack % 1
- \fi}
-
-%D This macro triggers special support. Currently, the
-%D version and revision number are not used. Any version number
-%D greater than zero will enable special support.
-
-\newconditional\manyMPspecials % \settrue\manyMPspecials
-
-\def\handleMPspecialscomment #1.#2 #3 % version.revision signal #4=div=1000|10000
- {\doresetMPstack
- \chardef\MPspecialversion #1%
- \chardef\MPspecialrevision#2%
- \chardef\MPspecialsignal #3%
- \let\handleMPsequence\dohandleMPsequence
- \ifnum#1=\plusone
- \expandafter\handleMPsequence
- \else
- \expandafter\handleMPspecialscommentx
- \fi}
-
-\def\handleMPspecialscommentx #1 % version 2
-% {\doifelsedoifelse{#1}{10000}{\settrue\manyMPspecials}{\setfalse\manyMPspecials}% local
- {\ifnum10000=0#1\relax\settrue\manyMPspecials\else\setfalse\manyMPspecials\fi
- \handleMPsequence}
-% one can say (in meta-ini):
-%
-% \prependtoks
-% _special_div_ := 1000\ifconditional\manyMPspecials0\fi ;
-% \to \MPextensions
+\newconditional\manyMPspecials \settrue\manyMPspecials
%D In case of \PDF, we need to prepare resourcs.
@@ -2232,15 +291,25 @@
\newtoks\MPstopresources
\def\startMPresources
- {\the\MPstartresources
- \ifx\currentPDFresources\empty\else
- \message{[unused resources]}%
- \fi
- \global\let\currentPDFresources\empty}
+ {\the\MPstartresources}
\def\stopMPresources
- {\let\currentPDFresources\empty
- \the\MPstopresources}
+ {\the\MPstopresources}
+
+%D Some day we may consider collecting local resources.
+
+\appendtoks
+ \global\let\currentPDFresources\empty % kind of redundant
+\to \MPstartresources
+
+% \appendtoks
+% \collectPDFresources
+% \global\let\currentPDFresources\collectedPDFresources
+% \to \MPstopresources
+
+\appendtoksonce
+ \the\everyPDFxform
+\to \MPstopresources
%D Since colors are not subjected to transformations, we can
%D only use colors as signal. In our case, we use a dummy colored
@@ -2251,224 +320,139 @@
\newif\ifMPcmykcolors
\newif\ifMPspotcolors
-\ifx\normalhandleMPrgbcolor\undefined % in case we reload this module
-
- \let\normalhandleMPrgbcolor \handleMPrgbcolor
- \let\normalhandleMPcmykcolor\handleMPcmykcolor
- \let\normalhandleMPgraycolor\handleMPgraycolor
- \let\normalhandleMPspotcolor\handleMPspotcolor
-
-\fi
-
-%D When we are using \CONTEXT, we will fall back to the
-%D better color conversion routines. This also has the advantage
-%D that we don't have to parse and convert the file. In this
-%D alternative, \type {\!MP} is not (yet) supported. Because
-%D we can (for efficiency reasons) turn off strokecolor,
-%D something we cannot do in \METAPOST\ converted code.
-
-\newif\ifPDFMPstrokecolor \PDFMPstrokecolortrue
-
-%D [This code should move to meta-ini.]
-
-\ifCONTEXT % we can use this for a better xgstate handling
-
- \def\checkPDFMPstrokecolor
- {\ifPDFMPstrokecolor \PDFstrokecolortrue \fi}
+\def\dohandleMPrgb #1#2#3{\revokeMPtransparencyspecial\execcolorR #1:#2:#3:0:0\od}
+\def\dohandleMPcmyk#1#2#3#4{\revokeMPtransparencyspecial\execcolorC#1:#2:#3:#4:0:0\od}
+\def\dohandleMPgray #1{\revokeMPtransparencyspecial\execcolorS #1:0:0\od}
+\def\dohandleMPspot#1#2#3#4{\revokeMPtransparencyspecial\execcolorP#1:#2:#3:#4:0:0\od}
- \def\normalhandleMPrgbcolor
- {{\checkPDFMPstrokecolor\execcolorR\gMPa1:\gMPa2:\gMPa3:0:0\od}}
+%D Specials:
- \def\normalhandleMPcmykcolor
- {{\checkPDFMPstrokecolor\execcolorC\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}}
+\settrue \manyMPspecials \newcount\nofMParguments \let\extraMPpathcode\empty
- \def\normalhandleMPgraycolor
- {{\checkPDFMPstrokecolor\execcolorS\gMPa1:0:0\od}}
-
- \def\normalhandleMPspotcolor % ???
- {{\checkPDFMPstrokecolor\execcolorP\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}}
-
-\fi
-
-% In the previous macros we use the special drivers. A more
-% direct approach would have been:
-%
-% \def\doPDFstartrgbcolormode#1#2#3%
-% {\PDFcode{#1 #2 #3 rg #1 #2 #3 RG}}
-%
-% \def\doPDFstartcmykcolormode#1#2#3#4%
-% {\PDFcode{#1 #2 #3 #4 k #1 #2 #3 #4 K}}
-%
-% \def\doPDFstartgraycolormode#1%
-% {\PDFcode{#1 g #1 G}}
-%
-% \appendtoks
-% \let\dostartrgbcolormode \doPDFstartrgbcolormode
-% \let\dostartcmykcolormode\doPDFstartcmykcolormode
-% \let\dostartgraycolormode\doPDFstartgraycolormode
-% \to \everyMPtoPDFconversion
-
-%D Now we can handle special color signals. We only do this
-%D when special are detected.
-
-% \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#1000.0000\relax}
-% \def\doMPrgbnumber#1.#2#3#4#5\relax{#2#3#4}
+\def\@@MP {@@MP}
+\def\@@MPSK{@MPSK@}
-%D We cannot use \type {\everyMPtoPDFconversion} because in \MPTOPDF\
-%D we don't have the \type {\appendtoks} macro available.
+\def\MPspecial{\@@MPSK\@@MPSK\gMPs\nofMParguments}
-\def\setMPextensions
- {\ifconditional\manyMPspecials
- \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##10000.00000\relax}%
- \def\doMPrgbnumber##1.##2##3##4##5##6\relax{##2##3##4##5}%
- \else
- \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##1000.0000\relax}%
- \def\doMPrgbnumber##1.##2##3##4##5\relax{##2##3##4}%
- \fi}
+\def\defineMPspecial#1#2%
+ {\setvalue{\@@MPSK\@@MPSK#1}{#2}}
-%D The naive case looks like:
+%D Special number~1 is dedicated to \CMYK\ support. If you
+%D want to know why: look at this:
%D
-%D \starttyping
-%D \def\handleMPrgbcolor%
-%D {\setMPcolor
-%D \ifcase\MPspecialversion
-%D \resetMPcolor\normalhandleMPrgbcolor
-%D \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal
-%D % consider it to be a signal
-%D \else
-%D \resetMPcolor\normalhandleMPrgbcolor
-%D \fi\fi}
-%D \stoptyping
+%D \startbuffer[mp]
+%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ;
+%D \stopbuffer
%D
-%D However, since we want \CMYK\ support, we will use the
-%D following implementation:
-
-% \def\setMPcolor
-% {\edef\lastMPrvalue{\gMPa1}%
-% \edef\lastMPgvalue{\gMPa2}%
-% \edef\lastMPbvalue{\gMPa3}}
-%
-% speed up (hardly called, so no let is needed)
-
-\def\setMPcolor
- {\edef\lastMPrvalue{\csname\@@MP01\endcsname}%
- \edef\lastMPgvalue{\csname\@@MP02\endcsname}%
- \edef\lastMPbvalue{\csname\@@MP03\endcsname}}
-
-\def\zeroMPrgbvalue{0.0}
-
-\def\resetMPcolor
- {\let\lastMPrvalue\zeroMPrgbvalue
- \let\lastMPgvalue\zeroMPrgbvalue
- \let\lastMPbvalue\zeroMPrgbvalue}
-
-\resetMPcolor
+%D \startbuffer[cmyk]
+%D \startcombination[4*1]
+%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3}
+%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15}
+%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8}
+%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1}
+%D \stopcombination
+%D \stopbuffer
+%D
+%D \placefigure
+%D {\CMYK\ support disabled,
+%D conversion to \RGB.}
+%D {\setupcolors[cmyk=nee,state=start]\getbuffer[cmyk]}
+%D
+%D \placefigure
+%D {\CMYK\ support enabled,
+%D no support in \METAPOST.}
+%D {\setupcolors[cmyk=ja,mpcmyk=nee,state=start]\getbuffer[cmyk]}
+%D
+%D \placefigure
+%D {\CMYK\ support enabled,
+%D no conversion to \RGB,
+%D support in \METAPOST}
+%D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]}
-\def\@@MPSK{@MPSK@}
-\def\@@MPSP{@MPSP@}
+\defineMPspecial{1}
+ {\ifMPcmykcolors
+ \setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPcmykcolor{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}}%
+ \fi}
-\def\interceptMPcmykcolor % todo : \ifMPcmykcolors
- {\ifcase\MPrgbnumber\lastMPgvalue
- % cannot happen
- \or
- % 1 == cmyk color spec
- \ifMPcmykcolors \dointerceptMPcmykcolor \fi
- \or
- % 2 == spot color
- \ifMPspotcolors \dointerceptMPspotcolor \fi
- \or
- % 3 == rgb transparency
- \invokeMPtransparencyspecial
- \or
- % 4 == cmyk transparency
- \ifMPcmykcolors \invokeMPtransparencyspecial \fi
- \or
- % 5 == spot transparency
- \ifMPspotcolors \invokeMPtransparencyspecial \fi
- \else
- % \writestatus{MPtoPDF}{unknown direct special}%
+\defineMPspecial{2}
+ {\ifMPspotcolors
+ \setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPspotcolor{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}}%
+% \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}%
\fi}
-% ifcsname
+% \def\checkMPspot#1#2#3#4%
+% {\expanded{\resolveMPspotcolor#1 #2 #3 #4}\end
+% \ifx\MPspotspace\MPresolvedspace
+% \edef\MPspotspacespec{/\MPspotspace\space}%
+% \doifinstringelse\MPspotspacespec\currentMPcolorspaces
+% \donothing\registerMPcolorspace
+% \fi}
-\def\dointerceptMPcmykcolor
- {\revokeMPtransparencyspecial
- \@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else
- \@EA\@EA\@EA\setMPcmyk\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname
- \normalhandleMPcmykcolor
- \fi}
+\let\revokeMPtransparencyspecial\relax
-\def\dointerceptMPspotcolor
- {\revokeMPtransparencyspecial
- \@EA\ifx\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else
- \@EA\@EA\@EA\setMPspot\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname
- \normalhandleMPspotcolor
- \fi}
+\def\dohandleMPrgbcolor #1#2#3{\revokeMPtransparencyspecial\execcolorR #1:#2:#3:0:0\od}
+\def\dohandleMPcmykcolor#1#2#3#4{\revokeMPtransparencyspecial\execcolorC#1:#2:#3:#4:0:0\od}
+\def\dohandleMPgraycolor #1{\revokeMPtransparencyspecial\execcolorS #1:0:0\od}
+\def\dohandleMPspotcolor#1#2#3#4{\revokeMPtransparencyspecial\execcolorP#1:#2:#3:#4:0:0\od}
-\def\handleMPrgbcolor
- {\resetMPcolor
- \ifcase\MPspecialversion
- \normalhandleMPrgbcolor
- \else
- \setMPcolor
- \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal\relax
- \interceptMPcmykcolor
- \else
- \revokeMPtransparencyspecial
- \normalhandleMPrgbcolor
- \fi
- \fi}
+%D Transparency support used specials 60 (rgb) and 61
+%D (cmyk).
+%D
+%D \startbufferFshade
+
+%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0);
+%D
+%D fill p rotated 90 withcolor transparent(1,.5,yellow) ;
+%D fill p rotated 210 withcolor transparent(1,.5,green) ;
+%D fill p rotated 330 withcolor transparent(1,.5,blue) ;
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \startlinecorrection \processMPbuffer \stoplinecorrection
+%D
+%D One can also communicate colors between \CONTEXT\ and
+%D \METAPOST:
+%D
+%D \startbuffer
+%D \definecolor[tcyan] [c=1,k=.2,t=.5]
+%D \definecolor[tmagenta][m=1,k=.2,t=.5]
+%D \definecolor[tyellow] [y=1,k=.2,t=.5]
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0);
+%D
+%D fill p rotated 90 withcolor \MPcolor{tcyan} ;
+%D fill p rotated 210 withcolor \MPcolor{tmagenta} ;
+%D fill p rotated 330 withcolor \MPcolor{tyellow} ;
+%D \stopbuffer
+%D
+%D \startlinecorrection \processMPbuffer \stoplinecorrection
+%D
+%D We save all the three components needed in one macro,
+%D just to save hash space.
-\def\handleMPgraycolor
- {\resetMPcolor
- \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi
- \normalhandleMPgraycolor}
+\def\dohandleMPrgbtransparency #1#2#3#4#5{\execcolorR #1:#2:#3:#4:#5\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
+\def\dohandleMPcmyktransparency#1#2#3#4#5#6{\execcolorC#1:#2:#3:#4:#5:#6\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
+\def\dohandleMPgraytransparency #1#2#3{\execcolorS #1:#2:#3\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
+\def\dohandleMPspottransparency#1#2#3#4#5#6{\execcolorP#1:#2:#3:#4:#5:#6\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
-\def\handleMPcmykcolor
- {\resetMPcolor
- \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi
- \normalhandleMPcmykcolor}
+\def\dorevokeMPtransparencyspecial
+ {\PDFcode{\PDFtransparencyresetidentifier\space gs}%
+ \let\revokeMPtransparencyspecial\relax}
-%D Specials are define and recalled using:
+\defineMPspecial{3} % rgb
+ {\setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPrgbtransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs1}{\gMPs2}}}
-\def\MPspecial
- {MP special \gMPs\nofMParguments}
+\defineMPspecial{4} % cmyk
+ {\setxvalue{\@@MPSK\gMPs7}{\noexpand\dohandleMPcmyktransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs1}{\gMPs2}}}
-\def\defineMPspecial#1#2%
- {\setvalue{MP special #1}{#2}}
-
-%D The path processing macro is slightly extended.
-
-\newtoks \invokeMPspecials
-
-\def\finishMPpath
- {\PDFcode
- {\ifcase\finiMPpath W n\or S\or f\or B\else W n\fi
- \extraMPpathcode}}
-
-\def\processMPpath
- {\checkMPpath % !
- \ifcase\nofMPsegments\else
- \let\extraMPpathcode\empty
- \ifcase\MPspecialversion\else
- \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal
- \ifnum\MPrgbnumber\lastMPgvalue>10 % really needed
- \scratchcounter\MPrgbnumber\lastMPbvalue
- \edef\currentMPspecial{\the\scratchcounter}%
- \ifnum\finiMPpath=2 % to outer level
- \the\invokeMPspecials
- \fi
- \fi
- \fi
- \fi
- \flushMPpath
- \closeMPpath
- \finishMPpath
- \fi
- \let\handleMPsequence\dohandleMPsequence
- \resetMPstack
- \nofMPsegments0
- \handleMPsequence}
+\defineMPspecial{5} % spot
+ {\setxvalue{\@@MPSK\gMPs7}{\noexpand\dohandleMPspottransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs1}{\gMPs2}}%
+ }%\checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}}
%D Shading is an example of a more advanced graphic feature,
%D but users will seldom encounter those complications. Here
@@ -2605,137 +589,9 @@
%D \stoptabulate
\newcount\currentPDFshade % 0 % global (document wide) counter
-\let\currentMPshades\empty
-
-\def\startMPshading#1%
- {\edef\currentMPspecial{\gMPs{#1}}}
-
-\def\stopMPshading
- {\global\advance\currentPDFshade \plusone
- \setxvalue{obj:Sh:\currentMPspecial}%
- {/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }%
- \setxvalue{mps:Sh:\currentMPspecial}%
- {\the\currentPDFshade}}
-
-\appendtoks
- \global\let\currentMPshades\empty
-\to \MPstartresources
-
-\appendtoks
- \ifx\currentMPshades\empty \else
- \xdef\currentPDFresources{\currentPDFresources
- /Shading <<\currentMPshades>>}%
- \fi
-\to \MPstopresources
-
-\def\invokeMPshadespecial
- {\ifundefined{mps:Sh:\currentMPspecial}\else
- \edef\currentMPshade{\getvalue{obj:Sh:\currentMPspecial}}%
- \doifinstringelse\currentMPshade\currentMPshades \donothing
- {\xdef\currentMPshades{\currentMPshades\currentMPshade}}%
- \def\extraMPpathcode{/Sh\getvalue{mps:Sh:\currentMPspecial} sh Q}%
- \chardef\finiMPpath\zerocount
- \PDFcode{q /Pattern cs}%
- \fi}
-
-\appendtoks \invokeMPshadespecial \to \invokeMPspecials
-
-%D We need to convert the \CMYK\ specials into colors, because
-%D we have to do it twice, we define a macro.
-
-\def\checkMPshadingcolor#1#2#3#4#5%
- {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}%
- \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}%
- \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}%
- \global\let\MPresolvedspace\MPgrayspace
- \global\let\MPresolvedcolor\!!zerocount
- \ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\relax
- \ifcase\MPrgbnumber\tempMPgvalue
- \or % 1 = cmyk
- \ifMPcmykcolors
- \expanded{\resolveMPcmykcolor\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}}\end
- \fi
- \or % 2 = spot
- \ifMPspotcolors
- \expanded{\resolveMPspotcolor\getvalue{\@@MPSP\number\MPrgbnumber\tempMPbvalue}}\end
- \fi
- \or
- % 3 = rgb transparency
- % to do
- \or
- % 4 == cmyk transparency
- % \ifMPcmykcolors
- % to do
- % \fi
- \or
- % 5 == spot transparency
- % \ifMPspotcolors
- % to do
- % \fi
- \fi
- \else
- \ifx\tempMPrvalue\tempMPgvalue
- \ifx\tempMPrvalue\tempMPbvalue
- \expanded{\resolveMPgraycolor\tempMPbvalue}\end
- \else
- \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end
- \fi
- \else
- \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end
- \fi
- \fi
- \let#4\MPresolvedcolor
- \let#5\MPresolvedspace}
-
-%D We also need to make sure that we have two \RGB\ or
-%D \CMYK colors, since we have to set the colorspace.
-
-\def\setMPshadingcolors#1#2#3#4#5#6% color space
- {\checkMPshadingcolor{#1}{#2}{#3}\MPshadeAc\MPshadeAs
- \checkMPshadingcolor{#4}{#5}{#6}\MPshadeBc\MPshadeBs
- \ifx\MPshadeAs\MPshadeBs
- \let\MPshadeA\MPshadeAc
- \let\MPshadeB\MPshadeBc
- \let\MPshadeC\MPshadeAs
- \else\ifx\MPshadeAs\MPgrayspace
- \ifx\MPshadeBs\MPrgbspace
- \edef\MPshadeA{\MPshadeAc\space\MPshadeAc\space\MPshadeAc}%
- \else
- \negatecolorcomponent\MPshadeAc
- \edef\MPshadeA{0 0 0 \MPshadeAc}%
- \fi
- \let\MPshadeB\MPshadeBc
- \let\MPshadeC\MPshadeBs
- \else\ifx\MPshadeBs\MPgrayspace
- \let\MPshadeA\MPshadeAc
- \ifx\MPshadeAs\MPrgbspace
- \edef\MPshadeB{\MPshadeBc\space\MPshadeBc\space\MPshadeBc}%
- \else
- \negatecolorcomponent\MPshadeBc
- \edef\MPshadeB{0 0 0 \MPshadeBc}%
- \fi
- \let\MPshadeC\MPshadeAs
- \else
- % different color spaces
- \def\MPshadeA{1}%
- \def\MPshadeB{1}%
- \let\MPshadeC\MPgrayspace
- \fi\fi\fi}
-
-\let\MPshadeA\MPcmykWhite
-\let\MPshadeB\MPcmykBlack
-\let\MPshadeC\MPgrayspace
-%D The reason why this macro is a bit complicates is that we
-%D handle black and white situations (otherwise we would have
-%D to use \CMYK\ b/w in case of a \CMYK\ shade).
-
-%D Here are the special handlers:
-
-\defineMPspecial{30}
- {\startMPshading{14}% type 2
- \setMPshadingcolors{4}{5}{6}{9}{10}{11}%
- \immediate\pdfobj
+\def\dosetMPlinearshade#1%
+ {\immediate\pdfobj
{<</FunctionType 2
/Domain [\gMPs1 \gMPs2]
/C0 [\MPshadeA]
@@ -2743,16 +599,34 @@
/N \gMPs3>>}%
\immediate\pdfobj
{<</ShadingType 2
- /ColorSpace /\MPshadeC\space
+ /ColorSpace /\MPresolvedspace
/Function \the\pdflastobj\space 0 R
- /Coords [\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}]
+ /Coords [\MPshadeC]
/Extend [true true]>>}%
- \stopMPshading}
+ \global\advance\currentPDFshade \plusone
+ \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }%
+ \setxvalue{\@@MPSK#1}{\noexpand\dohandleMPshade{\the\currentPDFshade}}}
-\defineMPspecial{31}
- {\startMPshading{16}% type 3
- \setMPshadingcolors{4}{5}{6}{10}{11}{12}%
- \immediate\pdfobj
+\defineMPspecial{30}
+ {\expanded{\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA
+ \expanded{\resolveMPrgbcolor{\gMPs{9}}{\gMPs{10}}{\gMPs{11}}}\to\MPshadeB
+ \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}}%
+ \dosetMPlinearshade{\gMPs{14}}}
+
+\defineMPspecial{32}
+ {\expanded{\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
+ \expanded{\resolveMPcmykcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB
+ \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}%
+ \dosetMPlinearshade{\gMPs{16}}}
+
+\defineMPspecial{34}
+ {\expanded{\resolveMPspotcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
+ \expanded{\resolveMPspotcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB
+ \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}%
+ \dosetMPlinearshade{\gMPs{16}}}
+
+\def\dosetMPcircularshade#1%
+ {\immediate\pdfobj
{<</FunctionType 2
/Domain [\gMPs1 \gMPs2]
/C0 [\MPshadeA]
@@ -2760,29 +634,52 @@
/N \gMPs3>>}%
\immediate\pdfobj
{<</ShadingType 3
- /ColorSpace /\MPshadeC\space
+ /ColorSpace /\MPresolvedspace
/Function \the\pdflastobj\space 0 R
- /Coords [\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}]
+ /Coords [\MPshadeC]
/Extend [true true]>>}%
- \stopMPshading}
+ \global\advance\currentPDFshade \plusone
+ \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }%
+ \setxvalue{\@@MPSK#1}{\noexpand\dohandleMPshade{\the\currentPDFshade}}}
+
+\defineMPspecial{31}
+ {\expanded{\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA
+ \expanded{\resolveMPrgbcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}}\to\MPshadeB
+ \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}}%
+ \dosetMPcircularshade{\gMPs{16}}}
+
+\defineMPspecial{33}
+ {\expanded{\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
+ \expanded{\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB
+ \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}%
+ \dosetMPcircularshade{\gMPs{18}}}
+
+\defineMPspecial{35}
+ {\expanded{\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
+ \expanded{\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB
+ \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}%
+ \dosetMPcircularshade{\gMPs{18}}}
+
+\newconditional\ignoreMPpath
+
+\def\dohandleMPshade#1%
+ {\revokeMPtransparencyspecial
+ \settrue\ignoreMPpath
+ \def\extraMPpathcode{/Sh#1 sh Q}%
+ \chardef\finiMPpath\zerocount
+ \PDFcode{q /Pattern cs}}
%D Figure inclusion is kind of strange to \METAPOST, but when
%D Santiago Muelas started discussing this with me, I was able
%D to cook up a solution using specials.
-\def\invokeMPfigurespecial%
- {\getvalue{mps:gr:\currentMPspecial}} % or \relax
-
-\appendtoks \invokeMPfigurespecial \to \invokeMPspecials
-
\defineMPspecial{10}
- {\setxvalue{mps:gr:\gMPs8}%
- {\noexpand\handleMPfigurespecial
- {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}%
- \noexpand\setxvalue{mps:gr:\gMPs8}{}}}
+ {\setxvalue{\@@MPSK\gMPs8}%
+ {\noexpand\handleMPfigurespecial{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}{\gMPs8}}}
-\def\handleMPfigurespecial#1#2#3#4#5#6#7% todo : combine with ext fig
- {\vbox to \zeropoint
+\def\handleMPfigurespecial#1#2#3#4#5#6#7#8% todo : combine with ext fig
+ {\global\letvalue{\@@MPSK#8}\empty
+ \vbox to \zeropoint
{\vss
\hbox to \zeropoint
{\ifcase\pdfoutput\or % will be hooked into the special driver
@@ -2820,99 +717,23 @@
%D for Mark Wicks.
\defineMPspecial{20}
- {\setxvalue{mps:hl:\gMPs6}%
- {\noexpand\handleMPhyperlink
- {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}%
- \noexpand\setxvalue{mps:hl:\gMPs6}{}}}
-
-\def\handleMPhyperlink#1#2#3#4#5%
- {%\ifcase\pdfoutput\or
- \setbox\scratchbox\hbox
- {\setbox\scratchbox\null
- \scratchdimen#1\onebasepoint\scratchdimen-\scratchdimen
- \advance\scratchdimen#3\onebasepoint
- \wd\scratchbox\scratchdimen
- \scratchdimen#2\onebasepoint\scratchdimen-\scratchdimen
- \advance\scratchdimen#4\onebasepoint
- \ht\scratchbox\scratchdimen
- \incolorfalse
- \gotobox{\box\scratchbox}[#5]}%
- \setbox\scratchbox\hbox
- {\scratchdimen\MPxoffset\onebasepoint\advance\scratchdimen#1\onebasepoint
- \hskip\scratchdimen
- \scratchdimen\MPyoffset\onebasepoint\advance\scratchdimen#2\onebasepoint
- \raise\scratchdimen\box\scratchbox}%
- \smashbox\scratchbox
- \box\scratchbox
- }%\fi}
-
-\def\invokeMPhyperlinkspecial%
- {\getvalue{mps:hl:\currentMPspecial}} % or \relax
-
-\appendtoks \invokeMPhyperlinkspecial \to \invokeMPspecials
-
-%D Special number~1 is dedicated to \CMYK\ support. If you
-%D want to know why: look at this:
-%D
-%D \startbuffer[mp]
-%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ;
-%D \stopbuffer
-%D
-%D \startbuffer[cmyk]
-%D \startcombination[4*1]
-%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3}
-%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15}
-%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8}
-%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1}
-%D \stopcombination
-%D \stopbuffer
-%D
-%D \placefigure
-%D {\CMYK\ support disabled,
-%D conversion to \RGB.}
-%D {\setupcolors[cmyk=nee,state=start]\getbuffer[cmyk]}
-%D
-%D \placefigure
-%D {\CMYK\ support enabled,
-%D no support in \METAPOST.}
-%D {\setupcolors[cmyk=ja,mpcmyk=nee,state=start]\getbuffer[cmyk]}
-%D
-%D \placefigure
-%D {\CMYK\ support enabled,
-%D no conversion to \RGB,
-%D support in \METAPOST}
-%D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]}
+ {\setxvalue{\@@MPSK\gMPs6}%
+ {\noexpand\handleMPhyperlink{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}}}
-\defineMPspecial{1}
- {\ifMPcmykcolors
- \setxvalue{\@@MPSK\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }%
- \fi}
-
-\def\setMPcmyk#1 #2 #3 #4 %
- {\setvalue{\@@MP01}{#1}%
- \setvalue{\@@MP02}{#2}%
- \setvalue{\@@MP03}{#3}%
- \setvalue{\@@MP04}{#4}}
-
-\defineMPspecial{2}
- {\ifMPspotcolors
- \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% space is essential
- \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}%
- \fi}
-
-\def\setMPspot#1 #2 #3 #4 %
- {\setvalue{\@@MP01}{#1}%
- \setvalue{\@@MP02}{#2}%
- \setvalue{\@@MP03}{#3}%
- \setvalue{\@@MP04}{#4}}
-
-\def\checkMPspot#1#2#3#4%
- {\expanded{\resolveMPspotcolor#1 #2 #3 #4}\end
- \ifx\MPspotspace\MPresolvedspace
- \edef\MPspotspacespec{/\MPspotspace\space}%
- \doifinstringelse\MPspotspacespec\currentMPcolorspaces
- \donothing\registerMPcolorspace
- \fi}
+\def\handleMPhyperlink#1#2#3#4#5#6%
+ {\global\letvalue{\@@MPSK#6}\empty
+ \setbox\scratchbox\hbox
+ {\setbox\scratchbox\null
+ \wd\scratchbox\dimexpr-#1\onebasepoint+#3\onebasepoint\relax
+ \ht\scratchbox\dimexpr-#2\onebasepoint+#4\onebasepoint\relax
+ \incolorfalse
+ \gotobox{\box\scratchbox}[#5]}%
+ \setbox\scratchbox\hbox
+ {\hskip\dimexpr\MPxoffset\onebasepoint+#1\onebasepoint\relax
+ \raise\dimexpr\MPyoffset\onebasepoint+#2\onebasepoint\relax
+ \box\scratchbox}%
+ \smashbox\scratchbox
+ \box\scratchbox}
%D This special (number 50) passes positions to a tex file.
%D This method uses a two||pass approach an (mis|)|used the
@@ -2958,268 +779,17 @@
%D \setMPlayer [test] [somepos-2] {Whatever we need there!}
%D \stoptyping
-\ifx\dosavepositionwhd\undefined
- \let\dosavepositionwhd\gobblesevenarguments
-\fi
-
\defineMPspecial{50} % x y width height label
- {\bgroup
- \scratchdimen\MPllx\onebasepoint\scratchdimen-\scratchdimen
- % \scratchdimen-\MPllx\onebasepoint % moet ook werken
- \advance\scratchdimen\gMPs1\onebasepoint
- \edef\x{\number\scratchdimen}%
- \scratchdimen\gMPs2\onebasepoint
- \scratchdimen-\scratchdimen
- \advance\scratchdimen\MPury\onebasepoint
- \edef\y{\number\scratchdimen}%
- \scratchdimen\gMPs3\onebasepoint
- \edef\w{\number\scratchdimen}%
- \scratchdimen\gMPs4\onebasepoint
- \edef\h{\number\scratchdimen}%
- \dosavepositionwhd{\gMPs5}0\x\y\w\h0%
- \egroup}
-
-%D Transparency support used specials 60 (rgb) and 61
-%D (cmyk).
-%D
-%D \startbuffer
-%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0);
-%D
-%D fill p rotated 90 withcolor transparent(1,.5,yellow) ;
-%D fill p rotated 210 withcolor transparent(1,.5,green) ;
-%D fill p rotated 330 withcolor transparent(1,.5,blue) ;
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection \processMPbuffer \stoplinecorrection
-%D
-%D One can also communicate colors between \CONTEXT\ and
-%D \METAPOST:
-%D
-%D \startbuffer
-%D \definecolor[tcyan] [c=1,k=.2,t=.5]
-%D \definecolor[tmagenta][m=1,k=.2,t=.5]
-%D \definecolor[tyellow] [y=1,k=.2,t=.5]
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D \startbuffer
-%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0);
-%D
-%D fill p rotated 90 withcolor \MPcolor{tcyan} ;
-%D fill p rotated 210 withcolor \MPcolor{tmagenta} ;
-%D fill p rotated 330 withcolor \MPcolor{tyellow} ;
-%D \stopbuffer
-%D
-%D \startlinecorrection \processMPbuffer \stoplinecorrection
-%D
-%D We save all the three components needed in one macro,
-%D just to save hash space.
-
-\def\@@MPST{@MPST@}
-
-\def\assignMPStransparency#1#2#3%
- {\edef\PDFtransparencyidentifier{#1}%
- \edef\PDFtransparencyreference {#2}%
- \edef\PDFtransparencycolorspecs{#3}}
-
-\def\PDFtransparencyspec % todo
- {\ifx\MPresolvedspace\MPgrayspace
- \MPresolvedcolor\space g
- \MPresolvedcolor\space G%
- \else\ifx\MPresolvedspace\MPrgbspace
- \MPresolvedcolor\space rg
- \MPresolvedcolor\space RG%
- \else\ifx\MPresolvedspace\MPcmykspace
- \MPresolvedcolor\space k
- \MPresolvedcolor\space K%
- \else\ifx\MPresolvedspace\empty\else
- /\MPresolvedspace\space cs
- /\MPresolvedspace\space CS
- \PDFgetspotcolorspec\MPresolvedcolor
- \fi\fi\fi\fi}
-
-\defineMPspecial{3} % rgb
- {\edef\currentMPspecial{\gMPs6}%
- \presetPDFtransparency{\gMPs1}{\gMPs2}%
- \expanded{\resolveMPrgbcolor\gMPs3 \gMPs4 \gMPs5}\end
- \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug !
- {\noexpand\assignMPStransparency
- {\PDFtransparencyidentifier}%
- {\PDFtransparencyreference}%
- {\PDFtransparencyspec}}}
-
-\defineMPspecial{4} % cmyk
- {\edef\currentMPspecial{\gMPs7}%
- \presetPDFtransparency{\gMPs1}{\gMPs2}%
- \expanded{\resolveMPcmykcolor\gMPs3 \gMPs4 \gMPs5 \gMPs6}\end
- \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug !
- {\noexpand\assignMPStransparency
- {\PDFtransparencyidentifier}%
- {\PDFtransparencyreference}%
- {\PDFtransparencyspec}}}
-
-\defineMPspecial{5} % spot
- {\edef\currentMPspecial{\gMPs7}%
- \presetPDFtransparency{\gMPs1}{\gMPs2}%
- \checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}%
- \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug !
- {\noexpand\assignMPStransparency
- {\PDFtransparencyidentifier}%
- {\PDFtransparencyreference}%
- {\PDFtransparencyspec}}}
-
-% beware: for the moment only supported in pdftex; needs a cleanup!
-
-\def\registerMPcolorspace
- {\doifobjectreferencefoundelse{PDFCS}\MPspotspace
- {\doPDFgetobjectreference{PDFCS}\MPspotspace\PDFobjectreference
- \xdef\currentMPcolorspaces
- {\currentMPcolorspaces\MPspotspacespec\PDFobjectreference\space}}
- \donothing}
-
-%D We need to add resource specifications!
-
-\appendtoks
- \global\let\currentMPcolorspaces\empty
-\to \MPstartresources
-
-\appendtoks
- \ifx\currentMPcolorspaces\empty \else
- \xdef\currentPDFresources{\currentPDFresources
- /ColorSpace <<\currentMPcolorspaces>>}%
- \fi
-\to \MPstopresources
-
-%D For efficiency reasons, we fall back on the allocation
-%D mechanisms already present. For use within \MPTOPDF, we
-%D provide a fall back routine.
-
-\let\currentMPtransparencies\empty
-
-% this one triggers a new graphic state
-
-\def\invokeMPtransparencyspecial
- {\scratchcounter\MPrgbnumber\lastMPbvalue
- \edef\currentMPspecial{\the\scratchcounter}%
- \ifundefined{\@@MPST\currentMPspecial}\else
- \getvalue{\@@MPST\currentMPspecial}%
- \doifinstringelse\PDFtransparencyidentifier\currentMPtransparencies
- \donothing\registerMPtransparencyresource % slow
- \PDFcode
- {\PDFtransparencycolorspecs\space
- \PDFtransparencyidentifier\space gs}%
- % potential optimization
- % \setevalue{\@@MPST\currentMPspecial}%
- % {\PDFcode
- % {\PDFtransparencycolorspecs\space
- % \PDFtransparencyidentifier\space gs}}%
- % \getvalue{\@@MPST\currentMPspecial}%
- \let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial
- \fi}
-
-% this one does a reset
-
-\let\revokeMPtransparencyspecial\relax
-
-\appendtoks
- \revokeMPtransparencyspecial
-\to \MPstopresources
-
-\def\dorevokeMPtransparencyspecial % only called if state is set
- {\ifx\PDFtransparencyresetidentifier\empty\else
- \doifinstringelse\PDFtransparencyresetidentifier\currentMPtransparencies
- \donothing\registerMPtransparencyresetresource
- \PDFcode{\PDFtransparencyresetidentifier\space gs}%
- % potential optimization
- % \def\dorevokeMPtransparencyspecial
- % {\PDFcode
- % {\PDFtransparencycolorspecs\space
- % \PDFtransparencyidentifier\space gs}}%
- \let\dorevokeMPtransparencyspecial\dodorevokeMPtransparencyspecial
- \let\revokeMPtransparencyspecial\relax % invoke sets it
- \fi}
-
-% and this one does a simplified reset
-
-\def\dodorevokeMPtransparencyspecial % used after first invocation
- {\PDFcode{\PDFtransparencyresetidentifier\space gs}%
- \let\revokeMPtransparencyspecial\relax} % invoke sets it
-
-% add a resource entry
+ {\dosavepositionwhd
+ {\gMPs5}%
+ {0}%
+ {\the\dimexpr-\MPllx\onebasepoint+\gMPs1\onebasepoint\relax}
+ {\the\dimexpr\gMPs2\onebasepoint-\scratchdimen+\MPury\onebasepoint\relax}%
+ {\the\dimexpr\gMPs3\onebasepoint\relax}%
+ {\the\dimexpr\gMPs4\onebasepoint\relax}%
+ {0pt}}
-\def\registerMPtransparencyresource
- {\xdef\currentMPtransparencies
- {\currentMPtransparencies
- \PDFtransparencyidentifier\space
- \PDFtransparencyreference\space}}
-
-\def\registerMPtransparencyresetresource
- {\xdef\currentMPtransparencies
- {\currentMPtransparencies
- \PDFtransparencyresetidentifier\space
- \PDFtransparencyresetreference\space}}
-
-\appendtoks \invokeMPtransparencyspecial \to \invokeMPspecials
-
-\ifCONTEXT \else
-
- \def\@@MPSTN{@MPSTN@}
- \def\@@MPSTO{@MPSTO@}
-
- \newcount\PDFcurrenttransparency
-
- \let\PDFtransparencyresetidentifier\empty
- \let\PDFtransparencyresetreference \empty
-
- \let\PDFtransparencyidentifier\empty
- \let\PDFtransparencyreference \empty
-
- \def\initializePDFtransparency
- {\global\let\initializePDFtransparency\relax
- \presetPDFtransparency{1}{1}%
- \xdef\PDFtransparencyresetidentifier{/Tr0}%
- \xdef\PDFtransparencyresetreference{\the\pdflastobj\space 0 R}}
-
- \def\presetPDFtransparency#1#2%
- {\initializePDFtransparency
- \@EA\ifx\csname\@@MPSTO#1:#2\endcsname\relax
- \global\advance\PDFcurrenttransparency \plusone
- \immediate\pdfobj{\PDFtransparencydictionary{#1}{#2}{}}%
- \setxvalue{\@@MPSTN#1:#2}{\the\PDFcurrenttransparency}%
- \setxvalue{\@@MPSTO#1:#2}{\the\pdflastobj}%
- \fi
- \edef\PDFtransparencyidentifier{/Tr\getvalue{\@@MPSTN#1:#2}}%
- \edef\PDFtransparencyreference{\getvalue{\@@MPSTO#1:#2} 0 R}}
-
- \def\PDFtransparencydictionary#1#2#3% type fraction extras
- {<</Type /ExtGState
- /ca #2 /CA #2
- /BM /\ifcase#1 Normal\or Normal\or Multiply\or Screen\or
- Overlay\or SoftLight\or HardLight\or ColorDodge\or
- ColorBurn\or Darken\or Lighten\or Difference\or
- Exclusion\else Compatible\fi
- #3>>}
-
-\fi
-
-\appendtoks
- \global\let\currentMPtransparencies\empty
-\to \MPstartresources
-
-\appendtoks
- \ifx\currentMPtransparencies\empty \else
- \xdef\currentPDFresources{\currentPDFresources
- /ExtGState <<\currentMPtransparencies>>}%
- \fi
-\to \MPstopresources
-
-%D In all cases, we need to keep track of the resources
-%D used.
-
-%D A few auxiliary macros:
+%D A few auxiliary macros. This will move to colo-ini.
\def\MPgrayspace{DeviceGray}
\def\MPrgbspace {DeviceRGB}
@@ -3229,72 +799,52 @@
\def\MPcmykBlack{0 0 0 0}
\def\MPcmykWhite{0 0 0 1}
-\ifCONTEXT
-
- \def\startMPcolorresolve
- {\bgroup
- \def\dostartgraycolormode##1%
- {\global\let\MPresolvedspace\MPgrayspace
- \xdef\MPresolvedcolor{##1}}%
- \def\dostartrgbcolormode ##1##2##3%
- {\global\let\MPresolvedspace\MPrgbspace
- \xdef\MPresolvedcolor{##1 ##2 ##3}}%
- \def\dostartcmykcolormode##1##2##3##4%
- {\global\let\MPresolvedspace\MPcmykspace
- \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}%
- \def\dostartspotcolormode##1##2%
- {\global\let\MPspotspace\empty
- \xdef\MPresolvedspace{##1}%
- \xdef\MPresolvedcolor{##2}%
- \global\let\MPspotspace\MPresolvedspace}% signal
- \dostartgraycolormode\!!zerocount} % kind of hackery initialization
-
- \let\stopMPcolorresolve\egroup
-
- \def\resolveMPrgbcolor#1 #2 #3\end
- {\startMPcolorresolve
- \execcolorR#1:#2:#3:0:0\od
- \stopMPcolorresolve}
-
- \def\resolveMPcmykcolor#1 #2 #3 #4\end
- {\startMPcolorresolve
- \execcolorC#1:#2:#3:#4:0:0\od
- \stopMPcolorresolve}
-
- \def\resolveMPgraycolor#1\end
- {\startMPcolorresolve
- \execcolorS#1:0:0\od
- \stopMPcolorresolve}
-
- \def\resolveMPspotcolor#1 #2 #3 #4\end
- {\startMPcolorresolve
- \ifnum#2>\plusone
- \checkmultitonecolor{#1}%
- \fi
- \execcolorP#1:#2:#3:#4:0:0\od
- \stopMPcolorresolve}
-
-\else
-
- \def\resolveMPspotcolor#1 #2\end
- {\global\let\MPresolvedspace\MPgrayspace
- \xdef\MPresolvedcolor{0}}
-
- \def\resolveMPrgbcolor#1 #2 #3\end
- {\global\let\MPresolvedspace\MPrgbspace
- \xdef\MPresolvedcolor{#1 #2 #3}}
-
- \def\resolveMPcmykcolor#1 #2 #3 #4\end
- {\global\let\MPresolvedspace\MPcmykspace
- \xdef\MPresolvedcolor{#1 #2 #3 #4}}
-
- \def\resolveMPgraycolor#1\end
- {\global\let\MPresolvedspace\MPgrayspace
- \xdef\MPresolvedcolor{#1}} % should be inverted
-
-\fi
-
-%D Begin of soon obsolete code.
+\def\startMPcolorresolve
+ {\bgroup
+ \def\dostartgraycolormode##1%
+ {\global\let\MPresolvedspace\MPgrayspace
+ \xdef\MPresolvedcolor{##1}}%
+ \def\dostartrgbcolormode ##1##2##3%
+ {\global\let\MPresolvedspace\MPrgbspace
+ \xdef\MPresolvedcolor{##1 ##2 ##3}}%
+ \def\dostartcmykcolormode##1##2##3##4%
+ {\global\let\MPresolvedspace\MPcmykspace
+ \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}%
+ \def\dostartspotcolormode##1##2%
+ {\global\let\MPspotspace\empty
+ \xdef\MPresolvedspace{##1}%
+ \xdef\MPresolvedcolor{##2}%
+ \global\let\MPspotspace\MPresolvedspace}% signal
+ \dostartgraycolormode\!!zerocount} % kind of hackery initialization
+
+\let\stopMPcolorresolve\egroup
+
+\def\resolveMPrgbcolor#1#2#3\to#4%
+ {\startMPcolorresolve
+ \execcolorR#1:#2:#3:0:0\od
+ \stopMPcolorresolve
+ \let#4\MPresolvedcolor}
+
+\def\resolveMPcmykcolor#1#2#3#4\to#5%
+ {\startMPcolorresolve
+ \execcolorC#1:#2:#3:#4:0:0\od
+ \stopMPcolorresolve
+ \let#5\MPresolvedcolor}
+
+\def\resolveMPgraycolor#1\end\to#2%
+ {\startMPcolorresolve
+ \execcolorS#1:0:0\od
+ \stopMPcolorresolve
+ \let#2\MPresolvedcolor}
+
+\def\resolveMPspotcolor#1#2#3#4\end\to#5%
+ {\startMPcolorresolve
+ \ifnum#2>\plusone
+ \checkmultitonecolor{#1}%
+ \fi
+ \execcolorP#1:#2:#3:#4:0:0\od
+ \stopMPcolorresolve
+ \let#5\MPresolvedcolor}
%D \macros
%D {dogetPDFmediabox}
@@ -3338,10 +888,10 @@
\doprocessfile\scratchread{#1}\doprocessPDFline
\egroup
\ifx\PDFxoffset\undefined
- #2\zeropoint
- #3\zeropoint
- #4\zeropoint
- #5\zeropoint
+ #2=\zeropoint
+ #3=\zeropoint
+ #4=\zeropoint
+ #5=\zeropoint
\else
#2=\PDFxoffset\onebasepoint
#3=\PDFyoffset\onebasepoint
@@ -3362,12 +912,53 @@
\global\let\PDFyoffset\PDFyoffset}
\def\setPDFmediabox#1[#2 #3 #4 #5]#6\done
- {\dimen2=#2bp\dimen2=-\dimen2 % \dimen2=-#2bp also works since tex handles --
- \dimen4=#3bp\dimen4=-\dimen4 % \dimen4=-#3bp also works since tex handles --
- \dimen6=#4bp\advance\dimen6 \dimen2
- \dimen8=#5bp\advance\dimen8 \dimen4
+ {\dimen2=#2\onebasepoint\dimen2=-\dimen2 % \dimen2=-#2\onebasepoint also works since tex handles --
+ \dimen4=#3\onebasepoint\dimen4=-\dimen4 % \dimen4=-#3\onebasepoint also works since tex handles --
+ \dimen6=#4\onebasepoint\advance\dimen6 \dimen2
+ \dimen8=#5\onebasepoint\advance\dimen8 \dimen4
\setPDFboundingbox{\dimen2}{\dimen4}{\dimen6}{\dimen8}\PDFxscale\PDFyscale}
%D End of soon obsolete code.
+%D The plugins:
+
+\startMPinitializations
+ mp_shade_version := 2 ;
+\stopMPinitializations
+
+\loadmarkfile{meta-pdf}
+
+%D Test code:
+
+% \startMPcode
+% fill fullcircle scaled 3cm withcolor red ;
+% fill fullcircle scaled 2cm withcolor green ;
+% fill fullcircle scaled 1cm withcolor blue ;
+% currentpicture := currentpicture shifted (-4cm,0) ;
+% fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ;
+% fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ;
+% fill fullcircle scaled 1cm withcolor cmyk(0,0,1,0) ;
+% currentpicture := currentpicture shifted (-4cm,0) ;
+% draw fullcircle scaled 3cm dashed evenly ;
+% draw fullcircle scaled 2cm dashed withdots ;
+% draw origin withpen pencircle scaled 3mm;
+% currentpicture := currentpicture shifted (-4cm,0) ;
+% fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red);
+% fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red);
+% fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green);
+% fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5));
+% currentpicture := currentpicture shifted (12cm,-4cm) ;
+% draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ;
+% currentpicture := currentpicture shifted (-4cm,0) ;
+% % bug: shift
+% draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ;
+% draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ;
+% filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ;
+% currentpicture := currentpicture shifted (-4cm,0) ;
+% % shade cannot handle shift
+% circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ;
+% circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ;
+% filldraw boundingbox currentpicture enlarged -3cm withpen pencircle scaled 1pt withcolor .5white ;
+% \stopMPcode
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/meta-tex.tex b/Master/texmf-dist/tex/context/base/meta-tex.tex
index c49021d2e8a..f1faa300d1d 100644
--- a/Master/texmf-dist/tex/context/base/meta-tex.tex
+++ b/Master/texmf-dist/tex/context/base/meta-tex.tex
@@ -27,11 +27,15 @@
\def\openTeXtexts {\immediate\openout \TeXtextwrite\currentTeXtext.mpb\relax}
\def\closeTeXtexts{\immediate\closeout\TeXtextwrite}
-\def\currentTeXtext{\jobname-mpgraph}
+\def\currentTeXtext {\jobname-mpgraph}
+\def\currentTeXstack{mpgtxt}
-\initializeboxstack\currentTeXtext
+\initializeboxstack\currentTeXstack
\newtoks\collectedmptexts
+\newtoks\everyTeXtexts
+
+\chardef\TeXtextsmode\zerocount % no inheritance
\long\def\startTeXtexts#1\stopTeXtexts
{\global\collectedmptexts\expandafter{\the\collectedmptexts#1}}
@@ -39,10 +43,16 @@
\def\dostartTeXtexts
{\global\setfalse\TeXtextdone
\startnointerference
- \the\everyMPTEXgraphic
\openTeXtexts
+ \ifcase\TeXtextsmode
+ % normally there is no need for this (faster anyway)
+ \or
+ \scantokens\expandafter{\the\everyMPTEXgraphic}% brr
+ \or
+ \the\everyTeXtexts
+ \fi
\ifrunMPgraphics
- \initializeboxstack\currentTeXtext
+ \initializeboxstack\currentTeXstack
\else
\global\let\openTeXtexts\relax
\global\let\finishTeXtexts\closeTeXtexts
@@ -50,7 +60,7 @@
\def\dostopTeXtexts
{\ifrunMPgraphics
- \closeTeXtexts
+ \closeTeXtexts
\fi
\stopnointerference}
@@ -67,25 +77,47 @@
% {\setnormalcatcodes}
% {\global\settrue\TeXtextdone
% \immediate\write\TeXtextwrite{savetxt(#1,\the\wd\nextbox,\the\ht\nextbox,\the\dp\nextbox);}%
-% \savebox\currentTeXtext{#1}{\box\nextbox}}
+% \savebox\currentTeXstack{#1}{\box\nextbox}}
% \hbox}
\long\def\TeXtext
{\dosingleempty\doTeXtext}
+% currently, colors in the converter don't use the color stack
+%
+% 0 = nothing, withcolor works ok, but nested colors fail
+% 1 = local color stack ok
+% 2 = obey color stack (not yet supported)
+
+\chardef\TeXtextcolormode\plusone
+
+\def\definetextext[#1]#2{\setvalue{textext@@#1}{#2}}
+
+% \definetextext[framed]{\framed}
+%
+% \startMPcode
+% draw \sometxt[framed]{black} rotated 45 ;
+% \stopMPcode
+
\long\def\doTeXtext[#1]#2#3%
{\begingroup
\setbox\nextbox\hbox
{\setnormalcatcodes
- \newlinechar=`\^^M
+ \endlinechar\minusone
\everyeof\emptytoks
- %\def\ascii{#3}%
- %\scantokens\expandafter{\ascii}}%
- \scantokens{#3}}%
+ %\def\ascii{#3}\scantokens\expandafter{\ascii}}%
+ \ifcase\TeXtextcolormode
+ \scantokens{\executeifdefined{textext@@#1}\firstofoneargument{#3}}%
+ \else
+ \localcolortrue
+ \startcurrentcolor
+ \scantokens{\executeifdefined{textext@@#1}\firstofoneargument{#3}}%
+ \stopcurrentcolor
+ \fi}%
\global\settrue\TeXtextdone
\edef\currenttextxt{\number#2}%
\executeifdefined{textext::#1}{\getvalue{textext::depth}}%
- \savebox\currentTeXtext\currenttextxt{\box\nextbox}%
+ \savebox\currentTeXstack\currenttextxt{\box\nextbox}%
\endgroup}
\setvalue{textext::depth}{\immediate\write\TeXtextwrite{savetxt(\currenttextxt,\the\nextboxwd,\the\nextboxht,\the\nextboxdp) shifted (0,-\the\nextboxdp);}}
@@ -105,28 +137,24 @@
% this took a while to figure out
- % \def\getTeXtext
- % {\localMPtxtfont
- % \setbox\mptextbox\hbox{\foundbox\currentTeXtext{\number\nofTeXtexts}}%
- % \setbox\scratchbox\hbox{\MPtextdata}%
- % \edef\mpwd{\the\dimexpr\MPtextsize\dimexpr\wd\scratchbox/10\relax\relax}%
- % \edef\mpht{\the\dimexpr\MPtextsize\dimexpr\ht\scratchbox/10\relax\relax}%
- % \setbox\mptextbox\hbox{\raise\dp\mptextbox\box\mptextbox}%
- % \dp\mptextbox\zeropoint
- % \scale[\c!width=\mpwd,\c!height=\mpht]{\box\mptextbox}}%
+ \let\MPtextdata\empty
\def\getTeXtext
- {\localMPtxtfont
- \setbox\mptextbox\hbox{\foundbox\currentTeXtext{\number\nofTeXtexts}}%
- \setbox\scratchbox\hbox{\MPtextdata}%
- \edef\mpwd{\the\dimexpr\MPtextsize\dimexpr\wd\scratchbox/10\relax\relax}%
- \edef\mpht{\the\dimexpr\MPtextsize\dimexpr\ht\scratchbox/10\relax\relax}%
- \setbox\mptextbox\hbox{\raise\dp\mptextbox\box\mptextbox}%
- \dp\mptextbox\zeropoint
- \scale[\c!width=\mpwd,\c!height=\mpht]{\box\mptextbox}}
+ {\ifx\MPtextdata\empty\else
+ \localMPtxtfont
+ \setbox\mptextbox\hbox{\foundbox\currentTeXstack{\number\nofTeXtexts}}%
+ \setbox\scratchbox\hbox{\MPtextdata}% set in meta-pdf.mkii/mkiv
+ \edef\mpwd{\the\dimexpr\MPtextsize\dimexpr\wd\scratchbox/10\relax\relax}%
+ \edef\mpht{\the\dimexpr\MPtextsize\dimexpr\ht\scratchbox/10\relax\relax}%
+ \setbox\mptextbox\hbox{\raise\dp\mptextbox\box\mptextbox}%
+ \dp\mptextbox\zeropoint
+ \scale[\c!width=\mpwd,\c!height=\mpht]{\box\mptextbox}%
+ \fi}
\fi
+\let\nofTeXtexts\!!zerocount
+
\setvalue{handleMPtext00001}% only height in tag (00001)
{\setbox\scratchbox\hbox
{\obeyMPspecials
@@ -146,14 +174,6 @@
string txtpref ; txtpref := "00001::::" ;
\stopMPextensions
-% \long\def\filtersometxt#1\sometxt#2#3#4%
-% {\ifx#3\empty
-% \else
-% \increment\txtcounter
-% \TeXtext\txtcounter{#2}%
-% \expandafter\filtersometxt
-% \fi#3#4}
-
\long\def\dodofiltersometxt#1#2#3%
{\ifx#2\empty
\else
@@ -170,6 +190,8 @@
\long\def\filtersometxt#1\sometxt
{\doifnextcharelse[\redofiltersometxt\dodofiltersometxt}
+% cleaner in mkiv
+%
% \filtersometxt abc\sometxt{def};hij\sometxt{klm};\sometxt{}\empty\relax
\long\def\flushTeXtexts#1%
@@ -204,3 +226,121 @@
\writeMPgraphic{#1}} % potential optimization: pass \ascii
\protect \endinput
+
+% torture test (will move)
+
+\startMPpage
+ numeric a_b_c ;
+ picture p ; pickup pencircle scaled .1pt ;
+ p := \sometxt{Just a \color[blue]{simple} example text.} ;
+ p := image(draw p; draw boundingbox p withcolor red; ) ;
+ p := p rotatedaround(center p, 360*(5/100)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ currentpicture := currentpicture scaled 20 ;
+ draw boundingbox currentpicture withcolor .5white ;
+ setbounds currentpicture to boundingbox currentpicture enlarged 10pt ;
+\stopMPpage
+
+\startMPpage
+ picture p ;
+ p := \sometxt{\framed[width=fit,align=middle]{\input tufte\relax}} ;
+ draw p rotatedaround(center p, 30) ;
+\stopMPpage
+
+\startMPpage
+ picture p ;
+ p := \sometxt{\framed[width=fit,align=middle]{\input tufte\relax}} ;
+ draw p slanted .5 ;
+\stopMPpage
+
+\dorecurse{10} {
+ \startTeXtexts
+ \TeXtext{\recurselevel}{\ruledhbox{I must be {\green crazy} to implement this}}
+ \stopTeXtexts
+ \startMPpage
+ picture p ; pickup pencircle scaled .1pt ;
+ numeric i ; i := \recurselevel ;
+ p := sometxt(i) ;
+ p := p rotatedaround(center p, 360*(i*5/100)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ currentpicture := currentpicture scaled 20 ;
+ draw boundingbox currentpicture withcolor .5white ;
+ \stopMPpage
+}
+
+\startTeXtexts
+ \dorecurse{100}{\TeXtext{\recurselevel}{\ruledhbox{\strut interesting \recurselevel}}}
+\stopTeXtexts
+
+\startMPpage
+ picture p ; pickup pencircle scaled .1pt ;
+ for i = 1 upto 100:
+ p := sometxt(i) ;
+ p := p rotatedaround(center p, 360*(i*5/100)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ endfor ;
+ currentpicture := currentpicture scaled 20 ;
+ draw boundingbox currentpicture withcolor .5white ;
+\stopMPpage
+
+\startTeXtexts
+ \dorecurse{100}{\TeXtext{\recurselevel}{\ruledhbox{\strut interesting \recurselevel}}}
+\stopTeXtexts
+
+\startMPpage
+ picture p ; pickup pencircle scaled .1pt ;
+ for i = 1 step 5 until 100 :
+ p := sometxt(i) ;
+ p := p rotatedaround(center p, 360*(i/100)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ endfor ;
+ currentpicture := currentpicture scaled 20 ;
+ draw boundingbox currentpicture withcolor .5white ;
+\stopMPpage
+
+\startTeXtexts
+ \dorecurse{20}{\TeXtext{\recurselevel}{\externalfigure[t:/sources/cow.pdf][width=1cm]}}
+\stopTeXtexts
+
+\startMPpage
+ picture p ; pickup pencircle scaled .1pt ;
+ for i = 1 upto 20 :
+ p := sometxt(i) ;
+ p := p shifted (2.5cm,0) rotated (360*(i/20)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ endfor ;
+ currentpicture := currentpicture scaled 10 ;
+ draw boundingbox currentpicture withcolor .5white ;
+\stopMPpage
+
+\startTeXtexts
+ \dorecurse{200}{\TeXtext{\recurselevel}{\ruledhbox{\strut I must be {\green crazy} \recurselevel}}}
+\stopTeXtexts
+
+\startMPpage
+ picture p ; pickup pencircle scaled .1pt ;
+ numeric i ; i := 100 ;
+ p := sometxt(i) ;
+ p := p rotatedaround(center p, 360*(i*36/100)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ currentpicture := currentpicture scaled 20 ;
+ draw boundingbox currentpicture withcolor .5white ;
+\stopMPpage
+
+\dorecurse{10}{
+ \startTeXtexts
+ \dorecurse{200}{\TeXtext{\recurselevel}{\ruledhbox{\strut I must be {\green crazy} \recurselevel}}}
+ \stopTeXtexts
+ \startMPpage
+ picture p ; pickup pencircle scaled .1pt ;
+ j := 10*\recurselevel-9;
+ k := 10*\recurselevel;
+ for i = j upto k:
+ p := sometxt(i) ;
+ p := p rotatedaround(center p, 360*(i/100)) ;
+ draw p ; draw boundingbox p withcolor blue ;
+ endfor ;
+ currentpicture := currentpicture scaled 20 ;
+ draw boundingbox currentpicture withcolor red ;
+ \stopMPpage
+}
diff --git a/Master/texmf-dist/tex/context/base/meta-txt.tex b/Master/texmf-dist/tex/context/base/meta-txt.tex
index e6817563575..de4239e8543 100644
--- a/Master/texmf-dist/tex/context/base/meta-txt.tex
+++ b/Master/texmf-dist/tex/context/base/meta-txt.tex
@@ -53,14 +53,14 @@
\setuptolerance[\v!verytolerant,\v!stretch]%
\!!counta=0
\!!toksa=\emptytoks
- \def\docommando##1%
+ \def\docommand##1%
{\setbox\scratchbox=\hbox{\useMPgraphic{##1}}%
\global\chardef\parfirst=0
\getMPdata % \readlocfile{\MPdatafile}{}{}%
\setshapecharacteristics
\advance\!!counta by \parlines
\expandafter\appendtoks\the\partoks\to\!!toksa}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\global\parseriestrue
\xdef\totalparlines{\the\!!counta}%
\global\partoks\!!toksa
@@ -79,7 +79,7 @@
\getshapecharacteristics}
\def\adaptparshape%
- {\def\docommando##1%
+ {\def\docommand##1%
{\ifcase\!!counta
\expandafter\appendtoks\space##1 \to\!!toksa
\else
@@ -89,7 +89,7 @@
\doglobal\decrement(\totalparlines,\!!counta)%
\multiply\!!counta \plustwo
\!!toksa\emptytoks
- \expanded{\processseparatedlist[\the\partoks][\space]}\docommando
+ \expanded{\processseparatedlist[\the\partoks][\space]}\docommand
\global\partoks\!!toksa
%\ifx\partoks\emptytoks\else % safeguard
\expanded{\parshape\totalparlines\the\partoks}%
diff --git a/Master/texmf-dist/tex/context/base/mult-com.tex b/Master/texmf-dist/tex/context/base/mult-com.tex
index 0582c34727e..599fd61d2cc 100644
--- a/Master/texmf-dist/tex/context/base/mult-com.tex
+++ b/Master/texmf-dist/tex/context/base/mult-com.tex
@@ -1004,6 +1004,14 @@
stelletexttexteein nastavtexttexty
impostatestotesti seteazatextetext
regletextestexte
+ settextcontent: steltekstinhoudin settextcontent
+ settext settextcontent
+ settext settextcontent
+ settext
+ resettext: resettekstinhoud resettextcontent
+ resettextcontent resettextcontent
+ resettextcontent resettextcontent
+ resettextcontent
definetext: definieertekst definetext
definieretext definujtext
definiscitesto definestetext
@@ -2518,7 +2526,7 @@ determineregistercharacteristics: bepaalregisterkenmerken determineregi
leftedgewidth: linkerrandbreedte leftedgewidth
breitelinkerrand sirkalevehookraje
ampiezzabordosinistro latimecoltstanga
- largeurbrodgauche
+ largeurbordgauche
rightedgewidth: rechterrandbreedte rightedgewidth
breiterechterrand sirkapravehookraje
ampiezzabordodestro latimecoltdreapta
diff --git a/Master/texmf-dist/tex/context/base/mult-con.tex b/Master/texmf-dist/tex/context/base/mult-con.tex
index 07bbf399443..de24230ae83 100644
--- a/Master/texmf-dist/tex/context/base/mult-con.tex
+++ b/Master/texmf-dist/tex/context/base/mult-con.tex
@@ -363,6 +363,14 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
center center
center center
center
+ flushouter: lijnbuiten flushouter
+ flushouter flushouter
+ flushouter flushouter
+ flushouter
+ flushinner: lijnbinnen flushinner
+ flushinner flushinner
+ flushinner flushinner
+ flushinner
\stopvariables
@@ -399,6 +407,10 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
formel rovnice
formula formula
formule
+ subformula: subformule subformula
+ subformel subrovnice
+ subformula subformula
+ subformule
formulae: formules formulae
formeln rovnice
formule formule
@@ -1152,7 +1164,7 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
leftedge: linkerrand leftedge
linkekante levahrana
bordosinistro bordurastanga
- brodgauche
+ bordgauche
leftedgedistance: linkerrandafstand leftedgedistance
linkerkantenabstand vzdalenostlevehrany
distanzabordosinistro distantabordurastanga
@@ -2540,6 +2552,10 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
neu novy
nuovo nou
nouveau
+ old: oud old
+ old old
+ old old
+ old
MONTH: MAAND MONTH
MONAT MESIC
MESE LUNA
@@ -2552,6 +2568,10 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
mar mar
mar mar
mar
+ item: som item
+ pos polozka
+ elemento element
+ element
marking: markering marking
beschriftung znaceni
marcatura marcaje
@@ -3169,6 +3189,15 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
descrizione descriere
description
+ lefthanging: linkshangend lefthanging
+ lefthanging lefthanging
+ lefthanging lefthanging
+ lefthanging
+ righthanging: rechtshangend righthanging
+ righthanging righthanging
+ righthanging righthanging
+ righthanging
+
\stopvariables
\startconstants dutch english
diff --git a/Master/texmf-dist/tex/context/base/mult-fst.tex b/Master/texmf-dist/tex/context/base/mult-fst.tex
new file mode 100644
index 00000000000..af915e000de
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mult-fst.tex
@@ -0,0 +1,30 @@
+%D \module
+%D [ file=mult-fst,
+%D version=2006.08.16,
+%D title=\CONTEXT\ Multilingual Macros,
+%D subtitle=Speed Up,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% And so, after a few years of keeping this potentially dangerous
+% speedup in cont-exp, we now move it to the kernel: the next
+% patch is 30\% faster on main interface (seconds) (9->7 sec on
+% 1 million calls). Another speed up is still under testing.
+
+\unprotect
+
+\startinterface english
+
+ \def\dosetevalue #1#2{\@EA\edef\csname#1#2\endcsname}
+ \def\dosetgvalue #1#2{\@EA\gdef\csname#1#2\endcsname}
+ \def\dosetvalue #1#2{\@EA\def \csname#1#2\endcsname}
+ \def\docopyvalue#1#2#3{\@EA\def \csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}}
+
+\stopinterface
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mult-ini.tex b/Master/texmf-dist/tex/context/base/mult-ini.tex
index 69ef0a6ac10..444edcfeef6 100644
--- a/Master/texmf-dist/tex/context/base/mult-ini.tex
+++ b/Master/texmf-dist/tex/context/base/mult-ini.tex
@@ -105,9 +105,34 @@
\def\s!complex {complex} \def\s!start {start}
\def\s!simple {simple} \def\s!stop {stop}
-\def\!!width {width} \def\!!plus {plus}
-\def\!!height {height} \def\!!minus {minus}
-\def\!!depth {depth} \def\!!to {to}
+%D The word \type{height} takes 6~token memory cells. The
+%D control sequence \type{\height} on the other hand uses only
+%D one. Knowing this, we can improve the performance of \TEX,
+%D both is terms of speed and memory usage, by using control
+%D sequences instead of the words written in full.
+%D
+%D Where in the \ASCII\ file the second lines takes nine extra
+%D characters, \TEX\ saves us 13~tokens.
+%D
+%D \starttyping
+%D \hrule width 10pt height 2pt depth 1pt
+%D \hrule \!!width 10pt \!!height 2pt \!!depth 1pt
+%D \stoptyping
+%D
+%D One condition is that we have defined \type{\!!height},
+%D \type{\!!width} and \type{\!!depth} as respectively
+%D \type{height}, \type{width} and \type{depth}. Using this
+%D scheme therefore only makes sense when a token sequence is
+%D used more than once. Savings like this should of course be
+%D implemented in english, just because \TEX\ is english.
+
+\def\!!width {width}
+\def\!!height {height}
+\def\!!depth {depth}
+\def\!!plus {plus}
+\def\!!minus {minus}
+\def\!!fill {fill}
+\def\!!to {to}
%D \macros
%D {defineinterfaceconstant,
@@ -219,17 +244,17 @@
\def\defaultinterface{english}
\def\selectinterface
- {\def\docommando##1##2%
+ {\def\docommand##1##2%
{\bgroup
\endlinechar\minusone
\global\read16 to ##1
\egroup
\doifnothing\currentinterface{\let##1=##2}%
\doifundefined{\s!prefix!##1}{\let##1=##2}}%
- \docommando\currentinterface\defaultinterface
+ \docommand\currentinterface\defaultinterface
\writestatus{interface}{defining \currentinterface\space interface}%
\writeline
- \docommando\currentresponses\currentinterface
+ \docommand\currentresponses\currentinterface
\writestatus{interface}{using \currentresponses\space messages}%
\writeline
\let\selectinterface\relax}
@@ -423,6 +448,8 @@
\expandafter\addinterfacemessage
\fi}
+\let\stopmessages\undefined % for dep checker
+
\def\startmessages #1 library: #2
{\definemessageconstant{#2}% handy for modules
\bgroup
@@ -1525,15 +1552,14 @@
%D Out of convenience we define the banners here.
-\edef\contextbanner
+\def\contextbanner
{ConTeXt \space
- ver: \noexpand \contextversion \space \space
- fmt: \noexpand \formatversion \space \space
- int: \noexpand \currentinterface \space \space
- mes: \noexpand \currentresponses}
+ ver: \contextversion \space \contextmark \space \space
+ fmt: \formatversion \space \space
+ int: \currentinterface/\currentresponses}
\def\showcontextbanner
- {\writeline\writestring{\contextbanner}\writeline}
+ {\writeline\writebanner{\contextbanner}\writeline}
\edef\formatversion
{\ifx\normalyear \undefined\the\year \else\the\normalyear \fi.%
@@ -1541,11 +1567,11 @@
\ifx\normalday \undefined\the\day \else\the\normalday \fi}
\ifx\contextversion\undefined
- \def\contextversion{unknown}
+ \def\contextversion {unknown}
\def\contextversionnumber{0}
\else
\def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi#2\ifnum#3<10 0\fi#3 #4:#5}
- \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax}
+ \edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax\space\contextmark}
\fi
\ifx\undefined\normaldump
diff --git a/Master/texmf-dist/tex/context/base/mult-sys.tex b/Master/texmf-dist/tex/context/base/mult-sys.tex
index 716c6d6bfdd..1e0cb5f3dbf 100644
--- a/Master/texmf-dist/tex/context/base/mult-sys.tex
+++ b/Master/texmf-dist/tex/context/base/mult-sys.tex
@@ -90,6 +90,7 @@
\definemessageconstant {colors}
\definemessageconstant {columns}
\definemessageconstant {encodings}
+\definemessageconstant {regimes}
\definemessageconstant {figures}
\definemessageconstant {files}
\definemessageconstant {floatblocks}
@@ -108,38 +109,8 @@
\definemessageconstant {verbatims}
\definemessageconstant {versions}
-
-%D The word \type{height} takes 6~token memory cells. The
-%D control sequence \type{\height} on the other hand uses only
-%D one. Knowing this, we can improve the performance of \TEX,
-%D both is terms of speed and memory usage, by using control
-%D sequences instead of the words written in full.
-%D
-%D Where in the \ASCII\ file the second lines takes nine extra
-%D characters, \TEX\ saves us 13~tokens.
-%D
-%D \starttyping
-%D \hrule width 10pt height 2pt depth 1pt
-%D \hrule \!!width 10pt \!!height 2pt \!!depth 1pt
-%D \stoptyping
-%D
-%D One condition is that we have defined \type{\!!height},
-%D \type{\!!width} and \type{\!!depth} as respectively
-%D \type{height}, \type{width} and \type{depth}. Using this
-%D scheme therefore only makes sense when a token sequence is
-%D used more than once. Savings like this should of course be
-%D implemented in english, just because \TEX\ is english.
-
-\def\!!width {width}
-\def\!!height {height}
-\def\!!depth {depth}
-\def\!!plus {plus}
-\def\!!minus {minus}
-\def\!!fill {fill}
-\def\!!to {to}
-
-%D The same goes for some \CONTEXT\ constants, used in the
-%D definition of private commands:
+%D Net come some \CONTEXT\ constants, used in the definition
+%D of private commands:
\definesystemconstant {next}
\definesystemconstant {pickup}
@@ -351,7 +322,6 @@
\def\!!twelvepoint {12pt}
\def\!!fourteenpointfour {14.4pt}
-\newdimen \zeropoint \zeropoint = 0pt
\newdimen \onepoint \onepoint = 1pt
\newdimen \onebasepoint \onebasepoint = 1bp
\chardef \scaledpoint = 1
@@ -451,6 +421,7 @@
\definesystemvariable {fi} % FIle
\definesystemvariable {fl} % Floats
\definesystemvariable {fm} % ForMules
+\definesystemvariable {fn} % subformulas
\definesystemvariable {fp} % FilegroeP
\definesystemvariable {fr} % ForM
\definesystemvariable {fs} % FileSynonym
@@ -584,6 +555,7 @@
\definesystemvariable {uc} % Unicode
\definesystemvariable {ui} % UItvoer
\definesystemvariable {ur} % URl
+\definesystemvariable {up} % Utility Program
\definesystemvariable {ve} % VErsie
\definesystemvariable {vn} % VoetNoten
\definesystemvariable {vt} % VerTical
@@ -644,6 +616,10 @@
\defineinterfacevariable {c} {c}
\defineinterfacevariable {d} {d}
+%D Special purpose variables:
+
+\def\v!oddeven#1{\ifodd#1\v!odd\else\v!even\fi}
+
%D The names of files and their extensions are fixed.
%D \CONTEXT\ uses as less files as possible. Utility files can
%D be recognized by the first two characters of the extension:
diff --git a/Master/texmf-dist/tex/context/base/page-app.tex b/Master/texmf-dist/tex/context/base/page-app.tex
index f31e3ad2da1..6e477903c22 100644
--- a/Master/texmf-dist/tex/context/base/page-app.tex
+++ b/Master/texmf-dist/tex/context/base/page-app.tex
@@ -115,6 +115,28 @@
\c!height=\v!fit,
\c!frame=\v!off]
+%D For Mojca:
+%D
+%D \starttyping
+%D \startTEXstream \chapter{Bla} Hello world!\crlf Hello world! \stopTEXstream
+%D \startTEXpage \chapter{Bla} Hello world!\crlf Hello world! \stopTEXpage
+%D \stoptyping
+%D
+%D maybe I should support stream=yes in framed.
+
+\def\startTEXstream
+ {\dosingleempty\dostartTEXstream}
+
+\def\dostartTEXstream[#1]%
+ {\page
+ \defineoutputstream[tex]%
+ \enableoutputstream[tex]%
+ \def\stopTEXstream
+ {\disableoutputstream
+ \startTEXpage
+ \outputstreamunvbox[tex]%
+ \stopTEXpage}}
+
%D Application pages (for an example, see \type {m-pstric}):
\def\@@texapp{texapp}
@@ -171,4 +193,30 @@
\box\scratchbox
\egroup}
+%D \macros
+%D {startpagefigure}
+%D
+%D \starttyping
+%D \starttext \pagefigure[two.1] \stoptext
+%D \stoptyping
+
+\def\startpagefigure
+ {\dodoubleempty\dostartpagefigure}
+
+\def\dostartpagefigure[#1][#2]%
+ {\bgroup
+ \getparameters[\??ex][\c!offset=\v!overlay,#2]%
+ \startTEXpage[\c!offset=\@@exoffset]%
+ \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic
+
+\def\stoppagefigure
+ {\stopTEXpage
+ \egroup}
+
+\def\pagefigure
+ {\dodoubleempty\dopagefigure}
+
+\def\dopagefigure[#1][#2]%
+ {\dostartpagefigure[#1][#2]\stoppagefigure}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-bck.tex b/Master/texmf-dist/tex/context/base/page-bck.tex
index 2054be5fb0d..886a4283730 100644
--- a/Master/texmf-dist/tex/context/base/page-bck.tex
+++ b/Master/texmf-dist/tex/context/base/page-bck.tex
@@ -159,13 +159,10 @@
\def\addpagebackground#1%
{\doifbothsidesoverruled
- \addsomebackground\v!rightpage#1\paperwidth\paperheight
- \orsideone
- \addsomebackground\v!rightpage#1\paperwidth\paperheight
- \orsidetwo
- \addsomebackground\v!leftpage #1\paperwidth\paperheight
- \od
- \addsomebackground\v!page #1\paperwidth\paperheight}
+ {\addsomebackground\v!rightpage#1\paperwidth\paperheight}
+ {\addsomebackground\v!rightpage#1\paperwidth\paperheight}
+ {\addsomebackground\v!leftpage #1\paperwidth\paperheight}%
+ \addsomebackground\v!page #1\paperwidth\paperheight}
%D Then there are the 25 areas that make up the layout: {\em
%D top, header, text, footer, bottom} times {\em left edge,
@@ -198,19 +195,6 @@
\fi
\addsomebackground\v!text#1\makeupwidth\textheight}
-% \def\addtextbackground#1%
-% {\ifconditional\hiddenbackgroundenabled
-% \addsomebackground\v!verborgen #1\zetbreedte\teksthoogte % mine !
-% \fi
-% \doifbothsidesoverruled
-% \addsomebackground\v!rechtertekst#1\zetbreedte\teksthoogte
-% \orsideone
-% \addsomebackground\v!rechtertekst#1\zetbreedte\teksthoogte
-% \orsidetwo
-% \addsomebackground\v!linkertekst #1\zetbreedte\teksthoogte
-% \od
-% \addsomebackground\v!tekst #1\zetbreedte\teksthoogte}
-
%D The next couple of macros implement the area backgrounds.
%D As said, these are cached in dedicated boxes. The offsets
%D and depth of the page are used for alignment purposes.
@@ -218,9 +202,9 @@
\newdimen\pageoffset % bleed
\newdimen\pagedepth
-\let\pagebackgroundhoffset = \!!zeropoint
-\let\pagebackgroundvoffset = \!!zeropoint
-\let\pagebackgrounddepth = \!!zeropoint
+\let\pagebackgroundhoffset\!!zeropoint
+\let\pagebackgroundvoffset\!!zeropoint
+\let\pagebackgrounddepth \!!zeropoint
% \def\setbackgroundboxes
% {\showmessage\m!layouts8\empty
@@ -235,8 +219,8 @@
%D background at the same time since something may have
%D changed halfway a page.
-\chardef\newrightbackground0
-\chardef\newleftbackground 0
+\chardef\newrightbackground\zerocount
+\chardef\newleftbackground \zerocount
\def\recalculatebackgrounds
{\global\newbackgroundtrue}
@@ -249,26 +233,22 @@
\global\setbox\rightbackground\emptybox
\fi
\doifbothsides
- \ifcase\newleftbackground \else
- % \showmessage\m!layouts8\empty
- \setbackgroundbox\leftbackground\relax
- \global\chardef\newleftbackground\zerocount
- \global\chardef\newrightbackground\zerocount
- \fi
- \orsideone
- \ifcase\newleftbackground \else
- % \showmessage\m!layouts8\empty
- \setbackgroundbox\leftbackground\relax
- \global\chardef\newleftbackground\zerocount
- %\global\chardef\newrightbackground\zerocount
- \fi
- \orsidetwo
- \ifcase\newrightbackground \else
- % \showmessage\m!layouts8\empty
- \setbackgroundbox\rightbackground\doswapmargins
- \global\chardef\newrightbackground\zerocount
- \fi
- \od
+ {\ifcase\newleftbackground \else
+ % \showmessage\m!layouts8\empty
+ \setbackgroundbox\leftbackground\relax
+ \global\chardef\newleftbackground\zerocount
+ \global\chardef\newrightbackground\zerocount
+ \fi}
+ {\ifcase\newleftbackground \else
+ % \showmessage\m!layouts8\empty
+ \setbackgroundbox\leftbackground\relax
+ \global\chardef\newleftbackground\zerocount
+ \fi}
+ {\ifcase\newrightbackground \else
+ % \showmessage\m!layouts8\empty
+ \setbackgroundbox\rightbackground\doswapmargins
+ \global\chardef\newrightbackground\zerocount
+ \fi}%
\ifx\@@mastate\v!repeat\else\global\newbackgroundfalse\fi}
\def\addmainbackground#1% todo: dimension spec
@@ -315,7 +295,7 @@
\ifconditional\swapbackgroundmargins
\doifmarginswapelse \donothing
{\swapmacros\v!rightmargin\v!leftmargin
- \swapmacros\v!rightedge \v!leftedge}%
+ \swapmacros\v!rightedge \v!leftedge}%
\fi
\calculatereducedvsizes
\offinterlineskip
@@ -361,8 +341,8 @@
\doifvaluesomething{\??ma#3#4\c!setups}{\setups[\getvalue{\??ma#3#4\c!setups}]}% should not produce funny spaces !
\fastlocalframed
[\??ma#3#4]
- [\c!component=#3-#4,\c!width=#1,\c!height=#2,\c!offset=\v!overlay,\c!setups=]
- {\getvalue{\??ma#3#4\c!command}}% {\hsize=#1\vsize=#2....}
+ [\c!component=#3-#4,\c!offset=\v!overlay,\c!setups=]
+ {\vbox to #2{\vss\hbox to#1{\hss\getvalue{\??ma#3#4\c!command}\hss}\vss}}%
\else
\hskip#1%
\fi
@@ -395,21 +375,20 @@
\def\dosetupbackgrounds[#1][#2][#3]%
{\ifthirdargument
\global\somebackgroundtrue
- \def\docommando##1%
+ \def\docommand##1%
{\doifinsetelse{##1}{\v!paper,\v!page,\v!leftpage,\v!rightpage}
{\getparameters[\??ma##1][#3]\checkbackground{##1}}
- {\def\dodocommando####1%
+ {\def\dodocommand####1%
{\getparameters[\??ma##1####1][#3]\checkbackground{##1####1}}%
- \processcommalist[#2]\dodocommando}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#2]\dodocommand}}%
+ \processcommalist[#1]\docommand
\else\ifsecondargument
\global\somebackgroundtrue
\doifcommonelse{#1}{\v!text,\v!hidden,%
%\v!linkertekst,\v!rechtertekst,%
\v!paper,\v!page,\v!leftpage,\v!rightpage}
- {\def\docommando##1%
- {\getparameters[\??ma##1][#2]\checkbackground{##1}}%
- \processcommalist[#1]\docommando}%
+ {\def\docommand##1{\getparameters[\??ma##1][#2]\checkbackground{##1}}%
+ \processcommalist[#1]\docommand}%
{\setupbackgrounds
[#1]%
[\v!leftedge,\v!leftmargin,\v!text,\v!rightmargin,\v!rightedge]%
@@ -476,7 +455,7 @@
%D intermediate commands. The inheritance macro makes sure
%D that copies are efficient.
-\def\dodocommando#1#2%
+\def\dodocommand#1#2%
{\copylocalframed
[\??ma#1#2][\??ma\v!page]%
\getparameters
@@ -491,29 +470,29 @@
%D The stand alone text area inherits from the page too.
-\dodocommando\v!text \empty
-%dodocommando\v!linkertekst \empty
-%dodocommando\v!rechtertekst\empty
-\dodocommando\v!hidden \empty
+\dodocommand\v!text \empty
+%dodocommand\v!linkertekst \empty
+%dodocommand\v!rechtertekst\empty
+\dodocommand\v!hidden \empty
%D We now define all 25 main areas in a row.
-\def\docommando#1%
- {\dodocommando#1\v!leftedge
- \dodocommando#1\v!leftmargin
- \dodocommando#1\v!text
- \dodocommando#1\v!rightmargin
- \dodocommando#1\v!rightedge}
+\def\docommand#1%
+ {\dodocommand#1\v!leftedge
+ \dodocommand#1\v!leftmargin
+ \dodocommand#1\v!text
+ \dodocommand#1\v!rightmargin
+ \dodocommand#1\v!rightedge}
-\docommando\v!top
-\docommando\v!header
-\docommando\v!text
-\docommando\v!footer
-\docommando\v!bottom
+\docommand\v!top
+\docommand\v!header
+\docommand\v!text
+\docommand\v!footer
+\docommand\v!bottom
%D We need some cleanup now.
-\let\dodocommando\relax \let\docommando\relax
+\let\dodocommand\relax \let\docommand\relax
%D We now set up the individual areas to use reasonable
%D defaults.
@@ -534,18 +513,18 @@
\c!offset=\!!zeropoint, % later set to \v!overlay, watch out !
\c!depth=\!!zeropoint]
-\def\docommando#1%
+\def\docommand#1%
{\inheritparameter[\??ma][#1\c!frameoffset][\v!page\c!offset]%
\inheritparameter[\??ma][#1\c!backgroundoffset][\v!page\c!offset]}
-\docommando\v!paper
-\docommando\v!page
-\docommando\v!leftpage
-\docommando\v!rightpage
+\docommand\v!paper
+\docommand\v!page
+\docommand\v!leftpage
+\docommand\v!rightpage
%D Again we clean up temporary macros.
-\let\docommando\relax
+\let\docommand\relax
%D The hidden layer can be populated by extending the
%D following comma separated list. This only happens in core
@@ -590,35 +569,15 @@
\resetglobal \expandafter\gobbleoneargument
\fi}
-% \def\doaddlocalbackground#1%
-% {\edef\next
-% {\noexpand\redoglobal\wd#1\the\wd#1%
-% \noexpand\redoglobal\ht#1\the\ht#1%
-% \noexpand\dodoglobal\dp#1\the\dp#1}%
-% \dodoglobal\setbox#1\hbox
-% {\fastlocalframed
-% [\??ma\v!local]
-% [\c!component=local,\c!frame=\v!off,\c!offset=\v!overlay,\c!setups=,%
-% \c!width=\wd#1,\c!height=\ht#1,% no \c!depth=\dp#1 in cont-exp.tex, to be checked !
-% \c!background=\localbackground]%
-% {\registerMPlocaltextarea{\box#1}}}%
-% \next
-% \doglobal\increment\localpositionnumber\relax} % afterwards !
-
\def\doaddlocalbackground#1%
- {\edef\next
- {\noexpand\redoglobal\wd#1\the\wd#1%
- \noexpand\redoglobal\ht#1\the\ht#1%
- \noexpand\redoglobal\dp#1\the\dp#1}%
- \redoglobal\setbox#1\hbox
- {\fastlocalframed
+ {\dodoglobal\setbox#1\hbox
+ {\fastlocalframed % \localframed
[\??ma\v!local]
[\c!component=local,\c!frame=\v!off,\c!offset=\v!overlay,\c!setups=,%
- \c!width=\wd#1,\c!height=\ht#1,% no \c!depth=\dp#1 in cont-exp.tex, to be checked !
+ \c!location=\v!keep,% when we use \localframed instead of \fastlocalframed
\c!background=\localbackground]%
{\registerMPlocaltextarea{\box#1}}}%
- \next
- \resetglobal
+ \resetglobal % redundant
\doglobal\increment\localpositionnumber\relax} % afterwards !
% Test how previous macro behaves with depth:
diff --git a/Master/texmf-dist/tex/context/base/page-flt.tex b/Master/texmf-dist/tex/context/base/page-flt.tex
index a6c39efec22..98d62bcb5ec 100644
--- a/Master/texmf-dist/tex/context/base/page-flt.tex
+++ b/Master/texmf-dist/tex/context/base/page-flt.tex
@@ -18,6 +18,8 @@
\unprotect
+\ifx\addlocalbackgroundtobox\undefined \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi
+
% naar supp-box.tex
\def\voidbox{\box\voidb@x}
@@ -181,6 +183,16 @@
13: there is nothing to split
\stopmessages
+\def\floatparameter #1{\csname\??fl\currentfloat#1\endcsname}
+\def\floatcaptionparameter#1{\csname\??kj\currentfloat#1\endcsname}
+
+% for the moment we need to define the parameters anyway, first we need to implement a
+% proper parent chain (also for framed); no problem now that machines are fast (tests
+% show that this may save 20 k or more in the format)
+%
+% \def\floatparameter #1{\executeifdefined{\??fl\currentfloat#1}{\csname\??fl#1\endcsname}}
+% \def\floatcaptionparameter#1{\executeifdefined{\??kj\currentfloat#1}{\csname\??bk#1\endcsname}}
+
\def\setupfloats
{\dodoubleargument\getparameters[\??bk]}
@@ -188,22 +200,28 @@
{\dodoubleargument\getparameters[\??kj]}
\def\dosetupfloat[#1][#2]%
- {\def\docommando##1{\getparameters[\??fl##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??fl##1][#2]}%
+ \processcommalist[#1]\docommand}
\def\setupfloat
{\dodoubleargument\dosetupfloat}
\def\dosetupcaption[#1][#2]%
- {\def\docommando##1{\getparameters[\??kj##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??kj##1][#2]}%
+ \processcommalist[#1]\docommand}
\def\setupcaption
{\dodoubleargument\dosetupcaption}
+
\def\doemptyblock#1%
{\localframed
- [\??fl#1][\c!frame=\v!on]%
+ [\??fl#1]
+ [\c!frame=\v!on,
+ \c!width=\@@bkwidth,
+ \c!height=\@@bkheight,
+ \c!location=\v!normal,
+ \c!offset=\@@bkoffset]%
{\getmessage\m!floatblocks{12}\empty}}
% A complication is that we may have to handle a pagebreak
@@ -212,27 +230,17 @@
% we're realy dealing with the float. Some day I'll root out
% the global settings.
-% \def\docomplexplacefloat[#1][#2]% [#3]#4%
-% {\edef\floattype{#1}%
-% \doifelsenothing\floattype
-% {\let\floattype\v!figure}
-% {\doifundefined{\??fl#1\c!default}{\let\floattype\v!figure}}%
-% \doifelsenothing{#2}
-% {\edef\floatlocation{\getvalue{\??fl\floattype\c!default}}}
-% {\edef\floatlocation{#2}}%
-% \expanded{\dodocomplexplacefloat[\floattype][\floatlocation]}}
-
\def\docomplexplacefloat[#1][#2]% [#3]#4%
- {\edef\floattype{#1}%
- \doifelsenothing\floattype
- {\let\floattype\v!figure}
- {\doifundefined{\??fl#1\c!default}{\let\floattype\v!figure}}%
+ {\edef\currentfloat{#1}%
+ \doifelsenothing\currentfloat
+ {\let\currentfloat\v!figure}
+ {\doifundefined{\??fl#1\c!default}{\let\currentfloat\v!figure}}%
\doifelsenothing{#2}
- {\edef\floatlocation{\getvalue{\??fl\floattype\c!default}}}
+ {\edef\floatlocation{\floatparameter\c!default}}
{\edef\floatlocation{#2}}%
\doifinsetelse\v!split{#2}
- {\expanded{\dodocomplexsplitfloat[\floattype][\floatlocation]}}
- {\expanded{\dodocomplexplacefloat[\floattype][\floatlocation]}}}
+ {\expanded{\dodocomplexsplitfloat[\currentfloat][\floatlocation]}}
+ {\expanded{\dodocomplexplacefloat[\currentfloat][\floatlocation]}}}
\def\dodocomplexsplitfloat[#1][#2][#3]#4%
{\splitfloat{\dodocomplexplacefloat[#1][#2][#3]{#4}}}
@@ -245,43 +253,6 @@
\v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,%
\v!text,\v!opposite}% \v!page
-% \def\dodocomplexplacefloat[#1][#2][#3]#4%
-% {\flushnotes
-% \flushsidefloats % here !
-% \ifsomefloatwaiting
-% % this was \checkwaitingfloats spread all over
-% \doifinsetelse\v!always{#2}
-% {\showmessage\m!floatblocks5\empty}
-% {\expanded{\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats\donothing}%
-% % but which should be done before using box \floatbox
-% \fi
-% \ifmargeblokken % waarschijnlijk gebroken ! ! ! !
-% \doifinset\v!margin{#2}
-% {\endgraf
-% \bgroup\everypar{\egroup\the\everypar}%
-% \hsize\@@mbwidth}%
-% \fi
-% \global\insidefloattrue
-% \begingroup % **
-% \the\everyinsidefloat
-% \let\@@extrafloat\empty
-% \presetmorefloatvariables{#2}%
-% \dowithnextboxcontent % better a \the\everyfloattoks
-% {\setlocalfloathsize
-% \getvalue{\??fl#1\c!inner}%
-% \fuzzysnappingfalse
-% \postponenotes} % new
-% {\xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
-% % we need to carry over the par because of side floats
-% \doifnotinset\v!text{#2}{\carryoverpar\endgroup}%
-% \global\sidefloatdownshift \zeropoint
-% \global\sidefloatextrashift\zeropoint
-% \ifparfloat
-% \doifinset\v!reset{#2}\forgetsidefloats
-% \doinhibitblank
-% \fi}% better move this to side floats
-% \vbox}
-
\def\dodocomplexplacefloat[#1][#2][#3]#4%
{\flushnotes
\flushsidefloats % here !
@@ -305,12 +276,12 @@
\presetmorefloatvariables{#2}%
\dowithnextboxcontent % better a \the\everyfloattoks
{\setlocalfloathsize
- \getvalue{\??fl#1\c!inner}%
+ \floatparameter\c!inner
\fuzzysnappingfalse
\postponenotes} % new
- {\doifvaluesomething{\??fl#1\c!criterium}
- {\ifdim\wd\nextbox>\getvalue{\??fl#1\c!criterium}\relax
- \edef\forcedfloatmethod{\executeifdefined{\??fl#1\c!fallback}\v!here}%
+ {\doifsomething{\floatparameter\c!criterium}
+ {\ifdim\wd\nextbox>\floatparameter\c!criterium\relax
+ \edef\forcedfloatmethod{\executeifdefined{\??fl\currentfloat\c!fallback}\v!here}%
\fi}%
\xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
% we need to carry over the par because of side floats
@@ -346,14 +317,14 @@
\fi
\global\sidefloatshift\zeropoint
\global\sidefloatmaximum\zeropoint
- \global\chardef\sidefloatmethod\getvalue{\??fl#1\c!sidemethod}%
- \global\chardef\textfloatmethod\getvalue{\??fl#1\c!textmethod}%
+ \global\chardef\sidefloatmethod\floatparameter\c!sidemethod
+ \global\chardef\textfloatmethod\floatparameter\c!textmethod
\global\chardef\sidefloatalign\zerocount
\globallet\floatrotation\!!zerocount
\calculatefloatskips{#1}%
\ifparfloat
\processaction
- [\getvalue{\??fl#1\c!sidealign}]
+ [\floatparameter\c!sidealign]
[\v!height=>\global\chardef\sidefloatalign\plusone,%
\v!line=>\global\chardef\sidefloatalign\plustwo,% (***)
\v!depth=>\global\chardef\sidefloatalign\plusthree,%
@@ -382,7 +353,7 @@
\fi
\doifinsetelse\v!nonumber{#2}
{\global\nofloatnumbertrue}
- {\doifelsevalue{\??kj#1\c!number}\v!yes
+ {\doifelse{\floatcaptionparameter\c!number}\v!yes
{\global\nofloatnumberfalse}
{\global\nofloatnumbertrue}}%
\ConvertToConstant\doifelse{#4}{}
@@ -431,17 +402,6 @@
% \fuzzysnappingfalse
%\to \everyinsidefloat
-%\def\doifrightpagefloatelse % watch out: other default ! ! !
-% {\ifdoublesided
-% \ifodd\purenumber\twopassfloatdata\space
-% \@EAEAEA\firstoftwoarguments
-% \else
-% \@EAEAEA\secondoftwoarguments
-% \fi
-% \else
-% \@EA\firstoftwoarguments
-% \fi}
-
\def\doifrightpagefloatelse
{\ifdoublesided
\ifsinglesided
@@ -559,22 +519,22 @@
#4\setbox#3\vbox
{\vskip\sidefloatdownshift\nointerlineskip\box#3}%
\fi
- \doifvaluesomething{\??fl#1\c!minwidth}
- {\scratchdimen\getvalue{\??fl#1\c!minwidth}\relax
+ \doifsomething{\floatparameter\c!minwidth}
+ {\scratchdimen\floatparameter\c!minwidth\relax
\ifdim\wd#3<\scratchdimen
#4\setbox#3\hbox to \scratchdimen
- {\doifnotvalue{\??fl#1\c!location}\v!left \hss
+ {\doifnot{\floatparameter\c!location}\v!left \hss
\box#3%
- \doifnotvalue{\??fl#1\c!location}\v!right\hss}%
+ \doifnot{\floatparameter\c!location}\v!right\hss}%
\fi}%
% todo: rand / rug
\doifinset\v!hanging{#2}
{\doifcommonelse{\v!inleft,\v!leftmargin}{#2}
- {\letvalue{\??fl#1\c!maxwidth}\leftmarginwidth}%
+ {\letvalue{\??fl\currentfloat\c!maxwidth}\leftmarginwidth}%
{\doifcommon{\v!inright,\v!rightmargin}{#2}
- {\letvalue{\??fl#1\c!maxwidth}\rightmarginwidth}}}%
- \doifvaluesomething{\??fl#1\c!maxwidth}
- {\scratchdimen\getvalue{\??fl#1\c!maxwidth}\relax
+ {\letvalue{\??fl\currentfloat\c!maxwidth}\rightmarginwidth}}}%
+ \doifsomething{\floatparameter\c!maxwidth}
+ {\scratchdimen\floatparameter\c!maxwidth\relax
\ifdim\wd#3>\scratchdimen
\doifcommonelse{\v!inright,\v!rightmargin,\v!rightedge
\v!inleft,\v!leftmargin,\v!leftedge}{#2}
@@ -584,9 +544,9 @@
{\doifnotinset\v!right{#2}\hss
\box#3%
\doifnotinset\v!left{#2}\hss}%
- {\doifnotvalue{\??fl#1\c!location}\v!left\hss
+ {\doifnot{\floatparameter\c!location}\v!left\hss
\box#3%
- \doifnotvalue{\??fl#1\c!location}\v!right\hss}}}%
+ \doifnot{\floatparameter\c!location}\v!right\hss}}}%
\fi}%
\fi}
@@ -617,15 +577,20 @@
% todo: \floatparameter + \currentfloat - saves many hash entries
\def\dododefinefloat[#1][#2]%
- {\presetlocalframed[\??fl#1]%
+ {\def\currentfloat{#1}%
+ \presetlocalframed[\??fl#1]%
\setupfloat
[#1]
- [\c!width=8\lineheight, % 15\bodyfontsize,
- \c!height=6\lineheight, % 10\bodyfontsize,
+ [%\c!width=8\lineheight, % 15\bodyfontsize,
+ %\c!height=6\lineheight, % 10\bodyfontsize,
+\c!offset=\v!overlay,
+\c!width=\v!fit,
+\c!height=\v!fit,
\c!minwidth=,
\c!maxwidth=,
\c!maxheight=,
\c!criterium=,
+% inherited
\c!sidespacebefore=\@@bksidespacebefore,
\c!sidespaceafter=\@@bksidespaceafter,
\c!sidealign=\@@bksidealign, % \v!line
@@ -646,25 +611,28 @@
\c!rightframe=\@@bkrightframe,
\c!frameoffset=\@@bkframeoffset,
%\c!local=\@@bklocal,
- \c!pageboundaries=,
\c!textmethod=\@@bktextmethod,
\c!sidemethod=\@@bksidemethod,
+ \c!pageboundaries=,
\c!default=]%
\setupcaption
[#1]
- [\c!location=\@@kjlocation,
+ [\c!headstyle=\@@kjheadstyle,
+ \c!headcolor=\@@kjheadcolor,
+ \c!textstyle=\@@kjtextstyle,
+ \c!textcolor=\@@kjtextcolor,
+ \c!style=\@@kjstyle,
+ \c!color=\@@kjcolor,
+ \c!location=\@@kjlocation,
\c!grid=\@@kjgrid,
%\c!before=\@@kjbefore,
\c!inbetween=\@@kjinbetween,
%\c!after=\@@kjafter,
+\c!spacebefore=\@@kjspacebefore,
+\c!spaceinbetween=\@@kjspaceinbetween,
+\c!spaceafter=\@@kjspaceafter,
\c!width=\@@kjwidth,
\c!minwidth=\@@kjminwidth,
- \c!headstyle=\@@kjheadstyle,
- \c!headcolor=\@@kjheadcolor,
- \c!textstyle=\@@kjtextstyle,
- \c!textcolor=\@@kjtextcolor,
- \c!style=\@@kjstyle,
- \c!color=\@@kjcolor,
\c!align=\@@kjalign,
\c!number=\@@kjnumber,
\c!way=\@@kjway,
@@ -675,17 +643,22 @@
\c!stopper=\@@kjstopper,
\c!suffix=\@@kjsuffix, % hook
\c!command=\@@kjcommand,
- \c!conversion=\@@kjconversion]%
+ \c!conversion=\@@kjconversion
+ ]%
\definenumber % \definelabel
[#1]
[\c!text=#1,
\c!location=\v!intext,
- \c!way=\getvalue{\??kj#1\c!way},
- \c!blockway=\getvalue{\??kj#1\c!blockway},
- \c!sectionnumber=\getvalue{\??kj#1\c!sectionnumber},
- \c!conversion=\getvalue{\??kj#1\c!conversion}]%
+% \c!way=\getvalue{\??kj#1\c!way},
+% \c!blockway=\getvalue{\??kj#1\c!blockway},
+% \c!sectionnumber=\getvalue{\??kj#1\c!sectionnumber},
+% \c!conversion=\getvalue{\??kj#1\c!conversion}]%
+ \c!way=\floatcaptionparameter\c!way,
+ \c!blockway=\floatcaptionparameter\c!blockway,
+ \c!sectionnumber=\floatcaptionparameter\c!sectionnumber,
+ \c!conversion=\floatcaptionparameter\c!conversion]%
\presetlabeltext[#1=\Word{#1}~]%
- \checkfloatracer{\v!float#1}%
+ \newnodelocation{\v!float\@@thenumber{#1}}%
\dodefinefloatcommands[#1][#2]}
\def\dodefinefloatcommands[#1][#2]%
@@ -719,6 +692,7 @@
\c!textmethod,\c!sidemethod]%
\copyparameters[\??kj#1][\??kj#3]
[\c!location,\c!before,\c!inbetween,\c!after,
+ \c!spacebefore,\c!spaceinbetween,\c!spaceafter,
\c!width,\c!headstyle,\c!headcolor,\c!style,\c!color,
\c!textstyle,\c!textcolor,\c!minwidth,
\c!align,\c!number,\c!way,\c!blockway,
@@ -727,11 +701,41 @@
\presetlabeltext[#1=\labeltext{#3}]%
\dodefinefloatcommands[#1][#2]}
+% todo: ook in localframed een parent chain, then we can inherit without defs
+
+\def\redodefinefloat[#1][#2][#3]% same label/number
+ {\presetlocalframed[\??fl#1]%
+ \copylocalframed[\??fl#1][\??fl#3]%
+ \copyparameters[\??fl#1][\??fl#3]
+ [\c!width,\c!height,%\c!local,
+ \c!maxwidth,\c!maxheight,\c!minwidth,
+ \c!margin,\c!sidespacebefore,\c!sidespaceafter,\c!sidealign,
+ \c!leftmargindistance,\c!rightmargindistance,\c!criterium,
+ \c!frame,\c!radius,\c!corner,\c!location,\c!background,\c!framecolor,
+ \c!backgroundscreen,\c!backgroundcolor,\c!backgroundoffset,
+ \c!topframe,\c!bottomframe,\c!leftframe,\c!rightframe,
+ \c!frameoffset,\c!pageboundaries,\c!default,
+ \c!textmethod,\c!sidemethod]%
+ \copyparameters[\??kj#1][\??kj#3]
+ [\c!location,\c!before,\c!inbetween,\c!after,
+ \c!spacebefore,\c!spaceinbetween,\c!spaceafter,
+ \c!width,\c!headstyle,\c!headcolor,\c!style,\c!color,
+ \c!textstyle,\c!textcolor,\c!minwidth,
+ \c!align,\c!number,\c!way,\c!blockway,
+ \c!sectionnumber,\c!separator,\c!stopper,\c!suffix,\c!distance,\c!conversion]%
+ \definenumber[#1][#3]%
+ \presetlabeltext[#1=\labeltext{#3}]%
+ \dodefinefloatcommands[#1][#2]}
+
+
\def\placefloat
{\dotripleempty\docomplexplacefloat}
-\installinsertion\topins \newdimen\topinserted
-\installinsertion\botins \newdimen\botinserted
+\installinsertion\topins
+\installinsertion\botins
+
+\newdimen\botinserted
+\newdimen\topinserted
%D Extra float registers.
@@ -769,80 +773,27 @@
\let\twopassfloatdata\realpageno
\def\dosavefloatdata % \expanded
- {\bgroup
- \doglobal\increment\noffloatdata
- \edef\dosavefloatdata
- {\writeutilitycommand
- {\twopassentry
- {\s!float\s!data}%
- {\noffloatdata}%
- {\noffloatpages::\noexpand\realfolio}}}% later {}{}{}{} and \getfirst...
- \dosavefloatdata
- \egroup}
+ {\doglobal\increment\noffloatdata
+ \lazysavetaggedtwopassdata{\s!float\s!data}{\noffloatdata}{\noffloatpages}{\noexpand\realfolio}}% later {}{}{}{} and \getfirst...
\def\dogetfloatdata % precedes save !
{\doglobal\increment\noffloatpages
- \findtwopassdata{\s!float\s!data}{\noffloatpages::}%
+ \findtwopassdata{\s!float\s!data}{\noffloatpages}%
\iftwopassdatafound
\globallet\twopassfloatdata\twopassdata
\else
\globallet\twopassfloatdata\realpageno % \realfolio
\fi}
-% Er wordt bij \v!altijd als dat nodig is hernummerd.
-% Daarbij wordt gebruik gemaakt van de opgeslagen nummers en
-% volgorde.
-%
-% replaced code:
-%
-% \definetwopasslist\s!float
-%
-% \def\dofloatreference#1%
-% {\doifnot\@@bknumbering\v!nocheck
-% {\doglobal\increment\numberedfloat
-% \doifelse\@@bknumbering\v!text % alternative to yes|page
-% {\let\next\immediatewriteutilitycommand}
-% {\let\next\writeutilitycommand}%
-% \expanded{\next
-% {\noexpand\twopassentry
-% {\s!float}%
-% {\numberedfloat}%
-% {\composedsectionnumber}}}}}
-%
-% \def\redofloatorder#1%
-% {\doifnot\@@bknumbering\v!nocheck
-% {\doglobal\increment\nofplacedfloats\relax
-% \gettwopassdata\s!float
-% \iftwopassdatafound
-% \doifnot\composedsectionnumber\twopassdata
-% {\edef\oldcomposedsectionnumber{\composedsectionnumber}%
-% \xdef\composedsectionnumber{\twopassdata}%
-% \showmessage\m!floatblocks1{\nofplacedfloats,#1 \oldcomposedsectionnumber,\composedsectionnumber}}%
-% \fi}}
-%
-% \def\preparefloatnumber#1%
-% {\incrementnumber[#1]%
-% \makesectionnumber[#1]}
-%
-% \def\tracefloatnumber#1%
-% {\dofloatreference{#1}%
-% \redofloatorder{#1}}
-%
-% \def\checkfloatracer#1%
-% {}
-
-\def\checkfloatracer#1%
- {\newnodelocation{#1}}
-
\def\tracefloatnumber#1%
- {\doifnot\@@bknumbering\v!nocheck
- {\checkfloatracer{\v!float#1}% will go
- \tagnodelocation{\v!float#1}}}
+ {\doifnot\@@bknumbering\v!nocheck{\tagnodelocation{\v!float\@@thenumber{#1}}}}
\newconditional\retainfloatnumber
\def\preparefloatnumber#1%
{\xdef\floatcaptionnumber{#1}%
+ \doifelsenodelocation{\v!float\@@thenumber{#1}}
+ \donothing {\chardef\nodelocationmode\zerocount}%
\doifelse\@@bknumbering\v!nocheck
{\incrementnumber[#1]%
\makesectionnumber[#1]%
@@ -863,10 +814,9 @@
\incrementnumber[#1]%
\savenumber[#1]%
% the real work is done here
- \checkfloatracer{\v!float#1}% will go
- \nextnodelocation{\v!float#1}% better \nextfloatnumber
- \analyzenodelocation{\v!float#1}%
- \scratchcounter\getnodelocationo{\v!float#1}%
+ \nextnodelocation{\v!float\@@thenumber{#1}}% better \nextfloatnumber
+ \analyzenodelocation{\v!float\@@thenumber{#1}}%
+ \scratchcounter\getnodelocationo{\v!float\@@thenumber{#1}}%
\advance\scratchcounter\minusone
% here we correct for 'per whatever handling'
\advance\scratchcounter-\accumulatednumber[#1]%
@@ -928,6 +878,12 @@
% \setbox\floatbox\hbox to \hsize{\hss\box\globalscratchbox\hss}%
% \else
% \setbox\floatbox\box\globalscratchbox % local !
+% % retain special alignments
+% \ifinsidecolumns
+% \ifdim\wd\floatbox>\makeupwidth
+% \wd\floatbox\makeupwidth
+% \fi
+% \fi
% \fi
% \else
% \setbox\floatbox\box\globalscratchbox % local !
@@ -1261,19 +1217,6 @@
\def\floatautofactor{.5}
-% \def\sometopbottomfloat[#1]%
-% {\doifinsetelse\v!auto{#1}
-% {\ifdim\pagetotal<\floatautofactor\pagegoal % when empty page, maxdimen
-% \placesometopsfloat[#1]%
-% \else
-% \placesomebotsfloat[#1]%
-% \fi}
-% {\doifinsetelse\v!top{#1}
-% {\placesometopsfloat[#1]}
-% {\doifinsetelse\v!bottom{#1}
-% {\placesomebotsfloat[#1]}
-% {\placesomeherefloat[#1]}}}}
-
\def\sometopbottomfloat[#1]%
{\doifelse\floatmethod\v!auto
{\ifdim\pagetotal<\floatautofactor\pagegoal % when empty page, maxdimen
@@ -1299,10 +1242,6 @@
% \box\floatbox inhoud+referentie
%
% \do???float#1 #1 = boxnummer
-%
-% \ifinsidefloat wordt \true gezet voor \docompletefloat en \false
-% na float plaatsen; kan worden gebruikt om in
-% andere commando's witruimte te onderdrukken
\newdimen\floatsideskip \floatsideskip =12pt
\newdimen\floattopskip \floattopskip =\floattopskip
@@ -1329,39 +1268,23 @@
{\global#1\zeropoint}
{\doifelse{#2}\v!none
{\global#1\zeropoint}
- {\setbox0\vbox{\whitespace\@EA\blank\@EA[#2]}%
+ {\setbox0\vbox{\whitespace\expanded{\blank[#2]}}%
\global#1\ht0}}}
-\def\calculatefloatskips#1%
+\def\calculatefloatskips#1% todo floatparam
{{\docalculatefloatskip\floattopskip \@@bkspacebefore
\docalculatefloatskip\floatbottomskip \@@bkspaceafter
\docalculatefloatskip\sidefloattopskip {\getvalue{\??fl#1\c!sidespacebefore}}% \@@bksidespacebefore
\docalculatefloatskip\sidefloatbottomskip{\getvalue{\??fl#1\c!sidespaceafter}}% \@@bksidespaceafter
\gdef\sidefloattopoffset{\openstrutdepth}% was \def
- \global\floatsideskip\getvalue{\??fl#1\c!margin}%
+ \global\floatsideskip \getvalue{\??fl#1\c!margin}%
\global\sidefloatleftshift \getvalue{\??fl#1\c!leftmargindistance}%
\global\sidefloatrightshift\getvalue{\??fl#1\c!rightmargindistance}%
- \global\noftopfloats \@@bkntop\relax
- \global\nofbotfloats \@@bknbottom\relax}}
-
-\newif\ifinsidefloat
+ \global\noftopfloats\@@bkntop \relax
+ \global\nofbotfloats\@@bknbottom\relax}}
\let\floatcaptionsuffix\empty % an optional suffix
\let\floatcaptionnumber\empty % a logical counter
-
-% obsolete ?
-%
-% \def\dosetfloatcaption#1#2#3% name will change
-% {\def\dofloattekst%
-% {{\doattributes{\??kj#1}\c!sttle\c!color{#3}}}%
-% \doifelsevalue{\??kj#1\c!number}\v!yes
-% {\def\dofloatnummer%
-% {{\xdef\floatcaptionnumber{#1}%
-% \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor
-% {\strut#2\floatcaptionsuffix}}}%
-% \ConvertToConstant\doifnot{#3}{}
-% {\tfskip\emergencystretch=.5em}}}
-% {\let\dofloatnummer\empty}}
% Quite experimental !
@@ -1403,7 +1326,7 @@
{\doattributes{\??kj#1}\c!headstyle\c!headcolor
{\labeltexts{#1}{\preparednumber}}%
\doattributes{\??kj#1}\c!textstyle\c!textcolor
- {\dotfskip{\getvalue{\??kj#1\c!distance}}#3}}}%
+ {\dotfskip{\floatcaptionparameter\c!distance}#3}}}%
\fi}
\def\placefloatcaptiontext [#1]{\getvalue{@fl@t@#1}}
@@ -1417,34 +1340,24 @@
\let\placefloatlabelreference \placefloatcaptionreference
\def\borderedfloatbox#1%
- {\localframed
- [\??fl#1]
- [\c!width=\@@bkwidth,
- \c!height=\@@bkheight,
- \c!location=\v!normal,
- \c!offset=\@@bkoffset]%
- {\box\floatbox}}
+ {\localframed[\??fl#1][\c!location=\v!normal]{\box\floatbox}}
\newbox\captionbox
-% \floatparameter
-
-\def\putcompletecaption#1#2#3#4%
- {\noindent
-% \xdef\lastcaptiontag{\strut#2\floatcaptionsuffix}%
+\def\putcompletecaption#1#2#3%
+ {\doifsomething{\floatcaptionparameter\c!spacebefore}{\blank[\floatcaptionparameter\c!spacebefore]}%
+% \floatcaptionparameter\c!before % test for side effects first
+ \noindent
\xdef\lastcaptiontag{\strut#2}%
-% \xdef\floatcaptionnumber{#1}%
\dostartattributes{\??kj#1}\c!style\c!color\empty
\ifnofloatnumber
\else
\hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2}}%
\ifnofloatcaption \else \ifemptyfloatcaption \else
- \ifcase#4\relax
- \scratchskip\@@kjkjdistance\relax
- \dotfskip\scratchskip\emergencystretch.5\scratchskip
- \else
- \ifx\@@kjkjinbetween\empty\else\unskip\@@kjkjinbetween\fi
- \fi
+ \doifelsenothing{\floatcaptionparameter\c!spaceinbetween}
+ {\scratchskip\floatcaptionparameter\c!distance\relax
+ \dotfskip\scratchskip\emergencystretch.5\scratchskip}
+ {\blank[\floatcaptionparameter\c!spaceinbetween]}%
\fi \fi
\fi
\ifnofloatcaption
@@ -1456,7 +1369,9 @@
\xdef\lastcaptiondp{\strutdepth}%
\begstrut#3\endstrut\endgraf}%
\fi
- \dostopattributes}
+ \dostopattributes
+% \floatcaptionparameter\c!after % test for side effects first
+ \doifsomething{\floatcaptionparameter\c!spaceafter}{\blank[\floatcaptionparameter\c!spaceafter]}}
\let\lastcaptionht\!!zeropoint
\let\lastcaptiondp\!!zeropoint
@@ -1466,6 +1381,11 @@
\newbox\tempfloatbox
\newbox\tempcaptionbox
+\newif\iftracecaptions
+
+\def\settracedcaptionbox
+ {\iftracecaptions\setbox\tempcaptionbox\ruledhbox{\box\tempcaptionbox}\fi}
+
%\stelblokkopjesin[\c!width=5cm]
%\stelblokkopjesin[\c!align=\v!left]
%\stelblokkopjesin[\c!align=\v!right]
@@ -1473,7 +1393,7 @@
\def\docheckcaptioncontent#1#2#3#4%
{\ifnofloatcaption \else
\setbox\tempcaptionbox\hbox
- {\trialtypesettingtrue\notesenabledfalse\putcompletecaption{#4}{#2}{#3}{0}}%
+ {\trialtypesettingtrue\notesenabledfalse\putcompletecaption{#4}{#2}{#3}}%
% new, \placefigure{\XMLflush{somecaption}}{} passes earlier empty check
% so here we misuse the scratch box; actually this means that the previous
% test can go away (some day, when i redo this module)
@@ -1489,19 +1409,68 @@
\ifx\moveboxontogrid\undefined \let\movecaptionontogrid\gobblethreearguments \fi
+% \def\dosetpagfloat#1#2#3#4% \copy wegwerken
+% {\bgroup
+% \setlocalfloathsize
+% \ifnum\floatrotation>0
+% \swapdimens\hsize\vsize
+% \fi
+% \forgetall
+% \postponenotes
+% \dontcomplain
+% \setbox\tempfloatbox\vbox{\borderedfloatbox{#4}}%
+% \def\locatefloat
+% {\chardef\alignstrutmode\zerocount
+% \alignedline{\floatparameter\c!location}\v!middle}%
+% \docheckcaptioncontent{#1}{#2}{#3}{#4}%
+% \ifnofloatcaption
+% \dopreparenocaption{#1}{#2}{#3}{#4}%
+% \edef\width{\the\wd\floatbox}%
+% \doglobal\addlocalbackgroundtobox\floatbox
+% \else
+% % todo: installable maken, variant/method=auto vs macro
+% \doifinsetelse{\floatcaptionparameter\c!location}{\v!high,\v!middle,\v!low}
+% {\dopreparesidecaption{#1}{#2}{#3}{#4}}
+% {\doifelse{\floatcaptionparameter\c!minwidth}\v!fit
+% {\doifelse{\floatcaptionparameter\c!width}\v!max
+% {\dopreparestackcaptionmax{#1}{#2}{#3}{#4}}
+% {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox % wider caption
+% \doifelse{\floatcaptionparameter\c!width}\v!fit
+% {\dopreparestackcaptionaut{#1}{#2}{#3}{#4}}
+% {\dopreparestackcaptionwid{#1}{#2}{#3}{#4}}%
+% \else
+% \dopreparestackcaptionmin{#1}{#2}{#3}{#4}%
+% \fi}}
+% {\dopreparestackcaptionfix{#1}{#2}{#3}{#4}}}% new, special effects (see icare)
+% \edef\width{\the\wd\tempfloatbox}%
+% \addlocalbackgroundtobox\tempfloatbox
+% \setbox\tempcaptionbox\hbox{\floatcaptionparameter\c!command{\box\tempcaptionbox}}%
+% \moveboxontogrid\tempcaptionbox{\floatcaptionparameter\c!grid}\lastcaptionht
+% \addlocalbackgroundtobox\tempcaptionbox
+% \buildfloatbox
+% \fi
+% \ifnum\floatrotation>0
+% \global\setbox\floatbox\vbox
+% {\rotate[\c!rotation=\floatrotation]{\box\floatbox}}%
+% \edef\width{\the\wd\tempfloatbox}%
+% \else
+% \postcenterfloatbox\width
+% \fi
+% \egroup}
+
\def\dosetpagfloat#1#2#3#4% \copy wegwerken
{\bgroup
\setlocalfloathsize
-\ifnum\floatrotation>0
- \swapdimens\hsize\vsize
-\fi
+ \ifnum\floatrotation>0
+ \swapdimens\hsize\vsize
+ \fi
\forgetall
\postponenotes
\dontcomplain
\setbox\tempfloatbox\vbox{\borderedfloatbox{#4}}%
\def\locatefloat
{\chardef\alignstrutmode\zerocount
- \alignedline\@@flfllocation\v!middle}%
+ \alignedline{\floatparameter\c!location}\v!middle}%
\docheckcaptioncontent{#1}{#2}{#3}{#4}%
\ifnofloatcaption
\dopreparenocaption{#1}{#2}{#3}{#4}%
@@ -1509,23 +1478,12 @@
\doglobal\addlocalbackgroundtobox\floatbox
\else
% todo: installable maken, variant/method=auto vs macro
- \doifinsetelse\@@kjkjlocation{\v!high,\v!middle,\v!low}
- {\dopreparesidecaption{#1}{#2}{#3}{#4}}
- {\doifelse\@@kjkjminwidth\v!fit
- {\doifelse\@@kjkjwidth\v!max
- {\dopreparestackcaptionmax{#1}{#2}{#3}{#4}}
- {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox % wider caption
- \doifelse\@@kjkjwidth\v!fit
- {\dopreparestackcaptionaut{#1}{#2}{#3}{#4}}
- {\dopreparestackcaptionwid{#1}{#2}{#3}{#4}}%
- \else
- \dopreparestackcaptionmin{#1}{#2}{#3}{#4}%
- \fi}}
- {\dopreparestackcaptionfix{#1}{#2}{#3}{#4}}}% new, special effects (see icare)
+ \dopreparedocaption{#1}{#2}{#3}{#4}%
+ \settracedcaptionbox
\edef\width{\the\wd\tempfloatbox}%
\addlocalbackgroundtobox\tempfloatbox
- \setbox\tempcaptionbox\hbox{\@@kjkjcommand{\box\tempcaptionbox}}%
- \moveboxontogrid\tempcaptionbox\@@kjkjgrid\lastcaptionht
+ \setbox\tempcaptionbox\hbox{\floatcaptionparameter\c!command{\box\tempcaptionbox}}%
+ \moveboxontogrid\tempcaptionbox{\floatcaptionparameter\c!grid}\lastcaptionht
\addlocalbackgroundtobox\tempcaptionbox
\buildfloatbox
\fi
@@ -1538,10 +1496,6 @@
\fi
\egroup}
-\ifx\addlocalbackgroundtobox\undefined
- \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument}%
-\fi
-
\def\captionminwidth {15\bodyfontsize}
\def\captionovershoot {2em}
@@ -1552,57 +1506,95 @@
\fi\fi
\locatefloat{\copy\tempfloatbox}}}
+\def\dopreparedocaption#1#2#3#4%
+ {\doifinsetelse{\floatcaptionparameter\c!location}{\v!top,\v!bottom}
+ {\doifinsetelse{\floatcaptionparameter\c!width}{\v!fit,\v!max}
+ {\doifelse{\floatcaptionparameter\c!minwidth}\v!fit
+ {\doifelse{\floatcaptionparameter\c!width}\v!max
+ {\dopreparestackcaptionmax{#1}{#2}{#3}{#4}}
+ {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox % wider caption
+ \doifelse{\floatcaptionparameter\c!width}\v!fit
+ {\dopreparestackcaptionaut{#1}{#2}{#3}{#4}}
+ {\dopreparestackcaptionwid{#1}{#2}{#3}{#4}}%
+ \else
+ \dopreparestackcaptionmin{#1}{#2}{#3}{#4}%
+ \fi}}
+ {\dopreparestackcaptionfix{#1}{#2}{#3}{#4}}}%
+ {\dopreparesidewidthcaption{#1}{#2}{#3}{#4}}}% new, special effects (see icare)
+ {\doifinsetelse{\floatcaptionparameter\c!width}{\v!fit,\v!max}
+ {\dopreparesideautocaption{#1}{#2}{#3}{#4}}
+ {\dopreparesidewidthcaption{#1}{#2}{#3}{#4}}}}
+
+% \def\dosettempcaptionbox
+% {\dosetraggedvbox{\floatcaptionparameter\c!align}%
+% \setbox\tempcaptionbox\raggedbox}
+
+\def\dosettempcaptionbox
+ {\setbox\tempcaptionbox\vbox\bgroup
+ \expanded{\setupalign[\v!new,\v!reset,\floatcaptionparameter\c!align,\v!old]}%
+ \let\next}
+
+\def\dopreparesideautocaption#1#2#3#4%
+ {\scratchdimen\dimexpr\hsize-\wd\tempfloatbox-\@@bkmargin\relax % was \tfskipsize\relax
+ \ifdim\wd\tempcaptionbox>\scratchdimen
+ \ifdim\wd\tempcaptionbox<1.3\scratchdimen
+ \scratchdimen0.8\scratchdimen
+ \fi
+ \fi
+ \dosettempcaptionbox
+ {\hsize\scratchdimen
+ \putcompletecaption{#4}{#2}{#3}}}
+
+\def\dopreparesidewidthcaption#1#2#3#4%
+ {\dosettempcaptionbox
+ {\hsize\floatcaptionparameter\c!width
+ \putcompletecaption{#4}{#2}{#3}}}
+
\def\dopreparestackcaptionfix#1#2#3#4%
- {\dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
- {\hsize\@@kjkjminwidth % special effects
- \putcompletecaption{#4}{#2}{#3}{0}}}
+ {\dosettempcaptionbox
+ {\hsize\floatcaptionparameter\c!minwidth % special effects
+ \putcompletecaption{#4}{#2}{#3}}}
\def\dopreparestackcaptionmax#1#2#3#4%
- {\dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
+ {\dosettempcaptionbox
{\hsize\wd\tempfloatbox
- \putcompletecaption{#4}{#2}{#3}{0}}}
+ \putcompletecaption{#4}{#2}{#3}}}
\def\dopreparestackcaptionwid#1#2#3#4%
- {\dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
- {\hsize\@@kjkjwidth
- \putcompletecaption{#4}{#2}{#3}{0}}}
+ {\dosettempcaptionbox
+ {\hsize\floatcaptionparameter\c!width
+ \putcompletecaption{#4}{#2}{#3}}}
\def\dopreparestackcaptionmin#1#2#3#4%
- {\raggedcenter % the default
- \dosetraggedvbox\@@kjkjalign % when given
- \setbox\tempcaptionbox\raggedbox % vbox, keeps footnotes
+ {\dosettempcaptionbox
{\hsize\wd\tempfloatbox
- \putcompletecaption{#4}{#2}{#3}{0}}}
+ \doifnothing{\floatcaptionparameter\c!align}\raggedcenter % on purpose overloads align !
+ \putcompletecaption{#4}{#2}{#3}}}
\def\dopreparestackcaptionaut#1#2#3#4%
- {\doifsomething\@@kjkjalign
- {\ExpandBothAfter\doifnotinset\v!middle\@@kjkjalign
+ {\doifsomething{\floatcaptionparameter\c!align}
+ {\doifnotinset{\v!middle}{\floatcaptionparameter\c!align}%
{\let\captionovershoot\!!zeropoint}}%
\edef\captionhsize{\the\wd\tempfloatbox}%
\ifdim\captionhsize>\hsize
% float is wider than \hsize
- \dosetraggedvbox\@@kjkjalign
- \setbox\scratchbox\raggedbox % trial run
+ \dosettempcaptionbox
{\trialtypesettingtrue
\hsize\captionhsize
\notesenabledfalse
- \putcompletecaption{#4}{#2}{#3}{0}}%
+ \putcompletecaption{#4}{#2}{#3}}%
\ifdim\ht\scratchbox>\lineheight % more lines
- \dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
+ \dosettempcaptionbox
{\hsize\captionhsize
\advance\hsize -\captionovershoot\relax
\ifdim\hsize<\captionminwidth\relax
\hsize\captionhsize
\fi
- \putcompletecaption{#4}{#2}{#3}{0}}%
+ \putcompletecaption{#4}{#2}{#3}}%
\else
- \setbox\tempcaptionbox\raggedbox
+ \dosettempcaptionbox
{\hsize\captionhsize
- \putcompletecaption{#4}{#2}{#3}{0}}%
+ \putcompletecaption{#4}{#2}{#3}}%
\fi
\else
% float is smaller of equal to \hsize
@@ -1617,141 +1609,408 @@
\advance\scratchdimen 3em % an average word length
\ifdim\scratchdimen<\hsize \hsize\scratchdimen \fi
\notesenabledfalse
- \putcompletecaption{#4}{#2}{#3}{0}}%
+ \putcompletecaption{#4}{#2}{#3}}%
\ifdim\ht\scratchbox>\lineheight
% at least an average word longer than a line
- \dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
+ \dosettempcaptionbox
{\scratchdimen\captionhsize
\advance\scratchdimen \captionovershoot
\ifdim\scratchdimen<\hsize \hsize\scratchdimen \fi
- \putcompletecaption{#4}{#2}{#3}{0}}%
+ \putcompletecaption{#4}{#2}{#3}}%
\else
- % just over a line, don't use an overshoot
- \expanded{\doifcommonelse{\@@kjkjalign}}{\v!left,\v!right,\v!flushleft,\v!flushright}
- {\dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
+ % just over a line, don't use an overshoot % % % todo: outer/inner and such
+ \doifcommonelse{\floatcaptionparameter\c!align}{\v!left,\v!right,\v!flushleft,\v!flushright}
+ {\dosettempcaptionbox
{\hsize\captionhsize
% strange : \raggedcenter
- \putcompletecaption{#4}{#2}{#3}{0}}}
+ \putcompletecaption{#4}{#2}{#3}}}
{% nicer
- \setbox\tempcaptionbox\cbox
+ \dosettempcaptionbox
{\hsize\captionhsize
- \putcompletecaption{#4}{#2}{#3}{0}}}%
+ \doifnothing{\floatcaptionparameter\c!align}\raggedcenter% overloads
+ \putcompletecaption{#4}{#2}{#3}}}%
\fi
\fi}
\def\dopreparesidecaption#1#2#3#4%
- {\dimen0\hsize
- \advance\dimen0 -\wd\tempfloatbox
- \advance\dimen0 -\@@bkmargin\relax % was \tfskipsize\relax
- \ifdim\wd\tempcaptionbox>\dimen0
- \dimen2=1.3\dimen0
- \ifdim\wd\tempcaptionbox<\dimen2
- \dimen0=0.8\dimen0
+ {\scratchdimen\dimexpr\hsize-\wd\tempfloatbox-\@@bkmargin\relax % was \tfskipsize\relax
+ \ifdim\wd\tempcaptionbox>\scratchdimen
+ \ifdim\wd\tempcaptionbox<1.3\scratchdimen
+ \scratchdimen0.8\scratchdimen
\fi
\fi
- \setbox\tempcaptionbox\vbox
- {\hsize\dimen0
- \raggedright
- \putcompletecaption{#4}{#2}{#3}{1}}}
+ \dosettempcaptionbox % \setbox\tempcaptionbox\vbox
+ {\hsize\scratchdimen
+ \doifnothing{\floatcaptionparameter\c!align}\raggedright % on purpose overloads align !
+ \putcompletecaption{#4}{#2}{#3}}}
+
+\newdimen\tempfloatheight
+\newdimen\tempfloatwidth
+
+\def\dofloatboxbetweenstack
+ {\endgraf\nointerlineskip\floatcaptionparameter\c!inbetween\endgraf}
+
+\def\dofloatboxdefaultbuilder % done
+ {\locatefloat{\box\tempfloatbox}}
+
+\def\dofloatboxnextrightbuilder#1%
+ {\ifparfloat \hbox \else \expandafter \locatefloat \fi
+ {\tempfloatheight\ht\tempfloatbox
+ \box\tempfloatbox
+ \expanded{\doifnotinset{\v!hang}{\floatcaptionparameter\c!location}}{\dotfskip{\floatcaptionparameter\c!distance}}%
+ \vbox to\tempfloatheight{#1}}}
+
+\def\dofloatboxnextleftbuilder#1%
+ {\ifparfloat \hbox \else \expandafter \locatefloat \fi
+ {\tempfloatheight\ht\tempfloatbox
+ \vbox to\tempfloatheight{#1}%
+ \expanded{\doifnotinset{\v!hang}{\floatcaptionparameter\c!location}}{\dotfskip{\floatcaptionparameter\c!distance}}%
+ \box\tempfloatbox}}
+
+\def\dofloatboxnextouterbuilder
+ {\doifrightpagefloatelse\dofloatboxnextrightbuilder\dofloatboxnextleftbuilder}
+\def\dofloatboxnextinnerbuilder
+ {\doifrightpagefloatelse\dofloatboxnextleftbuilder\dofloatboxnextrightbuilder}
+
+\def\dofloatboxnextrighthangbuilder#1%
+ {\ifparfloat \hbox \else \expandafter \locatefloat \fi
+ {\tempfloatheight\ht\tempfloatbox
+ \box\tempfloatbox
+ \vbox to\tempfloatheight{#1}}}
+
+\def\dofloatboxnextlefthangbuilder#1%
+ {\ifparfloat \hbox \else \expandafter \locatefloat \fi
+ {\tempfloatheight\ht\tempfloatbox
+ \vbox to\tempfloatheight{#1}%
+ \box\tempfloatbox}}
+
+\def\dodofloatboxnextrightmarginbuilder#1#2%
+ {\ifparfloat
+ \hbox\bgroup
+ \tempfloatheight\ht\tempfloatbox
+ \box\tempfloatbox
+ \hsmash{\hskip#1\vbox to\tempfloatheight{#2}}%
+ \egroup
+ \else
+ \begingroup
+ \tempfloatheight\ht\tempfloatbox
+ \everyrightofalignedline{\hsmash{\hskip#1\vbox to\tempfloatheight{#2}}}%
+ \locatefloat{\box\tempfloatbox}%
+ \endgroup
+ \fi}
+
+\def\dodofloatboxnextleftmarginbuilder#1#2%
+ {\ifparfloat
+ \hbox\bgroup
+ \tempfloatheight\ht\tempfloatbox
+ \hsmash{\hskip-\dimexpr#1+\wd\tempcaptionbox\relax\vbox to\tempfloatheight{#2}}%
+ \box\tempfloatbox
+ \egroup
+ \else
+ \begingroup
+ \tempfloatheight\ht\tempfloatbox
+ \everyleftofalignedline{\hsmash{\hskip-\dimexpr#1+\wd\tempcaptionbox\relax\vbox to\tempfloatheight{#2}}}%
+ \locatefloat{\box\tempfloatbox}%
+ \endgroup
+ \fi}
+
+\def\dofloatboxnextrightmarginbuilder{\dodofloatboxnextrightmarginbuilder\rightmargindistance}
+\def\dofloatboxnextleftmarginbuilder {\dodofloatboxnextleftmarginbuilder \leftmargindistance }
+
+\def\dofloatboxnextoutermarginbuilder
+ {\doifrightpagefloatelse
+ {\dodofloatboxnextrightmarginbuilder\rightmargindistance}
+ {\dodofloatboxnextleftmarginbuilder \rightmargindistance}}
+
+\def\dofloatboxnextinnermarginbuilder
+ {\doifrightpagefloatelse
+ {\dodofloatboxnextleftmarginbuilder \leftmargindistance}
+ {\dodofloatboxnextrightmarginbuilder\leftmargindistance}}
+
+\def\dofloatboxnextbuilder % beware, we first check on left/rightmargin because there can be left/right also
+ {\let\next\dofloatboxnextleftbuilder
+ \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
+ [ \v!outermargin=>\let\next\dofloatboxnextoutermarginbuilder,
+ \v!innermargin=>\let\next\dofloatboxnextinnermarginbuilder,
+ \v!leftmargin=>\let\next\dofloatboxnextleftmarginbuilder,
+ \v!rightmargin=>\let\next\dofloatboxnextrightmarginbuilder,
+ \v!lefthanging=>\let\next\dofloatboxnextlefthangbuilder,
+ \v!righthanging=>\let\next\dofloatboxnextrighthangbuilder,
+ \v!outer=>\let\next\dofloatboxnextouterbuilder,
+ \v!inner=>\let\next\dofloatboxnextinnerbuilder,
+ \v!left=>\let\next\dofloatboxnextleftbuilder,
+ \v!right=>\let\next\dofloatboxnextrightbuilder]%
+ \next}
+
+\def\dofloatboxsidebuilder
+ {\ifparfloat
+ \let\next\dofloatboxhighbuilder
+ \else
+ \let\next\dofloatboxmiddlebuilder
+ \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
+ [ \v!low=>\let\next\dofloatboxlowbuilder,
+ \v!middle=>\let\next\dofloatboxmiddlebuilder,
+ \v!high=>\let\next\dofloatboxhighbuilder]%
+ \fi
+ \next}
+
+\def\doflushfloatleftcaptionhang
+ {\hsmash{\llap{\box\tempcaptionbox\dotfskip{\floatcaptionparameter\c!distance}}}}
+\def\doflushfloatrightcaptionhang
+ {\hsmash{\rlap{\dotfskip{\floatcaptionparameter\c!distance}\box\tempcaptionbox}}}
+
+\def\doflushfloatcaptionhang
+ {\expanded{\doifinsetelse{\v!righthanging}{\floatcaptionparameter\c!location}}
+ {\doflushfloatrightcaptionhang}
+ {\expanded{\doifinsetelse{\v!lefthanging}{\floatcaptionparameter\c!location}}
+ {\doflushfloatleftcaptionhang}
+ {\expanded{\doifinsetelse{\v!hang}{\floatcaptionparameter\c!location}}
+ {\expanded{\doifinsetelse{\v!outer}{\floatcaptionparameter\c!location}}
+ {\doifrightpagefloatelse{\doflushfloatrightcaptionhang}{\doflushfloatleftcaptionhang}}
+ {\expanded{\doifinsetelse{\v!right}{\floatcaptiondirectives}}
+ {\doflushfloatrightcaptionhang}
+ {\doflushfloatleftcaptionhang}}}
+ {\box\tempcaptionbox}}}}
+
+\def\dofloatboxhighbuilder
+ {\dofloatboxnextbuilder{\dofloatboxbetweenstack\doflushfloatcaptionhang\vfill}}
+
+\def\dofloatboxlowbuilder
+ {\dofloatboxnextbuilder{\vfill\doflushfloatcaptionhang\dofloatboxbetweenstack}}
+
+\def\dofloatboxmiddlebuilder
+ {\dofloatboxnextbuilder{\vfill\box\tempcaptionbox\vfill}}
+
+% \def\dofloatboxnormalstackbuilder#1#2#3#4% hbox needed
+% {\tempfloatwidth\wd\tempfloatbox
+% \ifparfloat
+% \hbox{#3}\dofloatboxbetweenstack\hbox{#4}%
+% \else
+% \hbox{#1}\dofloatboxbetweenstack\hbox{#2}%
+% \fi}
+
+% \def\dofloatboxgridstackbuilder#1#2#3#4%
+% {\dp\tempcaptionbox\strutdepth
+% \setbox\scratchbox\vbox
+% {\tempfloatwidth\wd\tempfloatbox
+% \ifparfloat
+% #3\vss\dofloatboxbetweenstack#4%
+% \else
+% #1\vss\dofloatboxbetweenstack#2%
+% \fi}%
+% \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
+% \vbox to \noflines\lineheight{\unvbox\scratchbox}}
+
+% \def\dofloatboxstretchstackbuilder#1#2#3#4%
+% {\dp\tempcaptionbox\strutdepth
+% \setbox\scratchbox\vbox
+% {\locatefloat{\copy#1}%
+% \locatefloat{\copy#2}}%
+% \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
+% \vbox to \noflines\lineheight
+% {\tempfloatwidth\wd\tempfloatbox
+% \ifparfloat
+% #3\vss\dofloatboxbetweenstack\vss#4%
+% \else
+% #1\vss\dofloatboxbetweenstack\vss#2%
+% \fi}}
-\def\buildfloatbox % todo: installable, also vertical align caption relative to floatbox
+% \def\dofloatboxtopbuilder
+% {\let\next\dofloatboxnormalstackbuilder
+% \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
+% [ \v!grid=>\let\next\dofloatboxgridstackbuilder,
+% \v!stretch=>\let\next\dofloatboxstretchstackbuilder]%
+% \next
+% {\locatetextfloat{\box\tempcaptionbox}}
+% {\locatefloat {\box\tempfloatbox }}
+% {\locatesidefloat{\box\tempcaptionbox}}
+% {\hbox {\box\tempfloatbox }}}
+
+% \def\dofloatboxbottombuilder
+% {\let\next\dofloatboxnormalstackbuilder
+% \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
+% [ \v!grid=>\let\next\dofloatboxgridstackbuilder,
+% \v!stretch=>\let\next\dofloatboxstretchstackbuilder]%
+% \next
+% {\locatefloat {\box\tempfloatbox }}
+% {\locatetextfloat{\box\tempcaptionbox}}
+% {\hbox {\box\tempfloatbox }}
+% {\locatesidefloat{\box\tempcaptionbox}}}
+
+% \definefloat
+% [lefty][lefties][figure]
+% \setupfloat
+% [lefty]
+% [default=left,
+% rightmargindistance=-2cm,
+% leftmargindistance=-2cm]
+% \setupcaption
+% [lefty]
+% [location={bottom,overlay}]
+%
+% \starttext
+% \placelefty{}{} \input tufte \input tufte
+% \placelefty{}{} \input tufte \input tufte
+% \stoptext
+
+\def\bothangfloat#1{\ruledvbox to \ht\tempfloatbox{#1\vss}}
+\def\tophangfloat#1{\ruledvbox to \ht\tempfloatbox{\vss#1}}
+
+\def\dofloatboxnormaltopstackbuilder
+ {\expanded{\doifinset{\v!overlay}{\floatcaptionparameter\c!location}}\tophangfloat
+ {\tempfloatwidth\wd\tempfloatbox
+ \ifparfloat
+ \hbox{\locatesidefloat{\box\tempcaptionbox}}%
+ \dofloatboxbetweenstack
+ \hbox{\hbox {\box\tempfloatbox }}%
+ \else
+ \hbox{\locatetextfloat{\box\tempcaptionbox}}
+ \dofloatboxbetweenstack
+ \hbox{\locatefloat {\box\tempfloatbox }}%
+ \fi}}
+
+\def\dofloatboxnormalbotstackbuilder
+ {\expanded{\doifinset{\v!overlay}{\floatcaptionparameter\c!location}}\bothangfloat
+ {\tempfloatwidth\wd\tempfloatbox
+ \ifparfloat
+ \hbox{\hbox {\box\tempfloatbox }}%
+ \dofloatboxbetweenstack
+ \hbox{\locatesidefloat{\box\tempcaptionbox}}%
+ \else
+ \hbox{\locatefloat {\box\tempfloatbox }}%
+ \dofloatboxbetweenstack
+ \hbox{\locatetextfloat{\box\tempcaptionbox}}%
+ \fi}}
+
+\def\dofloatboxgridtopstackbuilder
+ {\dp\tempcaptionbox\strutdepth
+ \setbox\scratchbox\vbox
+ {\tempfloatwidth\wd\tempfloatbox
+ \ifparfloat
+ \locatesidefloat{\box\tempcaptionbox}%
+ \vss\dofloatboxbetweenstack
+ \hbox {\box\tempfloatbox }%
+ \else
+ \locatetextfloat{\box\tempcaptionbox}%
+ \vss\dofloatboxbetweenstack
+ \locatefloat {\box\tempfloatbox }%
+ \fi}%
+ \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
+ \vbox to \noflines\lineheight{\unvbox\scratchbox}}
+
+\def\dofloatboxgridbotstackbuilder
+ {\dp\tempcaptionbox\strutdepth
+ \setbox\scratchbox\vbox
+ {\tempfloatwidth\wd\tempfloatbox
+ \ifparfloat
+ \hbox {\box\tempfloatbox }%
+ \vss\dofloatboxbetweenstack
+ \locatesidefloat{\box\tempcaptionbox}%
+ \else
+ \locatefloat {\box\tempfloatbox }%
+ \vss\dofloatboxbetweenstack
+ \locatetextfloat{\box\tempcaptionbox}%
+ \fi}%
+ \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
+ \vbox to \noflines\lineheight{\unvbox\scratchbox}}
+
+\def\dofloatboxstretchtopstackbuilder
+ {\dp\tempcaptionbox\strutdepth
+ \setbox\scratchbox\vbox
+ {\locatefloat{\copy\tempcaptionbox}%
+ \locatefloat{\copy\tempfloatbox }}%
+ \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
+ \vbox to \noflines\lineheight
+ {\tempfloatwidth\wd\tempfloatbox
+ \ifparfloat
+ \locatesidefloat{\box\tempcaptionbox}%
+ \vss\dofloatboxbetweenstack\vss
+ \hbox {\box\tempfloatbox }%
+ \else
+ \locatetextfloat{\box\tempcaptionbox}%
+ \vss\dofloatboxbetweenstack\vss
+ \locatefloat {\box\tempfloatbox }%
+ \fi}}
+
+\def\dofloatboxstretchbotstackbuilder
+ {\dp\tempcaptionbox\strutdepth
+ \setbox\scratchbox\vbox
+ {\locatefloat{\copy\tempfloatbox }%
+ \locatefloat{\copy\tempcaptionbox}}%
+ \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
+ \vbox to \noflines\lineheight
+ {\tempfloatwidth\wd\tempfloatbox
+ \ifparfloat
+ \hbox {\box\tempfloatbox }%
+ \vss\dofloatboxbetweenstack\vss
+ \locatesidefloat{\box\tempcaptionbox}
+ \else
+ \locatefloat {\box\tempfloatbox }%
+ \vss\dofloatboxbetweenstack\vss
+ \locatetextfloat{\box\tempcaptionbox}%
+ \fi}}
+
+\def\dofloatboxtopbuilder
+ {\let\next\dofloatboxnormaltopstackbuilder
+ \expanded{\processfirstactioninset[\floatcaptionparameter\c!location]}
+ [ \v!grid=>\let\next\dofloatboxgridstackbuilder,
+ \v!stretch=>\let\next\dofloatboxstretchstackbuilder]%
+ \next}
+
+\def\dofloatboxbottombuilder
+ {\let\next\dofloatboxnormalbotstackbuilder
+ \expanded{\processfirstactioninset[\floatcaptionparameter\c!location]}
+ [ \v!grid=>\let\next\dofloatboxgridstackbuilder,
+ \v!stretch=>\let\next\dofloatboxstretchstackbuilder]%
+ \next}
+
+\def\relocatecaptionright#1{\locatefloat{\hbox to \tempfloatwidth{\hss#1}}}
+\def\relocatecaptionleft #1{\locatefloat{\hbox to \tempfloatwidth{#1\hss}}}
+
+\long\def\installfloatboxbuilder#1#2{\setvalue{\??kj:#1}{#2}}
+
+\def\buildfloatbox
{\global\setbox\floatbox\vbox
{\setlocalfloathsize
\forgetall
- \processaction
- [\@@kjkjlocation]
- [ \v!top=>\locatefloat{\box\tempcaptionbox}%
- \endgraf\nointerlineskip\@@kjkjinbetween
- \locatefloat{\box\tempfloatbox},
- \v!bottom=>\locatefloat{\box\tempfloatbox}%
- \endgraf\nointerlineskip\@@kjkjinbetween
- \locatefloat{\box\tempcaptionbox},
- \v!high=>\locatefloat
- {\doifelse\@@flfllocation\v!left
- {\box\tempfloatbox
- \dotfskip\@@kjkjdistance
- \vbox to\ht\tempfloatbox{\@@kjkjinbetween\box\tempcaptionbox\vfill}}
- {\vbox to\ht\tempfloatbox{\@@kjkjinbetween\box\tempcaptionbox\vfill}%
- \tfskip
- \box\tempfloatbox}},
- \v!low=>\locatefloat
- {\doifelse\@@flfllocation\v!left
- {\box\tempfloatbox
- \dotfskip\@@kjkjdistance
- \vbox to\ht\tempfloatbox
- {\vfill\box\tempcaptionbox\@@kjkjinbetween}}
- {\vbox to\ht\tempfloatbox
- {\vfill\box\tempcaptionbox\@@kjkjinbetween}%
- \dotfskip\@@kjkjdistance
- \box\tempfloatbox}},
- \v!middle=>\locatefloat
- {\doifelse\@@flfllocation\v!left
- {\box\tempfloatbox
- \dotfskip\@@kjkjdistance
- \vbox to\ht\tempfloatbox{\vfill\box\tempcaptionbox\vfill}}
- {\vbox to\ht\tempfloatbox{\vfill\box\tempcaptionbox\vfill}%
- \dotfskip\@@kjkjdistance
- \box\tempfloatbox}},
- \s!unknown=>\locatefloat{\box\tempfloatbox},
- \v!none=>\locatefloat{\box\tempfloatbox}]}}
+ \let\floatcaptionarrangement\s!default
+ \def\docommand##1%
+ {\doifdefined{\??kj:##1}{\def\floatcaptionarrangement{##1}\quitcommalist}}%
+ \processcommacommand[\floatcaptionparameter\c!location]\docommand
+ \executeifdefined{\??kj:\floatcaptionarrangement}{\getvalue{\??kj:\s!default}}}}
+
+\def\locatetextfloat
+ {\let\next\locatefloat
+ \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
+ [ \v!left=>\let\next\relocatecaptionleft,
+ \v!right=>\let\next\relocatecaptionright,
+ \v!inner=>\doifrightpagefloatelse{\let\next\relocatecaptionleft }{\let\next\relocatecaptionright},
+ \v!outer=>\doifrightpagefloatelse{\let\next\relocatecaptionright}{\let\next\relocatecaptionleft }]%
+ \next}
+
+\installfloatboxbuilder \v!none \dofloatboxdefaultbuilder
+\installfloatboxbuilder \s!default \dofloatboxdefaultbuilder
+\installfloatboxbuilder \v!high \dofloatboxhighbuilder
+\installfloatboxbuilder \v!low \dofloatboxlowbuilder
+\installfloatboxbuilder \v!middle \dofloatboxmiddlebuilder
+
+\installfloatboxbuilder \v!left \dofloatboxsidebuilder
+\installfloatboxbuilder \v!right \dofloatboxsidebuilder
+
+\installfloatboxbuilder \v!top \dofloatboxtopbuilder
+\installfloatboxbuilder \v!bottom \dofloatboxbottombuilder
+
+% \setuplayout[grid=yes] \showgrid \setupcaptions[style=smallbodyfont,location=grid,inbetween=]
+%
+% \starttext
+% test \placefigure{} {\externalfigure[cow.pdf][frame=on,grid=yes]} test \page
+% test \placefigure{\input zapf\relax}{\externalfigure[cow.pdf][frame=on,grid=yes]} test \page
+% test \placefigure{} {\externalfigure[cow.pdf][frame=on,grid=depth]} test \page
+% test \placefigure{\input zapf\relax}{\externalfigure[cow.pdf][frame=on,grid=depth]} test \page
+% \stoptext
\newif\ifpostponecolumnfloats \postponecolumnfloatsfalse % don't change
-%\def\postcenterfloatbox#1%
-% {\ifinsidecolumns
-% \ifpostponecolumnfloats
-% \scratchdimen=\zetbreedte
-% \else
-% \scratchdimen=#1\relax
-% \fi
-% \else\ifdim#1>\hsize
-% \scratchdimen=\hsize
-% \else
-% \scratchdimen=\wd\floatbox
-% \fi\fi
-% \global\setbox\floatbox=\hbox to \scratchdimen
-% {\hfill\box\floatbox\hfill}} % geen \hss, gaat mis in kolommen !
-
-% \def\postcenterfloatbox#1% 2 of 4
-% {\global\floatwidth\wd\ifdim\wd2>\wd4 2 \else 4 \fi
-% \ifdim\floatwidth>\zetbreedte
-% \global\floatwidth\zetbreedte
-% \else\ifdim\floatwidth<\hsize
-% \global\floatwidth\hsize
-% \fi\fi
-% \global\setbox\floatbox=\hbox to \floatwidth
-% {\hss\box\floatbox\hss}}
-
-% \def\postcenterfloatbox#1% 2 of 4
-% {\global\setbox\floatbox=\hbox to \width % \wd\ifdim\wd2>\wd4 2\else4\fi
-% {\hss\box\floatbox\hss}%
-% \ifdim\wd\floatbox>\zetbreedte
-% \global\setbox\floatbox=\hbox to \zetbreedte
-% {\hss\box\floatbox\hss}%
-% \else\ifcenterfloatbox\ifdim\wd\floatbox<\hsize
-% % \global\setbox\floatbox=\hbox to \hsize
-% % {\hss\box\floatbox\hss}%
-% \fi\fi\fi
-% \global\floatwidth\wd\floatbox}
-
-%\def\postcenterfloatbox#1%
-% {\ifinsidecolumns
-% \ifpostponecolumnfloats
-% \scratchdimen\zetbreedte
-% \else
-% \scratchdimen#1\relax
-% \fi
-% \else\ifdim#1>\hsize
-% \scratchdimen\hsize
-% \else
-% \scratchdimen\wd\floatbox
-% \fi\fi
-% \global\setbox\floatbox\hbox to \scratchdimen
-% % {\hfill\box\floatbox\hfill}} % geen \hss, gaat mis in kolommen !
-% {\hss \box\floatbox\hss }} % wel \hss, anders mis in colset
-
\chardef\postcenterfloatmethod\plusone
\def\postcenterfloatbox#1%
@@ -1794,56 +2053,47 @@
\ifnofloatcaption
\global\setbox\floatbox\vbox{\box\tempfloatbox}%
\else
- \doifelse\@@kjkjwidth\v!max
- {\dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
- {\hsize\wd\tempfloatbox\putcompletecaption{#4}{#2}{#3}{0}}}%
- {\doifelse\@@kjkjwidth\v!fit
- {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox\relax
- \setbox\tempcaptionbox\vbox
- {\forgetall\hsize\wd\tempfloatbox\putcompletecaption{#4}{#2}{#3}{0}}%
- \else
- \setbox\tempcaptionbox\hbox to \wd\tempfloatbox
- {\hss\box\tempcaptionbox\hss}%
- \fi}
- {\dosetraggedvbox\@@kjkjalign
- \setbox\tempcaptionbox\raggedbox
- {\hsize\wd\tempfloatbox\putcompletecaption{#4}{#2}{#3}{0}}}}%
- \setbox\tempcaptionbox\hbox{\@@kjkjcommand{\box\tempcaptionbox}}%
- \moveboxontogrid\tempcaptionbox\@@kjkjgrid\lastcaptionht
+ \dopreparedosidecaption{#1}{#2}{#3}{#4}%
+ \settracedcaptionbox
+ \setbox\tempcaptionbox\hbox{\floatcaptionparameter\c!command{\box\tempcaptionbox}}%
+ \moveboxontogrid\tempcaptionbox{\floatcaptionparameter\c!grid}\lastcaptionht
\addlocalbackgroundtobox\tempcaptionbox % no \doglobal
- \global\setbox\floatbox\vbox
- {\processaction
- [\@@kjkjlocation]
- [ \v!top=>\box\tempcaptionbox
- \endgraf\nointerlineskip\@@kjkjinbetween
- \box\tempfloatbox,
- \v!bottom=>\box\tempfloatbox
- \endgraf\nointerlineskip\@@kjkjinbetween
- \box\tempcaptionbox,
- \v!none=>\box\tempfloatbox,
- \s!unknown=>\box\tempfloatbox
- \endgraf\nointerlineskip\@@kjkjinbetween
- \box\tempcaptionbox]}%
+ \buildsidefloatbox
\fi
-% \doglobal\addlocalbackgroundtobox\floatbox
\egroup}
+\def\dopreparedosidecaption#1#2#3#4% will be enhanced
+ {\doifelse{\floatcaptionparameter\c!width}\v!max
+ {\dosettempcaptionbox
+ {\hsize\wd\tempfloatbox\putcompletecaption{#4}{#2}{#3}}}%
+ {\doifelse{\floatcaptionparameter\c!width}\v!fit
+ {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox\relax
+ \setbox\tempcaptionbox\vbox
+ {\forgetall\hsize\wd\tempfloatbox\putcompletecaption{#4}{#2}{#3}}%
+ \else
+ \setbox\tempcaptionbox\hbox to \wd\tempfloatbox
+ {\hss\box\tempcaptionbox\hss}%
+ \fi}
+ {\dosettempcaptionbox
+ {\hsize\floatcaptionparameter\c!width % \wd\tempfloatbox
+ \putcompletecaption{#4}{#2}{#3}}}}}
+
+\def\buildsidefloatbox
+ {\let\locatefloat\relax
+ \def\locatesidefloat##1%
+ {\begingroup
+ \chardef\alignstrutmode\zerocount
+ \hsize\tempfloatwidth \forgetall
+ \alignedline{\floatparameter\c!location}\v!middle{##1}%
+ \endgroup}%
+ \buildfloatbox}
+
\newif\ifparfloat
\long\def\dosetfloatbox#1#2#3#4% todo : \global\setbox
{\ifvisible
\par
- \edef\@@kjkjlocation {\getvalue{\??kj#4\c!location}}%
- \edef\@@kjkjgrid {\getvalue{\??kj#4\c!grid}}% new
- \def\@@kjkjinbetween{\getvalue{\??kj#4\c!inbetween}}% no \edef
- \def\@@kjkjcommand {\getvalue{\??kj#4\c!command}}% no \edef
- \edef\@@kjkjwidth {\getvalue{\??kj#4\c!width}}%
- \edef\@@kjkjminwidth {\getvalue{\??kj#4\c!minwidth}}% in geval van automatisch
- \edef\@@kjkjdistance {\getvalue{\??kj#4\c!distance}}%
- \edef\@@kjkjalign {\getvalue{\??kj#4\c!align}}%
- \def\@@kjkjstopper {\getvalue{\??kj#4\c!stopper}}%
- \edef\@@flfllocation {\getvalue{\??fl#4\c!location}}%
+ \edef\floatcaptiondirectives{\floatparameter\c!location,\floatcaptionparameter\c!location}%
\ifparfloat
\@EA\dosetparfloat % {#1}{#2}{#3}{#4}%
\else
@@ -1876,18 +2126,6 @@
\newcounter\noxfloatlocations
-% \long\def\dofloat#1#2#3#4%
-% {\dosetfloatbox{#1}{#2}{#3}{#4}%
-% \doifelsevaluenothing{\??fl#4\c!criterium}
-% {\dogetfloatbox{#1}\empty}
-% {\ifdim\wd\floatbox>\getvalue{\??fl#4\c!criterium}\relax
-% \postcenterfloatbox{\wd\floatbox}% else we get left aligned
-% %dogetfloatbox{#1}\v!here % see details/pascal
-% \dogetfloatbox{#1}{\executeifdefined{\??fl#4\c!fallback}\v!here}%
-% \else
-% \dogetfloatbox{#1}\empty
-% \fi}}
-
\long\def\dofloat#1#2#3#4%
{\dosetfloatbox{#1}{#2}{#3}{#4}%
\dogetfloatbox{#1}\empty}
@@ -1901,51 +2139,6 @@
\xdef\naturalfloatwidth {\the\wd#1}%
\xdef\naturalfloatdepth {\the\dp#1}}
-% \long\def\docompletefloat#1#2#3#4#5#6#7% #7 = box number
-% {%\flushsidefloats % moved
-% \presetfloatvariables{#1}{#4}{#2}{#6}%
-% \bgroup
-% \setnaturalfloatdimensions#7%
-% \global\setbox\floatbox\vbox
-% {\executeifdefined{\??fl#1\c!command}\firstofoneargument{\box#7}}%
-% \setnaturalfloatdimensions\floatbox
-% \dimen0 \ht\floatbox
-% \advance\dimen0 \dp\floatbox
-% \ifdim\dimen0=\zeropoint
-% \showmessage\m!floatblocks{11}\empty
-% \global\setbox\floatbox\vbox{\doemptyblock{#3}}%
-% \fi
-% \ifnofloatcaption
-% \global\setbox\floatbox\vbox
-% {\unvbox\floatbox
-% \vss % gets rid of the depth (unless tabulate)
-% \rawpagereference\s!flt{#2}}%
-% \egroup
-% \dofloat{#4}{}{#6}{#1}%
-% \else
-% \doglobal\convertargument#6\to\asciititle % \asciititle is global
-% \ifnofloatnumber
-% \global\setbox\floatbox\vbox
-% {\unvbox\floatbox % no \vss, keep the depth
-% \rawreference\s!flt{#2}{{}{\asciititle}}}%
-% \egroup
-% \dofloat{#4}{}{#6}{#1}%
-% \else
-% \incrementnumber[#1]%
-% \makesectionnumber[#1]%
-% \global\setbox\floatbox\vbox
-% {\unvbox\floatbox % no \vss, keep the depth
-% \dofloatreference
-% \redofloatorder{#1}%
-% \rawreference\s!flt{#2}{{\composedsectionnumber}{\asciititle}}%
-% \dowritetolist{#3}{\composedsectionnumber}{#6}{#3}}%
-% \egroup
-% \preparefullnumber{\??kj#1}\composedsectionnumber\preparednumber
-% \dofloat{#4}{\labeltexts{#5}{\preparednumber}}{#6}{#1}%
-% \fi
-% \fi
-% \global\insidefloatfalse}
-
\long\def\docompletefloat#1#2#3#4#5#6#7% #7 = box number
{%\flushsidefloats % moved
\presetfloatvariables{#1}{#4}{#2}{#6}%
@@ -2075,23 +2268,11 @@
\box\preparedmarginbox}}%
\processaction % traag
[\@@mblocation]
- [ \v!inmargin=>\doifbothsidesoverruled
- \rightmarginbox
- \orsideone
- \rightmarginbox
- \orsidetwo
- \leftmarginbox
- \od,
- \v!middle=>\doifbothsidesoverruled
- \rightmarginbox
- \orsideone
- \leftmarginbox
- \orsidetwo
- \rightmarginbox
- \od,
- \v!left=>\leftmarginbox,
- \v!right=>\rightmarginbox,
- \s!unknown=>\setbox\preparedmarginbox\hbox{}]}
+ [ \v!inmargin=>\doifbothsidesoverruled\rightmarginbox\rightmarginbox\leftmarginbox,
+ \v!middle=>\doifbothsidesoverruled\rightmarginbox\leftmarginbox\rightmarginbox,
+ \v!left=>\leftmarginbox,
+ \v!right=>\rightmarginbox,
+ \s!unknown=>\setbox\preparedmarginbox\hbox{}]}
\def\dostartmarginblock % 2 maal \vbox ivm \unvbox elders
{\global\setbox\marginbox\vtop\bgroup\vbox\bgroup
@@ -2271,9 +2452,12 @@
\setupcaptions
[\c!location=\v!bottom,
\c!grid=,
- \c!before=\blank,
+ \c!before=, % not used (yet)
\c!inbetween={\blank[\v!medium]},
- \c!after=\blank,
+ \c!after=, % not used (yet)
+\c!spacebefore=,
+\c!spaceinbetween=, % replaces fuzzy inbetween dual usage
+\c!spaceafter=,
\c!width=\v!fit,
\c!minwidth=\v!fit, % id est: the width of the floatbox in some cases
\c!headstyle=\v!bold,
@@ -2296,8 +2480,8 @@
\setupfloats
[\c!location=\v!middle,
- \c!width=\v!fit,
- \c!height=\v!fit,
+ \c!width=8\lineheight,
+ \c!height=6\lineheight,
\c!offset=\v!overlay,
\c!frame=\v!off,
\c!radius=.5\bodyfontsize,
diff --git a/Master/texmf-dist/tex/context/base/page-imp.tex b/Master/texmf-dist/tex/context/base/page-imp.tex
index b64a543cff7..bdb3a7b65db 100644
--- a/Master/texmf-dist/tex/context/base/page-imp.tex
+++ b/Master/texmf-dist/tex/context/base/page-imp.tex
@@ -30,12 +30,9 @@
\def\clippedprintbox#1#2% can be made more efficient, see other clipper
{\ifclipprintbox
- \!!widthc\pagebackgroundoffset
- \!!widtha \paperwidth
- \advance\!!widtha \!!widthc
- \!!heighta\paperheight
- \advance\!!heighta\!!widthc
- \advance\!!heighta\!!widthc
+ \!!widthc \pagebackgroundoffset
+ \!!widtha \dimexpr\paperwidth + \!!widthc\relax
+ \!!heighta\dimexpr\paperheight+2\!!widthc\relax
\setbox#2\vbox to \paperheight{\vfill\box#2}%
\ht#2\paperheight
\wd#2\paperwidth
@@ -80,40 +77,51 @@
\!!deptha \dp#1%
\setbox#1\hbox
{\!!widthb \@@lyclipoffset
- \advance\!!heighta\!!deptha
- \advance\!!heighta2\!!widthb
- \advance\!!widtha \!!widthb
+ \advance\!!heighta\dimexpr\!!deptha+2\!!widthb\relax
+ \advance\!!widtha \!!widthb
\doifbothsides
- \advance\!!widtha\!!widthb
- \!!widthc-\!!widthb
- \hskip\!!widthc
- \orsideone
- \!!widthc\zeropoint
- \orsidetwo
- \!!widthc-\!!widthb
- \hskip\!!widthc
- \od
+ {\advance\!!widtha\!!widthb \!!widthc-\!!widthb \hskip\!!widthc}%
+ {\!!widthc\zeropoint}
+ {\!!widthc-\!!widthb \hskip\!!widthc}%
\lower\!!widthb\hbox
{\clip
[\c!hoffset=\!!widthc,
\c!voffset=-\!!widthb,
- \c!width=\!!widtha,
- \c!height=\!!heighta]%
+ \c!width=\!!widtha,
+ \c!height=\!!heighta]%
{\box#1}}}%
\wd#1\!!widtha
\ht#1\!!heighta
\dp#1\!!deptha
\fi}
+%D \macros
+%D {starttextdata}
+%D
+%D This is a user macro (appending to every last shipout is not
+%D really user friendly.
+
+\newtoks \collectedtextdata
+
+\long\def\starttextdata#1\stoptextdata
+ {\doglobal\appendtoks#1\to\collectedtextdata}
+
+\def\flushtextdata
+ {\vsmashed{\the\collectedtextdata}% all dimensions zero
+ \global\collectedtextdata\emptytoks
+ \globallet\flushtextdata\donothing}
+
+\prependtoks \flushtextdata \to \everylastshipout
+
% moved code:
\def\myshipout#1%
- {\voorpagina % voor de pagebody dus !
+ {\beforeshipout % voor de pagebody dus !
\dontshowcomposition
\ifarrangingpages\@EA\actualarrange\else\@EA\actualshipout\fi
{\thisisrealpage\realfolio#1}%
\gotonextrealpage
- \napagina}
+ \aftershipout}
\newbox\postponedcontent
@@ -227,7 +235,9 @@
\global\advance\paperwidth -2\scratchdimen
\scratchdimen\getvalue{\??pp#1\c!offset}%
\divide\scratchdimen \arrangedpageY
- \global\advance\paperheight -2\scratchdimen}
+ \global\advance\paperheight-2\scratchdimen}
+
+\newconditional\arrangedbackgroundokay % more ifs -> conditionals
\def\setuparranging[#1]%
{\ifarrangingdisabled \else
@@ -250,6 +260,7 @@
180=>\gdef\arrangedrotationO{180}\gdef\arrangedrotationE{0},
270=>\gdef\arrangedrotationO{270}\gdef\arrangedrotationE{90},
\s!reset=>\global\arrangingpagesfalse,
+ \v!background=>\global\settrue\arrangedbackgroundokay,
\s!unknown=>\checkinstalledpagearrangement\commalistelement]%
% no \s!default=> we can have aaa,,bbb
\ifx\handlearrangedpage\undefined
@@ -342,8 +353,7 @@
\def\filluparrangedpages % beware: \realpageno is 1 ahead
{\ifarrangingpages
- \scratchcounter\realpageno
- \advance\scratchcounter \minusone
+ \scratchcounter\numexpr\realpageno-\plusone\relax
\dosetmodulo\scratchcounter\arrangedpageT\scratchcounter
\ifcase\scratchcounter\else
\advance\scratchcounter \plusone
@@ -390,7 +400,8 @@
\ifnegatearranged
\negatecolorbox{#1}%
\fi
- \finishpagebox#1
+ \finishpagebox#1%
+ \ifconditional\arrangedbackgroundokay\addprintbackground#1\fi
\actualshipout{\box#1}%
\egroup}
@@ -531,8 +542,7 @@
\def\splitoffarrangedpagesTWO
{\splittopskip\zeropoint
\global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint
- \scratchdimen\ht\arrangedpageB
- \advance\scratchdimen -\onepoint
+ \scratchdimen\dimexpr\ht\arrangedpageB-\onepoint\relax
\ifdim\scratchdimen>\onepoint
\setbox\scratchbox\vsplit\arrangedpageB to \scratchdimen
\fi}
@@ -761,18 +771,16 @@
{\dosetuparrangement\@@ppnx\@@ppny\@@ppxy\!!zerocount\!!zerocount
\pusharrangedpageXY\poparrangedpagesXY\relax}
-\beginETEX \dimexpr
+%D A crazy definition, don't guess who pushed me for the landscape option.
\definepapersize
[XY]
- [\c!width=\dimexpr(\dimexpr(\@@ppwidth-\numexpr(\@@ppnx-1)\dimexpr(\@@ppdx))/\@@ppnx),
- \c!height =\dimexpr(\dimexpr(\@@ppheight -\numexpr(\@@ppny-1)\dimexpr(\@@ppdy))/\@@ppny)]
+ [\c!height=\dimexpr\dimexpr\@@ppheight-\numexpr\@@ppny-1\relax\dimexpr\@@ppdy\relax\relax/\@@ppny\relax,
+ \c!width =\dimexpr\dimexpr\@@ppwidth -\numexpr\@@ppnx-1\relax\dimexpr\@@ppdx\relax\relax/\@@ppnx\relax]
\setuppaper
- [\c!width=\dimexpr(\printpaperwidth-2\dimexpr(\@@ppbackspace)),
- \c!height =\dimexpr(\printpaperheight -2\dimexpr(\@@pptopspace))]
-
-\endETEX
+ [\c!width =\dimexpr\printpaperwidth -2\dimexpr\@@ppbackspace\relax\relax,
+ \c!height=\dimexpr\printpaperheight-2\dimexpr\@@pptopspace \relax\relax]
% \definepageshift[test][horizontal][10pt,20pt,30pt,40pt,50pt]
% \definepageshift[test][vertical] [10pt,20pt,30pt,40pt,50pt]
@@ -913,11 +921,11 @@
{\doifelse{#2}\v!odd
{\dorecurse\@@ipn
{\ifodd\recurselevel\relax\dofilterpage{#1}\recurselevel\fi}}
- {\def\dodocommando##1%
+ {\def\dodocommand##1%
{\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}%
- \def\docommando##1%
- {\dowithrange{##1}\dodocommando}%
- \processcommalist[#2]\docommando}}%
+ \def\docommand##1%
+ {\dowithrange{##1}\dodocommand}%
+ \processcommalist[#2]\docommand}}%
\egroup}
\def\dofilterpage#1#2%
@@ -1004,82 +1012,117 @@
\c!before=\page,\c!after=\page,\c!inbetween=\blank,
\c!frame=,\c!background=,\c!backgroundcolor=,
#2]%
+ \def\@@ipname{#1}%
\@@ipbefore
- %\doglobal\newcounter\combinedpagescounter
- \globallet\combinedpagescounter\@@ipstart
- \doifelse\@@ipalternative\v!b\!!doneafalse\!!doneatrue
- \if!!donea
- \doloop
- {\vbox to \textheight
- {\hsize\textwidth % ? ?
- \scratchdimen\@@ipdistance
- \!!widtha\hsize
- \advance\!!widtha -\@@ipnx\scratchdimen
- \advance\!!widtha \scratchdimen
- \divide \!!widtha \@@ipnx
- \!!heighta\vsize
- \advance\!!heighta -\@@ipny\scratchdimen
- \advance\!!heighta \scratchdimen
- \divide \!!heighta \@@ipny
- \dorecurse\@@ipny
- {\hbox to \hsize
- {\dorecurse\@@ipnx
- {\vbox to \!!heighta
- {\hsize\!!widtha
- \vsize\!!heighta
- \@@iptop
- \hbox to \hsize
- {\@@ipleft
- \ifnum\combinedpagescounter>\@@ipstop\relax
- \globallet\@@ipn\!!zerocount
- \else\ifnum\combinedpagescounter>\@@ipn \else
- \externalfigure[#1]
- [\c!object=\v!no,
- \c!page=\combinedpagescounter,
- \c!factor=\v!max,
- \c!background=\@@ipbackground,
- \c!backgroundcolor=\@@ipbackgroundcolor,
- \c!frame=\@@ipframe]%
- \fi\fi
- \@@ipright}
- \@@ipbottom}%
- \doglobal\increment\combinedpagescounter
- \hfil}%
- \hfilneg}
- \vfil}%
- \vfilneg}%
- \page
- \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}
- \else
- \doloop
- {\startbaselinecorrection
- \scratchdimen\@@ipdistance
- \!!widtha\hsize
- \advance\!!widtha -\@@ipnx\scratchdimen
- \advance\!!widtha \scratchdimen
- \divide \!!widtha \@@ipnx
- \hbox to \hsize
- {\dorecurse\@@ipnx
- {\doglobal\increment\combinedpagescounter
- \ifnum\combinedpagescounter>\@@ipn \else
- \expanded{\externalfigure[#1]
- [\c!page=\combinedpagescounter,
- \c!width=\the\!!widtha,% todo \freezedimenmacro
- \c!background=\@@ipbackground,
- \c!backgroundcolor=\@@ipbackgroundcolor,
- \c!frame=\@@ipframe]}%
- \hfill
- \fi}\hfillneg}%
- \stopbaselinecorrection
- \ifnum\combinedpagescounter<\@@ipn\relax
- \@@ipinbetween
- \else
- \exitloop
- \fi}
- \fi
+ \executeifdefined{\strippedcsname\docombinepages\@@ipalternative}\docombinepagesb
\@@ipafter
\egroup}
+\def\docombinepagesa
+ {\globallet\combinedpagescounter\@@ipstart
+ \doloop
+ {\vbox to \textheight
+ {\hsize\textwidth % ? ?
+ \scratchdimen\@@ipdistance
+ \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
+ \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
+ \dorecurse\@@ipny
+ {\hbox to \hsize
+ {\dorecurse\@@ipnx
+ {\vbox to \!!heighta
+ {\hsize\!!widtha
+ \vsize\!!heighta
+ \@@iptop
+ \hbox to \hsize
+ {\@@ipleft
+ \ifnum\combinedpagescounter>\@@ipstop\relax
+ \globallet\@@ipn\!!zerocount
+ \else\ifnum\combinedpagescounter>\@@ipn \else
+ \externalfigure[\@@ipname]
+ [\c!object=\v!no,
+ \c!page=\combinedpagescounter,
+ \c!factor=\v!max,
+ \c!background=\@@ipbackground,
+ \c!backgroundcolor=\@@ipbackgroundcolor,
+ \c!frame=\@@ipframe]%
+ \fi\fi
+ \@@ipright}
+ \@@ipbottom}%
+ \doglobal\increment\combinedpagescounter
+ \hfil}%
+ \hfilneg}
+ \vfil}%
+ \vfilneg}%
+ \page
+ \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}}
+
+\def\docombinepagesc
+ {\globallet\combinedpagescounter\@@ipstart
+ \doloop
+ {\vbox to \textheight
+ {\hsize\textwidth % ? ?
+ \scratchdimen\@@ipdistance
+ \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
+ \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
+ \hbox to \hsize
+ {\dorecurse\@@ipnx
+ {\@@ipleft
+ \vbox to \textheight
+ {\hsize\!!widtha
+ {\dorecurse\@@ipny
+ {\@@iptop
+ \hbox to \hsize
+ {\vbox to \!!heighta
+ {\hsize\!!widtha
+ \vsize\!!heighta
+ \ifnum\combinedpagescounter>\@@ipstop\relax
+ \globallet\@@ipn\!!zerocount
+ \else\ifnum\combinedpagescounter>\@@ipn \else
+ \externalfigure[\@@ipname]
+ [\c!object=\v!no,
+ \c!page=\combinedpagescounter,
+ \c!factor=\v!max,
+ \c!background=\@@ipbackground,
+ \c!backgroundcolor=\@@ipbackgroundcolor,
+ \c!frame=\@@ipframe]%
+ \fi\fi}}
+ \doglobal\increment\combinedpagescounter
+ \@@ipbottom}%
+ \vfil}%
+ \vfilneg}
+ \hfil}%
+ \hfilneg}}
+ \page
+ \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}}
+
+\let\docombinepageshorizontal\docombinepagesa
+\let\docombinepagesvertical \docombinepagesc
+
+\def\docombinepagesb
+ {\globallet\combinedpagescounter\@@ipstart
+ \doloop
+ {\startbaselinecorrection
+ \scratchdimen\@@ipdistance
+ \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
+ \hbox to \hsize
+ {\dorecurse\@@ipnx
+ {\doglobal\increment\combinedpagescounter
+ \ifnum\combinedpagescounter>\@@ipn \else
+ \expanded{\externalfigure[\@@ipname]
+ [\c!page=\combinedpagescounter,
+ \c!width=\the\!!widtha,% todo \freezedimenmacro
+ \c!background=\@@ipbackground,
+ \c!backgroundcolor=\@@ipbackgroundcolor,
+ \c!frame=\@@ipframe]}%
+ \hfill
+ \fi}\hfillneg}%
+ \stopbaselinecorrection
+ \ifnum\combinedpagescounter<\@@ipn\relax
+ \@@ipinbetween
+ \else
+ \exitloop
+ \fi}}
+
%D \macros
%D {setuppagecomment,startpagecomment}
%D
@@ -1111,13 +1154,13 @@
\processaction
[\@@pclocation]
[ \v!bottom=>{\setuppapersize[\c!bottom =\vss,\c!top =\vskip\@@pcoffset]},
- \v!top=>{\setuppapersize[\c!top =\vss,\c!bottom =\vskip\@@pcoffset]},
- \v!left=>{\setuppapersize[\c!left =\hss,\c!right=\hskip\@@pcoffset]},
- \v!right=>{\setuppapersize[\c!right=\hss,\c!left =\hskip\@@pcoffset]}]%
+ \v!top=>{\setuppapersize[\c!top =\vss,\c!bottom =\vskip\@@pcoffset]},
+ \v!left=>{\setuppapersize[\c!left =\hss,\c!right=\hskip\@@pcoffset]},
+ \v!right=>{\setuppapersize[\c!right=\hss,\c!left =\hskip\@@pcoffset]}]%
\definepapersize
[\v!pagecomment]
[\c!height=\@@pcpaperheight,
- \c!width=\@@pcpaperwidth]%
+ \c!width=\@@pcpaperwidth]%
\let\@@pcprintpapersize\printpapersize
\setuppapersize[\papersize][\v!pagecomment]%
\setupbackgrounds[\v!paper][\c!background=\v!pagecomment]}
diff --git a/Master/texmf-dist/tex/context/base/page-ini.tex b/Master/texmf-dist/tex/context/base/page-ini.tex
index 826ecd350e4..020fd20cfb6 100644
--- a/Master/texmf-dist/tex/context/base/page-ini.tex
+++ b/Master/texmf-dist/tex/context/base/page-ini.tex
@@ -13,6 +13,8 @@
\writestatus{loading}{Context Page Macros / Initializations}
+% still a dutch/english mess
+
%D This class of modules implements the output routines and
%D floating body support. Although the modules are relatively
%D new, the code herein is rather old. This reordering was
@@ -994,20 +996,6 @@
\setvsize % this is needed for interacting components, like floats and multicolumns
\adaptfuzzypagegoal} % watch this hack!
-% \def\dofinaloutput#1#2%
-% {\beforefinaloutput
-% \the\everybeforeshipout
-% \ifspecialbasedsettings
-% \myshipout{\hbox{\hbox to \zeropoint{\the\pageboundsettings}%
-% \hbox{\dopagebody#1#2\setpagecounters}}}%
-% \else
-% \the\pageboundsettings
-% \myshipout{\hbox{\dopagebody#1#2\setpagecounters}}%
-% \fi
-% \the\everyaftershipout
-% \afterfinaloutput
-% \popproperties} % ... and here ...
-
\def\dofinaloutput#1#2% \vbox: prevents spurious spaces in every..pagebody
{\beforefinaloutput
\the\everybeforeshipout
@@ -1036,25 +1024,28 @@
\afterfinaloutput
\popproperties} % ... and here
-% beware: \ifverwerken is in use
+% beware: \ifprocessingpages is in use
+
+\ifx\checkpageversion\undefined \let\checkpageversion\relax \fi % todo: hook into \everybeforeshipout
+\ifx\doflushspread \undefined \let\doflushspread \relax \fi % todo
\def\finaloutput#1#2%
{\checkpageversion
- \ifverwerken
- \ifgeselecteerd
+ \ifprocessingpages
+ \ifpageselected
\@EAEAEA\dofinaloutput
\else
\@EAEAEA\donofinaloutput
\fi
\else
- \ifgeselecteerd
+ \ifpageselected
\@EAEAEA\donofinaloutput
\else
\@EAEAEA\dofinaloutput
\fi
\fi#1#2%
\resetselectiepagina
- \verhoogpaginanummer
+ \incrementpagenumber
\checkpagedimensions
\ifnum\outputpenalty>\superpenalty \else
\dosupereject
@@ -1062,8 +1053,6 @@
\doflushspread
\dopostponeblock}
-\ifx\doflushspread\undefined \let\doflushspread\relax \fi
-
\def\dooutput
{\finaloutput\unvbox\normalpagebox}
@@ -1073,15 +1062,6 @@
% this needs a real cleanup
-\chardef\conceptmode\zerocount
-
-\def\doifconcepttracing
- {\ifnum\conceptmode>\plustwo
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
\def\doplaceversiontext#1#2%
{\doifsomething{#2}
{\@EA\convertargument#2\to\ascii
@@ -1168,15 +1148,15 @@
% this will be inserts some day
-% \installinsertion\referentieinfobox
+% \installinsertion\referenceinfobox
% \installinsertion\registerinfobox
% \installinsertion\floatinfobox
-\newbox\referentieinfobox
+\newbox\referenceinfobox
\newbox\registerinfobox
\newbox\floatinfobox
-\def\referentieinfo{\dotestinfo\referentieinfobox}
+\def\referenceinfo{\dotestinfo\referenceinfobox}
\def\registerinfo {\dotestinfo\registerinfobox}
\def\floatinfo {\dotestinfo\floatinfobox}
@@ -1191,10 +1171,10 @@
\unvbox\floatinfobox
\vskip\!!twelvepoint
\fi
- \ifvoid\referentieinfobox\else
+ \ifvoid\referenceinfobox\else
\strut \getmessage\m!systems{25}%
\vskip\!!sixpoint
- \unvbox\referentieinfobox
+ \unvbox\referenceinfobox
\vskip\!!twelvepoint
\fi
\ifvoid\registerinfobox\else
@@ -1206,8 +1186,6 @@
\version[\v!final]
-\newif\ifinpagebody
-
% bewaren tvb documentatie
%
% \hbox to \hsize
@@ -1248,26 +1226,30 @@
{\dosingleempty\doshowgrid}
\def\doshowgrid[#1]%
- {\chardef\showgridstate\plusone % downward compatible default
- \processaction
+ {\chardef\showgridstate \plusone % downward compatible default
+ \chardef\gridboxlinemode \plusone
+ \chardef\gridboxlinenomode\plusone
+ \processallactionsinset
[#1]%
- [\v!reset=>\chardef\showgridstate\zerocount,
- %\v!bottom=>\chardef\showgridstate\plusone,
- \v!top=>\chardef\showgridstate\plustwo]}
+ [ \v!reset=>\chardef\showgridstate \zerocount,
+ \v!bottom=>\chardef\showgridstate \plusone,
+ \v!top=>\chardef\showgridstate \plustwo,
+ \v!none=>\chardef\gridboxlinemode \zerocount,
+ \v!all=>\chardef\gridboxlinemode \plusone,
+ \v!lines=>\chardef\gridboxlinemode \plustwo,
+ \v!frame=>\chardef\gridboxlinemode \plusthree,
+ \v!nonumber=>\chardef\gridboxlinenomode\zerocount,
+ \v!right=>\chardef\gridboxlinenomode\plusone,
+ \v!left=>\chardef\gridboxlinenomode\plustwo]}
\def\buildpagebox#1%
{\setbox#1\vbox to \paperheight
{\hsize\paperwidth
\vskip\topspace
\doifbothsides
- \hskip\backspace
- \orsideone
- \hskip\backspace
- \orsidetwo
- \hskip\paperwidth
- \hskip-\backspace
- \hskip-\makeupwidth
- \od
+ {\hskip\backspace}
+ {\hskip\backspace}
+ {\hskip\paperwidth \hskip-\backspace \hskip-\makeupwidth}%
\box#1}%
\dp#1\zeropoint}
@@ -1396,13 +1378,13 @@
% \shipoutfacingpage
\checkreferences
\checkmargeblokken
- \dotoks\beforeeverypage
+ \the\beforeeverypage
\flushtoks\beforepage
\inpagebodytrue\buildpagebody#1#2%
\flushtoks\afterpage
- \dotoks\aftereverypage
+ \the\aftereverypage
\resetpagebreak
- \updatelistreferences
+ %updatelistreferences % now in aftereverypage
\resetlayouttextlines % will go to \aftereverypage
\stoptextproperties
\the\everyafterpagebody}
@@ -1411,8 +1393,6 @@
\prependtoks \initializepaper \to \pageboundsettings
-\let\checkpageversion=\relax
-
% not here
\newif\ifpaginageblokkeerd \paginageblokkeerdfalse
@@ -1702,22 +1682,12 @@
\installpagebreakhandler \v!left
{\ejectinsert
\gotonextpageX % will become \gotonextpage
- \doifbothsidesoverruled
- \orsideone
- \resetcurrentsectionmarks % sic
- \ejectdummypage
- \orsidetwo
- \od}
+ \doifbothsidesoverruled{}{\resetcurrentsectionmarks\ejectdummypage}{}}
\installpagebreakhandler \v!right
{\ejectinsert
\gotonextpageX % will become \gotonextpage
- \doifbothsidesoverruled
- \orsideone
- \orsidetwo
- \resetcurrentsectionmarks % sic
- \ejectdummypage
- \od}
+ \doifbothsidesoverruled{}{}{\resetcurrentsectionmarks\ejectdummypage}}
\installpagebreakhandler \v!even
{\page
@@ -1746,12 +1716,9 @@
\gotonextpageX % will become \gotonextpage
\relax
\doifbothsidesoverruled
- \shipoutfacingpage
- \orsideone
- \orsidetwo
- \noheaderandfooterlines
- \ejectdummypage
- \od
+ {\shipoutfacingpage}
+ {}
+ {\noheaderandfooterlines \ejectdummypage}%
\filluparrangedpages}
\installpagebreakhandler \v!lastpage % handy for backpage preceded by empty pages
@@ -1878,41 +1845,39 @@
% \ignorerestoftext
% \to \everylastshipout
-\newif\ifgeselecteerd \geselecteerdtrue
-\newif\ifselecteren \selecterenfalse
-\newif\ifverwerken \verwerkentrue
+\newif\ifpageselected \pageselectedtrue
+\newif\ifselectingpages \selectingpagesfalse
+\newif\ifprocessingpages\processingpagestrue
-\let\selectie \empty
-\let\paginasoort\empty
-\let\napagina \relax
-\let\voorpagina \relax
+\let\pageselection \empty
+\let\currentpageselection\empty
+\let\aftershipout \relax
+\let\beforeshipout \relax
-\def\dodovoorpagina#1%
- {\global\let\voorpagina\relax
+\def\dodobeforeshipout#1%
+ {\global\let\beforeshipout\relax
\getvalue{\??pg#1\c!before}}
-\def\dovoorpagina
- {\doifsomething\paginasoort
- {\processcommacommand[\paginasoort]\dodovoorpagina}}
+\def\dobeforeshipout
+ {\doifsomething\currentpageselection
+ {\processcommacommand[\currentpageselection]\dodobeforeshipout}}
-\def\dododonapagina#1%
- {\global\let\napagina\relax
- \global\let\paginasoort\empty
+\def\dododoaftershipout#1%
+ {\global\let\aftershipout\relax
+ \global\let\currentpageselection\empty
\getvalue{\??pg#1\c!after}}
-\def\dodonapagina#1%
+\def\dodoaftershipout#1%
{\doifelsevalue{\??pg#1\c!option}\v!doublesided
{\doifbothsidesoverruled
- \dododonapagina{#1}%
- \orsideone
- \dododonapagina{#1}%
- \orsidetwo
- \od}
- {\dododonapagina{#1}}}
+ {\dododoaftershipout{#1}}
+ {\dododoaftershipout{#1}}
+ {}}
+ {\dododoaftershipout{#1}}}
-\def\donapagina
- {\doifsomething\paginasoort
- {\processcommacommand[\paginasoort]\dodonapagina}}
+\def\doaftershipout
+ {\doifsomething\currentpageselection
+ {\processcommacommand[\currentpageselection]\dodoaftershipout}}
% Dit wordt eigenlijk nooit en moet worden vervangen door
% het meer algemene mechanisme.
@@ -1920,13 +1885,13 @@
\def\dopagetype[#1]%
{\edef\desoortpagina{#1}%
\ifx\desoortpagina\empty \else
- \@EA\doglobal\@EA\addtocommalist\@EA{\desoortpagina}\paginasoort
- \ifselecteren
- \fullexpandtwoargsafter\doifcommon\desoortpagina\selectie
- {\global\geselecteerdtrue}%
+ \@EA\doglobal\@EA\addtocommalist\@EA{\desoortpagina}\currentpageselection
+ \ifselectingpages
+ \fullexpandtwoargsafter\doifcommon\desoortpagina\pageselection
+ {\global\pageselectedtrue}%
\fi
- \gdef\voorpagina{\dovoorpagina}%
- \gdef\napagina {\donapagina }%
+ \gdef\beforeshipout{\dobeforeshipout}%
+ \gdef\aftershipout {\doaftershipout}%
\fi}
\def\pagetype
@@ -1939,13 +1904,13 @@
\c!after=,
\c!option=,
#2]%
- \def\docommando##1%
+ \def\docommand##1%
{\getparameters
[\??pg##1]
[\c!before=\@@pgbefore,
\c!after=\@@pgafter,
\c!option=\@@pgoption]}%
- \processcommalist[#1]\docommando}%
+ \processcommalist[#1]\docommand}%
\def\couplepage
{\dodoubleargument\docouplepage}
@@ -1953,23 +1918,18 @@
\def\doprocesspage[#1][#2]%
{\processaction
[#2]
- [\v!yes=>\global\verwerkentrue,
- \v!no=>\global\verwerkenfalse]%
- \gdef\selectie{#1}%
- \global\selecterentrue
- \global\geselecteerdfalse}
+ [\v!yes=>\global\processingpagestrue,
+ \v!no=>\global\processingpagesfalse]%
+ \gdef\pageselection{#1}%
+ \global\selectingpagestrue
+ \global\pageselectedfalse}
\def\processpage
{\dodoubleargument\doprocesspage}
\def\resetselectiepagina
- {\ifselecteren
- \doifbothsidesoverruled
- \global\geselecteerdfalse
- \orsideone
- \orsidetwo
- \global\geselecteerdfalse
- \od
+ {\ifselectingpages
+ \doifbothsidesoverruled{\global\pageselectedfalse}{}{\global\pageselectedfalse}%
\fi}
\newif\ifregistertextareas
diff --git a/Master/texmf-dist/tex/context/base/page-lay.tex b/Master/texmf-dist/tex/context/base/page-lay.tex
index 20d9e66860b..70414c50001 100644
--- a/Master/texmf-dist/tex/context/base/page-lay.tex
+++ b/Master/texmf-dist/tex/context/base/page-lay.tex
@@ -13,6 +13,8 @@
\writestatus{loading}{Context Page Macros / Layout Specification}
+%D This module is now etex dependent.
+
% to be translated into english
% hoofdhoogte wordt bij status=hoog niet aangepast op outer
@@ -58,8 +60,8 @@
\newdimen\headerheight \headerheight = 2cm
\newdimen\footerheight \footerheight = \headerheight
-\newdimen\kopoffset \kopoffset = 0pt
-\newdimen\rugoffset \rugoffset = \kopoffset
+\newdimen\topoffset \topoffset = 0pt
+\newdimen\backoffset \backoffset = \topoffset
\newdimen\leftmarginwidth \leftmarginwidth = 3cm
\newdimen\rightmarginwidth \rightmarginwidth = \leftmarginwidth
@@ -103,27 +105,6 @@
%D Look how ugly a speed up looks:
-\beginTEX
-
-\def\layoutparameter#1%
- {\csname\??ly\@EA\ifx\csname
- \??ly\currentlayout#1\endcsname\relax\else\currentlayout
- \fi#1\endcsname}
-
-\def\namedlayoutparameter#1#2%
- {\csname\??ly
- \@EA\ifx\csname\??ly#1#2\endcsname\relax
- \@EA\ifx\csname\??ly\currentlayout#2\endcsname\relax
- \else\currentlayout\fi
- \else#1\fi
- \fi#2\endcsname}
-
-\endTEX
-
-%D Its \ETEX\ counterpart is:
-
-\beginETEX \ifcsname
-
\def\layoutparameter#1%
{\csname\??ly\ifcsname
\??ly\currentlayout#1\endcsname\currentlayout
@@ -134,8 +115,6 @@
\ifcsname\??ly\currentlayout#2\endcsname\currentlayout
\fi\fi#2\endcsname}
-\endETEX
-
%D Beause normal \TEX\ has at most 256 dimensions (of which a
%D substantial part is already in use), we provide a way to
%D generate a format with macro based alternatives. For a long
@@ -193,7 +172,9 @@
\def\setlayoutdistances % local in \setreducedvsize
{\headerdistance\layoutdistance\headerheight\c!headerdistance
- \footerdistance \layoutdistance\footerheight \c!footerdistance}
+ \footerdistance\layoutdistance\footerheight\c!footerdistance}
+
+% these are wrong in the running text, assumes some swapping, needs a cleanup
\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth }
\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth}
@@ -210,25 +191,9 @@
\newtoks\extralayoutcalculations \def\calculatelayoutextras{\the\extralayoutcalculations}
-\appendtoks
- \scratchdimen\leftmarginwidth \advance\scratchdimen\leftmargindistance \xdef\leftmargintotal {\the\scratchdimen}%
- \scratchdimen\rightmarginwidth \advance\scratchdimen\rightmargindistance \xdef\rightmargintotal{\the\scratchdimen}%
- \scratchdimen\leftedgewidth \advance\scratchdimen\leftedgedistance \xdef\leftedgetotal {\the\scratchdimen}%
- \scratchdimen\rightedgewidth \advance\scratchdimen\rightedgedistance \xdef\rightedgetotal {\the\scratchdimen}%
- \scratchdimen\leftmarginwidth \advance\scratchdimen\leftedgetotal \xdef\leftsidetotal {\the\scratchdimen}%
- \scratchdimen\rightmarginwidth \advance\scratchdimen\rightedgetotal \xdef\rightsidetotal {\the\scratchdimen}%
- \scratchdimen\leftmargintotal \advance\scratchdimen\leftedgetotal \xdef\leftcombitotal {\the\scratchdimen}%
- \scratchdimen\rightmargintotal \advance\scratchdimen\rightedgetotal \xdef\rightcombitotal {\the\scratchdimen}%
- %
- \scratchdimen\innermarginwidth \advance\scratchdimen\innermargindistance \xdef\innermargintotal{\the\scratchdimen}%
- \scratchdimen\outermarginwidth \advance\scratchdimen\outermargindistance \xdef\outermargintotal{\the\scratchdimen}%
- \scratchdimen\inneredgewidth \advance\scratchdimen\inneredgedistance \xdef\inneredgetotal {\the\scratchdimen}%
- \scratchdimen\outeredgewidth \advance\scratchdimen\outeredgedistance \xdef\outeredgetotal {\the\scratchdimen}%
- \scratchdimen\innermargintotal \advance\scratchdimen\inneredgetotal \xdef\innercombitotal {\the\scratchdimen}%
- \scratchdimen\outermargintotal \advance\scratchdimen\outeredgetotal \xdef\outercombitotal {\the\scratchdimen}%
- \scratchdimen\innermarginwidth \advance\scratchdimen\inneredgetotal \xdef\innersidetotal {\the\scratchdimen}%
- \scratchdimen\outermarginwidth \advance\scratchdimen\outeredgetotal \xdef\outersidetotal {\the\scratchdimen}%
-\to \extralayoutcalculations
+% \appendtoks
+% non etex calculations used to go here
+% \to \extralayoutcalculations
\newtoks\everyswapmargins % watch the order !
@@ -263,15 +228,21 @@
\def\definepapersize
{\dodoubleempty\dodefinepapersize}
-\def\dodefinepapersize[#1][#2]%
+\def\definepapersize
+ {\dotripleempty\dodefinepapersize}
+
+\def\dodefinepapersize[#1][#2][#3]%
{\ifsecondargument
\doifsomething{#1} % to be sure
- {\getparameters
- [\??pp#1] % geen \c!scale, scheelt hash ruimte
- [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]}%
+ {\doifassignmentelse{#2}
+ {\getparameters
+ [\??pp#1] % geen \c!scale, scheelt hash ruimte
+ [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]}
+ {\setvalue{\??pp:1:#1}{#2}%
+ \setvalue{\??pp:2:#1}{#3}}}%
\else
\getparameters[\??pp][#1]%
- \setuppapersize
+ \setuppapersize % hm. this will freeze !
\fi}
%D For the moment we need to fake this macro.
@@ -286,6 +257,27 @@
\definepapersize
[\c!width=210mm,\c!height=297mm,\c!offset=\!!zeropoint]
+%D Yet undocumented, let's see if it gets noticed.
+%D
+%D \starttyping
+%D \definepapersize[main] [A4] [A4]
+%D \definepapersize[extra][A4,landscape][A4,landscape]
+%D
+%D \starttext
+%D \setuppapersize[main]
+%D Page 1. \page
+%D Page 2. \page
+%D \setuppapersize[extra]
+%D Page 2 \page
+%D \setuppapersize[main]
+%D Page 3. \page
+%D Page 4. \page
+%D \adaptpapersize[extra]
+%D Page 5. \page
+%D Page 6. \page
+%D \stoptext
+%D \stoptyping
+
%D \macros
%D {setuppaper,setuppapersize}
%D
@@ -298,7 +290,7 @@
%D variables.
\chardef\papermirror =0 \chardef\printmirror =0
-\chardef\paperorientation=0 \chardef\printorientation=0
+\chardef\paperorientation=0 \chardef\printorientation=0 % beware: later no chardef
\chardef\paperreverse =0 \chardef\printreverse =0
\chardef\paperlandscape =0 \chardef\printlandscape =0
@@ -306,24 +298,12 @@
\def\paperscale{1} \newif\ifnegateprintbox
-% \def\dosetuppapersize[#1][#2]%
-% {\doifassignmentelse{#1}
-% {\getparameters[\??pp][#1]}
-% {\doifassignmentelse{#2}
-% {\getparameters[\??pp#1][#2]}
-% {\dodosetuppapersize[#1][#2]}}}
-%
-% The next version is more extensive; here we can
-% associate paper and page with key/value like settings,
-% which is handy in 'example' when we use setups
-
\def\setuppaper[#1]%
{\getparameters[\??pp][\c!paper=,\c!page=,#1]%
- \scratchcounter\@@ppnx
- \multiply\scratchcounter\@@ppny
- \edef\@@ppxy{\the\scratchcounter}%
+ \edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}%
\doifelsenothing\@@pppage
- {\doifsomething\@@pppaper
+ {\doifelsenothing\@@pppaper
+ {} % {\setuppapersize} % added, removed, no need for, too tricky, mag-01 (fixed by freezing pp's)
{\dodosetuppapersize[\papersize][\@@pppaper]}}
{\doifelsenothing\@@pppaper
{\dodosetuppapersize[\@@pppage][\printpapersize]}
@@ -335,9 +315,26 @@
\def\dosetuppapersize[#1][#2]%
{\doifassignmentelse{#1}
{\setuppaper[#1]}
- {\doifassignmentelse{#2}
- {\getparameters[\??pp#1][#2]}
- {\dodosetuppapersize[#1][#2]}}}
+ {\doifelsenothing{#2}
+ {\expanded{\dodosetuppapersize
+ [\executeifdefined{\??pp:1:#1}{#1}]%
+ [\executeifdefined{\??pp:2:#1}{}]}}
+ {\doifassignmentelse{#2}
+ {\getparameters[\??pp\executeifdefined{\??pp:1:#1}{#1}][#2]}
+ {\expanded{\dodosetuppapersize
+ [\executeifdefined{\??pp:1:#1}{#1}]%
+ [\executeifdefined{\??pp:1:#2}{#2}]}}}}}
+
+\let\reinstatepapersize\relax
+
+\def\adaptpapersize
+ {\global\let\reinstatepapersize\restorepapersize
+ \setuppapersize}
+
+\appendtoks
+ \reinstatepapersize
+ \global\let\reinstatepapersize\relax
+\to \everyaftershipout
\def\dodosetuppapersize[#1][#2]%
{\ifsecondargument
@@ -353,26 +350,37 @@
\restorepapersize
\fi\fi\fi}
+% dimen freeze is a bit tricky, but catches local redundant calls
+% with values where e.g width is defined in terms of \paperwidth
+
\def\dododosetuppapersize[#1][#2]%
{\xdef\restorepapersize{\noexpand\setuppapersize[#1][#2]}%
\dosetuppaperorientation{#1}\paperlandscape\paperorientation\paperreverse\papermirror
\dosetuppaperorientation{#2}\printlandscape\printorientation\printreverse\printmirror
- \def\docommando##1%
+ \def\docommand##1%
{\doifsomething{##1}{\doifdefined{\??pp##1\c!width}
- {\global\paperwidth\getvalue{\??pp##1\c!width}%
+ {\global\paperwidth \getvalue{\??pp##1\c!width}%
\global\paperheight\getvalue{\??pp##1\c!height}%
+\ifinpagebody
+ \setevalue{\??pp##1\c!height}{\the\paperheight}%
+ \setevalue{\??pp##1\c!width }{\the\paperwidth }%
+\fi
\calculatepaperoffsets{##1}%
\xdef\papersize{##1}}}}%
- \processcommacommand[#1]\docommando
+ \processcommacommand[#1]\docommand
\doifdefinedelse{\??pp#1\c!scale}
{\edef\paperscale{\getvalue{\??pp#1\c!scale}}}
{\edef\paperscale{1}}%
- \def\docommando##1%
+ \def\docommand##1%
{\doifsomething{##1}{\doifdefined{\??pp##1\c!width}
- {\global\printpaperwidth\getvalue{\??pp##1\c!width}%
+ {\global\printpaperwidth \getvalue{\??pp##1\c!width}%
\global\printpaperheight\getvalue{\??pp##1\c!height}%
+\ifinpagebody
+ \setevalue{\??pp##1\c!height}{\the\printpaperheight}%
+ \setevalue{\??pp##1\c!width }{\the\printpaperwidth}%
+\fi
\xdef\printpapersize{##1}}}}%
- \processcommacommand[#2]\docommando
+ \processcommacommand[#2]\docommand
\global\setdimentoatleast\paperwidth \onepoint
\global\setdimentoatleast\paperheight \onepoint
\global\setdimentoatleast\printpaperwidth \onepoint
@@ -388,8 +396,12 @@
\doif\@@ppoption\v!max % \v!fit is
{\bgroup
% we need to pre-swap else we get the wrong paper size
- \doifinset\paperorientation{90,270}{\swapdimens\paperwidth\paperheight}%
- \doifinset\printorientation{90,270}{\swapdimens\printpaperwidth\printpaperheight}%
+ \ifcase\paperorientation\else
+ \doifinset\paperorientation{90,270}{\swapdimens\paperwidth\paperheight}%
+ \fi
+ \ifcase\printorientation\else
+ \doifinset\printorientation{90,270}{\swapdimens\printpaperwidth\printpaperheight}%
+ \fi
\ifdim\paperheight>\printpaperheight
\global\printpaperheight\paperheight
\writestatus\m!systems{print height forced to paper height}%
@@ -428,13 +440,13 @@
\let\restorepapersize\relax
\def\checkforems[#1]%
- {\def\docommando##1%
+ {\def\docommand##1%
{\beforesplitstring##1\at em\to\asciia
\doifnot\asciia{##1}
{\aftersplitstring\asciia\at=\to\asciia
\doifsomething\asciia
{\showmessage\m!systems{10}{##1}}}}%
- \processcommalist[#1]\docommando}
+ \processcommalist[#1]\docommand}
\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi
@@ -475,33 +487,25 @@
{\ifdim\cutspace=\zeropoint
\global\cutspace\backspace
\fi
- \global\makeupwidth\paperwidth
- \global\advance\makeupwidth -\backspace
- \global\advance\makeupwidth -\cutspace}
+ \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax}
{\doifelse{\layoutparameter\c!width}\v!fit
{\ifdim\cutspace=\zeropoint
\global\cutspace\backspace
\fi
- \global\makeupwidth\paperwidth
- \global\advance\makeupwidth -\cutspace
- \scratchdimen\backspace
- \advance\scratchdimen -\leftedgewidth
- \advance\scratchdimen -\leftedgedistance
- \advance\scratchdimen -\leftmarginwidth
- \advance\scratchdimen -\leftmargindistance\relax
+ \global\makeupwidth\dimexpr\paperwidth-\cutspace\relax
+ \scratchdimen\dimexpr\backspace
+ -\leftedgewidth -\leftedgedistance
+ -\leftmarginwidth-\leftmargindistance\relax
\ifdim\scratchdimen<\zeropoint
\scratchdimen\zeropoint
\fi
- \global\advance\makeupwidth -\rightmargindistance
- \global\advance\makeupwidth -\rightmarginwidth
- \global\advance\makeupwidth -\rightedgedistance
- \global\advance\makeupwidth -\rightedgewidth
- \global\advance\makeupwidth -\scratchdimen}
+ \global\advance\makeupwidth\dimexpr
+ -\rightmargindistance-\rightmarginwidth
+ -\rightedgedistance -\rightedgewidth
+ -\scratchdimen\relax}
{\global\makeupwidth\layoutparameter\c!width\relax
\ifdim\cutspace=\zeropoint
- \global\cutspace\paperwidth
- \global\advance\cutspace-\makeupwidth
- \global\advance\cutspace-\backspace
+ \global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax
% \else
% A kind of inconsistent specification, but used
% in for instance s-pre-19.tex; the cutspace is
@@ -519,29 +523,20 @@
{\ifdim\bottomspace=\zeropoint
\global\bottomspace\topspace
\fi
- \global\makeupheight\paperheight
- \global\advance\makeupheight -\topspace
- \global\advance\makeupheight -\bottomspace}
+ \global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax}
{\doifelse{\layoutparameter\c!height}\v!fit
{\ifdim\bottomspace=\zeropoint
\global\bottomspace\topspace
\fi
- \global\makeupheight\paperheight
- \global\advance\makeupheight -\bottomspace
- \scratchdimen\topspace
- \advance\scratchdimen -\topheight
- \advance\scratchdimen -\topdistance\relax
+ \global\makeupheight\dimexpr\paperheight-\bottomspace\relax
+ \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax
\ifdim\scratchdimen<\zeropoint
\scratchdimen\zeropoint
\fi
- \global\advance\makeupheight -\bottomdistance
- \global\advance\makeupheight -\bottomheight
- \global\advance\makeupheight -\scratchdimen}
+ \global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax}
{\global\makeupheight\layoutparameter\c!height\relax
\ifdim\bottomspace=\zeropoint
- \global\bottomspace\paperheight
- \global\advance\bottomspace-\makeupheight
- \global\advance\bottomspace-\topspace
+ \global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax
\else
% inconsistent specification
\fi}}%
@@ -550,19 +545,12 @@
% a global lineheight is tricky: should we take the bodyfont interlinespace or the one set
% independent of the bodyfont (before or after a layout spec); way too fuzzy, so we
% stick to the current method (after a night of experimenting ...2003/10/13)
- \global\makeupheight\layoutparameter\c!lines\lineheight
- % new, cleaner
- \global\advance\makeupheight-\strutheight
- \global\advance\makeupheight \topskip
- % new, was a bug
- \global\advance\makeupheight \headerdistance
- \global\advance\makeupheight \footerdistance
- % so far
- \global\advance\makeupheight \headerheight
- \global\advance\makeupheight \footerheight
+ \global\makeupheight\dimexpr
+ \layoutparameter\c!lines\lineheight-\strutheight+\topskip+
+ \headerdistance+\headerheight+\footerdistance+\footerheight\relax
\fi
- \rugoffset\layoutparameter\c!horoffset
- \kopoffset\layoutparameter\c!veroffset
+ \backoffset\layoutparameter\c!horoffset
+ \topoffset \layoutparameter\c!veroffset
\global\setdimentoatleast\makeupwidth\onepoint
\global\setdimentoatleast\makeupheight \onepoint
% \checkcurrentlayout % here ?
@@ -578,17 +566,11 @@
\def\calculatepseudocolumns
{\global\layoutcolumns\layoutparameter\c!columns
\global\layoutcolumndistance\layoutparameter\c!columndistance
- \global\layoutcolumnwidth-\layoutcolumns\layoutcolumndistance
- \global\advance\layoutcolumnwidth\layoutcolumndistance
- \global\advance\layoutcolumnwidth\makeupwidth
+ \global\layoutcolumnwidth\dimexpr\makeupwidth-\layoutcolumns\layoutcolumndistance+\layoutcolumndistance\relax
\global\divide\layoutcolumnwidth\layoutcolumns
\dorecurse\layoutcolumns
- {\scratchdimen\layoutcolumnwidth
- \advance\scratchdimen\layoutcolumndistance
- \scratchcounter\recurselevel
- \advance\scratchcounter\minusone
- \scratchdimen\scratchcounter\scratchdimen
- \setxvalue{\??ly:c:\recurselevel}{\the\scratchdimen}}}
+ {\setxvalue{\??ly:c:\recurselevel}%
+ {\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}}}
%\dorecurse\layoutcolumns
% {\setxvalue{\??ly:c:\recurselevel}{\the\dimexpr
@@ -608,44 +590,95 @@
%
% \startstandardmakeup[page=blank] ... \stopstandardmakeup
-% \def\checkcurrentlayout % public and used in naw, so keep this name
-% {\ifundefined{\??ly\realfolio\c!state}%
-% \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
-% \else
-% \doifvalue{\??ly\realfolio\c!state}\v!start
-% {\xdef\currentlayout{\realfolio}\recalculatelayout}% new, global
-% \fi}
-
-\def\checkcurrentlayout % public and used in naw, so keep this name
- {\doifundefinedelse{\??ly\realfolio\c!state}
- {\doifundefinedelse{\??ly\v!current\c!state}
- {\doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout}
- {\globallet\currentlayout\v!current\recalculatelayout}}
- {\doifvalue{\??ly\realfolio\c!state}\v!start
- {\xdef\currentlayout{\realfolio}\recalculatelayout}}} % new, global
+\def\changetolayout#1%
+ {%\writestatus\m!layouts{changing to layout #1}%
+ \xdef\currentlayout{#1}\recalculatelayout}
\def\checkcurrentoddlayout
{\ifundefined{\??ly\v!odd\c!state}\else
- \doifvalue{\??ly\v!odd\c!state}\v!start
- {\globallet\currentlayout\v!odd\recalculatelayout}% new, global
+ \doifvalue{\??ly\v!odd\c!state}\v!start{\changetolayout\v!odd}%
\fi}
\def\checkcurrentevenlayout
{\ifundefined{\??ly\v!even\c!state}\else
- \doifvalue{\??ly\v!even\c!state}\v!start
- {\globallet\currentlayout\v!even\recalculatelayout}% new, global
+ \doifvalue{\??ly\v!even\c!state}\v!start{\changetolayout\v!even}%
\fi}
-% \appendtoks \checkcurrentlayout \to \everyaftershipout
+\ifx\lastpage\undefined \def\lastpage{1} \fi
+
+\def\reverserealfolio
+ {\ifnum\lastpage>\plusone
+ \ifnum\lastpage=\realfolio
+ \v!last
+ \else\ifnum\plusone=\realfolio
+ \v!first
+ \else
+ \the\numexpr\realfolio-\lastpage\relax
+ \fi\fi
+ \else
+ \!!zerocount
+ \fi}
+
+% \def\checkcurrentlayout % public and used in naw, so keep this name
+% {\doifundefinedelse{\??ly\realfolio\c!state}
+% {\doifundefinedelse{\??ly\reverserealfolio\c!state}
+% {\doifundefinedelse{\??ly\v!current\c!state}
+% {\doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout}
+% {\changetolayout\v!current}}
+% {\doifvalue{\??ly\reverserealfolio\c!state}\v!start
+% {\changetolayout\reverserealfolio}}}
+% {\doifvalue{\??ly\realfolio\c!state}\v!start
+% {\changetolayout\realfolio}}}
+
+\def\checkcurrentlayout % public and used in naw, so keep this name
+ {\ifcsname\??ly\realfolio\c!state\endcsname
+ \doifvalue{\??ly\realfolio\c!state}\v!start{\changetolayout\realfolio}%
+ \else\ifcsname\??ly\reverserealfolio\c!state\endcsname
+ \doifvalue{\??ly\reverserealfolio\c!state}\v!start{\changetolayout\reverserealfolio}%
+ \else\ifcsname\??ly\v!current\c!state\endcsname
+ \changetolayout\v!current % no start test ?
+ \else
+ \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
+ \fi\fi\fi}
+
+% testcase
+%
+% \setuppagenumbering[alternative=doublesided]
+%
+% \setuplayout [width=11cm]
+% \definelayout [odd] [backspace=1cm]
+% \definelayout [even] [backspace=4cm]
+% \definelayout [5] [backspace=5cm]
+% \definelayout [6] [backspace=5cm]
+% \definelayout [-2] [backspace=0cm,cutspace=0cm]
+% \definelayout [last] [backspace=0cm,cutspace=0cm]
+%
+% \checkcurrentlayout \showframe
+%
+% \starttext
+% \dorecurse{20} {\input knuth \endgraf \input tufte \endgraf}
+% \stoptext
+
+%appendtoks \checkcurrentlayout \to \everyaftershipout % no
+\appendtoks \checkcurrentlayout \to \everystarttext
\appendtoks
- \ifx\currentlayout\v!current
- \globallet\currentlayout\empty
- \global\letbeundefined{\??ly\v!current\c!state}%
- \checkcurrentlayout
- \fi
+ \dochecknextlayout
\to \everyaftershipout
+% \def\dochecknextlayout
+% {\ifx\currentlayout\v!current
+% % prevent redundant calculations
+% \else
+% \globallet\currentlayout\empty
+% \global\letbeundefined{\??ly\v!current\c!state}%
+% \checkcurrentlayout
+% \fi}
+%
+% this breaks after a standardmakeup
+
+\def\dochecknextlayout{\checkcurrentlayout}
+
\newif\ifdoublesidedprint
\def\presetcenterpagebox % in \setuplayout !!!!!!!!!!!!!!!!
@@ -671,19 +704,6 @@
{\getparameters[\??ly#1][#2]%
\checkforems[#2]}}
-% \def\dosetuplayout[#1][#2]%
-% {\let\currentlayout\empty
-% \ifsecondargument
-% \dodosetuplayout[#1][#2]%
-% \else\iffirstargument
-% \doifassignmentelse{#1}
-% {\dodosetuplayout[][#1]}
-% {\doifnot{#1}\v!reset{\def\currentlayout{#1}}}%
-% \fi\fi
-% \recalculatelayout
-% \checkcurrentlayout % here ?
-% \presetcenterpagebox}
-
% global needed for non-doublesided standardmakeup
\def\dosetuplayout[#1][#2]%
@@ -771,10 +791,10 @@
\def\doadaptlayout[#1][#2]%
{\doifelsenothing{#2}
{\dodoadaptlayout[#1]}
- {\def\docommando##1%
+ {\def\docommand##1%
{\addtocommalist{##1}\adaptedpages
\setgvalue{\??za##1}{\dodoadaptlayout[#2]}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\adaptpagedimensions}}
\def\adaptlayout
@@ -787,23 +807,25 @@
%D {right} parameters.
\def\centerpagebox#1%
- {\printpaperwidth\paperscale\printpaperwidth
- \printpaperheight \paperscale\printpaperheight
+ {\printpaperwidth \paperscale\printpaperwidth
+ \printpaperheight\paperscale\printpaperheight
\setbox#1\vbox to \printpaperheight
{\@@pptop
\hbox to \printpaperwidth
{\ifdoublesidedprint
- \doifbothsides \@@ppleft \box#1\@@ppright
- \orsideone \@@ppleft \box#1\@@ppright
- \orsidetwo \@@ppright\box#1\@@ppleft
- \od \else \@@ppleft \box#1\@@ppright
+ \doifbothsides
+ {\@@ppleft \box#1\@@ppright}
+ {\@@ppleft \box#1\@@ppright}
+ {\@@ppright\box#1\@@ppleft }%
+ \else
+ \@@ppleft \box#1\@@ppright
\fi}%
\par
\@@ppbottom}}
\def\offsetprintbox#1%
- {\ifdim\kopoffset=\zeropoint % \relax
- \ifdim\rugoffset=\zeropoint
+ {\ifdim\topoffset=\zeropoint % \relax
+ \ifdim\backoffset=\zeropoint
\donefalse
\else
\donetrue
@@ -816,32 +838,12 @@
\setbox#1\vbox
{%\forgetall
\offinterlineskip
- \vskip\kopoffset
- \doifbothsides
- \hskip\rugoffset
- \orsideone
- \hskip\rugoffset
- \orsidetwo
- \hskip-\rugoffset
- \od
+ \vskip\topoffset
+ \doifbothsides{\hskip\backoffset}{\hskip\backoffset}{\hskip-\backoffset}%
\box#1}%
\next
\fi}
-% \def\replicatebox#1#2#3%
-% {\setbox#1=\vbox
-% {%\forgetall
-% \offinterlineskip
-% \dorecurse{#3}
-% {\hbox{\dorecurse{#2}{\copy#1\hskip\@@lydx}\unskip}%
-% \vskip\@@lydy}
-% \unskip}}
-%
-% \def\replicatepagebox#1%
-% {\ifnum\@@lynx>0 \ifnum\@@lyny>0
-% \replicatebox{#1}{\@@lynx}{\@@lyny}%
-% \fi\fi}
-
\def\replicatepagebox#1%
{\ifnum\@@lynx>\plusone
\donetrue
@@ -940,9 +942,6 @@
\ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi
#1{#2}}
-\newif\ifdoublesided \doublesidedfalse
-\newif\ifsinglesided \singlesidedtrue
-
% NOG EENS NAGAAN WANNEER NU GLOBAL EN WANNEER NIET
\ifx\doifelselayoutsomeline\undefined % defined in page-txt
@@ -952,12 +951,10 @@
\def\calculatevsizes % global needed in \recalculatelayoutregel
{\redoglobal\textheight\makeupheight
\doifelselayoutsomeline \v!header
- {\redoglobal\advance\textheight -\headerheight
- \redoglobal\advance\textheight -\headerdistance}%
+ {\redoglobal\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}%
\donothing
\doifelselayoutsomeline \v!footer
- {\redoglobal\advance\textheight -\footerheight
- \redoglobal\advance\textheight -\footerdistance}%
+ {\redoglobal\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}%
\donothing
\ifzeropt\headerheight
\resetsystemmode\v!header
@@ -975,23 +972,32 @@
\def\calculatereducedvsizes
{\textheight\makeupheight
\doifelselayoutsomeline \v!header
- {\advance\textheight -\headerheight
- \advance\textheight -\headerdistance}%
+ {\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}%
{\headerheight\zeropoint
\setlayoutdistances}%
\doifelselayoutsomeline \v!footer
- {\advance\textheight -\footerheight
- \advance\textheight -\footerdistance}%
+ {\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}%
{\footerheight\zeropoint
\setlayoutdistances}}
-\def\freezetextwidth % \makeupwidth may be set to \textwidth
+\newdimen\innermakeupwidth % special purpose
+\newdimen\innermakeupmargin % special purpose
+
+\chardef\innermakeupcompensation\plusone
+
+\def\compensatedinnermakeupmargin
+ {\dimexpr\ifnum\innermakeupcompensation=\plusone+\innermakeupmargin\else\zeropoint\fi\relax}
+
+\def\freezetextwidth % \makeupwidth may be set to \textwidth
{\textwidth\makeupwidth % which is a tricky but valid value
- \doifsomething{\layoutparameter\c!textwidth}%
+ \doifsomething{\layoutparameter\c!textwidth}
{\textwidth\layoutparameter\c!textwidth}% % local
- \doifsomething{\layoutparameter\c!textmargin}%
- {\advance\textwidth-\layoutparameter\c!textmargin % local
- \advance\textwidth-\layoutparameter\c!textmargin}} % local
+ \global\innermakeupwidth\textwidth
+ \doifelsenothing{\layoutparameter\c!textmargin}
+ {\global\innermakeupmargin\zeropoint}
+ {\global\innermakeupmargin\layoutparameter\c!textmargin}%
+ \global\advance\innermakeupwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax
+ \advance\textwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax} % local
\def\calculatehsizes
{\freezetextwidth
@@ -1035,14 +1041,14 @@
% what are those \relax'es doing there?
-\def\doifbothsidesoverruled#1\orsideone#2\orsidetwo#3\od
+\def\doifbothsidesoverruled#1#2#3%
{\ifdoublesided
\doifoddpageelse{#2}{#3}\relax
\else
#1\relax
\fi}
-\def\doifbothsides#1\orsideone#2\orsidetwo#3\od
+\def\doifbothsides#1#2#3%
{\ifdoublesided
\ifsinglesided
#1\relax
@@ -1057,23 +1063,15 @@
\def\settexthoffset
{\doifbothsides
- \texthoffset\backspace
- \orsideone
- \texthoffset\backspace
- \orsidetwo
- \texthoffset\paperwidth
- \advance\texthoffset-\backspace
- \advance\texthoffset-\makeupwidth
- \od}
+ {\texthoffset\backspace}
+ {\texthoffset\backspace}
+ {\texthoffset\dimexpr\paperwidth-\backspace-\makeupwidth\relax}}
\def\goleftonpage
- {\hskip-\leftmargindistance
- \hskip-\leftmarginwidth
- \hskip-\leftedgedistance
- \hskip-\leftedgewidth}
+ {\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax}
\def\doifmarginswapelse#1#2%
- {\doifbothsides#1\orsideone#1\orsidetwo#2\od}
+ {\doifbothsides{#1}{#1}{#2}}
\def\swapmargins
{\doifmarginswapelse\relax\doswapmargins}
@@ -1107,29 +1105,25 @@
\def\outerspacewidth {\rightorleftpageaction\cutspace \backspace }
\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace}
-\beginETEX \dimexpr
-
- \def\leftmargintotal {\dimexpr\leftmarginwidth +\leftmargindistance \relax}
- \def\rightmargintotal{\dimexpr\rightmarginwidth+\rightmargindistance\relax}
- \def\leftedgetotal {\dimexpr\leftedgewidth +\leftedgedistance \relax}
- \def\rightedgetotal {\dimexpr\rightedgewidth +\rightedgedistance \relax}
-
- \def\leftsidetotal {\dimexpr\leftmarginwidth +\leftedgetotal \relax}
- \def\rightsidetotal {\dimexpr\rightmarginwidth+\rightedgetotal\relax}
- \def\leftcombitotal {\dimexpr\leftmargintotal +\leftedgetotal \relax}
- \def\rightcombitotal {\dimexpr\rightmargintotal+\rightedgetotal\relax}
-
- \def\innermargintotal{\dimexpr\innermarginwidth+\innermargindistance\relax}
- \def\outermargintotal{\dimexpr\outermarginwidth+\outermargindistance\relax}
- \def\inneredgetotal {\dimexpr\inneredgewidth +\inneredgedistance \relax}
- \def\outeredgetotal {\dimexpr\outeredgewidth +\outeredgedistance \relax}
-
- \def\innercombitotal {\dimexpr\innermargintotal+\inneredgetotal\relax}
- \def\outercombitotal {\dimexpr\outermargintotal+\outeredgetotal\relax}
- \def\innersidetotal {\dimexpr\innermarginwidth+\inneredgetotal\relax}
- \def\outersidetotal {\dimexpr\outermarginwidth+\outeredgetotal\relax}
-
-\endETEX
+\def\leftmargintotal {\dimexpr\leftmarginwidth +\leftmargindistance \relax}
+\def\rightmargintotal {\dimexpr\rightmarginwidth+\rightmargindistance\relax}
+\def\leftedgetotal {\dimexpr\leftedgewidth +\leftedgedistance \relax}
+\def\rightedgetotal {\dimexpr\rightedgewidth +\rightedgedistance \relax}
+
+\def\leftsidetotal {\dimexpr\leftmarginwidth +\leftedgetotal \relax}
+\def\rightsidetotal {\dimexpr\rightmarginwidth+\rightedgetotal\relax}
+\def\leftcombitotal {\dimexpr\leftmargintotal +\leftedgetotal \relax}
+\def\rightcombitotal {\dimexpr\rightmargintotal+\rightedgetotal\relax}
+
+\def\innermargintotal {\dimexpr\innermarginwidth+\innermargindistance\relax}
+\def\outermargintotal {\dimexpr\outermarginwidth+\outermargindistance\relax}
+\def\inneredgetotal {\dimexpr\inneredgewidth +\inneredgedistance \relax}
+\def\outeredgetotal {\dimexpr\outeredgewidth +\outeredgedistance \relax}
+
+\def\innercombitotal {\dimexpr\innermargintotal+\inneredgetotal\relax}
+\def\outercombitotal {\dimexpr\outermargintotal+\outeredgetotal\relax}
+\def\innersidetotal {\dimexpr\innermarginwidth+\inneredgetotal\relax}
+\def\outersidetotal {\dimexpr\outermarginwidth+\outeredgetotal\relax}
%D \macros
%D {startlocallayout}
@@ -1383,31 +1377,27 @@
%D A few goodies:
-\beginETEX \dimexpr
-
\definepapersize
[oversized]
- [\c!width=\dimexpr(\paperwidth+1.5cm),
- \c!height=\dimexpr(\paperheight+1.5cm)]
+ [ \c!width=\dimexpr\paperwidth +1.5cm\relax,
+ \c!height=\dimexpr\paperheight+1.5cm\relax]
\definepapersize
[doublesized]
- [\c!width=\dimexpr(\paperwidth),
- \c!height=\dimexpr(2\paperheight)]
+ [ \c!width=\dimexpr \paperwidth \relax,
+ \c!height=\dimexpr2\paperheight\relax]
\definepapersize
[doubleoversized]
- [\c!width=\dimexpr(\paperheight+1.5cm),
- \c!height=\dimexpr(2\paperwidth+1.5cm)]
+ [ \c!width=\dimexpr \paperheight+1.5cm\relax,
+ \c!height=\dimexpr2\paperwidth +1.5cm\relax]
%D For orthogonality:
\definepapersize
[undersized]
- [\c!width=\dimexpr(\paperwidth-1.5cm),
- \c!height=\dimexpr(\paperheight-1.5cm)]
-
-\endETEX
+ [ \c!width=\dimexpr\paperwidth -1.5cm\relax,
+ \c!height=\dimexpr\paperheight-1.5cm\relax]
\definelayout
[\v!page]
diff --git a/Master/texmf-dist/tex/context/base/page-lin.tex b/Master/texmf-dist/tex/context/base/page-lin.tex
index a0b4e84a94d..d28674686ac 100644
--- a/Master/texmf-dist/tex/context/base/page-lin.tex
+++ b/Master/texmf-dist/tex/context/base/page-lin.tex
@@ -29,57 +29,6 @@
\def\setuplines
{\dodoubleargument\getparameters[\??rg]}
-% old
-%
-% \def\startlines
-% {\@@rgbefore
-% \whitespace
-% %\page[\v!preference]} gaat mis na koppen, nieuw: later \nobreak
-% \begingroup
-% \def \@@rgstepyes {\parindent\zeropoint}%
-% \def \@@rgstepno {\parindent\zeropoint}%
-% \edef\@@rgparindent{\the\parindent}%
-% \globallet\@@rglinesteptoggle\!!plusone
-% \processaction
-% [\@@rgindenting]
-% [ \v!yes=>\def\@@rgstepyes{\parindent\@@rgparindent}%
-% \def\@@rgstepno {\parindent\@@rgparindent},
-% \v!odd=>\def\@@rgstepyes{\parindent\zeropoint }%
-% \def\@@rgstepno {\parindent\@@rgparindent},
-% \v!even=>\def\@@rgstepno {\parindent\zeropoint }%
-% \def\@@rgstepyes{\parindent\@@rgparindent}]%
-% \typesettinglinestrue
-% \setupwhitespace[\v!none]%
-% \obeylines
-% \let\checkindentation\relax
-% \@@rgstepno
-% \ignorespaces
-% \gdef\afterfirstobeyedline % tzt two pass, net als opsomming
-% {\gdef\afterfirstobeyedline
-% {\nobreak
-% \global\let\afterfirstobeyedline\relax}}%
-% \def\obeyedline
-% {\par
-% \let\checkindentation\relax % else problems with odd/even
-% \afterfirstobeyedline
-% \ifdim\lastskip>\zeropoint
-% \globallet\@@rglinesteptoggle\!!zerocount
-% \else
-% \doglobal\increment\@@rglinesteptoggle
-% \fi
-% \ifodd\@@rglinesteptoggle\relax
-% \@@rgstepyes
-% \else
-% \@@rgstepno
-% \fi
-% \futurelet\next\dobetweenthelines}%
-% \activatespacehandler\@@rgspace
-% \GotoPar}
-%
-% \def\stoplines
-% {\endgroup
-% \@@rgafter}
-
\def\startlines
{\@@rgbefore
\pushmacro\checkindentation
@@ -158,13 +107,6 @@
\def\activatespacehandler#1%
{\executeifdefined{\??sr#1}{\activatespacehandler\v!off}}
-% \def\dobetweenthelines%
-% {\convertcommand \next \to\!!stringa % very ugly and fuzzy
-% \convertargument\obeyedline\to\!!stringb % but needed anyway
-% \ifx\!!stringa\!!stringb % but alas, it fails
-% \@@rgtussen % hopelessly in non
-% \fi} % etex
-
\def\dobetweenthelines
{\doifmeaningelse\next\obeyedline\@@rginbetween\donothing}
@@ -200,29 +142,6 @@
\newevery \everylinenumber \relax
-% \def\dodoplacelinenumber
-% {% beware of em's, the font is already switched !
-% \setbox\scratchbox\hbox
-% {\setbox0\hbox{\@@rncommand{\completelinenumber}}\vsmashbox0%
-% \ifcase\linenumberlocation
-% \rlap{\hbox to \@@rnwidth{\box0\hss}}% was \llap, nog testen !!
-% \or
-% \inleftmargin
-% {\forgetall
-% \doifelse\@@rnwidth\v!margin
-% {\hsize\leftmarginwidth}{\hsize\@@rnwidth}%
-% \alignedline\@@rnalign\v!right{\box0\hskip\@@rndistance}}%
-% \else
-% \inrightmargin
-% {\forgetall
-% \doifelse\@@rnwidth\v!margin
-% {\hsize\rightmarginwidth}{\hsize\@@rnwidth}%
-% \alignedline\@@rnalign\v!left{\hskip\@@rndistance\box0}}%
-% \fi}%
-% \vsmashbox\scratchbox
-% \box\scratchbox
-% \the\everylinenumber}
-
\def\dodoplacelinenumber
{% beware of em's, the font is already switched !
\setbox\scratchbox\hbox
@@ -317,14 +236,17 @@
\numberinglinestrue
\complexorsimpleempty\startlinenumbering}
+\def\donoplacelinenumber
+ {\the\everylinenumber}
+
\def\doplacelinenumber
{\ifnum\linenumber<\@@rnstart\relax
+ \donoplacelinenumber
\else
- \!!counta\linenumber
- \divide\!!counta \@@rnstep
- \multiply\!!counta \@@rnstep\relax
- \ifnum\!!counta=\linenumber
+ \ifnum\numexpr(\linenumber/\@@rnstep)*\@@rnstep\relax=\linenumber
\doattributes\??rn\c!style\c!color\dodoplacelinenumber
+ \else
+ \donoplacelinenumber
\fi
\fi}
diff --git a/Master/texmf-dist/tex/context/base/page-log.tex b/Master/texmf-dist/tex/context/base/page-log.tex
index 53984eefd4f..d0671a73260 100644
--- a/Master/texmf-dist/tex/context/base/page-log.tex
+++ b/Master/texmf-dist/tex/context/base/page-log.tex
@@ -163,7 +163,7 @@
\def\dodosetlogobox#1#2%
{\hbox % width equals \makeupwidth
- {\def\docommando##1%
+ {\def\docommand##1%
{\donefalse
\ifnum\logostatus=3 \ExpandBothAfter
\doifinset{\getvalue{\??lo#1##1}}\requestedlogos\donetrue
@@ -173,43 +173,40 @@
\ifdone
#2{\hbox{\getvalue{\??lo#1##1\c!command}}}%
\fi}%
- \def\dodocommando##1##2##3##4##5##6%
+ \def\dodocommand##1##2##3##4##5##6%
{\hsmash
{\hskip-\texthoffset
\hbox to \paperwidth
- {\rlap{\docommando##1}\hss\llap{\docommando##6}}%
+ {\rlap{\docommand##1}\hss\llap{\docommand##6}}%
\hskip-\paperwidth
\hbox to \paperwidth
{\hskip\texthoffset
\hskip-\leftmarginwidth
\hskip-\leftmargindistance
- \hbox to \leftmarginwidth{\docommando##2\hss}%
+ \hbox to \leftmarginwidth{\docommand##2\hss}%
\hskip\leftmargindistance
- \hbox to \makeupwidth{\docommando##3\hss\docommando##4}%
+ \hbox to \makeupwidth{\docommand##3\hss\docommand##4}%
\hskip\rightmargindistance
- \hbox to \rightmarginwidth{\hss\docommando##5}%
+ \hbox to \rightmarginwidth{\hss\docommand##5}%
\hfill}}}%
\normalbaselines
\settexthoffset
\hsmash
- {\hbox to \makeupwidth{\hss\docommando\c!middle\hss}}%
+ {\hbox to \makeupwidth{\hss\docommand\c!middle\hss}}%
\hsmash
{\hskip-\texthoffset
- \hbox to \paperwidth{\docommando\v!page\hss}}%
+ \hbox to \paperwidth{\docommand\v!page\hss}}%
\swapmargins
\doifbothsidesoverruled
- \dodocommando
+ {\dodocommand
\v!leftedge \v!leftmargin \v!left
- \v!right \v!rightmargin \v!rightedge
- \orsideone
- \dodocommando
+ \v!right \v!rightmargin \v!rightedge}
+ {\dodocommand
\v!leftedge \v!leftmargin \v!left
- \v!right \v!rightmargin \v!rightedge
- \orsidetwo
- \dodocommando
+ \v!right \v!rightmargin \v!rightedge}
+ {\dodocommand
\v!rightedge \v!rightmargin \v!right
- \v!left \v!leftmargin \v!leftedge
- \od}}
+ \v!left \v!leftmargin \v!leftedge}}}
%D The user interface is relatively simple and provides
%D macros for assigning logos to logo areas as well as
diff --git a/Master/texmf-dist/tex/context/base/page-lyr.tex b/Master/texmf-dist/tex/context/base/page-lyr.tex
index e92f120529e..b0fabc3f7c5 100644
--- a/Master/texmf-dist/tex/context/base/page-lyr.tex
+++ b/Master/texmf-dist/tex/context/base/page-lyr.tex
@@ -13,6 +13,8 @@
\writestatus{loading}{Context Page Macros / Layers}
+%D This module is now etex dependent.
+
% todo : first / last / next / +... => page key
% test on left/right box when no doublesided option given
@@ -43,16 +45,11 @@
\def\dodefineoverlay[#1][#2][#3]% overlay [layer] content
{\ifthirdargument
\writestatus{BEWARE}{This (overlay definition) has changed!}% temp
- \def\docommando##1%
- {\setvalue{\??ov##1}####1####2####3####4####5####6####7%
- {\setlayer[#2]{\executedefinedoverlay
- ##1\\#3\\{####1}{####2}{####3}{####4}{####5}{####6}{####7}}}}%
+ \def\docommand##1{\setvalue{\??ov##1}{\setlayer[#2]{\executedefinedoverlay{##1}{#3}}}}
\else
- \def\docommando##1%
- {\setvalue{\??ov##1}{\executedefinedoverlay
- ##1\\#2\\}}%
+ \def\docommand##1{\setvalue{\??ov##1}{\executedefinedoverlay{##1}{#2}}}%
\fi
- \processcommalist[#1]\docommando}
+ \processcommalist[#1]\docommand}
%D When tracing is turned on, a couple of boxes will
%D show up as well as the reference point.
@@ -113,8 +110,8 @@
{\dodoubleargument\dosetuplayer}
\def\dosetuplayer[#1][#2]%
- {\def\docommando##1{\getparameters[\??ll##1][#2]}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\getparameters[\??ll##1][#2]}%
+ \processcommalist[#1]\docommand}
%D \macros
%D {setlayer}
@@ -187,8 +184,12 @@
\newbox\layerbox
-\newdimen\@@layerxsiz \newdimen\@@layerxoff \newdimen\@@layerxpos
-\newdimen\@@layerysiz \newdimen\@@layeryoff \newdimen\@@layerypos
+\newdimen\@@layerxsiz
+\newdimen\@@layerysiz
+\newdimen\@@layerxoff
+\newdimen\@@layeryoff
+\newdimen\@@layerxpos
+\newdimen\@@layerypos
\let\lastlayerxpos\!!zeropoint
\let\lastlayerypos\!!zeropoint
@@ -198,15 +199,20 @@
% todo left/right
+% \def\setlastlayerpos#1%
+% {\edef\layerpage{\MPp{lyr:\currentlayerdata}}%
+% \scratchdimen\MPx{lyr:#1:\layerpage}%
+% \scratchdimen-\scratchdimen
+% \advance\scratchdimen\MPx{lyr:\currentlayerdata}%
+% \xdef\lastlayerxpos{\the\scratchdimen}%
+% \scratchdimen\MPy{lyr:#1:\layerpage}%
+% \advance\scratchdimen-\MPy{lyr:\currentlayerdata}%
+% \xdef\lastlayerypos{\the\scratchdimen}}
+
\def\setlastlayerpos#1%
{\edef\layerpage{\MPp{lyr:\currentlayerdata}}%
- \scratchdimen\MPx{lyr:#1:\layerpage}%
- \scratchdimen-\scratchdimen
- \advance\scratchdimen\MPx{lyr:\currentlayerdata}%
- \xdef\lastlayerxpos{\the\scratchdimen}%
- \scratchdimen\MPy{lyr:#1:\layerpage}%
- \advance\scratchdimen-\MPy{lyr:\currentlayerdata}%
- \xdef\lastlayerypos{\the\scratchdimen}}
+ \xdef\lastlayerxpos{\the\dimexpr-\MPx{lyr:#1:\layerpage}+\MPx{lyr:\currentlayerdata}\relax}%
+ \xdef\lastlayerypos{\the\dimexpr \MPy{lyr:#1:\layerpage}-\MPy{lyr:\currentlayerdata}\relax}}
\def\definelayerpreset
{\dodoubleargument\dodefinelayerpreset}
@@ -262,10 +268,9 @@
{\@@layerxoff\@@layerxsiz}{\@@layerxoff\layerparameter\c!hoffset}%
\doifelse{\layerparameter\c!voffset}\v!max
{\@@layeryoff\@@layerysiz}{\@@layeryoff\layerparameter\c!voffset}%
- \advance\@@layerxoff\layerparameter\c!offset
- \advance\@@layeryoff\layerparameter\c!offset
-\advance\@@layerxoff\layerparameter\c!dx % internal, can be used in preset
-\advance\@@layeryoff\layerparameter\c!dy % internal, can be used in preset
+ % dx/dy are internal context ones and can be used in preset
+ \advance\@@layerxoff\dimexpr\layerparameter\c!offset+\layerparameter\c!dx\relax
+ \advance\@@layeryoff\dimexpr\layerparameter\c!offset+\layerparameter\c!dy\relax
\@@layerxpos\layerparameter\c!sx\@@layerxpos
\@@layerypos\layerparameter\c!sy\@@layerypos
\@@layerxoff\layerparameter\c!sx\@@layerxoff
@@ -283,11 +288,8 @@
\globallet\lastlayerypos\!!zeropoint
\ExpandBothAfter\doifinset\v!bottom{\layerparameter\c!corner}
{\ifnum\layerparameter\c!line=\zerocount\else % can be < 0
- \scratchcounter\layerparameter\c!line
- \scratchcounter-\scratchcounter
- \advance\scratchcounter\layoutlines
- \advance\scratchcounter\plusone
- \setevalue{\??ll\currentlayer\c!line}{\the\scratchcounter}%
+ \setevalue{\??ll\currentlayer\c!line}%
+ {\the\numexpr-\layerparameter\c!line+\layoutlines+\plusone\relax}%
\fi
\ifdim\@@layerysiz>\zeropoint
\advance\@@layerypos-\@@layerysiz
@@ -296,11 +298,8 @@
\fi}%
\ExpandBothAfter\doifinset\v!right{\layerparameter\c!corner}
{\ifnum\layerparameter\c!column=\zerocount\else % can be < 0
- \scratchcounter\layerparameter\c!column
- \scratchcounter-\scratchcounter
- \advance\scratchcounter \layoutcolumns
- \advance\scratchcounter \plusone
- \setevalue{\??ll\currentlayer\c!column}{\the\scratchcounter}%
+ \setevalue{\??ll\currentlayer\c!column}%
+ {\the\numexpr-\layerparameter\c!column+\layoutcolumns+\plusone\relax}%
\fi
\ifdim\@@layerxsiz>\zeropoint
\advance\@@layerxpos-\@@layerxsiz
@@ -308,12 +307,8 @@
\@@layerxoff-\@@layerxoff
\fi}%
\ExpandBothAfter\doif\v!middle{\layerparameter\c!corner}
- {\ifdim\@@layerxsiz>\zeropoint
- \advance\@@layerxpos.5\@@layerxsiz
- \fi
- \ifdim\@@layerysiz>\zeropoint
- \advance\@@layerypos.5\@@layerysiz
- \fi}%
+ {\ifdim\@@layerxsiz>\zeropoint \advance\@@layerxpos.5\@@layerxsiz \fi
+ \ifdim\@@layerysiz>\zeropoint \advance\@@layerypos.5\@@layerysiz \fi}%
\edef\layerpage{\layerparameter\c!page}}%
\doifsomething\layerpage
{\edef\layerpage{:\layerpage}%
@@ -353,13 +348,10 @@
\setbox\nextbox\hbox{\alignedbox[\layerparameter\c!location]\vbox{\flushnextbox}}%
\fi
\ifnum\layerparameter\c!line=\zerocount\else % no \ifcase, can be negative
- \advance\@@layerypos \layerparameter\c!line\lineheight
- \advance\@@layerypos \topskip
- \advance\@@layerypos-\lineheight
- \advance\@@layerypos-\nextboxht
+ \advance\@@layerypos\dimexpr\layerparameter\c!line\lineheight+\topskip-\lineheight-\nextboxht\relax
\fi
\ifnum\layerparameter\c!column=\zerocount\else % no \ifcase, can be negative
- \advance\@@layerxpos \layoutcolumnoffset{\layerparameter\c!column}%
+ \advance\@@layerxpos\layoutcolumnoffset{\layerparameter\c!column}%
\fi
\ifdone
\setbox\nextbox\hbox{\alignedbox[rb]\vbox{\flushnextbox}}%
@@ -381,8 +373,7 @@
\fi
% ll compensation
\ifcase\@@lacome\or % this test will become obsolete
- \advance\scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
+ \advance\scratchdimen\dimexpr\nextboxht+\nextboxdp\relax
\nextboxht\ifdim\scratchdimen>\lastlayerheight \scratchdimen \else \lastlayerheight \fi
\nextboxdp\zeropoint
\fi
@@ -446,12 +437,9 @@
{\doifundefinedelse{\@@layerbox#1}%
{\dodoflushlayerA[#1]}
{\doifbothsidesoverruled
- \dodoflushlayerB\v!left [#1]% left
- \orsideone
- \dodoflushlayerB\v!right[#1]% right
- \orsidetwo
- \dodoflushlayerB\v!left [#1]% left
- \od}}
+ {\dodoflushlayerB\v!left [#1]}% left
+ {\dodoflushlayerB\v!right[#1]}% right
+ {\dodoflushlayerB\v!left [#1]}}}% left
{\dodoflushlayerA[#1]}}}}
\def\dodoflushlayerA[#1]%
@@ -497,13 +485,18 @@
% stage of additions, i.e. llx/lly accumulate in repeat mode and the
% compensation may differ each flush depending on added content
\setbox\nextbox \if!!doneb
+% \vbox
+% {\scratchdimen\getboxlly\layerbox
+% \vskip-\scratchdimen
+% \scratchdimen\getboxllx\layerbox
+% \hskip-\scratchdimen
+% \advance\scratchdimen-\wd\layerbox
+% \hsize-\scratchdimen
+% \if!!donec\box\else\copy\fi\layerbox}%
\vbox
- {\scratchdimen\getboxlly\layerbox
- \vskip-\scratchdimen
- \scratchdimen\getboxllx\layerbox
- \hskip-\scratchdimen
- \advance\scratchdimen-\wd\layerbox
- \hsize-\scratchdimen
+ {\vskip-\getboxlly\layerbox
+ \hskip-\getboxllx\layerbox
+ \hsize-\dimexpr\getboxllx\layerbox-\wd\layerbox\relax
\if!!donec\box\else\copy\fi\layerbox}%
\else
\if!!donec\box\else\copy\fi\layerbox % sorry for the delay due to copying
@@ -738,7 +731,13 @@
\let\normalsettextpagecontent\settextpagecontent
-\definelayer[OTRTEXT] \setuplayer[OTRTEXT][\c!width=\makeupwidth,\c!height=\textheight]
+\definelayer
+ [OTRTEXT]
+
+\setuplayer
+ [OTRTEXT]
+ [\c!width=\innermakeupwidth,
+ \c!height=\textheight]
% will be overloaded in page-spr
diff --git a/Master/texmf-dist/tex/context/base/page-mak.tex b/Master/texmf-dist/tex/context/base/page-mak.tex
index 807d77fc07f..1637e632703 100644
--- a/Master/texmf-dist/tex/context/base/page-mak.tex
+++ b/Master/texmf-dist/tex/context/base/page-mak.tex
@@ -40,10 +40,10 @@
\def\dodefinemakeup[#1][#2]%
{\getparameters
[\??do#1]%
- [\c!width=\makeupwidth, % example in manual
- \c!height=\textheight, % example in manual
- \c!voffset=\!!zeropoint, % example in manual
- \c!hoffset=\!!zeropoint, % example in manual
+ [\c!width=\innermakeupwidth, % example in manual / was \makeupwidth
+ \c!height=\textheight, % example in manual
+ \c!voffset=\!!zeropoint, % example in manual
+ \c!hoffset=\!!zeropoint, % example in manual
\c!commands=,
\c!setups=,
\c!page=\v!right,
@@ -102,7 +102,7 @@
%D The simple case:
-\def\donostartmakeup
+\def\donostartmakeup % textwidth ?
{\page
\setupheader[\c!state=\v!empty]%
\setupfooter[\c!state=\v!empty]%
@@ -151,17 +151,17 @@
%D Selective page processing is handled here. (Why?)
\def\doflushmakeup
- {\ifverwerken
- \ifgeselecteerd
+ {\ifprocessingpages
+ \ifpageselected
\doshipoutmakeup
\fi
\else
- \ifgeselecteerd \else
+ \ifpageselected \else
\doshipoutmakeup
\fi
\fi
- \ifselecteren
- \global\geselecteerdfalse
+ \ifselectingpages
+ \global\pageselectedfalse
\fi}
\def\doshipoutmakeup
@@ -185,14 +185,11 @@
[\makeupparameter\c!doublesided]
[ \v!yes=>\null
\page,
- % \verlaagpaginanummer, % new
\v!empty=>{\setupmakeuplayout
\page[\v!blank]%
\null
\page}]%
- % \verlaagpaginanummer]% % new
\fi \fi
- % \verlaagpaginanummer % new
\globalpopmacro\@@pnstate} % new
%D The text surrounding the main body text can be influenced
@@ -212,7 +209,7 @@
\definemakeup
[\v!standard]
- [\c!width=\makeupwidth,
+ [\c!width=\innermakeupwidth,
\c!height=\textheight,
\c!voffset=\!!zeropoint,
\c!hoffset=\!!zeropoint,
diff --git a/Master/texmf-dist/tex/context/base/page-mar.tex b/Master/texmf-dist/tex/context/base/page-mar.tex
index 6a251f0d0e3..e11d0d15e08 100644
--- a/Master/texmf-dist/tex/context/base/page-mar.tex
+++ b/Master/texmf-dist/tex/context/base/page-mar.tex
@@ -58,50 +58,64 @@
\c!hoffset=\leftmargindistance,
\c!command=,
#2]%
- \setvalue{#1}{\domarginline{#1}}}
+ \unexpanded\setvalue{#1}{\dohandlemarginline{#1}}}
-\def\domarginline#1% #2
- {\getvalue{\s!do\??im\??im\executeifdefined{\??im\??im#1\c!location}\v!left}{#1}} % {#2}
+\def\marginlineparameter #1{\csname\??im\??im\currentmarginline#1\endcsname}
+\def\marginlineexecuter #1#2{\executeifdefined{\??im\??im\currentmarginline#1}{#2}}
-\def\doleftmarginline#1#2%
+\def\dohandlemarginline#1% #2
+ {\def\currentmarginline{#1}%
+ \csname\s!do\??im\??im\executeifdefined{\??im\??im#1\c!location}\v!left\endcsname{#1}} % {#2}
+
+\def\doleftmarginline#1#2% #1 is redundant (we can remove it when we group dohandlemarginline; maybe ...
{\pushindentation
\llap
- {\postsignalrightpage
- \hsize\getvalue{\??im\??im#1\c!width}\relax
- \executeifdefined{\??im\??im#1\c!command}\firstofoneargument{#2}\relax
- \hskip\leftskip
- \hskip\getvalue{\??im\??im#1\c!hoffset }\relax
- \hskip\getvalue{\??im\??im#1\c!distance}}%
+ {\def\currentmarginline{#1}%
+ \postsignalrightpage
+ \hsize\marginlineparameter\c!width\relax
+ \marginlineexecuter\c!command\firstofoneargument{#2}\relax
+ \hskip\dimexpr
+ +\leftskip
+ +\compensatedinnermakeupmargin
+ +\marginlineparameter\c!hoffset
+ +\marginlineparameter\c!distance
+ \relax}%
\popindentation
\ignorespaces}
-\def\dorightmarginline#1#2%
+\def\dorightmarginline#1#2% #1 is redundant
{\pushindentation
\rlap
- {\postsignalrightpage
- \hskip\hsize
- \hskip-\rightskip
- \hskip\getvalue{\??im\??im#1\c!hoffset }\relax
- \hskip\getvalue{\??im\??im#1\c!distance}\relax
- \hsize\getvalue{\??im\??im#1\c!width }\relax
- \executeifdefined{\??im\??im#1\c!command}\firstofoneargument{#2}}%
+ {\def\currentmarginline{#1}%
+ \postsignalrightpage
+ \hskip\dimexpr
+ +\hsize
+ -\rightskip
+ +\compensatedinnermakeupmargin
+ +\marginlineparameter\c!hoffset
+ +\marginlineparameter\c!distance
+ \relax
+ \hsize\marginlineparameter\c!width
+ \marginlineexecuter\c!command\firstofoneargument{#2}}%
\popindentation
\ignorespaces}
-\setvalue{\s!do\??im\??im\v!left }{\doleftmarginline}
-\setvalue{\s!do\??im\??im\v!right}{\dorightmarginline}
-\setvalue{\s!do\??im\??im\v!inner}{\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline}
-\setvalue{\s!do\??im\??im\v!outer}{\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline }
+\long\def\installmarginlinehandler#1#2{\setvalue{\s!do\??im\??im#1}{#2}}
+
+\installmarginlinehandler \v!left {\doleftmarginline}
+\installmarginlinehandler \v!right {\dorightmarginline}
+\installmarginlinehandler \v!inner {\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline}
+\installmarginlinehandler \v!outer {\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline }
-\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance,\c!hoffset=\zeropoint]
+\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance, \c!hoffset=\zeropoint]
\definemarginline[inrightmargin][\c!location=\v!right,\c!width=\rightmarginwidth,\c!distance=\rightmargindistance,\c!hoffset=\zeropoint]
-\definemarginline[inleftedge] [\c!location=\v!left, \c!width=\leftedgewidth, \c!distance=\leftedgedistance, \c!hoffset=\leftmargintotal]
-\definemarginline[inrightedge] [\c!location=\v!right,\c!width=\rightedgewidth, \c!distance=\rightedgedistance,\c!hoffset=\rightmargintotal]
+\definemarginline[inleftedge] [\c!location=\v!left, \c!width=\leftedgewidth, \c!distance=\leftedgedistance, \c!hoffset=\leftmargintotal]
+\definemarginline[inrightedge] [\c!location=\v!right,\c!width=\rightedgewidth, \c!distance=\rightedgedistance, \c!hoffset=\rightmargintotal]
\definemarginline[inoutermargin][\c!location=\v!outer,\c!width=\outermarginwidth,\c!distance=\outermargindistance,\c!hoffset=\zeropoint]
\definemarginline[ininnermargin][\c!location=\v!inner,\c!width=\innermarginwidth,\c!distance=\innermargindistance,\c!hoffset=\zeropoint]
-\definemarginline[inouteredge] [\c!location=\v!outer,\c!width=\outeredgewidth, \c!distance=\outeredgedistance,\c!hoffset=\outermargintotal]
-\definemarginline[ininneredge] [\c!location=\v!inner,\c!width=\inneredgewidth, \c!distance=\inneredgedistance,\c!hoffset=\innermargintotal]
+\definemarginline[inouteredge] [\c!location=\v!outer,\c!width=\outeredgewidth, \c!distance=\outeredgedistance, \c!hoffset=\outermargintotal]
+\definemarginline[ininneredge] [\c!location=\v!inner,\c!width=\inneredgewidth, \c!distance=\inneredgedistance, \c!hoffset=\innermargintotal]
\definemarginline[atleftmargin] [\c!location=\v!left, \c!command=\lrlap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint]
\definemarginline[atrightmargin][\c!location=\v!right,\c!command=\rllap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint]
@@ -192,9 +206,17 @@
\getparameters[\??im][#1]%
\fi}
+% \def\dodosetupinmargin[#1]#2% [settings]{class}
+% {\checkinmargin[#2]%
+% \getparameters[\??im#2][#1]}
+
\def\dodosetupinmargin[#1]#2% [settings]{class}
{\checkinmargin[#2]%
- \getparameters[\??im#2][#1]}
+ \getparameters[\??im#2][#1]%
+ % will become an \everyinmarginsetup thing
+ \ifcase\executeifdefined{\??im#2\c!sidemethod}{0}\else
+ \positioningtrue \positioningpartrue % global ?
+ \fi}
\def\checkinmargin[#1]%
{\ifundefined{\??im#1\c!offset}% this offset is related to framed !
@@ -382,11 +404,26 @@
%\hbox{\lower\strutdp\box\scratchbox}} % alas, wrong lapping, therefore useless
\dopositionmarginbox\scratchbox}
+% \def\domarginblockskip#1%
+% {\hskip\margincontenthoffset
+% \hskip\compensatedinnermakeupmargin\relax
+% \doifelsenothing\margincontentdistance
+% {\hskip\getvalue{\??im#1\c!distance}}
+% {\hskip\margincontentdistance}%
+% \relax}
+
\def\domarginblockskip#1%
- {\hskip\margincontenthoffset
- \doifelsenothing\margincontentdistance
- {\hskip\getvalue{\??im#1\c!distance}}
- {\hskip\margincontentdistance}%
+ {\doifelsenothing\margincontentdistance
+ {\hskip\dimexpr
+ +\margincontenthoffset
+ +\compensatedinnermakeupmargin
+ +\csname\??im#1\c!distance\endcsname
+ \relax}
+ {\dimexpr
+ +\margincontenthoffset
+ +\compensatedinnermakeupmargin
+ +\margincontentdistance
+ \relax}%
\relax}
\def\doleftmarginblock#1#2%
@@ -559,8 +596,54 @@
% \placefigure[right]{}{\externalfigure[dummy][width=2cm]}
% \input tufte \inothermargin{test} \input tufte
+% \def\dodoinmargin[#1][#2][#3][#4][#5]#6%
+% {\bgroup
+% \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous
+% \postponefootnotes % group is (somehow) needed
+% \doifinsetelse\v!low{#4}
+% {\chardef\margincontentdisplacement\plusone}
+% {\chardef\margincontentdisplacement\zerocount}%
+% \doif\v!reverse{#2}
+% {\swapmacros\dorightmarginblock\doleftmarginblock}%
+% \processaction
+% [#1]
+% [ \v!left=>\let\next\doleftmarginblock, % no swapping
+% \v!right=>\let\next\dorightmarginblock, % no swapping
+% \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock },
+% \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock},
+% \s!unknown=>\ifdoublesided
+% \doifcommonelse{+,-}{#4}
+% {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }}
+% {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}%
+% \else
+% \let\next\doleftmarginblock
+% \fi]%
+% \next{#3}{#6}%
+% \rawpagereference\s!mar{#5}% naar binnen ! ! ! !
+% \flushnotes
+% \egroup % don't forget the group
+% \ignorespaces}
+
+% test first
+%
+% setupsystem[random=1235]
+%
+% \setupinmargin[left][sidemethod=3]
+% \dorecurse{10}{test \fakewords{20}{40} test \inleft{test\\test} test \fakewords{20}{40} \par}
+% \page
+% \setupinmargin[left][sidemethod=4]
+% \dorecurse{40}{test \fakewords{50}{80} test \inleft{test\\test} \par}
+% \page
+
\def\dodoinmargin[#1][#2][#3][#4][#5]#6%
{\bgroup
+% \tracingall
+ % old stuff, a bit tricky, but now interfaced
+ \edef\currentmargincontent{#1}%
+ \chardef\marginrepositionmethod\executeifdefined{\??im\currentmargincontent\c!sidemethod }\plusone
+ \chardef\margincontentmethod \executeifdefined{\??im\currentmargincontent\c!textmethod }\plusthree
+ \chardef\marginpagecheckmethod \executeifdefined{\??im\currentmargincontent\c!splitmethod}\plusone
+ % so far
\forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous
\postponefootnotes % group is (somehow) needed
\doifinsetelse\v!low{#4}
diff --git a/Master/texmf-dist/tex/context/base/page-mul.tex b/Master/texmf-dist/tex/context/base/page-mul.tex
index 991e7532d30..4fd0979f8b8 100644
--- a/Master/texmf-dist/tex/context/base/page-mul.tex
+++ b/Master/texmf-dist/tex/context/base/page-mul.tex
@@ -1578,12 +1578,6 @@
%
% \stopcolumns
-\newif\ifinsidecolumns
-% \newif\if@@klbalanceren
-% \newif\if@@kluitlijnen
-
-\insidecolumnsfalse
-
\def\setupcolumns
{\dosingleempty\dosetupcolumns}
@@ -1706,6 +1700,76 @@
\vskip-\textheight
}% bugged : \prevdepth-\thousandpoint} % signals top of column to \blank
+%D New: only at start of columns; may change ! Rather
+%D interwoven and therefore to be integrated when the multi
+%D column modules are merged. (moved from cont-new.tex)
+
+\def\setupcolumnspan[#1]%
+ {\getparameters[\??ks][#1]}
+
+\presetlocalframed
+ [\??ks]
+
+\setupcolumnspan
+ [\c!n=2,
+ \c!offset=\v!overlay,
+ \c!frame=\v!off]
+
+\newbox\columnspanbox \let\postprocesscolumnspanbox\gobbleoneargument
+
+\def\dostartcolumnspan[#1]%
+ {\bgroup
+ \setupcolumnspan[#1]%
+ \forgetall
+ \ifinsidecolumns
+ \advance\hsize \intercolumnwidth
+ \hsize\@@ksn\hsize
+ \advance\hsize -\intercolumnwidth
+ \fi
+ \dowithnextbox
+ {\setbox\columnspanbox\flushnextbox
+ \ifinsidecolumns\wd\columnspanbox\hsize\fi
+ \postprocesscolumnspanbox\columnspanbox
+ \scratchdimen\ht\columnspanbox
+ \setbox\columnspanbox\hbox % depth to be checked, probably option!
+ {\localframed[\??ks][\c!offset=\v!overlay]{\box\columnspanbox}}%
+ \ht\columnspanbox\scratchdimen
+ \dp\columnspanbox\strutdp
+ \wd\columnspanbox\hsize
+ \ifinsidecolumns
+ \ifnum\@@ksn>1
+ \setvsize
+ \dohandleallcolumns
+ {\ifnum\currentcolumn>\@@ksn\else
+ \global\setbox\currenttopcolumnbox=\vbox
+ {\ifnum\currentcolumn=1
+ \snaptogrid\vbox{\copy\columnspanbox}
+ \else
+ \snaptogrid\vbox{\vphantom{\copy\columnspanbox}}
+ \fi}%
+ \wd\currenttopcolumnbox\hsize
+ \global\advance\vsize -\ht\currenttopcolumnbox
+ \fi}
+ \global\pagegoal\vsize
+ \else
+ \snaptogrid\vbox{\box\columnspanbox}
+ \fi
+ \else
+ \snaptogrid\vbox{\box\columnspanbox}
+ \fi
+ \endgraf
+ \ifvmode\prevdepth\strutdp\fi
+ \egroup}
+ \vbox\bgroup
+ %\topskipcorrection % becomes an option !
+ \EveryPar{\begstrut\EveryPar{}}} % also !
+
+\def\startcolumnspan
+ {\dosingleempty\dostartcolumnspan}
+
+\def\stopcolumnspan
+ {\egroup}
+
\setupcolumns
[\c!n=2,
\c!ntop=1,
diff --git a/Master/texmf-dist/tex/context/base/page-num.tex b/Master/texmf-dist/tex/context/base/page-num.tex
index b5a90fe6be3..d9f3bcdc0bb 100644
--- a/Master/texmf-dist/tex/context/base/page-num.tex
+++ b/Master/texmf-dist/tex/context/base/page-num.tex
@@ -94,7 +94,7 @@
\def\savenofsubpages
{\ifsubpaging
\showmessage\m!layouts6{\newnofsubpages,\the\subpageno}%
- \immediatewriteutilitycommand{\twopassentry{\s!subpage}{\newnofsubpages}{\the\subpageno}}%
+ \savetwopassdata{\s!subpage}{\newnofsubpages}{\the\subpageno}%
\fi}
\def\setsubpagenumbers
@@ -125,13 +125,7 @@
\setsubpagenumbers
\ifnum\oldsubpage>\zerocount
\showmessage\m!layouts6{\newnofsubpages,\oldsubpage}%
- \edef\next % \expanded
- {\writeutilitycommand%
- {\twopassentry%
- {\s!subpage}%
- {\newnofsubpages}%
- {\oldsubpage}}}%
- \next
+ \savetwopassdata{\s!subpage}{\newnofsubpages}{\oldsubpage}%
\fi
\doglobal\increment\newnofsubpages\relax
\fi
@@ -301,23 +295,6 @@
\def\setuppagenumber
{\dosingleargument\dosetuppagenumber}
-% long time used alternative
-%
-% \def\verlaagpaginanummer
-% {\doifinset{\@@pnstatus}{\v!start,\v!leeg,\v!geen}
-% {\decrementnumber[\s!page]%
-% \setuserpageno{\rawnumber[\s!page]}}}
-%
-% \def\verhoogpaginanummer
-% {\doifinset{\@@pnstatus}{\v!start,\v!leeg,\v!geen}
-% {\incrementnumber[\s!page]%
-% \setuserpageno{\rawnumber[\s!page]}}%
-% \doifinset{\@@pnstatus}{\v!handhaaf,\v!leeg}
-% {\global\let\@@pnstatus\v!start}}
-%
-% alternative, saves some 3 sec on 10K pages on a 1G machine
-% (needed during a test / prelude to installable methods)
-
\def\dodecrementpagenumber
{\decrementnumber[\s!page]\setuserpageno{\rawnumber[\s!page]}}
@@ -327,8 +304,8 @@
\def\dosynchronizepagenumber
{\global\let\@@pnstate\v!start}
-\def\verlaagpaginanummer{\getvalue{\??pn-\@@pnstate}}
-\def\verhoogpaginanummer{\getvalue{\??pn+\@@pnstate}}
+\def\decrementpagenumber{\getvalue{\??pn-\@@pnstate}}
+\def\incrementpagenumber{\getvalue{\??pn+\@@pnstate}}
\letvalue{\??pn-\v!start }\dodecrementpagenumber
\letvalue{\??pn-\v!none }\dodecrementpagenumber
@@ -356,13 +333,7 @@
\def\dopagesetreference
{\doglobal\increment\nofpagesets\relax
- \edef\writepagref
- {\writeutilitycommand
- {\twopassentry
- {\s!page}%
- {\nofpagesets}%
- {\noexpand\realfolio}}}%
- \writepagref}
+ \lazysavetwopassdata{\s!page}{\nofpagesets}{\noexpand\realfolio}}
\def\getpagestatus % hierboven gebruiken
{\ifdoublesided
diff --git a/Master/texmf-dist/tex/context/base/page-plg.tex b/Master/texmf-dist/tex/context/base/page-plg.tex
index 8478d6ef60b..b8da7f88af7 100644
--- a/Master/texmf-dist/tex/context/base/page-plg.tex
+++ b/Master/texmf-dist/tex/context/base/page-plg.tex
@@ -130,12 +130,9 @@
\vsize\paperheight
\setbox\pagebox\vbox
{\doifbothsidesoverruled
- \let\!!stringa\v!page
- \orsideone
- \let\!!stringa\v!rightpage
- \orsidetwo
- \let\!!stringa\v!leftpage
- \od
+ {\let\!!stringa\v!page}
+ {\let\!!stringa\v!rightpage}
+ {\let\!!stringa\v!leftpage}%
\getvalue{\??ly\c!method:\!!stringa}}%
\wd\pagebox\paperwidth
\ht\pagebox\paperheight
@@ -155,12 +152,9 @@
{\dodopagearea{#1}{#2}\c!middletext}}%
\else\ifsecondargument
\doifbothsidesoverruled
- \dodopagearea{#1}{#2}\c!righttext
- \orsideone
- \dodopagearea{#1}{#2}\c!righttext
- \orsidetwo
- \dodopagearea{#1}{#2}\c!lefttext
- \od
+ {\dodopagearea{#1}{#2}\c!righttext}
+ {\dodopagearea{#1}{#2}\c!righttext}
+ {\dodopagearea{#1}{#2}\c!lefttext }%
\else
\doif{#1}\v!text % copy due to trial runs in TABLE
{\iftrialtypesetting
diff --git a/Master/texmf-dist/tex/context/base/page-set.tex b/Master/texmf-dist/tex/context/base/page-set.tex
index be744b2a184..6dc5598e085 100644
--- a/Master/texmf-dist/tex/context/base/page-set.tex
+++ b/Master/texmf-dist/tex/context/base/page-set.tex
@@ -52,6 +52,8 @@
\def\@otr@{otr}
+\def\OTRSETmakeupwidth{\innermakeupwidth}
+
\let\OTRSETflushsidefloats \forgetsidefloats % \relax
\let\OTRSETsynchronizesidefloats\forgetsidefloats % \relax
@@ -474,13 +476,15 @@
\OTRSETdomakegridbox\nofcolumns\plusone\minusone
\fi}
+\def\OTRSETmakeupwidth{\makeupwidth} % temporary indirectness
+
\def\OTRSETdomakegridbox#1#2#3%
{\hbox\bgroup
\dontcomplain
\forgetall % can go once in \flush
\!!heighta \textheight
% test first !
- \hbox to \makeupwidth
+ \hbox to \OTRSETmakeupwidth
{\dostepwiserecurse{#1}{#2}{#3}
{\mofcolumns\recurselevel
\localcolumnwidth\OTRSETlocalwidth\mofcolumns
@@ -497,9 +501,9 @@
\box\scratchbox
\hskip\OTRSETgetparameter\c!distance\recurselevel
\fi}}%
- \hskip-\makeupwidth
+ \hskip-\OTRSETmakeupwidth
% main text
- \hbox to \makeupwidth
+ \hbox to \OTRSETmakeupwidth
{\dostepwiserecurse{#1}{#2}{#3}
{\mofcolumns\recurselevel
\localcolumnwidth\OTRSETlocalwidth\mofcolumns
@@ -1650,11 +1654,11 @@
\def\dosetupcolumnset[#1][#2][#3]%
{\ifthirdargument
- \def\docommando##1%
+ \def\docommand##1%
{\doifelse{##1}\v!each
- {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommando\recurselevel}}
+ {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommand\recurselevel}}
{\getparameters[\??mc#1##1][#3]}}%
- \processcommalist[#2]\docommando
+ \processcommalist[#2]\docommand
\else
\getparameters[\??mc#1][#2]%
\fi}
@@ -1787,7 +1791,7 @@
\saveinterlinespace
\globallet\columnsetpage\!!plusone
\def\currentcolumnset{#2}%
- \insidecolumnstrue % will be different flag
+ \insidecolumnstrue % will be different flag in addition
\activateotr{SET}{ONE}% andere naam, activate or so
\doifelsenothing{#1}
{\globallet\OTRSETlist\s!default}
@@ -1918,11 +1922,11 @@
% {\getcommacommandsize[\csname\??mc\OTRSETidentifier\c!regels\endcsname]%
% \ifnum\commalistsize>\plusone
% \scratchcounter\zerocount
-% \def\docommando##1%
+% \def\docommand##1%
% {\advance\scratchcounter\plusone
% \setvalue{\??mc\OTRSETidentifier\the\scratchcounter\c!regels}{##1}}%
% \processcommacommand
-% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommando
+% [\csname\??mc\OTRSETidentifier\c!regels\endcsname]\docommand
% \setvalue{\??mc\OTRSETidentifier\c!regels}{0}%
% \fi}}
@@ -2313,8 +2317,8 @@
\global\setbox\placeholderboxf\columnplaceholder1f}
\def\doOTRSETshowstatus
- {\llap{\incolortrue \localcolortrue \tt\tfxx\blue
- (\the\vsize->\number\columnfirstcell\#\number\columnfreecells)%
+ {\llap{\incolortrue \localcolortrue \tt\tfxx
+ \startcolor[blue](\the\vsize->\number\columnfirstcell\#\number\columnfreecells)\stopcolor
\hskip\leftskip}}
\def\OTRSETshowstatus
@@ -2549,7 +2553,7 @@
\fi}
\def\doinitializecolumntextareas#1#2%
- {\def\docommando##1%
+ {\def\docommand##1%
{\docheckcolumnsetareapage{##1#2}\plusone
\ifdone
\donefalse
@@ -2560,7 +2564,7 @@
\s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]%
\ifdone\dodoinitializecolumntextareas{##1}{#2}\fi
\fi}%
- \processcommacommand[#1]\docommando}
+ \processcommacommand[#1]\docommand}
\def\dodoinitializecolumntextareas#1#2%
{\doOTRSETsetgridcells
@@ -2579,7 +2583,7 @@
\def\doplacecolumntextareas#1#2% global ?
{\bgroup
\forgetall
- \def\docommando##1%
+ \def\docommand##1%
{\docheckcolumnsetareapage{##1#2}\zerocount
\ifdone
\donefalse
@@ -2594,7 +2598,7 @@
\doglobal\removefromcommalist{##1}#1%
\fi
\fi}%
- \processcommacommand[#1]\docommando
+ \processcommacommand[#1]\docommand
\egroup}
\def\columntextlastbackspace{\backspace}
@@ -2820,14 +2824,13 @@
\fi
\dostopframedtext
\egroup
- % frozen keeps grid snapping okay
\setbox\scratchbox\frozenhbox to \hsize
{\dontcomplain
\alignedline{\framedtextparameter{cs:#1}\c!location}\v!middle
{\lower\strutdepth\box\scratchbox}}%
\dp\scratchbox\zeropoint % else wrong snap insidefloat
%
-% to be tested first:
+% to be tested first (strange in grid mode)
%
% \setbox\scratchbox\frozenhbox to \hsize
% {\dontcomplain
diff --git a/Master/texmf-dist/tex/context/base/page-sid.tex b/Master/texmf-dist/tex/context/base/page-sid.tex
index 499f34f936f..02c4261fb59 100644
--- a/Master/texmf-dist/tex/context/base/page-sid.tex
+++ b/Master/texmf-dist/tex/context/base/page-sid.tex
@@ -15,6 +15,24 @@
\unprotect
+% problem: when too small, side effects; we need to determine the
+% shift earlier so that we can act when shift < size
+%
+% \definefloat[edgefigure]
+% \setupfloat
+% [edgefigure]
+% [rightmargindistance=-\rightmargintotal,
+% leftmargindistance=-\rightmargintotal,
+% default=outer]
+% \starttext
+% \placeedgefigure{}{\framed[width=12cm]{}} \input tufte
+% \placeedgefigure{}{\framed[width=5cm]{}} \input tufte
+% \placeedgefigure{}{\framed[width=4cm]{}} \input tufte
+% \placeedgefigure{}{\framed[width=2cm]{}} \input tufte
+% \stoptext
+
+% todo: dimexpr an dnumexpr
+
% These macro deal with side floats. We started with Daniel
% Comenetz macros as published in TUGBoat Volume 14 (1993),
% No.\ 1: Anchored Figures at Either Margin. I extended and
@@ -89,6 +107,37 @@
\newdimen\sidefloatrightskip
\newdimen\sidefloatmaximum
+% \def\checksidefloatshift
+% {\ifdim\sidefloatmaximum>\zeropoint
+% \ifcase\sidefloattype
+% % invalid
+% \or
+% % backspace
+% \or
+% \global\sidefloatshift-\sidefloatmaximum
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+% \or
+% \global\sidefloatshift-\sidefloatmaximum
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+% \or
+% % left
+% \or
+% % right
+% \or
+% \global\sidefloatshift-\sidefloatmaximum
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+% \or
+% \global\sidefloatshift-\sidefloatmaximum
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth
+% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+% \or
+% % cutspace
+% \fi
+% \fi}
+
\def\checksidefloatshift
{\ifdim\sidefloatmaximum>\zeropoint
\ifcase\sidefloattype
@@ -96,59 +145,118 @@
\or
% backspace
\or
- \global\sidefloatshift-\sidefloatmaximum
- \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance
- \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth
- \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+ \global\sidefloatshift\dimexpr
+ -\sidefloatmaximum
+ -\rightorleftpageaction \leftedgedistance \rightedgedistance
+ -\rightorleftpageaction \leftmarginwidth \rightmarginwidth
+ -\rightorleftpageaction \leftmargindistance \rightmargindistance
+ -\compensatedinnermakeupmargin
+ \relax
\or
- \global\sidefloatshift-\sidefloatmaximum
- \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+ \global\sidefloatshift\dimexpr
+ -\sidefloatmaximum
+ -\rightorleftpageaction \leftmargindistance \rightmargindistance
+ -\compensatedinnermakeupmargin
+ \relax
\or
% left
\or
% right
\or
- \global\sidefloatshift-\sidefloatmaximum
- \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+ \global\sidefloatshift\dimexpr
+ -\sidefloatmaximum
+ -\rightorleftpageaction \leftmargindistance \rightmargindistance
+ -\compensatedinnermakeupmargin
+ \relax
\or
- \global\sidefloatshift-\sidefloatmaximum
- \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance
- \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth
- \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
+ \global\sidefloatshift\dimexpr
+ -\sidefloatmaximum
+ -\rightorleftpageaction \leftedgedistance \rightedgedistance
+ -\rightorleftpageaction \leftmarginwidth \rightmarginwidth
+ -\rightorleftpageaction \leftmargindistance \rightmargindistance
+ -\compensatedinnermakeupmargin
+ \relax
\or
% cutspace
\fi
\fi}
+% \def\setsidefloatskips
+% {\global\sidefloatrightskip\zeropoint
+% \global\sidefloatleftskip \zeropoint
+% \ifcase\sidefloattype
+% \or % backspace
+% \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace
+% \or % leftedge
+% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance
+% \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth
+% \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance
+% \or % leftmargin
+% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance
+% \or % leftside
+% \or % rightside
+% \or % rightmargin
+% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance
+% \or % rightedge
+% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance
+% \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth
+% \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance
+% \or % cutspace
+% \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace
+% \fi
+% \ifdim\sidefloatrightskip>\zeropoint
+% \doglobal\advance\sidefloatrightskip\rightskip
+% \fi
+% \ifdim\sidefloatleftskip>\zeropoint
+% \doglobal\advance\sidefloatleftskip\leftskip
+% \fi}
+
+
+% use \outermarginwidth etc here
+
\def\setsidefloatskips
{\global\sidefloatrightskip\zeropoint
\global\sidefloatleftskip \zeropoint
\ifcase\sidefloattype
\or % backspace
- \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace
+ \global\sidefloatleftskip\dimexpr
+ +\rightorleftpageaction \backspace \cutspace
+ +\compensatedinnermakeupmargin
+ \relax
\or % leftedge
- \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance
- \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth
- \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance
+ \global\sidefloatleftskip\dimexpr
+ +\rightorleftpageaction \leftmargindistance \rightmargindistance
+ +\rightorleftpageaction \leftmarginwidth \rightmarginwidth
+ +\rightorleftpageaction \leftedgedistance \rightedgedistance
+ +\compensatedinnermakeupmargin
+ \relax
\or % leftmargin
- \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance
+ \global\sidefloatleftskip\dimexpr
+ +\rightorleftpageaction \leftmargindistance \rightmargindistance
+ +\compensatedinnermakeupmargin
+ \relax
\or % leftside
\or % rightside
\or % rightmargin
- \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance
+ \global\sidefloatrightskip\dimexpr
+ +\rightorleftpageaction \rightmargindistance \leftmargindistance
+ +\compensatedinnermakeupmargin
+ \relax
\or % rightedge
- \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance
- \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth
- \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance
+ \global\sidefloatrightskip\dimexpr
+ +\rightorleftpageaction \rightmargindistance \leftmargindistance
+ +\rightorleftpageaction \rightmarginwidth \leftmarginwidth
+ +\rightorleftpageaction \rightedgedistance \leftedgedistance
+ +\compensatedinnermakeupmargin
+ \relax
\or % cutspace
- \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace
- \fi
- \ifdim\sidefloatrightskip>\zeropoint
- \doglobal\advance\sidefloatrightskip\rightskip
+ \global\sidefloatrightskip\dimexpr
+ +\rightorleftpageaction \cutspace \backspace
+ +\compensatedinnermakeupmargin
+ \relax
\fi
- \ifdim\sidefloatleftskip>\zeropoint
- \doglobal\advance\sidefloatleftskip\leftskip
- \fi}
+ \ifdim\sidefloatrightskip>\zeropoint \doglobal\advance\sidefloatrightskip\rightskip \fi
+ \ifdim\sidefloatleftskip >\zeropoint \doglobal\advance\sidefloatleftskip \leftskip \fi}
% eq is still crap
@@ -405,117 +513,53 @@
\fi
-% \def\putsidefloat#1% grid (4) is rather experimental
-% {\par
-% \witruimte
-% % moved here dec 2001
-% {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% moved
-% \checksidefloatshift
-% \ifdim\sidefloatshift=\zeropoint \relax
-% \ifnum\sidefloattype=4
-% \global\advance\sidefloatshift\sidefloatextrashift
-% \global\sidefloatextrashift\zeropoint
-% \else\ifnum\sidefloattype=5
-% \global\advance\sidefloatshift\sidefloatextrashift
-% \global\sidefloatextrashift\zeropoint
-% \fi\fi
-% \else
-% \ifnum\sidefloattype<4
-% \global\chardef\sidefloattype4
-% \else\ifnum\sidefloattype>5
-% \global\chardef\sidefloattype5
-% \fi\fi
-% \fi
-% \previoussidefloat
-% \stallsidefloat
-% %\global\setbox\floatbox\hbox
-% % {\ifmarginfloat\else\ifrightfloat\else\kern\sidefloatleftshift\fi\fi
-% % \hskip\ifrightfloat-\sidefloatextrashift\else\sidefloatshift\fi
-% % \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}%
-% % \kern\ifrightfloat\sidefloatshift\else-\sidefloatextrashift\fi
-% % \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}%
+% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details
+% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details'
+
+% replacement for below
+%
% \global\setbox\floatbox\hbox % no \hskip, but \kern here
-% {\ifnum\sidefloattype=4
+% {\ifcase\sidefloattype
+% \vbox{#1}%
+% \or % 1
% \hskip\sidefloatleftshift
-% \else\ifnum\sidefloattype=1
+% \hskip\sidefloatshift
+% \vbox{#1}%
+% \kern-\sidefloatextrashift
+% \or % 2
+% \hskip\sidefloatshift
+% \vbox{#1}%
+% \kern-\sidefloatextrashift
+% \or % 3
+% \hskip\sidefloatshift
+% \vbox{#1}%
+% \kern-\sidefloatextrashift
+% \or % 4
% \hskip\sidefloatleftshift
-% \fi\fi
-% \ifnum\sidefloattype>4
-% \hskip-\sidefloatextrashift
-% \else
% \hskip\sidefloatshift
-% \fi
-% \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}%
-% \ifnum\sidefloattype>4
-% \kern\sidefloatshift
-% \else
+% \vbox{#1\removedepth}%
% \kern-\sidefloatextrashift
-% \fi
-% \ifnum\sidefloattype=8
+% \or % 5
+% \hskip-\sidefloatextrashift
+% \vbox{#1}%
+% \kern\sidefloatshift
% \kern\sidefloatrightshift
-% \else\ifnum\sidefloattype=5
+% \or % 6
+% \hskip-\sidefloatextrashift
+% \vbox{#1}%
+% \kern\sidefloatshift
+% \or % 7
+% \hskip-\sidefloatextrashift
+% \vbox{#1}%
+% \kern\sidefloatshift
+% \or % 8
+% \hskip-\sidefloatextrashift
+% \vbox{#1}%
+% \kern\sidefloatshift
% \kern\sidefloatrightshift
-% \fi\fi}%
-% \ifnum\sidefloatalign=4
-% \getnoflines{\ht\floatbox}%
-% \scratchdimen\noflines\lineheight
-% \advance\scratchdimen-\strutdepth
-% \getrawnoflines\sidefloattopskip
-% \advance\scratchdimen\noflines\lineheight
-% % todo: maybe rounding problem here
-% % \global\setbox\floatbox\hbox{\lower\lineheight\box\floatbox}%
-% \global\setbox\floatbox\hbox{\lower\strutdepth\box\floatbox}%
-% \global\ht\floatbox\scratchdimen
-% \global\dp\floatbox\zeropoint
-% \fi
-% \ifcase\sidefloatalign \else
-% \global\sidefloattopskip\zeropoint
-% \fi
-% \scratchdimen
-% \ifnum\sidefloattype<4
-% \sidefloattopskip
-% \else\ifnum\sidefloattype>5
-% \sidefloattopskip
-% \else
-% \zeropoint
-% \fi\fi
-% % the top of the box is at the previous baseline
-% \ifcase\sidefloatalign
-% % 0 normal
-% \advance\scratchdimen\strutdepth % == \sidefloattopoffset
-% \or % 1 height
-% \advance\scratchdimen\strutdepth % == \sidefloattopoffset
-% \or % 2 line
-% \or % 3 depth
-% \advance\scratchdimen\lineheight
-% \advance\scratchdimen\strutdepth
-% \or % 4 grid
-% \scratchdimen\zeropoint
-% \fi
-% % new
-% \global\sidefloatlinesdone\zerocount
-% \ifnum\sidefloatsidelines>\zerocount
-% \advance\scratchdimen\sidefloatsidelines\lineheight
-% \fi
-% % new
-% \global\setbox\floatbox\hbox
-% {\vbox{\vskip\scratchdimen\nointerlineskip\box\floatbox}}%
-% \ifnum\sidefloattype<4
-% \global\sidefloattopskip\zeropoint
-% \else\ifnum\sidefloattype>5
-% \global\sidefloattopskip\zeropoint
-% \fi\fi
-% \global\sidefloatdownshift\zeropoint
-% \measuresidefloat
-% \ifroomforfloat \else
-% \tosssidefloat
-% \measuresidefloat
-% \stallsidefloat
-% \fi
-% \setsidefloat}
-
-% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details
-% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details'
+% \fi}%
+%
+% keep this ^
\def\putsidefloat#1% grid (4) is rather experimental
{\par
diff --git a/Master/texmf-dist/tex/context/base/page-str.tex b/Master/texmf-dist/tex/context/base/page-str.tex
index ca6504598ab..ed1638029c5 100644
--- a/Master/texmf-dist/tex/context/base/page-str.tex
+++ b/Master/texmf-dist/tex/context/base/page-str.tex
@@ -111,12 +111,20 @@
\let\presetoutputstream\relax
-\def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi}
-\def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi}
\def\outputstreamht [#1]{\ht\outputstreamtag{#1}}
\def\outputstreamdp [#1]{\dp\outputstreamtag{#1}}
\def\outputstreamwd [#1]{\wd\outputstreamtag{#1}}
+%def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi}
+%def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi}
+
+\def\dowithoutputstreambox#1[#2]{\ifvoid\outputstreamtag{#2}\else#1\outputstreamtag{#2}\fi}
+
+\def\outputstreamcopy {\dowithoutputstreambox\copy }
+\def\outputstreambox {\dowithoutputstreambox\box }
+\def\outputstreamunvcopy{\dowithoutputstreambox\unvcopy}
+\def\outputstreamunvbox {\dowithoutputstreambox\unvbox }
+
%D Footnotes don't go along with streams, simply because there is no
%D way to re-split inserts. A dirty way out is to use marks and store
%D notes that way.
@@ -315,50 +323,50 @@
\box2\vfill\page
\egroup}
-%D Although one can put floats in a stream, it sometimes makes sense
-%D to keep them apart and this is what local floats do.
+ %D Although one can put floats in a stream, it sometimes makes sense
+ %D to keep them apart and this is what local floats do.
-\def\setuplocalfloats
- {\getparameters[\??lf]}
+ \def\setuplocalfloats
+ {\getparameters[\??lf]}
-\setuplocalfloats
- [%before=\blank,
- %after=\blank,
- inbetween=\blank]
+ \setuplocalfloats
+ [%before=\blank,
+ %after=\blank,
+ inbetween=\blank]
-\installfloathandler \v!local \somelocalfloat
+ \installfloathandler \v!local \somelocalfloat
-\initializeboxstack{localfloats}
+ \initializeboxstack{localfloats}
-\newcounter\noflocalfloats
+ \newcounter\noflocalfloats
-\def\resetlocalfloats
- {\doglobal\newcounter\noflocalfloats
- \initializeboxstack{localfloats}}
+ \def\resetlocalfloats
+ {\doglobal\newcounter\noflocalfloats
+ \initializeboxstack{localfloats}}
-\def\somelocalfloat[#1]%
- {\doglobal\increment\noflocalfloats
- \savebox{localfloats}{\noflocalfloats}{\box\floatbox}}
+ \def\somelocalfloat[#1]%
+ {\doglobal\increment\noflocalfloats
+ \savebox{localfloats}{\noflocalfloats}{\box\floatbox}}
-\def\getlocalfloats
- {\dorecurse\noflocalfloats
- {\ifnum\recurselevel=\plusone % 1\relax
- \getvalue{\??lf\c!before}%
- \else
- \getvalue{\??lf\c!inbetween}%
- \fi
- \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}%
- \ifnum\recurselevel=\noflocalfloats\relax
- \getvalue{\??lf\c!after}%
- \fi}}
+ \def\getlocalfloats
+ {\dorecurse\noflocalfloats
+ {\ifnum\recurselevel=\plusone % 1\relax
+ \getvalue{\??lf\c!before}%
+ \else
+ \getvalue{\??lf\c!inbetween}%
+ \fi
+ \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}%
+ \ifnum\recurselevel=\noflocalfloats\relax
+ \getvalue{\??lf\c!after}%
+ \fi}}
-\def\flushlocalfloats
- {\getlocalfloats
- \resetlocalfloats}
+ \def\flushlocalfloats
+ {\getlocalfloats
+ \resetlocalfloats}
-\def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}}
+ \def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}}
-\def\forcelocalfloats{\let\forcedfloatmethod\v!local}
+ \def\forcelocalfloats{\let\forcedfloatmethod\v!local}
%D Because many arrangements are possible, we will implement
%D some examples in a runtime loadable module \type {m-streams}.
diff --git a/Master/texmf-dist/tex/context/base/page-txt.tex b/Master/texmf-dist/tex/context/base/page-txt.tex
index 14707a5eb5e..ecc82c46ec0 100644
--- a/Master/texmf-dist/tex/context/base/page-txt.tex
+++ b/Master/texmf-dist/tex/context/base/page-txt.tex
@@ -67,20 +67,6 @@
\def\setuplayouttext
{\dotripleempty\dosetuplayouttext}
-% \def\dosetuplayouttext[#1][#2][#3]%
-% {\ifthirdargument
-% \getparameters[\??tk#1#2][#3]%
-% \else
-% %\getparameters[\??tk#1\v!text][#2]%
-% \edef\previoustextstate{\getvalue{\??tk#1\c!state}}%
-% \getparameters[\??tk#1][#2]%
-% \doifnotvalue{\??tk#1\c!state}\previoustextstate
-% {%\checkcurrentlayout % no
-% \calculatevsizes
-% \recalculatebackgrounds
-% \recalculatelogos}%
-% \fi}
-
\def\dosetuplayouttext[#1][#2][#3]%
{\ifthirdargument
\getparameters[\??tk#1#2][#3]%
@@ -92,10 +78,10 @@
{%\checkcurrentlayout % no
\edef\currenttextstate{\getvalue{\??tk#1\c!state}}%
% speed optimization (calculating backgrounds takes time)
- \doifcommon{\previoustextstate,\currenttextstate}{\v!high,\v!none}{%
- \calculatevsizes
- \recalculatebackgrounds
- \recalculatelogos}}%
+ \doifcommon{\previoustextstate,\currenttextstate}{\v!high,\v!none}
+ {\calculatevsizes
+ \recalculatebackgrounds
+ \recalculatelogos}}%
\fi}
\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]}
@@ -284,9 +270,6 @@
\setvalue{\string\placelayouttextline\v!none}#1#2%
{}
-% \setvalue{\string\placelayouttextline\v!high}#1#2%
-% {\global\settrue\resyncaftertextline}
-
\setvalue{\string\placelayouttextline\v!high}#1#2%
{\global\settrue\resyncaftertextline
\resettextlinestatus{#1}}
@@ -322,28 +305,10 @@
%D The following macro has to be called after a page
%D is flushed.
-% \def\resetlayouttextline#1%
-% {\doifvalue{\??tk#1\c!state}\v!high
-% {\global\settrue\resyncaftertextline
-% \resettextlinestatus{#1}}}
-
\def\resetlayouttextline#1%
{\getvalue {\??tk#1\s!reset}%
\letgvalue{\??tk#1\s!reset}\relax}
-% \def\resetlayouttextlines
-% {\resetlayouttextline\v!top
-% \resetlayouttextline\v!header
-% \resetlayouttextline\v!text
-% \resetlayouttextline\v!footer
-% \resetlayouttextline\v!bottom
-% \ifconditional\resyncaftertextline
-% \doglobal\calculatevsizes
-% \recalculatebackgrounds
-% \recalculatelogos
-% \global\setfalse\resyncaftertextline
-% \fi}
-
\def\resetlayouttextlines
{\resetlayouttextline\v!top
\resetlayouttextline\v!header
@@ -357,6 +322,48 @@
\global\setfalse\resyncaftertextline
\fi}
+% \settext[header][text][middle][xxx][yyy]
+
+\def\settextcontent
+ {\doquintupleempty\dosettextcontent}
+
+\def\dosettextcontent[#1][#2][#3][#4][#5]% header text middle text/text
+ {\iffifthargument
+ \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}%
+ {\dodoubletexts{\??tk#1}{#2}%
+ {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
+ {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}%
+ \else\iffourthargument
+ \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}%
+ {\dodoubletexts{\??tk#1}{#2}%
+ {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
+ {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}%
+ \else\ifthirdargument
+ \setvalue{\??tk#1#2\c!middletext}%
+ {\dodoubletexts{\??tk#1}{#2}%
+ {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}%
+ {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}%
+ \fi\fi\fi}
+
+\def\resettextcontent
+ {\dotripleempty\doresettextcontent}
+
+\def\doresettextcontent[#1][#2][#3]% header text middle
+ {\ifthirdargument
+ \letvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}\empty
+ \else\ifsecondargument
+ \letvalue{\??tk#1#2\c!lefttext }\empty
+ \letvalue{\??tk#1#2\c!middletext}\empty
+ \letvalue{\??tk#1#2\c!righttext }\empty
+ \fi\fi}
+
+\let\settext \settextcontent % downward compatibility
+\let\resettext\resettextcontent % downward compatibility
+
+\setvalue{:\c!middle:\c!text:}{\c!middletext}
+\setvalue{:\c!left :\c!text:}{\c!lefttext }
+\setvalue{:\c!right :\c!text:}{\c!righttext }
+
%D The next series of macros is not that easy to read,
%D because they hook into the main page building macros. By
%D using token list registers for the text content, we can
@@ -518,15 +525,9 @@
%\getvalue{\??tk#1\v!text\c!before}%
\getvalue{\??tk#1\c!before}%
\doifbothsidesoverruled
- \dodoplacelayouttextline#1\c!lefttext\c!middletext\c!righttext
- \gobbleoneargument\getvalue
- \orsideone
- \dodoplacelayouttextline#1\c!lefttext\c!middletext\c!righttext
- \gobbleoneargument\getvalue
- \orsidetwo
- \dodoplacelayouttextline#1\c!righttext\c!middletext\c!lefttext
- \getvalue\gobbleoneargument
- \od
+ {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\gobbleoneargument\getvalue}
+ {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\gobbleoneargument\getvalue}
+ {\dodoplacelayouttextline#1\c!righttext\c!middletext\c!lefttext \getvalue\gobbleoneargument}%
%\getvalue{\??tk#1\v!text\c!after}%
\getvalue{\??tk#1\c!after}%
\kern\zeropoint}% keep the \dp, beware of \vtops, never change this!
@@ -726,7 +727,7 @@
% \def\dodoresetlayouttekst[#1][#2]%
% {...}
%
-% \def\docommando#1%
+% \def\docommand#1%
% {\resetlayouttekst[#1][\v!tekst]%
% \resetlayouttekst[#1][\v!marge]%
% \resetlayouttekst[#1][\v!rand]}
@@ -734,7 +735,7 @@
%D We combine a lot of similar settings in a macro that
%D we will later dispose.
-\def\dodocommando[#1][#2]%
+\def\dodocommand[#1][#2]%
{\getparameters
[\??tk#1#2]
[%\c!state=\v!normal, % moved
@@ -756,19 +757,19 @@
\inheritparameter[\??tk#1#2][\c!leftwidth ][\c!width]%
\inheritparameter[\??tk#1#2][\c!rightwidth][\c!width]}
-\def\docommando#1%
- {\dodocommando[#1][\v!text]%
- \dodocommando[#1][\v!margin]%
- \dodocommando[#1][\v!edge]}
+\def\docommand#1%
+ {\dodocommand[#1][\v!text]%
+ \dodocommand[#1][\v!margin]%
+ \dodocommand[#1][\v!edge]}
-\docommando\v!top
-\docommando\v!header
-\docommando\v!footer
-\docommando\v!text
-\docommando\v!bottom
+\docommand\v!top
+\docommand\v!header
+\docommand\v!footer
+\docommand\v!text
+\docommand\v!bottom
-\let\docommando \relax
-\let\dodocommando\relax
+\let\docommand \relax
+\let\dodocommand\relax
%D While the header and footer lines are moved away from the
%D main text, the top and bottom lines are centered.
diff --git a/Master/texmf-dist/tex/context/base/ppchtex.tex b/Master/texmf-dist/tex/context/base/ppchtex.tex
index 25037018aa1..f2a022b20d5 100644
--- a/Master/texmf-dist/tex/context/base/ppchtex.tex
+++ b/Master/texmf-dist/tex/context/base/ppchtex.tex
@@ -286,7 +286,7 @@
% \fontdimen's opgehoogd. Omdat dit problemen gaf bij
% scaled fonts, is bij nader inzien gekozen voor de
% onderstaande oplossing, waarbij de nieuwe waarden worden
-% afgeleid van de x-height (\fontdimen5). De factor 0.70
+% afgeleid van de x-height (\fontexheight). De factor 0.70
% is min of meer experimenteel vastgesteld. Soms worden de
% regels iets verder uit elkaar gezet. Jammer. Italic fonts
% hebben grotere cijfers en vallen min of meer uit de boot.
@@ -307,16 +307,16 @@
\def\setsubscripts%
{\beginlatexmathmodehack
\def\dosetsubscript##1##2##3%
- {\dimen0=##3\fontdimen5##2%
+ {\dimen0=##3\fontexheight##2%
\setxvalue{@@\string##1\string##2}{\the##1##2\relax}%
##1##2=\dimen0\relax}%
\def\dodosetsubscript##1##2%
{\dosetsubscript{##1}{\textfont 2}{##2}%
\dosetsubscript{##1}{\scriptfont 2}{##2}%
\dosetsubscript{##1}{\scriptscriptfont2}{##2}}%
- %\dodosetsubscript{\fontdimen14}{?}%
- \dodosetsubscript{\fontdimen16}{.7}%
- \dodosetsubscript{\fontdimen17}{.7}%
+ %dodosetsubscript\mathsupnormal {?}%
+ \dodosetsubscript\mathsubnormal {.7}%
+ \dodosetsubscript\mathsubcombined{.7}%
\global\loweredsubscriptstrue
\endlatexmathmodehack}
@@ -330,9 +330,9 @@
{\doresetsubscript{##1}{\textfont2}%
\doresetsubscript{##1}{\scriptfont2}%
\doresetsubscript{##1}{\scriptscriptfont2}}%
- %\dodoresetsubscript{\fontdimen14}%
- \dodoresetsubscript{\fontdimen16}%
- \dodoresetsubscript{\fontdimen17}%
+ %dodoresetsubscript\mathsupnormal
+ \dodoresetsubscript\mathsubnormal
+ \dodoresetsubscript\mathsubcombined
\global\loweredsubscriptsfalse
\endlatexmathmodehack
\fi}
@@ -603,21 +603,21 @@
\dimen2=#2\relax
\dimen4=#3\relax
\setxvalue{chemical::\the\currentchemical}%
- {\noexpand\docommando{\the\dimen0}{\the\dimen2}{\the\dimen4}}%
+ {\noexpand\docommand{\the\dimen0}{\the\dimen2}{\the\dimen4}}%
\egroup}
%\def\getchemicaldimensions#1#2#3%
% {\global\advance\currentchemical by 1
-% \def\docommando##1##2##3%
+% \def\docommand##1##2##3%
% {#1=##1\relax#2=##2\relax#3=##3\relax}%
% \doifdefinedelse{chemical::\the\currentchemical}
% {\getvalue{chemical::\the\currentchemical}}
-% {\docommando{6cm}{4cm}{0cm}}}
+% {\docommand{6cm}{4cm}{0cm}}}
%
%\def\savechemicaldimensions%
% {\bgroup
% \writestatus{ppchtex}{saving dimensions in ppchtex.dim}%
-% \def\docommando##1##2##3%
+% \def\docommand##1##2##3%
% {\immediate\write\scratchwrite
% {\noexpand\setchemicaldimensions{##1}{##2}{##3}}}%
% \immediate\openout\scratchwrite=ppchtex.dim
@@ -734,9 +734,9 @@
\!!countc\!!countd
\@@chemicalbottom\@@chemicaltop\@@chemicalheight}%
%
- \edef\@@chemheight {\the\!!countc}%
- \edef\@@chemdepth {\the\!!countd}%
- \edef\@@chemicaltop{\the\!!countc}%
+ \edef\@@chemheight {\the\!!countc}%
+ \edef\@@chemdepth {\the\!!countd}%
+ \edef\@@chemicaltop {\the\!!countc}%
\edef\@@chemicalbottom{\the\!!countd}%
%
\doifinsetelse\v!on{\@@chemicalframe,\@@chemicalaxis}
diff --git a/Master/texmf-dist/tex/context/base/regi-ini.mkii b/Master/texmf-dist/tex/context/base/regi-ini.mkii
new file mode 100644
index 00000000000..7c0850b9050
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-ini.mkii
@@ -0,0 +1,153 @@
+%D \module
+%D [ file=regi-ini,
+%D version=2000.12.27, % 1998.12.03,
+%D title=\CONTEXT\ Regime Macros,
+%D subtitle=Initialization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D Plugs into the common interface.
+
+\def\mkloadregime#1%
+ {\makeshortfilename[\truefilename{\f!regimeprefix#1}]%
+ \startreadingfile
+ \readsysfile\shortfilename
+ {\showmessage\m!regimes2{#1}}
+ {\showmessage\m!regimes3{#1}}%
+ \stopreadingfile}
+
+\def\mkenableregime#1%
+ {\the\executeifdefined{\@reg@#1}\emptytoks}
+
+\def\mkwalkregime#1%
+ {\the\executeifdefined{\@reg@\currentregime}\emptytoks}
+
+\def\mkautosetregime#1#2%
+ {\ifnum#2>127
+ \expanded{\defineactivetoken #2 \@EA\noexpand\csname#1\endcsname}%
+ \fi}
+
+%D Remark: regimes accumulate, so there is no explicit reset in
+%D mkii mode.
+
+%D \macros
+%D {startregime}
+%D
+%D Sometimes it makes sense to activate the characters in the
+%D upper half of the character table. Such a bundle of
+%D characters can be packages in a regime. Later we will see
+%D encodings (that links characters slots to glyphs) and
+%D mappings (that take care of hyphenation and case changes).
+%D
+%D When character~231 is of category code letter, it
+%D directly maps to glyph~231 (unless of course some virtual
+%D font is used). By making character~231 active, we can map
+%D it onto for instance the glyph in slot 233. This mapping
+%D can in itself be indirect, in the sense that it is for
+%D instance handled by an accent command.
+%D
+%D Regimes are implemented roughly the same as mappings, but
+%D enabled under different circumstances. In the future, the
+%D low level implementation may change.
+
+\def\startregime[#1]%
+ {\pushmacro\currentregime
+ \edef\currentregime{#1}%
+ \checkregimetoks}
+
+\def\checkregimetoks
+ {\doifundefined{\@reg@\currentregime}
+ {\@EA\newtoks\csname\@reg@\currentregime\endcsname}}
+
+\def\stopregime
+ {\popmacro\currentregime}
+
+\def\setregimetoks
+ {\checkregimetoks
+ \@EA\let\@EA\regimetoks\csname\@reg@\currentregime\endcsname}
+
+%D \macros
+%D {defineactivedecimal, defineactivedecimals, defineactivetoken}
+%D
+%D The following commands are rather ugly ones. It makes a
+%D character active and assigns it a value. When expanded,
+%D the decimal number of the character is passed as first
+%D argument.
+%D
+%D \starttyping
+%D \def\decimalcharacter#1{\message{#1 is now active}}
+%D
+%D \defineactivedecimal 122 {\decimalcharacter}
+%D
+%D \defineactivedecimals 128 to 255 as {\decimalcharacter}
+%D \stoptyping
+%D
+%D This command is typically used in coding definitions,
+%D like the \UNICODE\ one.
+
+\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
+ {\catcode#1\active
+ \scratchcounter\uccode\activehackcode
+ \uccode\activehackcode#1\relax
+ \uppercase{\unexpanded\edef~{\noexpand#2{\number#1}}}%
+ \uccode\activehackcode\scratchcounter}
+
+\long\def\defineactivedecimal#1 #2 %
+ {\setregimetoks
+ \regimetoks\expandafter{\the\regimetoks\dodefineactivedecimal{#1}{#2}}}
+
+\long\def\defineactivedecimals#1 to #2 as #3 %
+ {\setregimetoks
+ \dostepwiserecurse{#1}{#2}\plusone
+ {\regimetoks\@EA\@EA\@EA{\@EA\the\@EA\regimetoks\@EA\dodefineactivedecimal\@EA{\recurselevel}{#3}}}}
+
+\def\doexpandactivedecimal#1%
+ {\ifnum#1>\scratchcounter
+ \expandafter\gobbletwoarguments
+ \else
+ \noexpand\dodefineactivedecimal{#1}{\the\scratchtoks}%
+ \expandafter\expandafter\expandafter\doexpandactivedecimal\expandafter
+ \fi\expandafter{\the\numexpr#1+\plusone\relax}}
+
+\long\def\defineactivedecimals#1 to #2 as #3 %
+ {\setregimetoks
+ \scratchcounter#2\relax
+ \scratchtoks{#3}%
+ \expanded{\regimetoks{\the\regimetoks\doexpandactivedecimal{#1}}}%
+ \ignorespaces}
+
+\long\def\defineactivetoken #1 #2% no {} after #2, else no kern
+ {\setregimetoks
+ \regimetoks\expandafter{\the\regimetoks\defineactivecharacter#1 {#2}}}
+
+\long\def\defineactiveinspector #1 #2% watch the missing {}
+ {\setregimetoks
+ \regimetoks\expandafter{\the\regimetoks\defineactivecharacter#1 {#2}}}
+
+% D This is kind of obsolete (replaced by previous code).
+%
+% \def\definetoken #1 % #1 = rawtoken or number
+% {\doifnumberelse{\string#1}
+% {\expanded{\dodefinetoken{\rawcharacter{#1}}}}
+% {\expanded{\dodefinetoken{\string#1}}}}
+%
+% \def\dodefinetoken#1#2%
+% {\defineactivecharacter#1 {\dohandletoken{#1}} %
+% \setvalue{\@reg@:t:\currentregime#1}{#2}}
+%
+% \def\dohandletoken#1%
+% {\csname\ifcsname \@reg@:t:\currentregime#1\endcsname % regi-def sets the defaults
+% \@reg@:t:\currentregime\else\defaultregime\fi#1\endcsname}
+
+%D Preloading:
+
+\useregime[def,uni,utf] % we load the rest runtime
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/regi-ini.tex b/Master/texmf-dist/tex/context/base/regi-ini.tex
index 679730d4059..3de73d90ab1 100644
--- a/Master/texmf-dist/tex/context/base/regi-ini.tex
+++ b/Master/texmf-dist/tex/context/base/regi-ini.tex
@@ -11,34 +11,172 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D For the moment regimes are implemented in \type
-%D {enco-ini.tex} module, but some day we will move the
-%D code here.
+\unprotect
-% also needed: message
+%D Messages (to be translated).
-\unprotect
+\startmessages dutch library: regimes
+ title: regime
+ 1: regime --
+ 2: regime -- wordt geladen
+ 3: onbekend regime --
+\stopmessages
-\def\douseregime#1% nearly identical to encoding
- {\doifundefined{\c!file\f!regimeprefix#1}%
- {\setvalue{\c!file\f!regimeprefix#1}{}%
- \makeshortfilename[\truefilename{\f!regimeprefix#1}]%
- \startreadingfile
- \readsysfile\shortfilename
- {\showmessage\m!encodings2{#1}}
- {\showmessage\m!encodings3{#1}}%
- \stopreadingfile}}
+\startmessages english library: regimes
+ title: regime
+ 1: regime --
+ 2: regime -- is loaded
+ 3: unknown regime --
+\stopmessages
+
+\startmessages german library: regimes
+ title: Kodierung
+ 1: Kodierung --
+ 2: Kodierung -- ist geladen
+ 3: Unbekannte Kodierung --
+\stopmessages
+
+\startmessages czech library: regimes
+ title: kodovani
+ 1: kodovani --
+ 2: je nacteno kodovani --
+ 3: nezname kodovani --
+\stopmessages
+
+\startmessages italian library: regimes
+ title: codifica
+ 1: codifica --
+ 2: codifica -- caricata
+ 3: codifica sconosciuta --
+\stopmessages
+
+\startmessages norwegian library: regimes
+ title: koding
+ 1: koding --
+ 2: koding -- er lest inn
+ 3: ukjent koding --
+\stopmessages
+
+\startmessages romanian library: regimes
+ title: codificari
+ 1: codificarea --
+ 2: codificarea -- este Encarcata
+ 3: codificarea -- este necunoscuta
+\stopmessages
+
+\startmessages french library: regimes
+ title: encodage
+ 1: encodage --
+ 2: l'encodage -- est chargé
+ 3: encodage -- inconnu
+\stopmessages
+
+%D Variables.
+
+\def\@reg@{@r@eg@} % regime prefix
+
+%D \macros
+%D {currentregime}
+
+\let\currentregime\empty
+\let\defaultregime\s!default
+
+%D Plugin interface.
+
+\let\mkloadregime \gobbleoneargument
+\let\mkenableregime \gobbleoneargument
+\let\mkdisableregime\relax
+\let\mkshowregime \gobbleoneargument
+\let\mkwalkregime \gobbleoneargument
+\let\mkautosetregime\gobbletwoarguments
+
+%D Some low level inheritance stuff (mkii).
+
+\def\doautosetregime{\mkautosetregime}
+
+%D \macros
+%D {defineregimesynonym,trueregimename}
+
+\def\defineregimesynonym
+ {\dodoubleargument\dodefineregimesynonym}
+
+\def\dodefineregimesynonym[#1][#2]%
+ {\setevalue{\@reg@:s:#1}{#2}}
+
+\def\trueregimename#1%
+ {\executeifdefined{\@reg@:s:#1}{#1}}
+
+%D \macros
+%D {useregime}
\def\useregime[#1]%
{\processcommalist[#1]\douseregime}
-\fetchruntimecommand \showregime {regi-run}
+\def\douseregime#1%
+ {\doifundefined{\c!file\f!regimeprefix#1}%
+ {\letgvalue{\c!file\f!regimeprefix#1}\empty
+ \mkloadregime{#1}}}
+
+%D \macros
+%D {enableregime,disableregime}
+
+\let\enabledregime\empty
+
+\def\enableregime[#1]%
+ {\edef\currentregime{\trueregimename{#1}}%
+ \doifelsenothing\currentregime
+ {\disableregime}
+ {\douseregime\currentregime
+ \mkenableregime\currentregime}}
+
+\def\disableregime
+ {\let\currentregime\empty
+ \mkdisableregime}
+
+%D \macros
+%D {protectregime, settoletterunlessactive, settocodeunlessactive}
+%D
+%D The next boolean is used later on to prevent unwanted
+%D catcode changes. Use it with care.
+
+\newif\ifprotectregime \protectregimetrue
+
+\def\settoletterunlessactive#1%
+ {\ifprotectregime\ifnum\catcode#1=\active\else
+ \catcode#1\@@letter
+ \fi\else
+ \catcode#1\@@letter
+ \fi}
+
+\def\settootherunlessactive#1%
+ {\ifprotectregime\ifnum\catcode#1=\active\else
+ \catcode#1=\@@other
+ \fi\else
+ \catcode#1=\@@other
+ \fi}
+
+\def\settocodeunlessactive#1#2%
+ {\ifprotectregime\ifnum\catcode#1=\active\else
+ \catcode#1=#2\relax
+ \fi\else
+ \catcode#1=#2\relax
+ \fi}
+
+%D Sort related:
+
+\def\dowalkregime{\mkwalkregime} % #1
+
+%D \macros
+%D {showregime}
+
+\def\showregime
+ {\dosingleempty\doshowregime}
-\protect
+\def\doshowregime[#1]%
+ {\mkshowregime{#1}}
-% \useregime[def,uni,ibm,win,il1,mac]
-% \useregime[def,uni,iso-8858-1,iso-8858-2,cp1252,mac]
+%D Plugins.
-\useregime[def,uni,utf] % we load the rest runtime
+\loadmkfile{regi-ini}
-\endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/regi-run.mkii b/Master/texmf-dist/tex/context/base/regi-run.mkii
new file mode 100644
index 00000000000..573f1803b8f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-run.mkii
@@ -0,0 +1,32 @@
+%D \module
+%D [ file=regi-run,
+%D version=2003.03.12,
+%D title=\CONTEXT\ Regime Macros,
+%D subtitle=Runtime Macros,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=Hans Hagen \& Ton Otten]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\gdef\mkshowregime#1%
+ {\doifnot{#1}{utf}
+ {\bgroup
+ \enableregime[#1]%
+ \starttabulate[|l|l|l|]
+ \dostepwiserecurse{128}{255}{1}
+ {\expanded
+ {\scantokens
+ {\NC \recurselevel
+ \NC \rawcharacter\recurselevel
+ \NC \noexpand\tttf
+ \noexpand\meaning\rawcharacter\recurselevel \NC \NR}}}%
+ \stoptabulate
+ \unskip
+ \egroup}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/regi-utf.tex b/Master/texmf-dist/tex/context/base/regi-utf.tex
index da89eedec78..85bdbf32fca 100644
--- a/Master/texmf-dist/tex/context/base/regi-utf.tex
+++ b/Master/texmf-dist/tex/context/base/regi-utf.tex
@@ -37,26 +37,22 @@
\expandafter \endinput
\endXETEX
-\unprotect
+\beginMETATEX
+ \expandafter \endinput
+\endMETATEX
-% beware, this may change: \utftwouniglyph rawchar
+\unprotect
\startregime[utf]
\dostepwiserecurse{192}{223}{1}
- {\expanded{\defineactiveinspector{\recurselevel} % space delimited
- {\noexpand\utftwouniglph{\recurselevel}}}%
- }%\letvalue{\@@univector\recurselevel}\gobbleoneargument}
+ {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utftwouniglph {\recurselevel}}}} % space delimited
\dostepwiserecurse{224}{239}{1}
- {\expanded{\defineactiveinspector{\recurselevel} % space delimited
- {\noexpand\utfthreeuniglph{\recurselevel}}}%
- }%\letvalue{\@@univector\recurselevel}\gobbetwoarguments}
+ {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utfthreeuniglph{\recurselevel}}}} % space delimited
\dostepwiserecurse{240}{247}{1}
- {\expanded{\defineactiveinspector{\recurselevel} % space delimited
- {\noexpand\utffouruniglph{\recurselevel}}}%
- }%\letvalue{\@@univector\recurselevel}\gobblethreearguments}
+ {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utffouruniglph {\recurselevel}}}} % space delimited
\stopregime
diff --git a/Master/texmf-dist/tex/context/base/rlxtools.rlx b/Master/texmf-dist/tex/context/base/rlxtools.rlx
index 2c5c3c6cef8..3d45798049f 100644
--- a/Master/texmf-dist/tex/context/base/rlxtools.rlx
+++ b/Master/texmf-dist/tex/context/base/rlxtools.rlx
@@ -2,6 +2,8 @@
<rl:manipulators>
+ <!-- normally the file tag will also have a suffix! -->
+
<!-- pstopdf will be made independent of the example framework -->
<!-- rl:manipulator name='pdf' suffix='svg'>
diff --git a/Master/texmf-dist/tex/context/base/s-abr-01.tex b/Master/texmf-dist/tex/context/base/s-abr-01.tex
index 54e5d6f9789..648780320ff 100644
--- a/Master/texmf-dist/tex/context/base/s-abr-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-abr-01.tex
@@ -96,6 +96,7 @@
\logo [IBM] {ibm}
\logo [IMAGEMAGICK]{ImageMagick}
\logo [INRSTEX] {inrs\TeX}
+\logo [IO] {io}
\logo [IRCNET] {IRCnet}
\logo [ISO] {iso}
\logo [JAVASCRIPT] {Java\-Script}
@@ -110,15 +111,20 @@
\logo [LATEX] {\LaTeX}
\logo [LINUX] {linux}
\logo [LISP] {Lisp}
+\logo [LUAJIT] {LuaJIT}
\logo [LUA] {Lua}
+\logo [LUATEX] {Lua\TeX}
+\logo [LUATOOLS] {luatools}
\logo [MACOSX] {MacOSX}
\logo [MAKEMPY] {MakeMPY}
\logo [MAPS] {Maps}
\logo [MATHML] {MathML}
\logo [METAFONT] {\MetaFont}
\logo [METAPOST] {\MetaPost}
+\logo [METATEX] {Meta\TeX}
\logo [MIKTEX] {Mik\TeX}
\logo [MLTEX] {ml\TeX}
+\logo [MTXTOOLS] {mtxtools}
\logo [MODULA] {Modula}
\logo [MOV] {mov}
\logo [MPS] {mps}
@@ -130,6 +136,7 @@
\logo [NTS] {nts}
\logo [OMEGA] {Omega}
\logo [OPI] {opi}
+\logo [OPENMATH] {OpenMath}
\logo [OTP] {otp}
\logo [PASCAL] {Pascal}
\logo [PCTEX] {pc\TeX}
@@ -202,6 +209,7 @@
\logo [URI] {uri}
\logo [URL] {url}
\logo [USA] {usa}
+\logo [UTF] {utf8}
\logo [USENET] {usenet}
\logo [UTF] {utf}
\logo [WDT] {wdt}
@@ -219,10 +227,11 @@
\logo [XSLT] {xslt}
\logo [XSLTPROC] {xsltproc}
\logo [XSL] {xsl}
-\logo [XETEX] {XeTeX}
+\logo [XETEX] {\XeTeX}
\logo [XSLFO] {xsl-fo}
\logo [XYPIC] {XYPIC} % wrong logo
\logo [YandY] {y\&y}
+\logo [ZIP] {zip}
\def\METAFUN {\MetaFun}
diff --git a/Master/texmf-dist/tex/context/base/s-mag-01.tex b/Master/texmf-dist/tex/context/base/s-mag-01.tex
index 38a1662c7d2..79d944f4cd8 100644
--- a/Master/texmf-dist/tex/context/base/s-mag-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-mag-01.tex
@@ -56,8 +56,8 @@
\definepapersize
[magazine]
- [width=\dimexpr(\paperwidth-.1\paperwidth),
- height=\dimexpr(\paperheight-.1\paperheight)]
+ [width=\dimexpr\paperwidth-.1\paperwidth\relax,
+ height=\dimexpr\paperheight-.1\paperheight\relax]
\setuppapersize
[magazine]
diff --git a/Master/texmf-dist/tex/context/base/s-mod-00.tex b/Master/texmf-dist/tex/context/base/s-mod-00.tex
index d585b04f9dc..d16688de553 100644
--- a/Master/texmf-dist/tex/context/base/s-mod-00.tex
+++ b/Master/texmf-dist/tex/context/base/s-mod-00.tex
@@ -292,7 +292,7 @@
{\doglobal\newcounter\NOfMarginLines}}
\def\dodomargeaanduidingen[#1]#2%
- {\def\docommando##1%
+ {\def\docommand##1%
{\indent\hbox
{\ifx#2\relax
\index{##1}%
@@ -302,7 +302,7 @@
#2{\doboundtext{##1}{\leftmarginwidth}{..}}}%
\doglobal\increment\NOfMarginLines
\endgraf}%
- \processcommalist[#1]\docommando}
+ \processcommalist[#1]\docommand}
\def\margeaanduidingen#1[#2]%
{\def\domargeaanduidingen##1##2%
diff --git a/Master/texmf-dist/tex/context/base/s-mod-01.tex b/Master/texmf-dist/tex/context/base/s-mod-01.tex
index 0e834049f44..dc695a44d72 100644
--- a/Master/texmf-dist/tex/context/base/s-mod-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-mod-01.tex
@@ -14,7 +14,7 @@
%D This module looks like crap, is not documented, will
%D change, and used to be called modu-*.tex.
-\usemodule[mod-00]
+\usemodule[mod-00,abr-01]
\unprotect
@@ -68,7 +68,7 @@
\setupfootertexts
[\v!margin]
- [\tt\Modulefile][]
+ [\filename{\Modulefile}][]
\stopmode
@@ -76,8 +76,8 @@
\setupfootertexts
[\v!margin]
- [\tt\Modulefile][]
- [\tt\Modulefile][]
+ [\filename{\Modulefile}][]
+ [\filename{\Modulefile}][]
\stopnotmode
diff --git a/Master/texmf-dist/tex/context/base/sort-ini.tex b/Master/texmf-dist/tex/context/base/sort-ini.tex
index 970cbff1f24..c3cbb319cc0 100644
--- a/Master/texmf-dist/tex/context/base/sort-ini.tex
+++ b/Master/texmf-dist/tex/context/base/sort-ini.tex
@@ -108,14 +108,14 @@
\doifelse \currentregime {utf}
{\exportutfsortexpansion{0}{128}{255}%
\exportutfsortexpansion{1}{0}{255}}
- {\def\defineactivecharacter##1 ##2%
+ {\def\defineactivecharacter##1 ##2% mkii code !
{\expanded{\exportsortshortcut{\rawcharacter{##1}}}{##2}}%
- \doifelse{\characterregime}\nocharacterregime
- {\doifnot{\characterencoding}\nocharacterencoding % to be sure, autoregime
- {\the\executeifdefined{\@reg@\characterencoding}\emptytoks}}%
- {\the\executeifdefined{\@reg@\characterregime}\emptytoks}}%
+ \doifelsenothing\currentregime
+ {\doifnot\characterencoding\nocharacterencoding % to be sure, autoregime
+ {\dowalkregime\characterencoding}}%
+ {\dowalkregime\characterencoding}}%
\egroup
- \readfile{\f!sortprefix def}\donothing\donothing % default
+ \readsysfile{\f!sortprefix def}\donothing\donothing % default
\global\let\savesortdefinitions\relax}
\def\savesortlanguage#1% language specifics
@@ -125,7 +125,7 @@
\global\letvalue{\f!sortprefix::#1}\empty
\def\currentexportclass{#1}%
\enablemode[sortorder-#1]%
- \readfile{\f!sortprefix lan}\donothing\donothing
+ \readsysfile{\f!sortprefix lan}\donothing\donothing
\egroup}}}
\prependtoks
@@ -146,6 +146,6 @@
% \blank[3*big] \placeregister[two]
% \stoptext
-% already done \prependtoks \savesortkeys \to \everystarttext
+\prependtoks \savesortkeys \to \everystarttext
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-def.mkii b/Master/texmf-dist/tex/context/base/spec-def.mkii
new file mode 100644
index 00000000000..6a66c68cb4f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spec-def.mkii
@@ -0,0 +1,16 @@
+%D \module
+%D [ file=spec-def,
+%D version=1996.01.25,
+%D title=\CONTEXT\ Special Macros,
+%D subtitle=Definitions,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This file is empty.
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-def.tex b/Master/texmf-dist/tex/context/base/spec-def.tex
index 62313585e6c..fa48700e672 100644
--- a/Master/texmf-dist/tex/context/base/spec-def.tex
+++ b/Master/texmf-dist/tex/context/base/spec-def.tex
@@ -175,7 +175,7 @@
%D simply call the start one with zero arguments.
%D \macros
-%D {doinsertfile,doinsertMPfile}
+%D {dogetfiguresize,doinsertfile,doinsertMPfile}
%D
%D Probably the most problematic special is the following
%D one. Because we want to be able to support different
@@ -197,6 +197,14 @@
%D The scale is given percents, the other values are base
%D points.
%D
+%D Per 2006 we have simplified this model. The amount of drivers
+%D is not growing and all support scaling. We pass variables via
+%D Driver specific macros.
+%D
+%D \starttyping
+%D \doinsertfile
+%D \stoptyping
+%D
%D The special is implemented as \type{or}. Because \DVIPSONE\
%D understands them all, a chain of alternatives would generate
%D multiple occurrences of the same illustration.
@@ -204,7 +212,8 @@
%D When option 1 is passed, the viewers is asked to present a
%D preview, like the first frame of a movie.
-\installspecial [\doinsertfile] [or] [9]
+\installspecial [\dogetfiguresize][or] [0] % now a special
+\installspecial [\doinsertfile] [or] [0] % [9]
\installspecial [\doinsertMPfile] [or] [1] % speed up
%D No start||stop construction is needed here, because there in
@@ -333,7 +342,7 @@
%D one. There are seven arguments.
%D
%D \starttyping
-%D \doovalbox {w} {h} {d} {linewidth} {radius} {stroke} {fill}
+%D \doovalbox {w} {h} {d} {linewidth} {radius} {stroke} {fill} {variant}
%D \stoptyping
%D
%D This command has to return a \type{\vbox} which can be used
@@ -341,7 +350,7 @@
%D degrees, the stroke and fill are~\type{1} (true) of~\type{0}
%D (false).
-\installspecial [\doovalbox] [or] [7]
+\installspecial [\doovalbox] [or] [8]
%D \macros
%D {dostartclipping,dostopclipping}
@@ -986,4 +995,6 @@
%D \setupoutput [pdftex]
%D \stoptyping
+\loadmarkfile{spec-def}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-dpm.tex b/Master/texmf-dist/tex/context/base/spec-dpm.tex
index 65714d74ced..9cf023fe0a8 100644
--- a/Master/texmf-dist/tex/context/base/spec-dpm.tex
+++ b/Master/texmf-dist/tex/context/base/spec-dpm.tex
@@ -55,32 +55,29 @@
%D
%D Only \METAPOST, \JPG\ and \PDF\ inclusion are supported.
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\dodoinsertfile{dpm}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}
+\definespecial\doinsertfile
+ {\dofileinsertion{dpm}\@@DriverImageType}
-\definefileinsertion{dpm}{mps}#1#2#3#4#5#6#7#8#9%
- {\PointsToWholeBigPoints{#7}\width
- \PointsToWholeBigPoints{#8}\height
- % brrr, should use #1->#9
+\definefileinsertion{dpm}{mps}%
+ {\PointsToWholeBigPoints\@@DriverImageWidth \width
+ \PointsToWholeBigPoints\@@DriverImageHeight\height
\special
- {PSfile="#1"\space
+ {PSfile="\@@DriverImageFile"\space
llx=\EPSllx\space lly=\EPSlly\space
urx=\EPSurx\space ury=\EPSury\space
rwi=\width0\space rhi=\height0}}
-\definefileinsertion{dpm}{pdf}#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \scratchdimen#7\edef\width {\the\scratchdimen\space}%
- \scratchdimen#8\edef\height{\the\scratchdimen\space}%
- \special{pdf: epdf width \width height \height (#1)}%
- \egroup}
+\definefileinsertion{dpm}{pdf}%
+ {\special{pdf: epdf
+ width \@@DriverImageWidth \space
+ height \@@DriverImageHeight\space
+ (\@@DriverImageFile)}}
-\definefileinsertion{dpm}{jpg}#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \scratchdimen#7\edef\width {\the\scratchdimen\space}%
- \scratchdimen#8\edef\height{\the\scratchdimen\space}%
- \special{pdf: image width \width height \height (#1)}%
- \egroup}
+\definefileinsertion{dpm}{jpg}%
+ {\special{pdf: image
+ width \@@DriverImageWidth \space
+ height \@@DriverImageHeight\space
+ (\@@DriverImageFile)}}
\definefileinsertion{dpm}{mov}{\doPDFinsertmov}
\definefileinsertion{dpm}{avi}{\doPDFinsertmov}
@@ -160,12 +157,12 @@
\definespecial\doflushJSpreamble#1%
{\bgroup
\let\compositeJScode=\empty
- \def\docommando##1%
+ \def\docommand##1%
{\edef\sanitizedJScode{\getJSpreamble{##1}}%
\@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
\special{pdf: object @JS:#1 <</S /JavaScript /JS (\sanitizedJScode)>>}%
\edef\compositeJScode{\compositeJScode\space (##1) @JS:#1}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\special{pdf: object @JS:JS <</Names [\compositeJScode]>>}%
\special{pdf: put @names <</JavaScript @JS:JS>>}%
\egroup}
@@ -320,7 +317,7 @@
%D \macros
%D {doPDFdestination}
-\def\doPDFdestination name #1%
+\def\doPDFdestination#1%
{\special{pdf: dest (#1) [@thispage /View [/Fit]]}}
%D \macros
@@ -358,10 +355,10 @@
\egroup
\fi}
-\def\doPDFaction width #1 height #2 action #3%
+\def\doPDFaction#1#2#3%
{\dodoPDFaction\empty{#1}{#2}{#3}}
-\def\doPDFannotation width #1 height #2 data #3%
+\def\doPDFannotation#1#2#3%
{\bgroup
\scratchdimen#1\edef\width {\the\scratchdimen\space}%
\scratchdimen#2\edef\height{\the\scratchdimen\space}%
@@ -372,7 +369,7 @@
%D \macros
%D {doPDFannotationobject,doPDFactionobject}
-\def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5%
+\def\doPDFannotationobject#1#2#3#4#5%
{\bgroup
\scratchdimen#3\edef\width {\the\scratchdimen\space}%
\scratchdimen#4\edef\height{\the\scratchdimen\space}%
@@ -380,7 +377,7 @@
\dosetobjectreference{#1}{#2}{@#1::#2}%
\egroup}
-\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5%
+\def\doPDFactionobject#1#2#3#4#5%
{\dodoPDFaction{@#1::#2}{#3}{#4}{#5}%
\dosetobjectreference{#1}{#2}{#1::#2}}
@@ -403,13 +400,13 @@
\def\doPDFpageresource#1%
{\message{[skipping PDF resource]}}
-\let\doPDFresetpageresources =\relax
-\let\doPDFresetpageattributes=\relax
+\let\doPDFresetpageresources \relax
+\let\doPDFresetpageattributes\relax
%D \macros
%D {doPDFbookmark}
-\def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+\def\doPDFbookmark#1#2#3#4#5%
{\ifcase#2\else
\scratchcounter#4\advance\scratchcounter\minusone
\special{pdf: out \ifcase#5-\fi#2
@@ -420,10 +417,10 @@
%D \macros
%D {doPDFdictionaryobject,doPDFarrayobject}
-\def\doPDFdictionaryobject class #1 name #2 data #3%
+\def\doPDFdictionaryobject#1#2#3%
{\special{pdf: object @#1::#2 <<#3>>}}
-\def\doPDFarrayobject class #1 name #2 data #3%
+\def\doPDFarrayobject#1#2#3%
{\special{pdf: object @#1::#2 [#3]}}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/spec-dpx.tex b/Master/texmf-dist/tex/context/base/spec-dpx.tex
index f317a388701..0f038034272 100644
--- a/Master/texmf-dist/tex/context/base/spec-dpx.tex
+++ b/Master/texmf-dist/tex/context/base/spec-dpx.tex
@@ -96,8 +96,8 @@
%D
%D Only \METAPOST, \BMP\ \JPG\ \PNG\ and \PDF\ inclusion are supported.
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\dodoinsertfile{dpx}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}
+\definespecial\doinsertfile
+ {\dofileinsertion{dpx}\@@DriverImageType}
%D Even though DVIPDFM supports \METAPOST directly, the funtionality
%D is not good. It conflicts much with \CONTEXT.
@@ -105,35 +105,30 @@
%D So, \METAPOST will be treated as the same way as PDFTeX using
%D MPtoPDF in DVIPDFMx since the version \type{dvipdfmx-20021028}.
-%\definefileinsertion{dpx}{mps}#1#2#3#4#5#6#7#8#9%
-% {\hbox
-% {%\convertMPcolors{#1}% plugged in supp-mpe
-% \scratchdimen#3\points \PointsToReal{.01\scratchdimen}\xscale
-% \scratchdimen#4\points \PointsToReal{.01\scratchdimen}\yscale
-% \convertMPtoPDF{#1}\xscale\yscale
-% \global\let\PDFimagereference\empty}}
-
%D DVIPDFM (and DVIPDFMx too) supports the image files with
%D the extension, \PDF, \JPG, \PNG, \BMP, and \EPS.
-\def\handleepsimage#1#2#3#4#5#6#7#8#9%
- {\PointsToWholeBigPoints{#7}\width
- \PointsToWholeBigPoints{#8}\height
- \special
- {PSfile="#1"\space
- llx=\EPSllx\space lly=\EPSlly\space
- urx=\EPSurx\space ury=\EPSury\space
- rwi=\width0\space rhi=\height0}}
+% \def\handleepsimage
+% {\PointsToWholeBigPoints\@@DriverImageWidth \width
+% \PointsToWholeBigPoints\@@DriverImageHeight\height
+% \special
+% {PSfile="\@@DriverImageFile"\space
+% llx=\EPSllx\space lly=\EPSlly\space
+% urx=\EPSurx\space ury=\EPSury\space
+% rwi=\width0\space rhi=\height0}}
-\definefileinsertion{dpx}{mps}{\handleepsimage}
-\definefileinsertion{dpx}{eps}{\handleepsimage} % unstable
+% \definefileinsertion{dpx}{mps}{\handleepsimage}
-\def\handlebmpimage#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \scratchdimen#7\edef\width {\the\scratchdimen\space}%
- \scratchdimen#8\edef\height{\the\scratchdimen\space}%
- \special{pdf: image width \width height \height (#1)}%
- \egroup}
+\definefileinsertion{tpd}{mps}
+ {\hbox
+ {\convertMPtoPDF\@@DriverImageFile{1}{1}%
+ \global\let\PDFimagereference\empty}}
+
+\def\handlebmpimage
+ {\special{pdf: image
+ width \@@DriverImageWidth \space
+ height \@@DriverImageHeight\space
+ (\@@DriverImageFile)}}
\definefileinsertion{dpx}{pdf}{\handlebmpimage}
\definefileinsertion{dpx}{jpg}{\handlebmpimage}
@@ -150,54 +145,6 @@
\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack}
-%D \type{\doPDFovalbox} in \type{spec-fdf} was modifed because
-%D the definition of \type{\PDFcode} was changed in this module.
-%D
-%D \macros
-%D {doPDFovalbox}
-%D
-%D For drawing ovals we use quite raw \PDF\ code. The next
-%D implementation does not differ that much from the one
-%D implemented in the \POSTSCRIPT\ driver.
-
-\def\doPDFovalbox#1#2#3#4#5#6#7% todo: \scratchdimen/\scatchbox
- {\bgroup
- \dimen0=#4\divide\dimen0 2
- \doPDFovalcalc{0pt}{+\dimen0}\xmin
- \doPDFovalcalc{#1}{-\dimen0}\xmax
- \doPDFovalcalc{#2}{-\dimen0}\ymax
- \doPDFovalcalc{-#3}{+\dimen0}\ymin
- \advance\dimen0 by #5%
- \doPDFovalcalc{0pt}{+\dimen0}\xxmin
- \doPDFovalcalc{#1}{-\dimen0}\xxmax
- \doPDFovalcalc{#2}{-\dimen0}\yymax
- \doPDFovalcalc{-#3}{+\dimen0}\yymin
- \doPDFovalcalc{#4}{\zeropoint}\stroke
- \doPDFovalcalc{#5}{\zeropoint}\radius
- \edef\dostroke{#6}%
- \edef\dofill{#7}%
- \setbox0\hbox
- {\ifnum\dostroke\dofill>0
- \ifPDFstrokecolor\else\ifnum\dostroke=1
- \writestatus\m!colors{pdf stroke color will fail}\wait
- \fi\fi
- \special{pdf:content
- \stroke\space w
- \xxmin\space \ymin\space m
- \xxmax\space \ymin\space l
- \xmax \space \ymin\space \xmax\space \yymin\space y
- \xmax \space \yymax\space l
- \xmax \space \ymax\space \xxmax\space \ymax\space y
- \xxmin\space \ymax\space l
- \xmin \space \ymax\space \xmin\space \yymax\space y
- \xmin \space \yymin\space l
- \xmin \space \ymin\space \xxmin\space \ymin\space y
- \ifnum\dostroke=1 S \fi
- \ifnum\dofill=1 f \fi}%
- \fi}%
- \wd0=#1\ht0=#2\dp0=#3\box0
- \egroup}
-
%D \macros
%D {doovalbox}
@@ -322,12 +269,12 @@
\definespecial\doflushJSpreamble#1%
{\bgroup
\let\compositeJScode\empty
- \def\docommando##1%
+ \def\docommand##1%
{\edef\sanitizedJScode{\getJSpreamble{##1}}%
\@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
\special{pdf:object @JS:##1 <</S /JavaScript /JS (\sanitizedJScode)>>}%
\edef\compositeJScode{\compositeJScode\space (##1) @JS:##1}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\special{pdf:names /JavaScript [\compositeJScode]}%
\egroup}
@@ -511,7 +458,7 @@
%D \macros
%D {doPDFdestination}
-\def\doPDFdestination name #1%
+\def\doPDFdestination#1%
{\special{pdf:names /Dests (#1) [@thispage \PDFpageviewwrd]}}
%D \macros
@@ -549,7 +496,7 @@
\egroup
\fi}
-\def\doPDFaction width #1 height #2 action #3%
+\def\doPDFaction#1#2#3%
{\dodoPDFaction\empty{#1}{#2}{#3}}
%D \type{\doPDFannotation} in \type{spec-dpm} had a bug.
@@ -557,7 +504,7 @@
%D \type{\doPDFannotation} conflicts with \type{\doPDFinsertmov},
%D since width and height also defined in \type{\doPDFinsertmov}.
-\def\doPDFannotation width #1 height #2 data #3%
+\def\doPDFannotation#1#2#3%
{\bgroup
\edef\data{#3}%
\scratchdimen#1\edef\width {\the\scratchdimen\space}%
@@ -568,7 +515,7 @@
%D \macros
%D {doPDFannotationobject,doPDFactionobject}
-\def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5%
+\def\doPDFannotationobject#1#2#3#4#5%
{\bgroup
\scratchdimen#3\edef\width {\the\scratchdimen\space}%
\scratchdimen#4\edef\height{\the\scratchdimen\space}%
@@ -576,7 +523,7 @@
\dosetobjectreference{#1}{#2}{@#1::#2}%
\egroup}
-\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5%
+\def\doPDFactionobject#1#2#3#4#5%
{\dodoPDFaction{@#1::#2}{#3}{#4}{#5}%
\dosetobjectreference{#1}{#2}{@#1::#2}}
@@ -635,7 +582,7 @@
%D \macros
%D {doPDFbookmark}
-\def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+\def\doPDFbookmark#1#2#3#4#5%
{\ifcase#1\else
%\scratchcounter#4\advance\scratchcounter\minusone
\special{pdf:outline #1 %\ifcase#5 opened\fi
@@ -679,12 +626,12 @@
\doPDFreserveDPXobjectfirst{FDF::docuextgstates}{<< >>}
-\def\doPDFdictionaryobject class #1 name #2 data #3%
+\def\doPDFdictionaryobject#1#2#3%
{\flushatshipout
{\special{pdf:\doPDFcheckedDPXobject{#1::#2}<<#3>>}%
\dosetobjectreference{#1}{#2}{@#1::#2}}}
-\def\doPDFarrayobject class #1 name #2 data #3%
+\def\doPDFarrayobject#1#2#3%
{\flushatshipout
{\special{pdf:\doPDFcheckedDPXobject{#1::#2}[#3]}%
\dosetobjectreference{#1}{#2}{@#1::#2}}}
@@ -870,7 +817,7 @@
\definespecial\dosetpositionpapersize#1#2%
{\xdef\flushDVIpositionpapersize
- {\special{pos:papersize #1 #2}%
+ {\special{pos:papersize \number#1 \number#2}%
\noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }%
\global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
@@ -878,7 +825,7 @@
\definespecial\dosetpositionpapersize#1#2%
{\xdef\flushDVIpositionpapersize
- {\special{pos:papersize #1 #2}%
+ {\special{pos:papersize \number#1 \number#2}%
\noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }%
\global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
diff --git a/Master/texmf-dist/tex/context/base/spec-dvi.tex b/Master/texmf-dist/tex/context/base/spec-dvi.tex
index e13698cf394..42fd8b259bb 100644
--- a/Master/texmf-dist/tex/context/base/spec-dvi.tex
+++ b/Master/texmf-dist/tex/context/base/spec-dvi.tex
@@ -101,22 +101,9 @@
\let\flushDVIpositionpapersize\relax
-% \definespecial\dosetpositionpapersize#1#2%
-% {\xdef\flushDVIpositionpapersize%
-% {\special{pos:papersize #1 #2}%
-% \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
-%
-% \appendtoksonce
-% \ifspecialbasedsettings
-% \ifpositioning\installprogram{dvipos -o \jobname.tuo \jobname.dvi}\fi
-% \fi
-% \to \everystoptext
-%
-% less tokens:
-
\definespecial\dosetpositionpapersize#1#2%
{\xdef\flushDVIpositionpapersize%
- {\special{pos:papersize #1 #2}%
+ {\special{pos:papersize \number#1 \number#2}%
\noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }%
\global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
diff --git a/Master/texmf-dist/tex/context/base/spec-fdf.mkii b/Master/texmf-dist/tex/context/base/spec-fdf.mkii
new file mode 100644
index 00000000000..d04890381c2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/spec-fdf.mkii
@@ -0,0 +1,156 @@
+%D \module
+%D [ file=spec-fdf,
+%D version=1998.05.18,
+%D title=\CONTEXT\ \PDF\ Macros,
+%D subtitle=Support Macros,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\chardef\safePDFcode=`-
+
+\def\setPDFdestination#1%
+ {\bgroup
+ \retainlccodes
+ \lccode`\/\safePDFcode \lccode`\#\safePDFcode
+ \lccode`\<\safePDFcode \lccode`\>\safePDFcode
+ \lccode`\[\safePDFcode \lccode`\]\safePDFcode
+ \lccode`\(\safePDFcode \lccode`\)\safePDFcode
+ \ifovercomePDFspace
+ \lccode`\ \safePDFcode
+ \fi
+ \ifovercomePDFbugs
+ \xdef\PDFdestination{'#1'}%
+ \else
+ \xdef\PDFdestination{#1}%
+ \fi
+ % nicer \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}%
+ \lowercase\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}%
+ \egroup}
+
+%D This is much faster since we don't have to set the full
+%D range of lc-codes; about 5 sec on a 1000mhz PIII for
+%D 20K named destinations "x(x) x"). Of course when you use
+%D page destinations, the saving is nil.
+
+% \beginETEX \scantokens
+%
+% \doifnotmode{atpragma}{\let\next\setPDFdestination} % experimental
+%
+% \bgroup
+%
+% \catcode`\/=\@@active \catcode`\#=\@@active
+% \catcode`\<=\@@active \catcode`\>=\@@active
+% \catcode`\[=\@@active \catcode`\]=\@@active
+% \catcode`\(=\@@active \catcode`\)=\@@active
+%
+% \gdef\PDFrepchar{-}
+%
+% \gdef\setPDFdcharacters
+% {\catcode`\/=\@@active \let/\PDFrepchar
+% \catcode`\#=\@@active \let#\PDFrepchar
+% \catcode`\<=\@@active \let<\PDFrepchar
+% \catcode`\>=\@@active \let>\PDFrepchar
+% \catcode`\[=\@@active \let[\PDFrepchar
+% \catcode`\]=\@@active \let]\PDFrepchar
+% \catcode`\(=\@@active \let(\PDFrepchar
+% \catcode`\)=\@@active \let)\PDFrepchar}
+%
+% \egroup
+%
+% \def\setPDFdestination#1% expansion is needed, otherwise embedded
+% {\bgroup % macros will not expand under the new
+% \setPDFdcharacters % catcode regime
+% \ifovercomePDFspace
+% \catcode32=\@@ignore
+% \fi
+% \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}%
+% \scantokens\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}%
+% \egroup}
+%
+% \doifnotmode{atpragma}{\let\setPDFdestination\next} % experimental
+%
+% \endETEX
+
+%D This is a slow one, that uses \type{\lccode}'s to
+%D change the glyph as well as converts sensisitve ones into a
+%D \PDF\ command sequence, so \type{(} becomes \type{\(}. In
+%D fact we translate the string to lowercase inactive and non
+%D special characters, limit their number and finaly convert
+%D some of the characters to save ones.
+
+\chardef\maxPDFstringsize=60
+
+\def\sanitizePDFstring#1\to#2% bugged
+ {\bgroup
+ \retainlccodes
+ \lccode`( \zerocount \lccode`) \zerocount
+ \lccode`< \zerocount \lccode`> \zerocount
+ \lccode`[ \zerocount \lccode`] \zerocount
+ \lccode`\\\zerocount \lccode`/ \zerocount
+ \lowercase{\convertargument#1\to\ascii}%
+ % by integrating the split in the loop below
+ % \splitofftokens\maxPDFstringsize\from\ascii\to\ascii
+ % we diminish the processing time considerably
+ \scratchcounter\maxPDFstringsize
+ \def\docommand##1%
+ {\ifcase\scratchcounter\else
+ \advance\scratchcounter \minusone
+ \ifcase\lccode`##1\relax
+ \xdef#2{#2\expandafter\string\csname##1\endcsname}%
+ \else
+ \xdef#2{#2##1}%
+ \fi
+ \fi}%
+ %\global\let#2=\empty
+ % or to permit #2 to be \ascii too:
+ \global\@EA\let\@EA#2\@EA\empty
+ \@EA\handletokens\ascii\with\docommand
+ \egroup}
+
+% \beginETEX \scantokens
+%
+% \doifnotmode{atpragma}{\let\next\sanitizePDFstring} % experimental
+%
+% \bgroup
+%
+% \catcode`\.=\@@escape
+%
+% .catcode`./=.@@active
+% .catcode`.<=.@@active .catcode`.>=.@@active
+% .catcode`.[=.@@active .catcode`.]=.@@active
+% .catcode`.(=.@@active .catcode`.)=.@@active
+%
+% .gdef.setPDFscharacters%
+% {.catcode`.\=.@@other
+% .catcode`./=.@@active .def/{.noexpand./}%
+% .catcode`.<=.@@active .def<{.noexpand.<}%
+% .catcode`.>=.@@active .def>{.noexpand.>}%
+% .catcode`.[=.@@active .def[{.noexpand.[}%
+% .catcode`.]=.@@active .def]{.noexpand.]}%
+% .catcode`.(=.@@active .def({.noexpand.(}%
+% .catcode`.)=.@@active .def){.noexpand.)}}
+%
+% .gdef.sanitizePDFstring#1.to#2%
+% {.bgroup
+% .setPDFscharacters
+% .catcode`=.@@escape
+% .edef.next{.strippedcsname#2}%
+% .scantokens{setxvalue{next}{#1}}%
+% .egroup}
+%
+% .egroup
+%
+% \doifnotmode{atpragma}{\let\sanitizePDFstring\next} % experimental
+%
+% \endETEX
+%
+% There is an unicode variant in spec-tst!
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-fdf.tex b/Master/texmf-dist/tex/context/base/spec-fdf.tex
index 5f759941bc0..fbb88677281 100644
--- a/Master/texmf-dist/tex/context/base/spec-fdf.tex
+++ b/Master/texmf-dist/tex/context/base/spec-fdf.tex
@@ -2,7 +2,7 @@
%D [ file=spec-fdf,
%D version=1998.05.18,
%D title=\CONTEXT\ \PDF\ Macros,
-%D subtitle=Adobe \PDF/\FDF\ version 2.1,
+%D subtitle=Support Macros,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,11 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D For the moment we keep this downward compatible hack:
+%D The name of this module is a bit strange but it started with fields
+%D so we keep the name.
-% todo: \depth van symbol appearance controleren
-
-%% see end of file
+%D When dealing with resources, we share the resource dictionaries
+%D between all xforms. This is inefficent in the sense that when no
+%D resources are used, redundant entries take space, but on the other
+%D hand we save redundant dictionaries so it's a nice compromise. Maybe
+%D that in \LUATEX\ I will reimplement most of the code here anyway.
%D We need to check if we can use \type {\driverreferenced}
%D object in more places.
@@ -47,6 +50,14 @@
\let\PDFswapdir\empty \def\PDFswapdir{\ifcase\inlinedirection\or\or-\fi}
+% the pdf spec changed cq. viewers started behaving differently / 5+
+
+\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one
+\chardef\overcomePDFpage\plustwo % page:number
+%chardef\overcomePDFpage\plusthree % pdftex page ref feature
+
+\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi
+
%D \macros
%D {setPDFdestination}
%D
@@ -60,162 +71,16 @@
\newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3-
\newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3-
-% the pdf spec changed cq. viewers started behaving differently / 5+
-
-\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one
-\chardef\overcomePDFpage\plustwo % page:number
-%chardef\overcomePDFpage\plusthree % pdftex page ref feature
-
-\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi
-
-\chardef\safePDFcode=`-
-
-\def\setPDFdestination#1%
- {\bgroup
- \retainlccodes
- \lccode`\/\safePDFcode \lccode`\#\safePDFcode
- \lccode`\<\safePDFcode \lccode`\>\safePDFcode
- \lccode`\[\safePDFcode \lccode`\]\safePDFcode
- \lccode`\(\safePDFcode \lccode`\)\safePDFcode
- \ifovercomePDFspace
- \lccode`\ \safePDFcode
- \fi
- \ifovercomePDFbugs
- \xdef\PDFdestination{'#1'}%
- \else
- \xdef\PDFdestination{#1}%
- \fi
- % nicer \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}%
- \lowercase\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}%
- \egroup}
-
-%D This is much faster since we don't have to set the full
-%D range of lc-codes; about 5 sec on a 1000mhz PIII for
-%D 20K named destinations "x(x) x"). Of course when you use
-%D page destinations, the saving is nil.
-
-% \beginETEX \scantokens
-%
-% \doifnotmode{atpragma}{\let\next\setPDFdestination} % experimental
-%
-% \bgroup
-%
-% \catcode`\/=\@@active \catcode`\#=\@@active
-% \catcode`\<=\@@active \catcode`\>=\@@active
-% \catcode`\[=\@@active \catcode`\]=\@@active
-% \catcode`\(=\@@active \catcode`\)=\@@active
-%
-% \gdef\PDFrepchar{-}
-%
-% \gdef\setPDFdcharacters
-% {\catcode`\/=\@@active \let/\PDFrepchar
-% \catcode`\#=\@@active \let#\PDFrepchar
-% \catcode`\<=\@@active \let<\PDFrepchar
-% \catcode`\>=\@@active \let>\PDFrepchar
-% \catcode`\[=\@@active \let[\PDFrepchar
-% \catcode`\]=\@@active \let]\PDFrepchar
-% \catcode`\(=\@@active \let(\PDFrepchar
-% \catcode`\)=\@@active \let)\PDFrepchar}
-%
-% \egroup
-%
-% \def\setPDFdestination#1% expansion is needed, otherwise embedded
-% {\bgroup % macros will not expand under the new
-% \setPDFdcharacters % catcode regime
-% \ifovercomePDFspace
-% \catcode32=\@@ignore
-% \fi
-% \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}%
-% \scantokens\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}%
-% \egroup}
-%
-% \doifnotmode{atpragma}{\let\setPDFdestination\next} % experimental
-%
-% \endETEX
+\let\setPDFdestination\gobbleoneargument % a MK specific definition
%D \macros
%D {sanitizePDFstring}
%D
%D This macro at least tries to convert a arbitrary string
%D into a sequence of characters valid for \PDF\ bookmarks and
-%D alike. It's a slow one, that uses \type{\lccode}'s to
-%D change the glyph as well as converts sensisitve ones into a
-%D \PDF\ command sequence, so \type{(} becomes \type{\(}. In
-%D fact we translate the string to lowercase inactive and non
-%D special characters, limit their number and finaly convert
-%D some of the characters to save ones.
+%D alike.
-%\beginTEX
-
-\chardef\maxPDFstringsize=60
-
-\def\sanitizePDFstring#1\to#2%
- {\bgroup
- \retainlccodes
- \lccode`( \plusone \lccode`) \plusone
- \lccode`< \plusone \lccode`> \plusone
- \lccode`[ \plusone \lccode`] \plusone
- \lccode`\\\plusone \lccode`/ \plusone
- \lowercase{\convertargument#1\to\ascii}%
- % by integrating the split in the loop below
- % \splitofftokens\maxPDFstringsize\from\ascii\to\ascii
- % we diminish the processing time considerably
- \scratchcounter\maxPDFstringsize
- \def\docommando##1%
- {\ifcase\scratchcounter\else
- \advance\scratchcounter \minusone
- \ifcase\lccode`##1\relax
- \xdef#2{#2.}% let's show that something is missing
- \or
- \xdef#2{#2\expandafter\string\csname##1\endcsname}%
- \else
- \xdef#2{#2##1}%
- \fi
- \fi}%
- %\global\let#2=\empty
- % or to permit #2 to be \ascii too:
- \global\@EA\let\@EA#2\@EA\empty
- \@EA\handletokens\ascii\with\docommando
- \egroup}
-
-%\endTEX
-%
-% \beginETEX \scantokens
-%
-% \doifnotmode{atpragma}{\let\next\sanitizePDFstring} % experimental
-%
-% \bgroup
-%
-% \catcode`\.=\@@escape
-%
-% .catcode`./=.@@active
-% .catcode`.<=.@@active .catcode`.>=.@@active
-% .catcode`.[=.@@active .catcode`.]=.@@active
-% .catcode`.(=.@@active .catcode`.)=.@@active
-%
-% .gdef.setPDFscharacters%
-% {.catcode`.\=.@@other
-% .catcode`./=.@@active .def/{.noexpand./}%
-% .catcode`.<=.@@active .def<{.noexpand.<}%
-% .catcode`.>=.@@active .def>{.noexpand.>}%
-% .catcode`.[=.@@active .def[{.noexpand.[}%
-% .catcode`.]=.@@active .def]{.noexpand.]}%
-% .catcode`.(=.@@active .def({.noexpand.(}%
-% .catcode`.)=.@@active .def){.noexpand.)}}
-%
-% .gdef.sanitizePDFstring#1.to#2%
-% {.bgroup
-% .setPDFscharacters
-% .catcode`=.@@escape
-% .edef.next{.strippedcsname#2}%
-% .scantokens{setxvalue{next}{#1}}%
-% .egroup}
-%
-% .egroup
-%
-% \doifnotmode{atpragma}{\let\sanitizePDFstring\next} % experimental
-%
-% \endETEX
+\def\sanitizePDFstring#1\to#2{}
%D \macros
%D {doPDFdestination,
@@ -240,22 +105,22 @@
%D drivers \type{pdf} (\ACROBAT) and \type{tpd} (\PDFTEX).
%D
%D \starttyping
-%D \doPDFdestination name #1
-%D \doPDFaction width #1 height #2 action #3
-%D \doPDFannotation width #1 height #2 data #3
-%D \doPDFannotationobject class #1 name #2 width #3 height #4 data #5
-%D \doPDFdictionaryobject class #1 name #2 data #3
-%D \doPDFarrayobject class #1 name #2 data #3
-%D \doPDFaddtocatalog #1
-%D \doPDFaddtoinfo #1
-%D \doPDFpageattribute #1
-%D \doPDFpageresource #1
-%D \doPDFpagesattribute #1
-%D \doPDFbookmark level #1 n #2 text #3 page #4 open #5
-%D
-%D \defaultobjectreference #1#2 % class name
-%D \doPDFgetobjectreference #1#2#3 % class name \PDFobjectreference
-%D \doPDFgetobjectpagereference #1#2#3 % class name \PDFobjectreference
+%D \doPDFdestination #1 name
+%D \doPDFaction #1#2#3 width height action
+%D \doPDFannotation #1#2#3 width height data
+%D \doPDFannotationobject #1#2#3#4#5 class name width height data
+%D \doPDFdictionaryobject #1#2#3 class name data
+%D \doPDFarrayobject #1#2#3 class name data
+%D \doPDFaddtocatalog #1
+%D \doPDFaddtoinfo #1
+%D \doPDFpageattribute #1
+%D \doPDFpageresource #1
+%D \doPDFpagesattribute #1
+%D \doPDFbookmark #1#2#3#4#5 level n text page open
+%D
+%D \defaultobjectreference #1#2 class name
+%D \doPDFgetobjectreference #1#2#3 class name \PDFobjectreference
+%D \doPDFgetobjectpagereference #1#2#3 class name \PDFobjectreference
%D \stoptyping
%D
%D The keywords reflect their use. For the moment we stick to
@@ -312,8 +177,7 @@
\def\checkPDFextgstates
{\ifx\docuPDFextgstates\empty \else
\ifnum\realpageno=\lastpage\relax
- \doPDFdictionaryobject class FDF name docuextgstates data
- {\docuPDFextgstates}%
+ \doPDFdictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}%
\fi
\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference
\doPDFpageresource{/ExtGState \PDFobjectreference}%
@@ -333,8 +197,7 @@
\def\checkPDFcolorspaces
{\ifx\docuPDFcolorspaces\empty \else
\ifnum\realpageno=\lastpage\relax
- \doPDFdictionaryobject class FDF name colorspaces data
- {\docuPDFcolorspaces}%
+ \doPDFdictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}%
\fi
\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference
\doPDFpageresource{/ColorSpace \PDFobjectreference}%
@@ -347,6 +210,26 @@
\def\appendtoPDFdocumentcolorspaces#1%
{\xdef\docuPDFcolorspaces{\docuPDFcolorspaces\space#1}}
+%D And another one (used to be in spec-pdf)
+
+\let\docuPDFshades\empty
+
+\def\checkPDFshades
+ {\ifx\docuPDFshades\empty \else
+ \ifnum\realpageno=\lastpage\relax
+ \doPDFdictionaryobject{FDF}{docushades}{\docuPDFshades}%
+ \fi
+ \doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference
+ \doPDFpageresource{/Shading \PDFobjectreference}%
+ \fi}
+
+\appendtoksonce
+ \checkPDFshades
+\to \everyshipout
+
+\def\appendtoPDFdocumentshades#1%
+ {\xdef\docuPDFshades{\docuPDFshades\space#1}}
+
%D \macros
%D {doPDFsetupscreen,doPDFsetupidentity}
%D
@@ -402,25 +285,26 @@
% not that good if we switch drivers
+\def\addPDFdocumentinfo
+ {\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}%
+ \doPDFaddtocatalog{/Version \ifdim\PDFversion00\points>100\points 1.\fi\PDFversion}%
+ \doPDFaddtoinfo{/Trapped /False}%
+ \doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}%
+ \doPDFaddtoinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}%
+ \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}%
+ \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}}
+
\appendtoksonce % hack to prevent duplicates
- \doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}%
- \doPDFaddtoinfo{/Trapped /False}%
- \doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}%
- \doPDFaddtoinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}%
- \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}%
- \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}%
+ \addPDFdocumentinfo
\to \everyfirstshipout
\def\PDFversion{1.5}
\appendtoksonce
\def\PDFversion{1.5}%
+ \let\addPDFdocumentinfo\relax
\to \everyresetspecials
-\appendtoksonce % we catch both n and 1.n
- \doPDFaddtocatalog{/Version \ifdim\PDFversion00\points>100\points 1.\fi\PDFversion}%
-\to \everylastshipout
-
\def\doPDFsetupwhateverbox#1#2#3#4#5#6% watch the extra arguments
{\bgroup
\!!widtha#5%
@@ -541,12 +425,12 @@
% \to \everylastshipout
%\def\doPDFsetupopenaction%
-% {\doPDFdictionaryobject class FDF name local:openaction data \lastPDFaction
+% {\doPDFdictionaryobject{FDF}{local:openaction}\lastPDFaction
% \doPDFgetobjectreference{FDF}{local:openaction}\PDFobjectreference
% \doPDFaddtocatalog{/OpenAction \PDFobjectreference}}
%
%\def\doPDFsetupcloseaction%
-% {\doPDFdictionaryobject class FDF name local:closeaction data \lastPDFaction
+% {\doPDFdictionaryobject{FDF}{local:closeaction}\lastPDFaction
% \doPDFgetobjectreference{FDF}{local:closeaction}\PDFobjectreference
% \doPDFaddtocatalog{/CloseAction \PDFobjectreference}}
@@ -587,9 +471,9 @@
{\bgroup
\setPDFdestination{#1}%
%\doifsomething{\PDFdestination}
- % {\doPDFdestination name {\PDFdestination}}%
+ % {\doPDFdestination{\PDFdestination}}%
\ifx\PDFdestination\empty \else
- \doPDFdestination name {\PDFdestination}%
+ \doPDFdestination{\PDFdestination}%
\fi
\egroup}
@@ -642,9 +526,7 @@
\savesecondaryPDFreference\action
\else
\getsecondaryPDFreferences
- \doPDFaction
- width \PDFswapdir#1 height #2
- action {\action \secondaryPDFreferences}%
+ \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
\fi
\fi
\egroup}
@@ -703,9 +585,7 @@
\savesecondaryPDFreference\action
\else
\getsecondaryPDFreferences
- \doPDFaction
- width \PDFswapdir#1 height #2
- action {\action \secondaryPDFreferences}%
+ \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
\fi
\fi
\egroup}
@@ -718,7 +598,7 @@
\bgroup
\xdef\lastfakedPDFpage{\realfolio}%
\advance\realpageno \minusone % is \expanded needed ?
- \expanded{\doPDFdestination name {page:\realfolio}}%
+ \expanded{\doPDFdestination{page:\realfolio}}%
\egroup
\fi
\fi \fi \fi}
@@ -736,9 +616,7 @@
\savesecondaryPDFreference\action
\else
\getsecondaryPDFreferences
- \doPDFaction
- width \PDFswapdir#1 height #2
- action {\action \secondaryPDFreferences}%
+ \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
\fi
\egroup}
@@ -835,15 +713,12 @@
% \ifx\PDFobjectclass\empty
% \let\next\doPDFaction
% \else
-% \edef\next{\doPDFactionobject
-% class {\PDFobjectclass} name {\PDFobjectname} }%
+% \edef\next{\doPDFactionobject{\PDFobjectclass}{\PDFobjectname}}%
% \globalletempty\PDFobjectclass
% \globalletempty\PDFobjectname
% \fi
% \next
- \doPDFaction
- width \PDFswapdir#1 height #2
- action {\action \secondaryPDFreferences}%
+ \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
\fi
\egroup}}
@@ -866,9 +741,7 @@
\savesecondaryPDFreference\action
\else
\getsecondaryPDFreferences
- \doPDFaction
- width \PDFswapdir#1 height #2
- action {\action \secondaryPDFreferences}%
+ \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
\fi
\egroup}
@@ -889,9 +762,7 @@
\savesecondaryPDFreference\action
\else
\getsecondaryPDFreferences
- \doPDFaction
- width \PDFswapdir#1 height #2
- action {\action \secondaryPDFreferences}%
+ \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
\fi}%
\egroup}
@@ -981,25 +852,24 @@
\let\currentmovie\s!unknown
-\def\doPDFinsertmov#1#2#3#4#5#6#7#8#9%
+\def\doPDFinsertmov
{\bgroup
- \xdef\currentmovie{#2}% label
- \PointsToBigPoints{#7}\width
- \PointsToBigPoints{#8}\height
+ \xdef\currentmovie{\@@DriverImageLabel}%
+ \PointsToBigPoints\@@DriverImageWidth \width
+ \PointsToBigPoints\@@DriverImageHeight\height
\let\pdf@@options\empty
\let\pdf@@actions\empty
\donefalse
- \@EA\processallactionsinset\@EA
- [#9]
+ \expanded{\processallactionsinset[\@@DriverImageOptions]}
[\v!controls=>\donetrue,
\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat },
\v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]%
\edef\pdf@@actions{\pdf@@actions /ShowControls \ifdone true\else false\fi}%
- \doPDFannotation width #7 height #8 data
+ \doPDFannotation\@@DriverImageWidth\@@DriverImageHeight
{/Subtype /Movie
/Border [0 0 0]
/T (movie \currentmovie)
- /Movie << /F (#1) /Aspect [\width\space\height] \pdf@@options >>
+ /Movie << /F (\@@DriverImageFile) /Aspect [\width\space\height] \pdf@@options >>
/A << \pdf@@actions >>}%
\egroup}
@@ -1021,7 +891,7 @@
[\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]%
\collectdriverresource
% \flushatshipout % since it can be buried in a chained box
- {\doPDFannotation width 0pt height 0pt data
+ {\doPDFannotation{0pt}{0pt}
{/Subtype /Movie
/Border [0 0 0]
/T (sound \currentsound)
@@ -1032,7 +902,7 @@
%D \macros
%D {doPDFattachfile}
-\def\doPDFfilestreamobject class #1 name #2 file #3 source #4%
+\def\doPDFfilestreamobject#1#2#3#4%
{}
\def\doPDFfilestreamidentifier#1%
@@ -1051,7 +921,7 @@
\doPDFembedfile\PDFfile{#7}{#8}%
\doPDFgetembeddedfilereference\PDFfile\PDFobjectreference
\setFDFlayer\@@DriverAttachmentLayer
- \doPDFannotation width {\width} height {\totalheight} data
+ \doPDFannotation{\width}{\totalheight}
{/Subtype /FileAttachment
/FS \PDFobjectreference\space
/Contents (#1)
@@ -1066,8 +936,7 @@
\def\doPDFembedfile#1#2#3% symbolic name | filename | user name
{\edef\PDFfile{#1}\convertcommand\PDFfile\to\PDFfile
\doifnotflagged{a:\PDFfile}%
- {\doPDFfilestreamobject
- class PDFEF name {\PDFfile} file {#2} source {#3}%
+ {\doPDFfilestreamobject{PDFEF}{\PDFfile}{#2}{#3}%
\doglobal\setflag{a:\PDFfile}}}
\def\doPDFgetembeddedfilereference#1#2%
@@ -1165,7 +1034,7 @@
\definespecial\doinsertrendering#1#2#3#4% tag mime file options
{\ifundefined{PDFMR:#1}%
\doifinstringelse{://}{#3}\donetrue\donefalse % evt url as keyword
- \doPDFdictionaryobject class {PDFMF} name {#1} data
+ \doPDFdictionaryobject{PDFMF}{#1}
{/Type /Rendition
/S /MR
% does not work: /SP << /Type /MediaScreenParam /BE << /B [1 0 0] /O 0.5 >> >>
@@ -1192,7 +1061,7 @@
\definespecial\doinsertrenderingobject#1#2#3#4% tag class objectname options
{\ifundefined{PDFMR:#1}%
\doPDFgetobjectreference{#2}{#3}\PDFobjectreference
- \doPDFdictionaryobject class {PDFMF} name {#1} data
+ \doPDFdictionaryobject{PDFMF}{#1}
{/Type /Rendition
/S /MR
/C << /Type /MediaClip
@@ -1221,7 +1090,7 @@
\doPDFgetobjectreference {PDFMF}{#2}\PDFobjectreferenceB
\vss
\hbox to #3 \bgroup
- \doPDFannotationobject class {#1} name {#2} width #3 height #4 data
+ \doPDFannotationobject{#1}{#2}{#3}{#4}
{/Subtype /Screen
/P \PDFobjectreferenceA
/A \PDFobjectreferenceB
@@ -1278,7 +1147,7 @@
\sanitizePDFdocencoding#3\to\bookmarktext % uses scratchcounter
\stripstring\bookmarktext
%\sanitizePDFstring#3\to\bookmarktext
- \doPDFbookmark level #1 n #2 text {\bookmarktext} page {#4} open #5
+ \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}%
\egroup}
%D The next section of this module is dedicated to form
@@ -1367,13 +1236,13 @@
{\bgroup
\!!counta\zerocount
\!!countb\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\doifsomething{##1}
{\advance\!!counta 0\getvalue{\@@FDFflag##1}%
\setvalue{\@@FDFflag##1}{0}%
\advance\!!countb 0\getvalue{\@@FDFplus##1}%
\setvalue{\@@FDFplus##1}{0}}}%
- \processcommacommand[#1]\docommando
+ \processcommacommand[#1]\docommand
\xdef\FDFflag{\the\!!counta}%
\xdef\FDFplus{\the\!!countb}%
\egroup}
@@ -1407,7 +1276,7 @@
%\let\FDFdefaultindex\!!zerocount
%\let\FDFdefaultvalue\empty
%\scratchcounter\zerocount
- \def\dodocommando##1=>##2=>##3\end
+ \def\dodocommand##1=>##2=>##3\end
{\addtocommalist{##1}\FDFkidlist
%\edef\FDFfirstvalues{\FDFfirstvalues(##1)}%
%\doif{##1}{#2}{\edef\FDFdefaultindex{\the\scratchcounter}}%
@@ -1419,9 +1288,9 @@
{\doif{##1}{#2}{\edef\FDFdefaultvalue{##2}}%
%\edef\FDFsecondvalues{\FDFsecondvalues(##2)}%
\edef\FDFvalues{\FDFvalues [(##2)(##1)] }}}% ! ##1 is shown
- \def\docommando##1%
- {\dodocommando##1=>=>\end}%
- \expanded{\processcommalist[#1]}\docommando}
+ \def\docommand##1%
+ {\dodocommand##1=>=>\end}%
+ \expanded{\processcommalist[#1]}\docommand}
%D This macro accepts comma separated \type{visual=>result}
%D pairs.
@@ -1593,8 +1462,8 @@
\def\setFDFaction#1#2%
{\bgroup
- \def\docommando{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}%
- \@EA\handlereferenceactions\@EA{#2}\docommando % one level expansion
+ \def\docommand{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}%
+ \@EA\handlereferenceactions\@EA{#2}\docommand % one level expansion
\egroup}
%D \macros
@@ -1638,15 +1507,14 @@
{\ifbuildFDFdictionary
\ifx\FDFcollection\empty\else
\ifbuildFDFencodingvector
- \doPDFdictionaryobject class FDF name local:encodingvector data
- \FDFencodingvector
+ \doPDFdictionaryobject{FDF}{local:encodingvector}{\FDFencodingvector}%
\fi
\defineFDFfonts
- \doPDFarrayobject class FDF name local:fields data \FDFcollection
+ \doPDFarrayobject{FDF}{local:fields}{\FDFcollection}%
\doPDFgetobjectreference{FDF}{local:fields}\PDFobjectreference
% The /NeedAppearances is pretty important because
% otherwise Acrobat 5 blows up on cloned radio widgets
- \doPDFdictionaryobject class FDF name local:acroform data
+ \doPDFdictionaryobject{FDF}{local:acroform}
{/Fields \PDFobjectreference\space
/NeedAppearances true
\doFDFiffieldset\PDFcalculationset{/CO [\doFDFgetfieldset\PDFcalculationset]}
@@ -1692,7 +1560,7 @@
{\ifbuildFDFencodingvector
\doPDFgetobjectreference{FDF}{local:encodingvector}\PDFobjectreference
\fi
- \doPDFdictionaryobject class FDF name local:#1 data
+ \doPDFdictionaryobject{FDF}{local:#1}
{/Type /Font
/Subtype /Type1
/Name /#1
@@ -1808,10 +1676,10 @@
\def\setFDFkids[#1][#2]% tag commalist
{\let\FDFkids\empty
- \def\docommando##1%
+ \def\docommand##1%
{\doPDFgetobjectreference{FDF}{#1##1}\PDFobjectreference
\edef\FDFkids{\FDFkids\PDFobjectreference\space}}%
- \@EA\processcommalist\@EA[#2]\docommando
+ \@EA\processcommalist\@EA[#2]\docommand
\ifx\FDFkids\empty\else\edef\FDFkids{/Kids [\FDFkids]}\fi
% \edef\FDFkids{/Kids [\FDFkids]}%
}
@@ -1835,7 +1703,7 @@
\setFDFactions[#9]%
\expanded{\escapePSstring#4}\to\FDFtext
\ifcase\currentFDFmode
- \doPDFannotationobject class FDF name #1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{#1}{#2}{#3}
{/Subtype /Widget /T (#1) /FT /Tx
/MaxLen \ifcase0#5 1000 \else#5 \fi
%/DV (#4) /V (#4) % value added
@@ -1850,7 +1718,7 @@
\registerFDFobject{#1}%
\or
\setFDFkids[kids:][\currentFDFkids]%
- \doPDFdictionaryobject class FDF name #1 data
+ \doPDFdictionaryobject{FDF}{#1}
{/T (#1) /FT /Tx
/MaxLen \ifcase0#5 1000 \else#5 \fi
\FDFkids\space
@@ -1867,7 +1735,7 @@
\or
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference
/Ff \FDFflag\space
@@ -1880,7 +1748,7 @@
\or
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference
/F \FDFplus
@@ -1899,7 +1767,7 @@
\setFDFvalues[#7][#4]%
\setFDFactions[#8]%
\ifcase\currentFDFmode
- \doPDFannotationobject class FDF name #1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{#1}{#2}{#3}
{/Subtype /Widget
/T (#1) /FT /Ch
/DV (#4) /V (#4)
@@ -1913,7 +1781,7 @@
\registerFDFobject{#1}%
\or
\setFDFkids[kids:][\currentFDFkids]%
- \doPDFdictionaryobject class FDF name #1 data
+ \doPDFdictionaryobject{FDF}{#1}
{/T (#1) /FT /Ch
\FDFkids\space
/DV (#4) /V (#4)
@@ -1928,7 +1796,7 @@
\or
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference
/Ff \FDFflag\space
@@ -1940,7 +1808,7 @@
\or
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference
/F \FDFplus
@@ -1967,7 +1835,7 @@
{\def\FDFdefault{Off}}%
\ifcase\currentFDFmode
\doFDFappearance{On}{#6}{#8}%
- \doPDFannotationobject class FDF name #1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{#1}{#2}{#3}
{/Subtype /Widget /T (#1) /FT /Btn
\ifFDFvalues
/DV /\FDFdefault\space
@@ -1984,7 +1852,7 @@
\registerFDFobject{#1}%
\or % no appearance and layer ?
\setFDFkids[kids:][\currentFDFkids]%
- \doPDFdictionaryobject class FDF name #1 data
+ \doPDFdictionaryobject{FDF}{#1}
{/T (#1) /FT /Btn
\FDFkids\space
\ifFDFvalues
@@ -2000,7 +1868,7 @@
\doFDFappearance{On}{#6}{#8}%
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference\space
\ifFDFvalues
@@ -2017,7 +1885,7 @@
\doFDFappearance{On}{#6}{#8}%
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference\space
/F \FDFplus\space
@@ -2052,7 +1920,7 @@
\ifcase\currentFDFmode
\doFDFappearance{#1}{#7}{1}%
\doPDFgetobjectreference{FDF}{#6}\PDFobjectreference
- \doPDFannotationobject class FDF name #1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference\space
/F \FDFplus\space
@@ -2064,7 +1932,7 @@
\or
\setFDFkids[kids:][\currentFDFkids]%
\doPDFgetobjectreference{FDF}{#6}\PDFobjectreference
- \doPDFdictionaryobject class FDF name #1 data
+ \doPDFdictionaryobject{FDF}{#1}
{/Parent \PDFobjectreference\space
\FDFkids\space
/F \FDFplus\space
@@ -2075,7 +1943,7 @@
\doFDFappearance{\currentFDFparent}{#7}{1}%
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue % nb
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference\space
/AS /\FDFdefault\space
@@ -2088,7 +1956,7 @@
\doFDFappearance{\currentFDFparent}{#7}{1}%
\doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
%\global\objectreferencingtrue
- \doPDFannotationobject class FDF name kids:#1 width #2 height #3 data
+ \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
{/Subtype /Widget
/Parent \PDFobjectreference\space
/AS /\FDFdefault\space
@@ -2106,8 +1974,8 @@
%\def\setFDFstrings[#1]%
% {\let\FDFstrings\empty
-% \def\docommando##1{\edef\FDFstrings{\FDFstrings(##1)}}%
-% \processcommacommand[#1]\docommando}
+% \def\docommand##1{\edef\FDFstrings{\FDFstrings(##1)}}%
+% \processcommacommand[#1]\docommand}
% Beware, RadiosInUnison is really needed in the pre 1.5/6 time this
% was the default but out of a sudden it's no longer the case. Also
@@ -2136,7 +2004,7 @@
\expanded{\setFDFkids[][\FDFkidlist]}%
%
\setFDFactions[#5]%
- \doPDFdictionaryobject class FDF name #1 data
+ \doPDFdictionaryobject{FDF}{#1}
{%/Subtype /Widget
/FT /Btn /T (#1) /Rect [0 0 0 0]
% used to be this
@@ -2208,7 +2076,7 @@
\let\N\empty\let\R\empty\let\D\empty
\dodoFDFappearance{#1}\yes
\dodoFDFappearance{Off}\no
- \doPDFdictionaryobject class FDF name {ap:#1:\yes:\no} data
+ \doPDFdictionaryobject{FDF}{ap:#1:\yes:\no}
{\ifx\N\empty\else/N \ifFDFvalues<<\N>>\else\N\fi\fi
\ifx\R\empty\else/R \ifFDFvalues<<\R>>\else\R\fi\fi
\ifx\D\empty\else/D \ifFDFvalues<<\D>>\else\D\fi\fi}}%
@@ -2257,10 +2125,10 @@
\def\doFDFdefinefieldset#1#2% tag commalist
{\let\FDFfieldset\empty
- \def\docommando##1%
+ \def\docommand##1%
{\doPDFgetobjectreference{FDF}{##1}\PDFobjectreference
\edef\FDFfieldset{\FDFfieldset\PDFobjectreference\space}}%
- \processcommacommand[#2]\docommando % nb: command
+ \processcommacommand[#2]\docommand % nb: command
\setevalue{FDF:set:#1}{\FDFfieldset}}
\def\doFDFgetfieldset#1%
@@ -2433,8 +2301,8 @@
{\def##1{##2}
\advance\scratchcounter by 1
\ifodd\scratchcounter \else
- \convertcommand\Title\to\asciiA
- \global\setFDFfield{\asciiA}{\Value}
+ \convertcommand\Title\to\asciia
+ \global\setFDFfield{\asciia}{\Value}
\doglobal\addtocommalist\Title\allFDFfields
\fi}
\ReadFile{#1.fdf}}%
@@ -2460,8 +2328,8 @@
\def\showFDFfields#1%
{\bgroup
\loadFDFfields{#1}
- \def\docommando##1{\par##1 = \getFDFfield{##1}\par}%
- \processcommacommand[\allFDFfields]\docommando
+ \def\docommand##1{\par##1 = \getFDFfield{##1}\par}%
+ \processcommacommand[\allFDFfields]\docommand
\egroup}
%D \macros
@@ -2530,7 +2398,7 @@
% \sanitizePDFencoding#8\to\PDFdata
% \setbox\scratchbox\vbox to #3
% {\vfill
-% \doPDFannotation width #2 height #3 data
+% \doPDFannotation{#2}{#3}
% {/Subtype /Text
% \ifcase#5 \else/Open true\fi
% /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
@@ -2567,8 +2435,7 @@
\donefalse
\ifdone
\setbox\scratchbox\hbox
- {\doPDFannotationobject class FDF name {c::\nofFDFcomments}
- width #2 height #3 data % text window, size does not work
+ {\doPDFannotationobject{FDF}{c::\nofFDFcomments}{#2}{#3}% text window, size does not work
{/Subtype /Popup
/Parent \PDFobjectreference}}%
\ifcase#7\relax
@@ -2594,8 +2461,7 @@
{\doPDFgetobjectreference{FDF}{c::\nofFDFcomments}\PDFobjectreference
\donetrue}
\donefalse
- \doPDFannotationobject class FDF name {c:\nofFDFcomments}
- width {\width} height {\height} data
+ \doPDFannotationobject{FDF}{c:\nofFDFcomments}{\width}{\height}
{/Subtype /Text
\ifcase#5 \else/Open true\fi
% pdftex (efficient)
@@ -2608,7 +2474,7 @@
\PDFsymbol
\PDFattributes}%
\else
- \doPDFannotation width #2 height #3 data
+ \doPDFannotation{#2}{#3}
{/Subtype /Text
\ifcase#5 \else/Open true\fi
/Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
@@ -2722,7 +2588,7 @@
\advance\dimen2 #2\relax
\PointsToBigPoints{\dimen2}#3}
-\def\doPDFovalbox#1#2#3#4#5#6#7% todo: \scratchdimen/\scatchbox
+\def\doPDFovalbox#1#2#3#4#5#6#7#8% todo: \scratchdimen/\scatchbox
{\bgroup
\dimen0=#4\divide\dimen0 \plustwo
\doPDFovalcalc{0pt}{+\dimen0}\xmin
@@ -2738,6 +2604,7 @@
\doPDFovalcalc{#5}{\zeropoint}\radius
\edef\dostroke{#6}%
\edef\dofill{#7}%
+ \edef\mode{\number#8 \space}%
% no \ifcase, else \relax in pdfcode
\setbox\scratchbox\hbox
{\ifnum\dostroke\dofill>\zerocount
@@ -2746,18 +2613,193 @@
\fi\fi
\PDFcode
{q
- \stroke\space w
- \xxmin\space \ymin\space m
- \xxmax\space \ymin\space l
- \xmax \space \ymin\space \xmax\space \yymin\space y
- \xmax \space \yymax\space l
- \xmax \space \ymax\space \xxmax\space \ymax\space y
- \xxmin\space \ymax\space l
- \xmin \space \ymax\space \xmin\space \yymax\space y
- \xmin \space \yymin\space l
- \xmin \space \ymin\space \xxmin\space \ymin\space y
- \ifnum\dostroke=\plusone S \fi
- \ifnum\dofill =\plusone f \fi
+ \stroke\space w
+ \ifcase\mode
+ \xxmin\space \ymin \space m
+ \xxmax\space \ymin \space l
+ \xmax \space \ymin \space \xmax \space \yymin\space y
+ \xmax \space \yymax\space l
+ \xmax \space \ymax \space \xxmax\space \ymax \space y
+ \xxmin\space \ymax \space l
+ \xmin \space \ymax \space \xmin \space \yymax\space y
+ \xmin \space \yymin\space l
+ \xmin \space \ymin \space \xxmin\space \ymin \space y
+ h
+ \or % 1
+ \xxmin\space \ymin \space m
+ \xxmax\space \ymin \space l
+ \xmax \space \ymin \space \xmax \space \yymin\space y
+ \xmax \space \ymax \space l
+ \xmin \space \ymax \space l
+ \xmin \space \yymin\space l
+ \xmin \space \ymin \space \xxmin\space \ymin \space y
+ h
+ \or % 2
+ \xxmin\space \ymin \space m
+ \xmax \space \ymin \space l
+ \xmax \space \ymax \space l
+ \xxmin\space \ymax \space l
+ \xmin \space \ymax \space \xmin \space \yymax\space y
+ \xmin \space \yymin\space l
+ \xmin \space \ymin \space \xxmin\space \ymin \space y
+ h
+ \or % 3
+ \xmin \space \ymin \space m
+ \xmax \space \ymin \space l
+ \xmax \space \yymax\space l
+ \xmax \space \ymax \space \xxmax\space \ymax \space y
+ \xxmin\space \ymax \space l
+ \xmin \space \ymax \space \xmin \space \yymax\space y
+ \xmin \space \ymin \space l
+ h
+ \or % 4
+ \xmin \space \ymin \space m
+ \xxmax\space \ymin \space l
+ \xmax \space \ymin \space \xmax \space \yymin\space y
+ \xmax \space \yymax\space l
+ \xmax \space \ymax \space \xxmax\space \ymax \space y
+ \xmin \space \ymax \space l
+ \xmin \space \ymin\space l
+ h
+ \or % 5
+ \xmin \space \ymin \space m
+ \xmax \space \ymin \space l
+ \xmax \space \yymax\space l
+ \xmax \space \ymax \space \xxmax\space \ymax \space y
+ \xmin \space \ymax \space l
+ \xmin \space \ymin \space l
+ h
+ \or % 6
+ \xmin \space \ymin \space m
+ \xxmax\space \ymin \space l
+ \xmax \space \ymin \space \xmax \space \yymin\space y
+ \xmax \space \ymax \space l
+ \xmin \space \ymax \space l
+ \xmin \space \ymin \space l
+ h
+ \or
+ \xxmin\space \ymin \space m
+ \xmax \space \ymin \space l
+ \xmax \space \ymax \space l
+ \xmin \space \ymax \space l
+ \xmin \space \yymin\space l
+ \xmin \space \ymin \space \xxmin\space \ymin \space y
+ h
+ \or
+ \xmin \space \ymin \space m
+ \xmax \space \ymin \space l
+ \xmax \space \ymax \space l
+ \xxmin\space \ymax \space l
+ \xmin \space \ymax \space \xmin \space \yymax\space y
+ \xmin \space \ymin \space l
+ h
+ \or % 9 top open
+ \xmin \space \ymax \space m
+ \xmin \space \yymin\space l
+ \xmin \space \ymin \space \xxmin\space \ymin \space y
+ \xxmax\space \ymin \space l
+ \xmax \space \ymin \space \xmax \space \yymin\space y
+ \xmax \space \ymax \space l
+ \or % 10 right open
+ \xmax \space \ymax \space m
+ \xxmin\space \ymax \space l
+ \xmin \space \ymax \space \xmin \space \yymax\space y
+ \xmin \space \yymin\space l
+ \xmin \space \ymin \space \xxmin\space \ymin \space y
+ \xmax\space \ymin \space l
+ \or % 11 bottom open
+ \xmax \space \ymin \space m
+ \xmax \space \yymax\space l
+ \xmax \space \ymax \space \xxmax \space \ymax\space y
+ \xxmin\space \ymax \space l
+ \xmin \space \ymax \space \xmin \space \yymax\space y
+ \xmin \space \ymin \space l
+ \or % 12 left open
+ \xmin \space \ymax \space m
+ \xxmax\space \ymax \space l
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \xmax \space \yymin\space l
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \xmin \space \ymin \space l
+ \or % 13
+ \xmin \space \ymax \space m
+ \xxmax\space \ymax \space l
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \xmax\space \ymin \space l
+ \or % 14
+ \xmax \space \ymax \space m
+ \xmax \space \yymin\space l
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \xmin \space \ymin \space l
+ \or % 15
+ \xmax \space \ymin \space m
+ \xxmin\space \ymin \space l
+ \xmin \space \ymin \space \xmin \space \yymin\space y
+ \xmin \space \ymax \space l
+ \or % 16
+ \xmin \space \ymin \space m
+ \xmin \space \yymax\space l
+ \xmin \space \ymax \space \xxmin\space \ymax \space y
+ \xmax \space \ymax \space l
+ \or % 17
+ \xxmax\space \ymax \space m
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \or % 18
+ \xmax \space \yymin\space m
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \or % 19
+ \xxmin\space \ymin \space m
+ \xmin \space \ymin \space \xmin \space \yymin\space y
+ \or % 20
+ \xmin \space \yymax\space m
+ \xmin \space \ymax \space \xxmin\space \ymax \space y
+ \or % 21
+ \xxmax\space \ymax \space m
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \xmin \space \yymax\space m
+ \xmin \space \ymax \space \xxmin\space \ymax \space y
+ \or % 22
+ \xxmax\space \ymax \space m
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \xmax \space \yymin\space m
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \or % 23
+ \xmax \space \yymin\space m
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \xxmin\space \ymin \space m
+ \xmin \space \ymin \space \xmin \space \yymin\space y
+ \or % 24
+ \xxmin\space \ymin \space m
+ \xmin \space \ymin \space \xmin \space \yymin\space y
+ \xmin \space \yymax\space m
+ \xmin \space \ymax \space \xxmin\space \ymax \space y
+ \or % 25
+ \xxmax\space \ymax \space m
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \xmax \space \yymin\space m
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \xxmin\space \ymin \space m
+ \xmin \space \ymin \space \xmin \space \yymin\space y
+ \xmin \space \yymax\space m
+ \xmin \space \ymax \space \xxmin\space \ymax \space y
+ \or % 26
+ \xmax \space \yymin\space m
+ \xmax \space \ymin \space \xxmax\space \ymin \space y
+ \xmin \space \yymax\space m
+ \xmin \space \ymax \space \xxmin\space \ymax \space y
+ \or % 27
+ \xxmax\space \ymax \space m
+ \xmax \space \ymax \space \xmax \space \yymax\space y
+ \xxmin\space \ymin \space m
+ \xmin \space \ymin \space \xmin \space \yymin\space y
+ \or % 28
+ \fi
+ \ifnum\mode>8
+ S
+ \else
+ \ifnum\dostroke=\plusone S \fi
+ \ifnum\dofill =\plusone f \fi
+ \fi
Q}%
\fi}%
\wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox
@@ -3102,8 +3144,8 @@
% kan zelf ocmd bevatten
\def\doPDFdefinelayer#1#2#3#4#5% tag title visible type printable
-% {\driverreferenced \doPDFdictionaryobject class PDLN name #1 data
- {\doPDFdictionaryobject class PDLN name #1 data
+% {\driverreferenced \doPDFdictionaryobject{PDLN}{#1}
+ {\doPDFdictionaryobject{PDLN}{#1}
{/Type /OCG
\ifcase#4 \or
/Intent /Design % disable layer hiding by user
@@ -3117,8 +3159,8 @@
\doifelse{#3}\v!start
{\xdef\PDFvidelayers{\PDFvidelayers\space\PDFobjectreference}}%
{\xdef\PDFhidelayers{\PDFhidelayers\space\PDFobjectreference}}%
- %\driverreferenced \doPDFdictionaryobject class PDLD name #1 data
- \doPDFdictionaryobject class PDLD name #1 data
+ %\driverreferenced \doPDFdictionaryobject{PDLD}{#1}
+ \doPDFdictionaryobject{PDLD}{#1}
{/Type /OCMD
/OCGs [\PDFobjectreference]}%
\doPDFgetobjectreference{PDLD}{#1}\PDFobjectreference
@@ -3126,18 +3168,18 @@
\def\flushPDFtextlayers
{\ifx\PDFtextlayers\empty \else
- \driverreferenced \doPDFarrayobject class PDF name textlayers data {\PDFtextlayers}%
+ \driverreferenced \doPDFarrayobject{PDF}{textlayers}{\PDFtextlayers}%
\doPDFgetobjectreference{PDF}{textlayers}\!!stringa
\ifx\PDFvidelayers\empty
\def\!!stringb{[null]}%
\else
- \driverreferenced \doPDFarrayobject class PDF name videlayers data {\PDFvidelayers}%
+ \driverreferenced \doPDFarrayobject{PDF}{videlayers}{\PDFvidelayers}%
\doPDFgetobjectreference{PDF}{videlayers}\!!stringb
\fi
\ifx\PDFhidelayers\empty
\def\!!stringc{[null]}%
\else
- \driverreferenced \doPDFarrayobject class PDF name hidelayers data {\PDFhidelayers}%
+ \driverreferenced \doPDFarrayobject{PDF}{hidelayers}{\PDFhidelayers}%
\doPDFgetobjectreference{PDF}{hidelayers}\!!stringc
\fi
\doPDFaddtocatalog
@@ -3168,10 +3210,10 @@
\def\domakeviewerlayerlist#1%
{\bgroup
\globallet\PDFlayeractionlist\empty
- \def\docommando##1%
+ \def\docommand##1%
{\doPDFgetobjectreference{PDLN}{##1}\PDFobjectreference
\xdef\PDFlayeractionlist{\PDFlayeractionlist\space\PDFobjectreference}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\egroup}
%D Something rather pdf dependent:
@@ -3198,6 +3240,29 @@
% {\PDFdirectcode{1 w 0 Tc 0 Tr}}
{\PDFcode{1 w 0 Tc 0 Tr}}
+%D Handy for the \METAPOST\ to \PDF\ converter:
+
+\newevery \everyPDFxform \relax % we can also use this one in meta-pdf
+
+\appendtoksonce
+ \collectPDFresources
+ \global\let\currentPDFresources\collectedPDFresources
+\to \everyPDFxform
+
+\let\collectedPDFresources\empty
+
+\def\collectPDFresources
+ {\doifobjectreferencefoundelse{FDF}{docushades}
+ {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference
+ \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing
+ \doifobjectreferencefoundelse{FDF}{docuextgstates}
+ {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference
+ \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing
+ \doifobjectreferencefoundelse{FDF}{colorspaces}
+ {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference
+ \xdef\collectedPDFresources{\collectedPDFresources/ColorSpace \PDFobjectreference}}\donothing
+ \global\let\collectPDFresources\relax}
+
%D And that was all.
\stopspecials
@@ -3213,4 +3278,6 @@
\fi
+\loadmarkfile{spec-fdf}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-ini.tex b/Master/texmf-dist/tex/context/base/spec-ini.tex
index 8d867e9a1be..a344219ac62 100644
--- a/Master/texmf-dist/tex/context/base/spec-ini.tex
+++ b/Master/texmf-dist/tex/context/base/spec-ini.tex
@@ -374,9 +374,9 @@
\def\resetspecials
{\the\everyresetspecials
- \def\docommando##1%
+ \def\docommand##1%
{\letvalue{\@@speclst@@##1}\empty}%
- \processcommacommand[\@@allspecials]\docommando
+ \processcommacommand[\@@allspecials]\docommand
\ifx\preloadedspecials\empty \else
\showmessage\m!specials3\preloadedspecials
\let\preloadedspecials\empty
@@ -674,7 +674,7 @@
{\showmessage\m!specials7{#1}}}}
\def\setupoutput[#1]%
- {\ifnum\realpageno<2 % new
+ {\ifnum\realpageno<\plustwo % new
\resetspecials\processcommacommand[#1]\dosetupoutput
\fi}
diff --git a/Master/texmf-dist/tex/context/base/spec-mis.tex b/Master/texmf-dist/tex/context/base/spec-mis.tex
index 6bd7c699443..06afb65c2e4 100644
--- a/Master/texmf-dist/tex/context/base/spec-mis.tex
+++ b/Master/texmf-dist/tex/context/base/spec-mis.tex
@@ -72,64 +72,37 @@
\newif\ifPDFstrokecolor \PDFstrokecolortrue
%D \macros
-%D {dodoinsertfile,dofileinsertion,
-%D definefileinsertion,doiffileinsertionsupported}
+%D {dofileinsertion,definefileinsertion,doiffileinsertionsupported}
%D
%D File insertion depend on the driver or \TEX\ variant used.
%D All driver modules use the same scheme for file insertion,
-%D and therefore have the next macro in common:
-
-% \def\dododoinsertfile[#1][#2,#3][#4,#5]% \next kan weg
-% {\def\fileinsertionclass{do#1insert}%
-% \doifdefinedelse{\fileinsertionclass#3}
-% {\def\next{\getvalue{\fileinsertionclass#3}}}
-% {\doifdefinedelse{\fileinsertionclass#2}
-% {\def\next{\getvalue{\fileinsertionclass#2}}}
-% {\def\next{\gobbleninearguments}}}%
-% \next{#4}{#5}}
-%
-% more modern
-%
-% \def\dododoinsertfile[#1][#2,#3][#4,#5]%
-% {\def\fileinsertionclass{do#1insert}%
-% \doifdefinedelse{\fileinsertionclass#3}
-% {\getvalue{\fileinsertionclass#3}}
-% {\doifdefinedelse{\fileinsertionclass#2}
-% {\getvalue{\fileinsertionclass#2}}
-% {\gobbleninearguments}}%
-% {#4}{#5}}
-%
-% more efficient
-%
-% \def\dododoinsertfile[#1][#2,#3][#4,#5]%
-% {\def\fileinsertionclass{do#1insert}%
-% \executeifdefined{\fileinsertionclass#3}
-% {\executeifdefined{\fileinsertionclass#2}\gobbleninearguments}%
-% {#4}{#5}}
-%
-% cleaner
-
-\def\dododoinsertfile[#1][#2,#3][#4,#5]%
- {\executeifdefined{do#1insert#3}{\executeifdefined{do#1insert#2}\gobbleninearguments}{#4}{#5}}
-
-\def\dodoinsertfile#1#2#3%
- {\dododoinsertfile[#1][#2][#3]}
-
-\def\definefileinsertion#1#2%
+%D and therefore have the next macro in common (stupified
+%D per august 2006):
+
+\let\supportedfileinsertions\empty
+\let\supportedfilecheckers \empty
+
+\def\definefileinsertion#1#2#3%
{\addtocommalist{#2}\supportedfileinsertions
- \setvalue{do#1insert#2}}
+ \setvalue{do#1insert#2}{#3}}
-\def\dofileinsertion#1#2%
- {\getvalue{do#1insert#2}}
+\def\definefilechecker#1#2#3%
+ {\addtocommalist{#2}\supportedfilecheckers
+ \setvalue{do#1check#2}{#3}}
+
+\def\dofileinsertion#1#2{\executeifdefined{do#1insert#2}\donothing}
+\def\dofilechecker #1#2{\executeifdefined{do#1check#2} \donothing}
\newevery \everyresetspecials \relax
\appendtoks \let\supportedfileinsertions\empty \to \everyresetspecials
+\appendtoks \let\supportedfilecheckers \empty \to \everyresetspecials
-\let\supportedfileinsertions\empty
+% \def\doiffileinsertionsupportedelse#1%
+% {\expanded{\doifinstringelse{#1}{\c!tex,\c!tmp,\supportedfileinsertions}}}
\def\doiffileinsertionsupportedelse#1%
- {\ExpandBothAfter\doifinstringelse{#1}{\c!tex,\c!tmp,\supportedfileinsertions}}
+ {\expanded{\doifinstringelse{\truegraphictype{#1}}{\c!tex,\c!tmp,\supportedfileinsertions}}}
%D This macro is called with 10 arguments, where the first
%D one specifies the driver, like \type{yy} or \type{tr}. The
diff --git a/Master/texmf-dist/tex/context/base/spec-pdf.tex b/Master/texmf-dist/tex/context/base/spec-pdf.tex
index ae3f582c70e..2191eaeae3a 100644
--- a/Master/texmf-dist/tex/context/base/spec-pdf.tex
+++ b/Master/texmf-dist/tex/context/base/spec-pdf.tex
@@ -300,7 +300,7 @@
%D definitions are rather verbose. First the destination
%D macro.
-\def\doPDFdestination name #1%
+\def\doPDFdestination#1%
{\special
{\@@insertpostscriptretain
[ /Dest /#1\space
@@ -357,10 +357,10 @@
\egroup
\fi}
-\def\doPDFaction width #1 height #2 action #3%
+\def\doPDFaction#1#2#3%
{\dodoPDFaction\empty{#1}{#2}{#3}}
-\def\doPDFannotation width #1 height #2 data #3%
+\def\doPDFannotation#1#2#3%
{\bgroup
\PointsToBigPoints{#1}\width
\PointsToBigPoints{#2}\height
@@ -371,7 +371,7 @@
pdfmark}%
\egroup}
-\def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5%
+\def\doPDFannotationobject#1#2#3#4#5%
{\bgroup
\PointsToBigPoints{#3}\width
\PointsToBigPoints{#4}\height
@@ -384,7 +384,7 @@
\egroup
\dosetobjectreference{#1}{#2}{#1::#2}}
-\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5%
+\def\doPDFactionobject#1#2#3#4#5%
{\dodoPDFaction{/_objdef {#1::#2}}{#3}{#4}{#5}%
\dosetobjectreference{#1}{#2}{#1::#2}}
@@ -393,14 +393,14 @@
%D
%D These two macros are used to build low level objects.
-\def\doPDFdictionaryobject class #1 name #2 data #3%
+\def\doPDFdictionaryobject#1#2#3%
{\special
{\@@insertpostscriptretain
[ /_objdef {#1::#2} /type /dict /OBJ pdfmark
[ {#1::#2} << #3 >> /PUT pdfmark}%
\dosetobjectreference{#1}{#2}{#1::#2}}
-\def\doPDFarrayobject class #1 name #2 data #3%
+\def\doPDFarrayobject#1#2#3%
{\special
{\@@insertpostscriptretain
[ /_objdef {#1::#2} /type /array /OBJ pdfmark
@@ -439,15 +439,15 @@
{\@@insertpostscriptretain
[ #1 /PAGES pdfmark}}}
-\let\doPDFresetpageresources =\relax
-\let\doPDFresetpageattributes=\relax
+\let\doPDFresetpageresources \relax
+\let\doPDFresetpageattributes\relax
%D \macros
%D {doPDFbookmark}
%D
%D This is how we force bookmarks entries in the file.
-\def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+\def\doPDFbookmark#1#2#3#4#5%
{\scratchcounter#4\advance\scratchcounter\minusone
\special
{\@@insertpostscriptretain
diff --git a/Master/texmf-dist/tex/context/base/spec-ps.tex b/Master/texmf-dist/tex/context/base/spec-ps.tex
index 077e2288717..803defe02ba 100644
--- a/Master/texmf-dist/tex/context/base/spec-ps.tex
+++ b/Master/texmf-dist/tex/context/base/spec-ps.tex
@@ -155,7 +155,7 @@
\advance\dimen2 #2%
\PointsToBigPoints{\dimen2}#3}
-\def\dosomeovalbox#1#2#3#4#5#6#7%
+\def\dosomeovalbox#1#2#3#4#5#6#7#8% variant not yet supported
{\bgroup
\dimen0=#4\divide\dimen0 2
\dosomeovalcalc{0pt}{+\dimen0}\xmin
@@ -199,7 +199,7 @@
%D The indirect call permits a (rather) dirty hack, needed
%D for \DVIPS\ support.
-\definespecial\doovalbox%
+\definespecial\doovalbox
{\dosomeovalbox}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/spec-tpd.tex b/Master/texmf-dist/tex/context/base/spec-tpd.tex
index c21139b03ce..29d5c7a15ed 100644
--- a/Master/texmf-dist/tex/context/base/spec-tpd.tex
+++ b/Master/texmf-dist/tex/context/base/spec-tpd.tex
@@ -27,19 +27,19 @@
% method = auto
%
-% \definefileinsertion{tpd}{auto}#1#2#3#4#5#6#7#8#9%
+% \definefileinsertion{tpd}{auto}%
% {\executesystemcommand{t:/ruby/pstopdf.rb #2}%
-% \dodoinsertfile{tpd}{pdf}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}
+% \dofileinsertion{tpd}{pdf}}
% \let\PDFdestvoffset\zeropoint
% \newbox\pdfdestbox
%
-% \def\doPDFdestination name #1%
+% \def\doPDFdestination#1%
% {\ifdim\PDFdestvoffset=\zeropoint\relax
-% \pdfdest name {#1} \PDFpageviewkey
+% \pdfdest name {#1}\PDFpageviewkey
% \else
% \setbox\pdfdestbox\hbox to \zeropoint
-% {\raise\PDFdestvoffset\hbox{\pdfdest name {#1} \PDFpageviewkey}}%
+% {\raise\PDFdestvoffset\hbox{\pdfdest name {#1}\PDFpageviewkey}}%
% \ht\pdfdestbox\zeropoint
% \box\pdfdestbox
% \fi}
@@ -208,7 +208,7 @@
%D This token register is flushed before an ximage is loaded.
\newevery \everyPDFximage \relax
-\let \everyPDFxform \everyPDFximage
+\newevery \everyPDFxform \relax
%D \macros
%D {dosetuppaper}
@@ -242,7 +242,8 @@
%D nasty but needed
-\appendtoksonce \loadallfontmapfiles \to \everyPDFximage % currently == \everyPDFxform
+\appendtoksonce \loadallfontmapfiles \to \everyPDFximage
+\appendtoksonce \loadallfontmapfiles \to \everyPDFxform
%D \macros
%D {doinsertfile,dogetnofinsertpages}
@@ -265,10 +266,8 @@
%D are hooked into both the figure placement mechanisms of
%D \CONTEXT\ and the specials inclusion mechanism.
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \dodoinsertfile{tpd}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
- \egroup}
+\definespecial\doinsertfile
+ {\dofileinsertion{tpd}{\truegraphictype\@@DriverImageType}}
%D The number of pages in (for instance an \PDF) insert
%D file, can be asked for using:
@@ -283,26 +282,11 @@
%D for \METAPOST\ graphics, \type{png} and \type{jpg} for
%D bitmap graphics.
-\definefileinsertion{tpd}{mps}#1#2#3#4#5#6#7#8#9%
+\definefileinsertion{tpd}{mps}
{\hbox
- {%\convertMPcolors{#1}% plugged in supp-mpe
- \scratchdimen#3\points \PointsToReal{.01\scratchdimen}\xscale
- \scratchdimen#4\points \PointsToReal{.01\scratchdimen}\yscale
- \convertMPtoPDF{#1}\xscale\yscale
+ {\convertMPtoPDF\@@DriverImageFile{1}{1}%
\global\let\PDFimagereference\empty}}
-%D The old, \TEX\ base \PDF\ insertion macro:
-%D
-%D \starttyping
-%D \def\dotpdinsertpdf#1#2#3#4#5#6#7#8#9%
-%D {\beforesplitstring#1\at.\to\filename
-%D \scratchdimen=#3pt \PointsToReal{.01\scratchdimen}\xscale
-%D \scratchdimen=#4pt \PointsToReal{.01\scratchdimen}\yscale
-%D \convertPDFtoPDF{\filename.pdf}\xscale\yscale{#5}{#6}{#7}{#8}}
-%D \stoptyping
-%D
-%D superseded by the next macros.
-
\definefileinsertion{tpd}{pdf}{\handlepdfimage}
\definefileinsertion{tpd}{png}{\handlepdfimage}
\definefileinsertion{tpd}{jpg}{\handlepdfimage}
@@ -311,18 +295,8 @@
% \definefileinsertion{tpd}{jpeg} {\handlepdfimage}
% \definefileinsertion{tpd}{jbig2}{\handlepdfimage}
-%definefileinsertion{tpd}{tif}{\handlepdfimage} % unstable and gone
-
%D Experimental:
-% \definefileinsertion{tpd}{svg}{\doPDFinsertsvg}
-% \definefileinsertion{tpd}{svgz}{\doPDFinsertsvg}
-%
-% todo: no placeholder but manipulator of evt autorlx
-
-\def\doPDFinsertsvg#1#2#3#4#5#6#7#8#9%
- {\externalfigureplaceholder{#1}{#7}{#8}}
-
%D The main file insertion macro is as follows. Because
%D \PDFTEX\ does not support arbitrary suffixes, we double
%D check on a user supplied filename, because \PDFTEX\ chokes
@@ -347,46 +321,41 @@
\ifx\pdflastximagepages\undefined \chardef\pdflastximagepages=1 \fi
+\def\checkpdfimagepagenumber
+ {\edef\pdfimagepagenumber
+ {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount
+ \space page\space\@@DriverImagePage\space
+ \fi\fi}}
+
\ifnum\pdftexversion>13
- \def\checkpdfimagepagenumber#1%
- {\let\pdfimagepagenumber\empty
- \getfromcommacommand[#1][1]%
- \doifnumberelse\commalistelement
- {\ifcase\commalistelement\else
- \edef\pdfimagepagenumber{page \commalistelement}%
- %\message{(pdf image \pdfimagepagenumber)}%
- \fi}
- {}}
-
- \def\handlepdfimage#1#2#3#4#5#6#7#8#9%
+ \def\handlepdfimage
{\bgroup
\the\everyPDFximage
- \doifvalidpdfimagefileelse{#1}
- {\checkpdfimagepagenumber{#9}%
- %\pdfimmediateximage
+ \doifvalidpdfimagefileelse\@@DriverImageFile
+ {\checkpdfimagepagenumber
\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
- \ifdim#7>\zeropoint \!!width #7\fi
- \ifdim#8>\zeropoint \!!height #8\fi
+ \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi
+ \ifdim\@@DriverImageHeight>\zeropoint \!!height\@@DriverImageHeight\fi
\pdfimagepagenumber
\@@DriverImageBox
- {#1}%
+ {\@@DriverImageFile}
\xdef\PDFimagereference{\the\pdflastximage}%
\xdef\nofinsertpages{\the\pdflastximagepages}%
\pdfrefximage\pdflastximage}
- {\framed[\c!width=#7,\c!height=#8]{#1}}%
+ {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}%
\egroup}
\else
- \def\handlepdfimage#1#2#3#4#5#6#7#8#9%
+ \def\handlepdfimage
{\bgroup
- \doifvalidpdfimagefileelse{#1}
+ \doifvalidpdfimagefileelse\@@DriverImageFile
{\pdfimage
- \ifdim#7>\zeropoint \!!width #7\fi
- \ifdim#8>\zeropoint \!!height #8\fi
- {#1}}%
- {\framed[\c!width=#7,\c!height=#8]{#1}}%
+ \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi
+ \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight\fi
+ {\@@DriverImageFile}}%
+ {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}%
\egroup}
\fi
@@ -407,15 +376,6 @@
\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack}
-%D \macros
-%D {measureTPDfiguresizetrue}
-%D
-%D Because \PDFTEX\ measures the figure itself, we can use
-%D this feature to bypass the normal prescan. Watch the
-%D double check on the suffix. Else \PDFTEX\ would choke.
-
-\newif\ifmeasureTPDfiguresize \measureTPDfiguresizetrue
-
%D For the moment we don't test for alternatives that
%D themselves have alternatives, especially cylcic
%D dependencies.
@@ -429,25 +389,6 @@
\ifx\@@DriverImageBox\undefined \def\@@DriverImageBox{artbox} \fi
-% \def\doguessTPDimagesize#1% does not work as expected
-% {\ifx\@@DriverImageBox\empty
-% \global\setbox\foundexternalfigure\hbox{\pdfximage \pdfimagepagenumber ArtBox {#1}\pdfrefximage\pdflastximage}%
-% \ifdim\ht\foundexternalfigure>\zeropoint
-% \def\@@DriverImageBox{ArtBox}%
-% \else
-% \global\setbox\foundexternalfigure\hbox{\pdfximage \pdfimagepagenumber TrimBox {#1}\pdfrefximage\pdflastximage}%
-% \ifdim\ht\foundexternalfigure>\zeropoint
-% \def\@@DriverImageBox{TrimBox}%
-% \else
-% \global\setbox\foundexternalfigure\hbox{\pdfximage \pdfimagepagenumber CropBox {#1}\pdfrefximage\pdflastximage}%
-% \ifdim\ht\foundexternalfigure>\zeropoint
-% \def\@@DriverImageBox{CropBox}%
-% \fi
-% \fi
-% \fi
-% \fi
-% \@@DriverImageBox}
-
\def\pdfimmediateximage{\immediate\pdfximage}
\ifnum\pdftexversion>13
@@ -475,81 +416,60 @@
\fi\fi
\global\let\PDFimagecolorreference\empty}
- \def\dogetTPDfiguresize#1#2#3#4#5#6#7%
- {\ifmeasureTPDfiguresize
- #4\zeropoint
- #5\zeropoint
- \doifvalidpdfimagefileelse{#2}
- {\ifvoid\foundexternalfigure
- \donetrue
- \else\ifx\PDFfigurereference\empty
- \donetrue
- \else
- \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse
- \fi\fi}
- {\donefalse}%
- \ifdone
- \the\everyPDFximage
- \checkpdfimagepagenumber{#3}%
- \checkpdfimageattributes
- \checkpdfimagecolorspecs
- \global\setbox\foundexternalfigure\hbox
- {\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
- %\pdfimmediateximage
- \pdfimageattributes
- \pdfimagecolorspecs
- \pdfimagepagenumber
- \@@DriverImageBox
- {#2}%
- \xdef\PDFimagereference{\the\pdflastximage}%
- \xdef\nofinsertpages{\the\pdflastximagepages}%
- \pdfrefximage\pdflastximage}%
- #6\wd\foundexternalfigure
- #7\ht\foundexternalfigure
- \global\let\PDFfigurereference\empty
- \global\let\PDFimageattributes\empty
- \else
- #6\zeropoint
- #7\zeropoint
- \fi
- \else
- #1{#2}{#3}{#4}{#5}{#6}{#7}% \normaldogetfiguresize...
- \fi}
+ \def\dogetTPDfiguresize
+ {\doifvalidpdfimagefileelse\@@DriverImageFile
+ {\ifvoid\foundexternalfigure
+ \donetrue
+ \else\ifx\PDFfigurereference\empty
+ \donetrue
+ \else
+ % hm, is this still needed
+ \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse
+ \fi\fi}
+ {\donefalse}%
+ \ifdone
+ \the\everyPDFximage
+ \checkpdfimageattributes
+ \checkpdfimagecolorspecs
+ \checkpdfimagepagenumber
+ \global\setbox\foundexternalfigure\hbox
+ {\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
+ \pdfimageattributes
+ \pdfimagecolorspecs
+ \pdfimagepagenumber
+ \@@DriverImageBox
+ {\@@DriverImageFile}%
+ \xdef\PDFimagereference{\the\pdflastximage}%
+ \xdef\nofinsertpages{\the\pdflastximagepages}%
+ \pdfrefximage\pdflastximage}%
+ \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
+ \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}%
+ \global\let\PDFfigurereference\empty
+ \global\let\PDFimageattributes\empty
+ \else
+ \global\let\analyzedfigurewidth \!!zeropoint
+ \global\let\analyzedfigureheight\!!zeropoint
+ \fi}
\else
- \def\dogetTPDfiguresize#1#2#3#4#5#6#7%
- {\ifmeasureTPDfiguresize
- #4\zeropoint
- #5\zeropoint
- \doifvalidpdfimagefileelse{#2}
- {\global\setbox\foundexternalfigure\vbox{\pdfimage{#2}}%
- #6\wd\foundexternalfigure
- #7\ht\foundexternalfigure}
- {#6\zeropoint
- #7\zeropoint}%
- \else
- #1{#2}{#3}{#4}{#5}{#6}{#7}% \normaldogetfiguresize...
- \fi}
+ \def\dogetTPDfiguresize
+ {\doifvalidpdfimagefileelse\@@DriverImageFile
+ {\global\setbox\foundexternalfigure\vbox{\pdfimage{\@@DriverImageFile}}%
+ \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
+ \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}}
+ {\global\let\analyzedfigurewidth \!!zeropoint
+ \global\let\analyzedfigureheight\!!zeropoint}}
\fi
-\let\normaldogetfiguresizepdf=\dogetfiguresizepdf
-\let\normaldogetfiguresizepng=\dogetfiguresizepng
-\let\normaldogetfiguresizetif=\dogetfiguresizetif
-\let\normaldogetfiguresizejpg=\dogetfiguresizejpg
-
-\def\dogetfiguresizepdf{\dogetTPDfiguresize\normaldogetfiguresizepdf}
-\def\dogetfiguresizepng{\dogetTPDfiguresize\normaldogetfiguresizepng}
-\def\dogetfiguresizetif{\dogetTPDfiguresize\normaldogetfiguresizetif}
-\def\dogetfiguresizejpg{\dogetTPDfiguresize\normaldogetfiguresizejpg}
+\definefilechecker{tpd}{pdf}{\dogetTPDfiguresize}
+\definefilechecker{tpd}{png}{\dogetTPDfiguresize}
+\definefilechecker{tpd}{jpg}{\dogetTPDfiguresize}
+\definefilechecker{tpd}{jb2}{\dogetTPDfiguresize}
-\appendtoksonce
- \let\dogetfiguresizepdf\normaldogetfiguresizepdf
- \let\dogetfiguresizepng\normaldogetfiguresizepng
- \let\dogetfiguresizetif\normaldogetfiguresizetif
- \let\dogetfiguresizejpg\normaldogetfiguresizejpg
-\to \everyresetspecials
+\definespecial\dogetfiguresize
+ {\dofilechecker{tpd}{\truegraphictype\@@DriverImageType}}
%D \macros
%D {doregisterfigure}
@@ -836,13 +756,13 @@
\definespecial\doflushJSpreamble#1%
{\bgroup
\let\compositeJScode\empty
- \def\docommando##1%
+ \def\docommand##1%
{\edef\sanitizedJScode{\getJSpreamble{##1}}%
\@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
\immediate\pdfobj {<< /S /JavaScript /JS (\sanitizedJScode) >>}%
\edef\compositeJScode
{\compositeJScode\space (##1) \PDFobjref\pdflastobj}}%
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\immediate\pdfobj{<< /Names [ \compositeJScode ] >>}%
\pdfnames{/JavaScript \PDFobjref\pdflastobj}%
\egroup}
@@ -1036,6 +956,11 @@
\fi
+\appendtoksonce
+ \collectPDFresources
+ \global\let\currentPDFresources\collectedPDFresources
+\to \everyPDFxform
+
%D \macros
%D {dosetpagetransition}
%D
@@ -1104,41 +1029,21 @@
%D \CONTEXT\ only uses relative positions, the origin is of
%D less importance.
-% \def\doTPDsetposition#1#2#3%
-% {\bgroup
-% \edef\doTPDsetposition%
-% {\writeutilitycommand
-% {#1%
-% {#2}%
-% {\noexpand\realfolio}%
-% {\noexpand\number\pdflastxpos}%
-% {\noexpand\number\pdflastypos}%
-% #3}}%
-% \pdfsavepos
-% \doTPDsetposition
-% \egroup}
-%
-% \definespecial\dosetposition#1%
-% {\doTPDsetposition{\pospxy}{#1}{}}
-%
-% \definespecial\dosetpositionwhd#1#2#3#4%
-% {\doTPDsetposition{\pospxywhd}{#1}{{#2}{#3}{#4}}}
-
\definespecial\dosetposition#1%
{\pdfsavepos
\dolazysaveposition
{#1}%
{\noexpand\realfolio}%
- {\noexpand\number\pdflastxpos}%
- {\noexpand\number\pdflastypos}}%
+ {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}%
+ {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}}%
\definespecial\dosetpositionwhd#1#2#3#4%
{\pdfsavepos
\dolazysavepositionwhd
{#1}%
{\noexpand\realfolio}%
- {\noexpand\number\pdflastxpos}%
- {\noexpand\number\pdflastypos}%
+ {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}%
+ {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}%
{#2}{#3}{#4}}
\definespecial\dosetpositionplus#1#2#3#4#5%
@@ -1146,8 +1051,8 @@
\dolazysavepositionplus
{#1}%
{\noexpand\realfolio}%
- {\noexpand\number\pdflastxpos}%
- {\noexpand\number\pdflastypos}%
+ {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}%
+ {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}%
{#2}{#3}{#4}{#5}}
%D \macros
@@ -1156,8 +1061,8 @@
%D Finally we implement some low level macros to deal with
%D flushing \PDF\ code. First we handle the named destinations.
-\def\doPDFdestination name #1%
- {\pdfdest name {#1} \PDFpageviewkey}
+\def\doPDFdestination#1%
+ {\pdfdest name {#1}\PDFpageviewkey}
%D \macros
%D {doPDFaction,doPDFannotation,ifsharePDFactions}
@@ -1175,7 +1080,7 @@
\ifnum\pdftexversion>13
- \def\doPDFaction width #1 height #2 action #3%
+ \def\doPDFaction#1#2#3%
{\ifcollectreferenceactions
\xdef\lastPDFaction{#3}%
\else
@@ -1201,7 +1106,7 @@
% less #2 passing
- \def\doPDFaction width #1 height #2 action #3%
+ \def\doPDFaction#1#2#3%
{\xdef\lastPDFcontent{#3}%
\ifcollectreferenceactions
\global\let\lastPDFaction\lastPDFcontent
@@ -1228,7 +1133,7 @@
\else
- \def\doPDFaction width #1 height #2 action #3%
+ \def\doPDFaction#1#2#3%
{\ifcollectreferenceactions
\xdef\lastPDFaction{#3}%
\else
@@ -1257,7 +1162,7 @@
% pdftex and viewers give problems with this one (printing forms)
%
-%\def\doPDFannotation width #1 height #2 data #3%
+%\def\doPDFannotation#1#2#3%
% {\pdfannot width #1sp height -#2sp depth \zeropoint{#3}}
%
% This is corrected in version 14. When this version is wide
@@ -1265,12 +1170,12 @@
\ifnum\pdftexversion>13
- \def\doPDFannotation width #1 height #2 data #3%
+ \def\doPDFannotation#1#2#3%
{\pdfannot width #1 height #2 depth \zeropoint{#3}}
\else
- \def\doPDFannotation width #1 height #2 data #3%
+ \def\doPDFannotation#1#2#3%
{\hbox{\raise#2\hbox{\pdfannot width #1 height #2 depth \zeropoint{#3}}}}
\fi
@@ -1283,12 +1188,12 @@
%D the last annotation object number directly), we take the
%D save route.
-\def\doPDFannotationobject class #1 name #2 width #3 height #4 data #5%
- {\doPDFannotation width #3 height #4 data {#5}%
+\def\doPDFannotationobject#1#2#3#4#5%
+ {\doPDFannotation{#3}{#4}{#5}%
\dosetobjectreference{#1}{#2}{\the\pdflastannot}}
-\def\doPDFactionobject class #1 name #2 width #3 height #4 action #5%
- {\doPDFaction width {#3} height {#4} action {#5}%
+\def\doPDFactionobject#1#2#3#4#5%
+ {\doPDFaction{#3}{#4}{#5}%
\dosetobjectreference{#1}{#2}{\the\pdflastannot}}
%D \macros
@@ -1327,19 +1232,19 @@
% obsolete cq. buggy in pdfTeX
%
-% \def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+% \def\doPDFbookmark#1#2#3#4#5%
% {\pdfoutline
% goto page #4\space
% \ifcase#2 \else count \ifcase#5-\fi#2 \fi
% {#3}}
-% \def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+% \def\doPDFbookmark#1#2#3#4#5%
% {\pdfoutline
% user {<</S /GoTo /D [#4\space\PDFpageviewwrd]>>}%
% \ifcase#2 \else count \ifcase#5-\fi#2 \fi
% {#3}}
-\def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+\def\doPDFbookmark#1#2#3#4#5%
{\doPDFgetpagereference{#4}\PDFobjectreference
\pdfoutline
user {<</S /GoTo /D [\PDFobjectreference\space\PDFpageviewwrd]>>}%
@@ -1352,12 +1257,12 @@
%D Where \PDFTEX\ has only one object primitive, optionally a
%D stream one, \ACROBAT\ has several operators.
-\def\doPDFdictionaryobject class #1 name #2 data #3%
+\def\doPDFdictionaryobject#1#2#3%
{\flushatshipout
{\immediate\pdfobj{<< #3 >>}%
\dosetobjectreference{#1}{#2}{\the\pdflastobj}}}
-\def\doPDFarrayobject class #1 name #2 data #3%
+\def\doPDFarrayobject#1#2#3%
{\flushatshipout
{\immediate\pdfobj{[ #3 ]}%
\dosetobjectreference{#1}{#2}{\the\pdflastobj}}}
@@ -1399,7 +1304,7 @@
%D Here follow some rather obscure macros. They will only
%D come into action when one wants negated output.
-%D Todo: move code to fdf module and
+%D Todo: move code to fdf module
\def\initializePDFnegative
{\immediate\pdfobj stream attr {/FunctionType 4 /Range [0 1] /Domain [0 1]} {{1 exch sub}}%
@@ -1425,12 +1330,11 @@
\let\PDFlaststreamobject \s!unknown
%def\PDFlaststreamreference{0 0 R}
-\def\doPDFfilestreamobject class #1 name #2 file #3 source #4%
+\def\doPDFfilestreamobject#1#2#3#4%
{\immediate\pdfobj stream file{#4}%
\edef\PDFlaststreamobject{\the\pdflastobj}%
\dosetobjectreference{PDFFS}{#2}{\PDFlaststreamobject}%
- \doPDFdictionaryobject class {#1} name {#2} data
- {/Type /Filespec /F (#3) /EF <</F \PDFobjref\PDFlaststreamobject>>}}
+ \doPDFdictionaryobject{#1}{#2}{/Type /Filespec /F (#3) /EF <</F \PDFobjref\PDFlaststreamobject>>}}
\def\doPDFgetfilestreamreference#1#2%
{\doPDFgetobjectreference{PDFFS}{#1}#2}
@@ -1441,9 +1345,9 @@
\@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject
\PDFlaststreamobject}}
-% %D We can set \METAPOST\ prologues to~2:
+% %D We can set \METAPOST\ prologues to~1:
-\def\MPprologues{2}
+\def\MPprologues{1}
%D Experimental:
diff --git a/Master/texmf-dist/tex/context/base/spec-tr.tex b/Master/texmf-dist/tex/context/base/spec-tr.tex
index 2631f399ed9..c1f997bca19 100644
--- a/Master/texmf-dist/tex/context/base/spec-tr.tex
+++ b/Master/texmf-dist/tex/context/base/spec-tr.tex
@@ -27,40 +27,29 @@
\def\@@insertpostscriptliteral {ps: }
\def\@@insertpostscriptretain {" }
-%\definefileinsertion{tr}{eps}#1#2#3#4#5#6#7#8#9%
-% {\PointsToBigPoints{#5}\width
-% \PointsToBigPoints{#6}\height
-% \special
-% {psfile=#1
-% hscale=#3\space
-% vscale=#4\space
-% hoffset=\width\space
-% voffset=\height}}
-
%D Ugly but useful:
-\definefileinsertion{tr}{eps}#1#2#3#4#5#6#7#8#9%
- {\PointsToWholeBigPoints{#7}\width
- \PointsToWholeBigPoints{#8}\height
+\definefileinsertion{tr}{eps}
+ {\bgroup
+ \PointsToWholeBigPoints\@@DriverImageWidth \width
+ \PointsToWholeBigPoints\@@DriverImageHeight\height
\special
- {PSfile="#1"\space
+ {PSfile="\@@DriverImageFile"\space
llx=\EPSllx\space
lly=\EPSlly\space
urx=\EPSurx\space
ury=\EPSury\space
- rwi=\width0\space
- rhi=\height0}}
+ \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi
+ \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}%
+ \egroup}
-\definefileinsertion{tr}{mps}#1#2#3#4#5#6#7#8#9%
+\definefileinsertion{tr}{mps}
{\hbox
- {%\includeMPfonts{#1}% dvips know mp
- \convertMPcolors{#1}%
- \dofileinsertion{tr}{eps}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}
+ {\convertMPcolors\@@DriverImageFile
+ \dofileinsertion{tr}{eps}}}
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \dodoinsertfile{tr}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
- \egroup}
+\definespecial\doinsertfile
+ {\dofileinsertion{tr}\@@DriverImageType}
%D Some MP stuff:
@@ -91,14 +80,14 @@
%D the retain constant into a macro, we can use the already
%D present \POSTSCRIPT\ definition (see \type{spec-ps}).
-\definespecial\doovalbox#1#2#3#4#5#6#7%
+\definespecial\doovalbox#1#2#3#4#5#6#7#8% variant not yet supported
{\bgroup
\edef\@@insertpostscriptretain gsave%
{\@@insertpostscriptliteral
gsave
Resolution 72 div
VResolution 72 div neg scale currentpoint translate}%
- \dosomeovalbox{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
+ \dosomeovalbox{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
\egroup}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/spec-tst.tex b/Master/texmf-dist/tex/context/base/spec-tst.tex
index e30eea2fec2..9f150dfe367 100644
--- a/Master/texmf-dist/tex/context/base/spec-tst.tex
+++ b/Master/texmf-dist/tex/context/base/spec-tst.tex
@@ -83,10 +83,10 @@
{\bgroup
\sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter
\stripstring\bookmarktext
- \doPDFbookmark level #1 n #2 text {\bookmarktext} page {#4} open #5
+ \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}%
\egroup}
-\def\doPDFbookmark level #1 n #2 text #3 page #4 open #5%
+\def\doPDFbookmark#1#2#3#4#5%
{\doPDFgetpagereference{#4}\PDFobjectreference
\pdfoutline
user {<</S /GoTo /D [\PDFobjectreference\space\PDFpageviewwrd]>>}%
diff --git a/Master/texmf-dist/tex/context/base/spec-var.tex b/Master/texmf-dist/tex/context/base/spec-var.tex
index 0a508f5614d..ba04565a259 100644
--- a/Master/texmf-dist/tex/context/base/spec-var.tex
+++ b/Master/texmf-dist/tex/context/base/spec-var.tex
@@ -21,6 +21,11 @@
\unprotect
+% This variable holds a comma separated list of (supported) figure
+% types. It may be changes by other modules.
+
+\let\figuretypes\empty
+
\ifx\undefined\@@DriverFieldName
\letempty \@@DriverFieldName
@@ -64,6 +69,14 @@
\ifx\undefined\@@DriverImageBox
\letempty \@@DriverImageBox
+ \letempty \@@DriverImageOptions
+ \letempty \@@DriverImageWidth
+ \letempty \@@DriverImageHeight
+ \letempty \@@DriverImageFile
+ \letempty \@@DriverImageLabel
+ \letempty \@@DriverImageType
+ \letempty \@@DriverImageMethod
+ \letempty \@@DriverImagePage
\fi
diff --git a/Master/texmf-dist/tex/context/base/spec-xtx.tex b/Master/texmf-dist/tex/context/base/spec-xtx.tex
index ee71a60a2cf..b9c491e75d1 100644
--- a/Master/texmf-dist/tex/context/base/spec-xtx.tex
+++ b/Master/texmf-dist/tex/context/base/spec-xtx.tex
@@ -76,10 +76,8 @@
%D \XETEX\ supports \type{\doPDFdestination} and
%D \type{\doPDFbookmark} inherited straight from \DVIPDFMX.
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \dodoinsertfile{xtx}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
- \egroup}
+\definespecial\doinsertfile
+ {\dofileinsertion{xtx}\@@DriverImageType}
\definefileinsertion{xtx}{jpg}{\xtxhandleotherimage}
\definefileinsertion{xtx}{png}{\xtxhandleotherimage}
@@ -87,75 +85,45 @@
\definefileinsertion{xtx}{tif}{\xtxhandleotherimage}
\definefileinsertion{xtx}{pdf}{\xtxhandlepdfimage }
-\def\xtxhandleotherimage#1#2#3#4#5#6#7#8#9%
- {\bgroup % not needed, we load this under a normal catcode regime; \catcode`\"=11
- \XeTeXpicfile "#1" width #7 height #8\relax%
- \donetrue
- \egroup}
-
-\def\xtxhandlepdfimage#1#2#3#4#5#6#7#8#9%
- {\bgroup % not needed, we load this under a normal catcode regime; \catcode`\"=11
- \checkpdfimagepagenumber{#9}
- \XeTeXpdffile "#1" \pdfimagepagenumber\space width #7 height #8 \relax%
- \donetrue
- \egroup}
-
-\def\checkpdfimagepagenumber#1%
- {\let\pdfimagepagenumber\empty
- \getfromcommacommand[#1][1]%
- \doifnumberelse\commalistelement
- {\ifcase\commalistelement\else
- \edef\pdfimagepagenumber{page \commalistelement}%
- %\message{(pdf image \pdfimagepagenumber)}%
- \fi}
- {}}
-
-% \type{\getfiguredimensionsA} calls this one.
-% \type{\executedtrue} means it was able to get the desired
-% dogetfiguresizeBLAH method for the image type.
-% \type{\donetrue} means that the image was successfully
-% measured to be more than zero points.
-
-\def\dogetXTXfiguresize#1#2#3#4#5#6#7%
- {#4\zeropoint
- #5\zeropoint
- \setbox\foundexternalfigure\vbox{\XeTeXpicfile "#2"}%
- #6\wd\foundexternalfigure
- #7\ht\foundexternalfigure
- \ifdim\wd\foundexternalfigure=\zeropoint % \ifzeropt\wd\foundexternalfigure
- #1{#2}{#3}{#4}{#5}{#6}{#7}%
- \fi}
-
-\def\dogetXTXpdfsize#1#2#3#4#5#6#7%
- {#4\zeropoint
- #5\zeropoint
- \checkpdfimagepagenumber{#3}
- \setbox\foundexternalfigure\vbox{\XeTeXpdffile "#2" \pdfimagepagenumber}% \relax not needed
- #6\wd\foundexternalfigure
- #7\ht\foundexternalfigure
- \ifdim\wd\foundexternalfigure=\zeropoint % \ifzeropt\wd\foundexternalfigure
- #1{#2}{#3}{#4}{#5}{#6}{#7}%
- \fi}
-
-\let\normaldogetfiguresizepng=\dogetfiguresizepng
-\let\normaldogetfiguresizetif=\dogetfiguresizetif
-\let\normaldogetfiguresizejpg=\dogetfiguresizejpg
-\let\normaldogetfiguresizegif=\dogetfiguresizegif
-\let\normaldogetfiguresizepdf=\dogetfiguresizepdf
-
-\def\dogetfiguresizepng{\dogetXTXfiguresize\normaldogetfiguresizepng}
-\def\dogetfiguresizejpg{\dogetXTXfiguresize\normaldogetfiguresizejpg}
-\def\dogetfiguresizegif{\dogetXTXfiguresize\normaldogetfiguresizegif}
-\def\dogetfiguresizetif{\dogetXTXfiguresize\normaldogetfiguresizetif}
-\def\dogetfiguresizepdf{\dogetXTXpdfsize\normaldogetfiguresizepdf}
-
-\appendtoksonce
- \let\dogetfiguresizepng\normaldogetfiguresizepng
- \let\dogetfiguresizetif\normaldogetfiguresizetif
- \let\dogetfiguresizejpg\normaldogetfiguresizejpg
- \let\dogetfiguresizegif\normaldogetfiguresizegif
- \let\dogetfiguresizepdf\normaldogetfiguresizepdf
-\to \everyresetspecials
+\def\checkpdfimagepagenumber
+ {\edef\pdfimagepagenumber
+ {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount
+ \space page\space\@@DriverImagePage\space
+ \fi\fi}}
+
+\def\xtxhandleotherimage
+ {\XeTeXpicfile "\@@DriverImageFile"
+ \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi
+ \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi
+ \relax}
+
+\def\xtxhandlepdfimage
+ {\checkpdfimagepagenumber
+ \XeTeXpdffile "\@@DriverImageFile"
+ \pdfimagepagenumber
+ \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi
+ \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi
+ \relax}
+
+\def\dogetXTXfiguresize
+ {\setbox\foundexternalfigure\vbox{\XeTeXpicfile "\@@DriverImageFile"}%
+ \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
+ \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}}
+
+\def\dogetXTXpdfsize
+ {\checkpdfimagepagenumber
+ \setbox\foundexternalfigure\vbox{\XeTeXpdffile "\@@DriverImageFile" \pdfimagepagenumber}%
+ \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
+ \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}}
+
+\definefilechecker{xtx}{png}{\dogetXTXfiguresize}
+\definefilechecker{xtx}{jpg}{\dogetXTXfiguresize}
+\definefilechecker{xtx}{gif}{\dogetXTXfiguresize}
+\definefilechecker{xtx}{tif}{\dogetXTXfiguresize}
+\definefilechecker{xtx}{pdf}{\dogetXTXpdfsize }
+
+\definespecial\dogetfiguresize
+ {\dofilechecker{xtx}\@@DriverImageType}
%D The figure object system caused no end of headaches. They all
%D went away with this single line:
diff --git a/Master/texmf-dist/tex/context/base/spec-yy.tex b/Master/texmf-dist/tex/context/base/spec-yy.tex
index 9d09b6e35b3..beec95493e2 100644
--- a/Master/texmf-dist/tex/context/base/spec-yy.tex
+++ b/Master/texmf-dist/tex/context/base/spec-yy.tex
@@ -8,8 +8,8 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D \macros
%D {dostartgraymode,dostopgraymode,
@@ -23,7 +23,7 @@
\startspecials[yandy]
\def\@@insertpostscriptliteral {ps: }
-\def\@@insertpostscriptretain {" } % this was: {postscript}
+\def\@@insertpostscriptretain {" } % this was: {postscript}
\definespecial\dostartgraymode#1%
{\special{color gray #1}}
@@ -43,31 +43,46 @@
\definespecial\dostopcolormode%
{\special{color gray 0}}
-\definefileinsertion{yy}{eps}#1#2#3#4#5#6#7#8#9%
- {\PointsToBigPoints{#5}\width
- \PointsToBigPoints{#6}\height
- \special
- {psfile=#1
- hscale=#3\space
- vscale=#4\space
- hoffset=\width \space
- voffset=\height}}
-
-\definefileinsertion{yy}{mps}#1#2#3#4#5#6#7#8#9%
+% \definefileinsertion{yy}{eps}%
+% {\PointsToBigPoints\@@DriverImageWidth \width
+% \PointsToBigPoints\@@DriverImageHeight\height
+% \special
+% {psfile=\@@DriverImageFile\space
+% %hscale=100\space
+% %vscale=100\space
+% hoffset=\width\space
+% voffset=\height}}
+
+\definefileinsertion{tr}{eps}
+ {\bgroup
+ \PointsToWholeBigPoints\@@DriverImageWidth \width
+ \PointsToWholeBigPoints\@@DriverImageHeight\height
+ \special
+ {PSfile="\@@DriverImageFile"\space
+ llx=\EPSllx\space
+ lly=\EPSlly\space
+ urx=\EPSurx\space
+ ury=\EPSury\space
+ \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi
+ \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}%
+ \egroup}
+
+\definefileinsertion{yy}{mps}
{\hbox
- {\includeMPfonts{#1}%
- \convertMPcolors{#1}%
- \dofileinsertion{yy}{eps}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}
+ {\includeMPfonts \@@DriverImageFile
+ \convertMPcolors\@@DriverImageFile
+ \dofileinsertion{yy}{eps}}}
-\definefileinsertion{yy}{tif}#1#2#3#4#5#6#7#8#9%
- {\special{insertimage: #1 #7 #8}}
+\definefileinsertion{yy}{tif}
+ {\special{insertimage:
+ \@@DriverImageFile \space
+ \@@DriverImageWidth\space
+ \@@DriverImageHeight}}
-\definespecial\doinsertfile#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \dodoinsertfile{yy}{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}%
- \egroup}
+\definespecial\doinsertfile
+ {\dofileinsertion{yy}\@@DriverImageType}
-\def\MPprologues{2}
+\def\MPprologues{1}
\def\MPOSTdriver{dvipsone}
\stopspecials
diff --git a/Master/texmf-dist/tex/context/base/supp-box.tex b/Master/texmf-dist/tex/context/base/supp-box.tex
index 76c71c1994d..e4f4922c782 100644
--- a/Master/texmf-dist/tex/context/base/supp-box.tex
+++ b/Master/texmf-dist/tex/context/base/supp-box.tex
@@ -263,16 +263,13 @@
{\begingroup % why no \bgroup
\dowithnextbox
{\setbox\scratchbox\null
- \ht\scratchbox\ht#1\dp\scratchbox\dp#2\wd\scratchbox\wd#3%
+ \ht\scratchbox\ht#1%
+ \dp\scratchbox\dp#2%
+ \wd\scratchbox\wd#3%
\box\scratchbox
\endgroup}
\normalhbox}
-% used in table
-%
-% \let\ifv@\undefined \let\v@true\undefined \let\v@false\undefined
-% \let\ifh@\undefined \let\h@true\undefined \let\h@false\undefined
-
\let\finph@nt\undefined
%D We also define plain's \type {\mathstrut}.
@@ -473,31 +470,13 @@
%D \doiftext {data} {then branch}
%D \stoptyping
-%\def\doiftextelse#1#2#3%
-% {\bgroup
-% \setbox0=\normalhbox{#1}%
-% \ifdim\wd0>\zeropoint
-% \egroup#2%
-% \else
-% \egroup#3%
-% \fi}
-
-% \def\doiftextelse#1%
-% {\bgroup
-% \setbox0\normalhbox{#1}%
-% \ifdim\wd0>\zeropoint
-% \egroup\@EA\firstoftwoarguments
-% \else
-% \egroup\@EA\secondoftwoarguments
-% \fi}
-
\def\doiftextelse#1%
{\bgroup
- \setbox0\normalhbox{\ignorespaces#1\removeunwantedspaces}%
- \ifdim\wd0>\zeropoint
- \egroup\@EA\firstoftwoarguments
- \else
+ \setbox\scratchbox\normalhbox{\ignorespaces#1\removeunwantedspaces}%
+ \ifzeropt\wd\scratchbox
\egroup\@EA\secondoftwoarguments
+ \else
+ \egroup\@EA\firstoftwoarguments
\fi}
\def\doiftext#1#2%
@@ -541,7 +520,7 @@
%D is needed because \type{\afterassignment} is executed inside
%D the box.
-\newbox\nextbox
+\ifx\nextbox\undefined \newbox\nextbox \fi
\long\def\dowithnextbox#1%
{\long\def\dodowithnextbox{#1}%
@@ -813,8 +792,11 @@
\newbox\tmpshapebox
+\newif\ifreshapingfailed % may save redundant runs
+
\def\doreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
- {\ifzeropt\ht\oldshapebox % \ifdim\ht\oldshapebox=\zeropoint
+ {\global\reshapingfailedfalse
+ \ifzeropt\ht\oldshapebox % \ifdim\ht\oldshapebox=\zeropoint
\setbox\newshapebox\normalvbox{}%
\else
\setbox\newshapebox\normalvbox
@@ -825,6 +807,20 @@
\setbox\newshapebox\box\tmpshapebox
\fi}
+\ifx\originalshapebox\undefined \let\originalshapebox\oldshapebox \fi
+
+\beginTEX
+
+\def\insertshapesignal
+ {\normalhbox to \shapesignal{\strut\hss}% plus \strut
+ \prevdepth\strutdp} % never \nointerlineskip
+
+% \def\restoreshapebox
+% {\global\setbox\tmpshapebox\copy\originalshapebox} % \oldshapebox
+
+\def\restoreshapebox % compensates for the signal
+ {\global\setbox\tmpshapebox\vbox{\vskip-\lineheight\unvcopy\oldshapebox}}
+
\def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
{\ifzeropt\lastskip % \ifdim\lastskip=\zeropoint\relax
\ifzeropt\lastkern % \ifdim\lastkern=\zeropoint\relax
@@ -856,27 +852,79 @@
\unskip
\fi
\ifnum\shapecounter>100 % can be less
- \message{<<forced exit from shapebox>>}%
- \global\setbox\tmpshapebox\copy\oldshapebox
+ \global\reshapingfailedtrue
+ \message{!!forced exit from shapebox!!}%
+ \restoreshapebox
\exitloop
\else
\advance\shapecounter \plusone
\fi}
+\endTEX
+
+% Now that the lastnode bugfixes are wide spread we can use:
+
+\beginETEX \lastnodetype
+
+\def\insertshapesignal
+ {\normalhbox to \shapesignal{\strut\hss}% plus \strut
+ \prevdepth\strutdp} % never \nointerlineskip
+
+% \def\restoreshapebox
+% {\global\setbox\tmpshapebox\copy\originalshapebox} % \oldshapebox
+
+\def\restoreshapebox % compensates for the signal
+ {\global\setbox\tmpshapebox\vbox{\vskip-\lineheight\unvcopy\oldshapebox}}
+
+\def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
+ {\ifnum\lastnodetype=\@@gluenode
+ \shapeskip\lastskip
+ \global\setbox\tmpshapebox\normalvbox{#4\unvbox\tmpshapebox}%
+ \unskip
+ \else\ifnum\lastnodetype=\@@kernnode
+ \shapekern\lastkern
+ \global\setbox\tmpshapebox\normalvbox{#3\unvbox\tmpshapebox}%
+ \unkern
+ \else\ifnum\lastnodetype=\@@penaltynode
+ \shapepenalty\lastpenalty
+ \global\setbox\tmpshapebox\normalvbox{#2\unvbox\tmpshapebox}%
+ \unpenalty
+ \else\ifnum\lastnodetype<\zeropoint
+ \exitloop
+ \else
+ \setbox\shapebox\lastbox
+ \ifvoid\shapebox
+ \else\ifdim\wd\shapebox=\shapesignal\relax
+ \exitloop
+ \else
+ \shapecounter\zerocount
+ \global\setbox\tmpshapebox\normalvbox{#1\unvbox\tmpshapebox}%
+ \fi\fi
+ \fi\fi\fi\fi
+ \ifnum\shapecounter>100 % can be less
+ \global\reshapingfailedtrue
+ \message{!!forced exit from shapebox \the\lastnodetype !!}%
+ \restoreshapebox
+ \exitloop
+ \else
+ \advance\shapecounter \plusone
+ \fi}
+
+\endETEX
+
\def\beginofshapebox
{\setbox\oldshapebox\normalvbox
\bgroup
\reshapingboxtrue
\the\everyshapebox
- \normalhbox to \shapesignal{\strut\hss}% plus \strut
- \prevdepth\strutdp} % never \nointerlineskip
+ \insertshapesignal}
\def\endofshapebox
{\endgraf
\egroup}
-\let\beginshapebox=\beginofshapebox
-\let\endshapebox =\endofshapebox
+\let\beginshapebox\beginofshapebox
+\let\endshapebox \endofshapebox
\def\flushshapebox
{\bgroup
@@ -930,8 +978,8 @@
% \omlijnd[offset=0pt,hoogte=8mm,uitlijnen={rechts,laho}]{\bfa test}
\def\innerflushshapebox
- {\ifzeropt\ht\newshapebox \else % \ifdim\ht\newshapebox=\zeropoint\relax \else
- \unvcopy\newshapebox\relax
+ {\ifzeropt\ht\newshapebox \else
+ \unvcopy\newshapebox\relax % unvcopy ! else spacing problem
% \kern-\dp\newshapebox\relax
\fi}
@@ -1077,6 +1125,73 @@
%D \stoptyping
%D \macros
+%D {processtokens}
+%D
+%D We fully agree with (most) typographers that inter||letter
+%D spacing is only permitted in fancy titles, we provide a
+%D macro that can be used to do so. Because this is
+%D (definitely and fortunately) no feature of \TEX, we have to
+%D step through the token list ourselves.
+%D
+%D \starttyping
+%D \processtokens {before} {between} {after} {space} {tokens}
+%D \stoptyping
+%D
+%D An example of a call is:
+%D
+%D \startbuffer
+%D \processtokens {[} {+} {]} {\space} {hello world}
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D This results in:
+%D
+%D \getbuffer
+%D
+%D The list of tokens may contain spaces, while \type{\\},
+%D \type{{}} and \type{\ } are handled as space too.
+
+\def\dodoprocesstokens
+ {\ifx\nextprocessedtoken\lastcharacter
+ \after
+ \let\nextprocessedtoken\relax
+ \else\ifx\nextprocessedtoken\bgroup
+ \def\nextprocessedtoken
+ {\dowithnextbox
+ {\before{\copy\nextbox}% \before can use nextbox several times
+ \let\before\between
+ \doprocesstokens}
+ \hbox\bgroup}%
+ \else
+ \expandafter\if\space\nextprocessedtoken
+ \after\white
+ \let\before\savedbefore
+ \else
+ \before\nextprocessedtoken
+ \let\before\between
+ \fi
+ \let\nextprocessedtoken\doprocesstokens
+ \fi\fi
+ \nextprocessedtoken}
+
+\def\doprocesstokens% the space after = is essential
+ {\afterassignment\dodoprocesstokens\let\nextprocessedtoken= }
+
+\def\processtokens#1#2#3#4#5%
+ {\begingroup
+ \def\lastcharacter{\lastcharacter}%
+ \def\space{ }%
+ \let\\=\space
+ \def\before {#1}%
+ \def\between{#2}%
+ \def\after {#3}%
+ \def\white {#4}%
+ \let\savedbefore\before
+ \doprocesstokens#5\lastcharacter
+ \endgroup}
+
+%D \macros
%D {doboundtext}
%D
%D Sometimes there is not enough room to show the complete
@@ -1153,7 +1268,8 @@
%D When no width is given, the whole text comes available. The
%D sentinel is optional. This is about the third version.
-\ifx\fakecompoundhyphen\undefined \let\fakecompoundhyphen\relax \fi
+\ifx\fakecompoundhyphen\undefined \let\fakecompoundhyphen\relax \fi
+\ifx\veryraggedright \undefined \def\veryraggedright{\raggedright} \fi
%D The simple alternative is as follows:
%D
@@ -1712,7 +1828,7 @@
%D De eerste switch bepaald het uitlijnen, de tweede rekt de
%D individuele kolommen op naar \type{\vsize}.
-\def\setrigidcolumnhsize#1#2#3%
+\def\setrigidcolumnhsize#1#2#3% todo: \dimexpr
{\xdef\savedrigidhsize{\the\hsize}%
\hsize#1\relax
\global\chardef\rigidcolumns#3\relax
@@ -2291,16 +2407,16 @@
{\bgroup
\sizeofbox\zeropoint
\scratchdimen\zeropoint
- \def\docommando
+ \def\docommand
{\advance\sizeofbox\scratchdimen
- \futurelet\next\dodocommando}%
- \def\dodocommando
+ \futurelet\next\dodocommand}%
+ \def\dodocommand
{\ifx\next\bgroup
\expanded{\egroup#1 to \the\sizeofbox}%
\else
- \@EA\afterassignment\@EA\docommando\@EA\scratchdimen
+ \@EA\afterassignment\@EA\docommand\@EA\scratchdimen
\fi}%
- \docommando}
+ \docommand}
%D Some new, still undocumented features:
@@ -2630,11 +2746,11 @@
\@EA\newbox\csname\@@stackbox#1\endcsname
\else
\global\setbox\csname\@@stackbox#1\endcsname\normalvbox{}%
- \def\docommando##1{\global\letbeundefined{\@@stacktag#1:##1}}%
- \processcommacommand[\getvalue{\@@stacklst#1}]\docommando
+ \def\docommand##1{\global\letbeundefined{\@@stacktag#1:##1}}%
+ \processcommacommand[\getvalue{\@@stacklst#1}]\docommand
\fi
- \setgvalue{\@@stacklst#1}{}%
- \setgvalue{\@@stackmax#1}{0}}
+ \global\letvalue{\@@stacklst#1}\empty
+ \global\letvalue{\@@stackmax#1}\!!zeropoint}
\def\savebox#1#2% stack name
{\dowithnextbox
@@ -2686,14 +2802,20 @@
\global\setbox\csname\@@stackbox:#1:#2\endcsname\normalvbox}
\def\initializeboxstack#1%
- {\def\docommando##1{\setstackbox{#1}{##1}{}}%
+ {\def\docommand##1{\setstackbox{#1}{##1}{}}%
\ifcsname\@@stacklst#1\endcsname
- \processcommacommand[\getvalue{\@@stacklst#1}]\docommando
+ \processcommacommand[\getvalue{\@@stacklst#1}]\docommand
\fi
- \setgvalue{\@@stacklst#1}{}}
+ \global\letvalue{\@@stacklst#1}\empty}
\def\savebox#1#2% stack name
- {\setxvalue{\@@stacklst#1}{\getvalue{\@@stacklst#1},#2}%
+ {% beware, \setxvalue defines the cs beforehand so we cannot use the
+ % test inside the { }
+ \ifcsname\@@stacklst#1\endcsname
+ \setxvalue{\@@stacklst#1}{\csname\@@stacklst#1\endcsname,#2}%
+ \else
+ \setxvalue{\@@stacklst#1}{#2}%
+ \fi
\setstackbox{#1}{#2}}
\def\foundbox#1#2%
@@ -2960,3 +3082,14 @@
\egroup}}
\protect \endinput
+
+% a bit of test code:
+
+\hbox \bgroup
+ \ruledvbox {\hbox{\strut gans}}
+ \ruledvbox to \lineheight {\hbox{\strut gans}}
+ \ruledvbox to \lineheight {\hbox {gans}}
+ \ruledvbox to \strutheight{\hbox {gans}}
+ \ruledvbox to \strutheight{\hbox{\strut gans}}
+ \ruledvbox to \strutheight{\vss\hbox{gans}}
+\egroup
diff --git a/Master/texmf-dist/tex/context/base/supp-eps.tex b/Master/texmf-dist/tex/context/base/supp-eps.tex
index b28a55b7d19..0a3cfa2b6dd 100644
--- a/Master/texmf-dist/tex/context/base/supp-eps.tex
+++ b/Master/texmf-dist/tex/context/base/supp-eps.tex
@@ -89,13 +89,12 @@
\scratchcounter\zerocount
\doprocessfile\scratchread{#1}\doprocessEPSline
\egroup
+ % Using \EPSllx bp instead of \dimen0=1bp and \EPSllx\dimen0 is more accurate (.005pt).
\ifnum\EPSfound>\zerocount
- #2=\EPSllx bp% Using \EPSllx bp instead of
- #4=\EPSurx bp% \dimen0=1bp and \EPSllx\dimen0
- #3=\EPSlly bp% is more accurate (.005pt).
- #5=\EPSury bp%
- \scratchdimen\EPSllx bp\advance#4 -\scratchdimen
- \scratchdimen\EPSlly bp\advance#5 -\scratchdimen
+ #2\dimexpr\EPSllx\onebasepoint \relax
+ #3\dimexpr\EPSlly\onebasepoint \relax
+ #4\dimexpr\EPSurx\onebasepoint-#2\relax
+ #5\dimexpr\EPSury\onebasepoint-#3\relax
\else
#2\zeropoint
#3\zeropoint
@@ -186,40 +185,10 @@
\gdef\EPSury{#4}%
\fi}
-% \def\getEPScreatorspec
-% {\edef\EPSspecialstring{\EPSspecialcontent. . . .}%
-% \expandafter\dogetEPScreatorspec\EPSspecialstring\end}
-
-% \def\dogetEPScreatorspec#1#2 . . #3\end
-% {\edef\EPSspecialstring{#1}%
-% \ifx\EPSspecialstring\empty
-% \dogetEPScreatorspec#2 . . #3\end
-% \else\ifx\EPSspecialstring\space
-% \dogetEPScreatorspec#2 . . #3\end
-% \else
-% \edef\EPScreatorstring{#1#2}%
-% \global\chardef\EPScreator
-% \ifx\EPScreatorstring\EPSmetaposttag\plusone\else\zerocount\fi\relax
-% \fi\fi}
-
-% adapted to new metapost output
-
\def\getEPScreatorspec
{\edef\EPSspecialstring{\EPSspecialcontent\space . .}%
\expandafter\dogetEPScreatorspec\EPSspecialstring\end}
-% \def\dogetEPScreatorspec#1#2 #3\end
-% {\edef\EPSspecialstring{#1}%
-% \ifx\EPSspecialstring\empty
-% \dogetEPScreatorspec#2 #3\end
-% \else\ifx\EPSspecialstring\space
-% \dogetEPScreatorspec#2 #3\end
-% \else
-% \edef\EPScreatorstring{#1#2}%
-% \global\chardef\EPScreator
-% \ifx\EPScreatorstring\EPSmetaposttag\plusone\else\zerocount\fi\relax
-% \fi\fi}
-
\def\dogetEPScreatorspec#1#2 #3\end
{\edef\EPScreatorstring{#1#2}%
\global\chardef\EPScreator\ifx\EPScreatorstring\EPSmetaposttag\plusone\else\zerocount\fi\relax}
diff --git a/Master/texmf-dist/tex/context/base/supp-fil.mkii b/Master/texmf-dist/tex/context/base/supp-fil.mkii
new file mode 100644
index 00000000000..56810f8269a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/supp-fil.mkii
@@ -0,0 +1,97 @@
+%D \module
+%D [ file=supp-fil,
+%D version=1995.10.10,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=Files,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details
+
+\unprotect
+
+%D For the moment, we limit sanitizing to taking care of
+%D active \type {/}.
+
+\bgroup % todo: _ cleanup
+
+\catcode`\/=\@@active
+\catcode`\:=\@@active
+\catcode`\~=\@@active
+\catcode`\_=\@@active
+
+\gdef\sanitizefilename#1\to#2%
+ {\bgroup
+ \edef/{\string/}%
+ \edef:{\string:}%
+ \edef~{\string~}%
+ \edef_{\string_}%
+ \retainlccodes
+ \lccode`\\=`\/
+ \lowercase{\expanded{\xdef\noexpand\sanitizedfilename{#1}}}%
+ \egroup
+ % maybe \convertcommand\sanitizedfilename\to#2%
+ \let#2\sanitizedfilename}
+
+\egroup
+
+\def\checkfilename#1%
+ {\doifinstringelse{@@/}{@@#1}% unix: /full/path
+ {\chardef\kindoffile\plusone}
+ {\doifinstringelse{:/}{#1}% windows: e:/full/path or http://
+ {\chardef\kindoffile\plusone}
+ {\chardef\kindoffile\zerocount}}}
+
+% \def\splitfilename#1%
+% {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
+% \greedysplitstring\splitofffull\at/\to\splitoffpath\and\splitoffbase
+% \ifx\splitoffbase\empty
+% \let\splitoffpath\empty
+% \let\splitoffbase\splitofffull
+% \fi
+% \greedysplitstring\splitoffbase\at.\to\splitoffname\and\splitofftype
+% \chardef\splitoffkind % can be used to test if pathpart was empty
+% \ifx\splitoffpath\empty \zerocount \else
+% \ifx\splitoffpath\splitoffroot \plusone \else
+% \plustwo \fi\fi
+% \ifx\splitoffname\empty\let\splitoffname\splitoffbase\fi
+% \ifx\splitoffpath\empty\let\splitoffpath\splitoffroot\fi}
+%
+% better, since it also handles leading /'s
+%
+% \splitfilename{oeps/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
+% \splitfilename{/oeps/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
+% \splitfilename{/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
+
+\def\splitfilename#1%
+ {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
+ \greedysplitstring\splitofffull\at/\to\splitoffpath\and\splitoffbase
+ \ifx\splitoffpath\splitofffull
+ \let\splitoffpath\empty
+ \fi
+ \ifx\splitoffbase\empty
+ \let\splitoffpath\empty
+ \let\splitoffbase\splitofffull
+ \fi
+ \greedysplitstring\splitoffbase\at.\to\splitoffname\and\splitofftype
+ \chardef\splitoffkind % can be used to test if pathpart was empty
+ \ifx\splitoffpath\empty \zerocount \else
+ \ifx\splitoffpath\splitoffroot \plusone \else
+ \plustwo \fi\fi
+ \ifx\splitoffname\empty\let\splitoffname\splitoffbase\fi
+ \ifx\splitoffpath\empty\let\splitoffpath\splitoffroot\fi}
+
+\def\splitfiletype#1%
+ {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
+ \let\splitoffpath\empty
+ \greedysplitstring\splitofffull\at.\to\splitoffname\and\splitofftype}
+
+\def\doifparentfileelse#1%
+ {\doifsamestringelse{#1}{\jobname }\firstoftwoarguments
+ {\doifsamestringelse{#1}{\jobname.\c!tex}\firstoftwoarguments
+ {\doifsamestringelse{#1}{\outputfilename}\firstoftwoarguments\secondoftwoarguments}}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-fil.tex b/Master/texmf-dist/tex/context/base/supp-fil.tex
index da4b595b844..b41858396d2 100644
--- a/Master/texmf-dist/tex/context/base/supp-fil.tex
+++ b/Master/texmf-dist/tex/context/base/supp-fil.tex
@@ -193,41 +193,13 @@
{\edef#3{#2}}
{\edef#3{#1\f!pathseparator#2}}}
-%D For the moment, we limit sanitizing to taking care of
-%D active \type {/}.
-
-\bgroup % todo: _ cleanup
-
-\catcode`\/=\@@active
-\catcode`\:=\@@active
-\catcode`\~=\@@active
-\catcode`\_=\@@active
-
-\gdef\sanitizefilename#1\to#2%
- {\bgroup
- \edef/{\string/}%
- \edef:{\string:}%
- \edef~{\string~}%
- \edef_{\string_}%
- \retainlccodes
- \lccode`\\=`\/
- \lowercase{\expanded{\xdef\noexpand\sanitizedfilename{#1}}}%
- \egroup
- % maybe \convertcommand\sanitizedfilename\to#2%
- \let#2\sanitizedfilename}
-
-\egroup
+\def\sanitizefilename#1\to#2{\def#2{#1}} % overloaded in mk
%D NEW:
\chardef\kindoffile=0 % 0=normal 1=full path spec (or http)
-\def\checkfilename#1%
- {\doifinstringelse{@@/}{@@#1}% unix: /full/path
- {\chardef\kindoffile\plusone}
- {\doifinstringelse{:/}{#1}% windows: e:/full/path or http://
- {\chardef\kindoffile\plusone}
- {\chardef\kindoffile\zerocount}}}
+\def\checkfilename{\chardef\kindoffile\zerocount} % overloaded in mk
%D \macros
%D {input, normalinput}
@@ -374,9 +346,33 @@
\normalinput\readfilename\relax
\the\everyafterreadfile}
-\unexpanded\def\readfile% #1%
- {\let\readlevel\maxreadlevel
- \doreadfile\empty} % {#1}
+% too less:
+%
+% \unexpanded\def\readfile% #1%
+% {\let\readlevel\maxreadlevel
+% \doreadfile\empty} % {#1}
+%
+% too much:
+%
+% \unexpanded\def\readfile#1#2#3%
+% {\readlocfile{#1}{#2}
+% {\readjobfile{#1}{#2}
+% {\readsysfile{#1}{#2}{#3}}}}
+%
+% just ok:
+
+\unexpanded\def\readfile#1#2#3%
+ {\readlocfile{#1}{#2}{\readsysfile{#1}{#2}{#3}}}
+
+\def\readtexfile#1#2#3%
+ {\pushcatcodetable \catcodetable \ctxcatcodes
+ \readfile{#1}{#2}{#3}%
+ \popcatcodetable}
+
+\def\readxmlfile#1#2#3%
+ {\pushcatcodetable \catcodetable \xmlcatcodes
+ \readfile{#1}{#2}{#3}%
+ \popcatcodetable}
\unexpanded\def\ReadFile#1%
{\readfile{#1}\donothing\donothing}
@@ -529,8 +525,11 @@
%D
%D This command obeys the standard method for locating files.
-\long\def\doonlyonce#1#2%
- {\doifundefined{@@@#1@@@}{\letgvalue{@@@#1@@@}\empty#2}}
+\long\def\doonlyonce#1%
+ {\doifundefinedelse{@@@#1@@@}
+ {\letgvalue{@@@#1@@@}\empty
+ \firstofoneargument}
+ {\gobbleoneargument}}
\def\doinputonce#1%
{\doonlyonce{#1}{\doiffileelse{#1}{\normalinput#1\relax}\donothing}}
@@ -559,17 +558,7 @@
\ifx\outputfilename\undefined \def\outputfilename{\jobname} \fi
-% \def\doifparentfileelse#1#2#3%
-% {\doifsamestringelse{#1}{\jobname }{#2}
-% {\doifsamestringelse{#1}{\jobname.\c!tex}{#2}
-% {\doifsamestringelse{#1}{\outputfilename}{#2}{#3}}}}
-%
-% todo: split name
-
-\def\doifparentfileelse#1%
- {\doifsamestringelse{#1}{\jobname }\firstoftwoarguments
- {\doifsamestringelse{#1}{\jobname.\c!tex}\firstoftwoarguments
- {\doifsamestringelse{#1}{\outputfilename}\firstoftwoarguments\secondoftwoarguments}}}
+\let\doifparentfileelse\gobblethreearguments % defined in mk
\def\normalless {<} % geen \let !
\def\normalmore {>} % geen \let !
@@ -593,37 +582,53 @@
%D We need to redo this: catcode sets and such
+\newtoks \everystartreadingfile
+\newtoks \everystopreadingfile
+
+% \def\startreadingfile% beter een every en \setnormalcatcodes
+% {\doglobal\increment\readingfilelevel
+% \the\everystartreadingfile
+% \setxvalue{\string\readingfilelevel::\readingfilelevel}%
+% {\catcode`/ =\the\catcode`/%
+% %\catcode`_ =\the\catcode`_% math ! ! !
+% \catcode`" =\the\catcode`"%
+% \catcode`: =\the\catcode`:%
+% \catcode`; =\the\catcode`;%
+% \catcode`< =\the\catcode`<%
+% \catcode`> =\the\catcode`>%
+% \catcode`\noexpand\\=\the\catcode`\\%
+% \catcode`\noexpand\{=\the\catcode`\{%
+% \catcode`\noexpand\}=\the\catcode`\}%
+% \catcode`\noexpand\%=\the\catcode`\%}%
+% \catcode`/ =\@@other
+% %\catcode`_ =\@@other
+% \catcode`" =\@@other
+% \catcode`: =\@@other
+% \catcode`; =\@@other
+% \catcode`< =\@@other
+% \catcode`> =\@@other
+% \catcode`\\=\@@escape
+% \catcode`\{=\@@begingroup
+% \catcode`\}=\@@endgroup
+% \catcode`\%=\@@comment
+% \pushendofline
+% \restoreendofline}
+
+% \def\stopreadingfile
+% {\popendofline
+% \getvalue{\string\readingfilelevel::\readingfilelevel}%
+% \the\everystopreadingfile
+% \doglobal\decrement\readingfilelevel}
+
\def\startreadingfile% beter een every en \setnormalcatcodes
{\doglobal\increment\readingfilelevel
- \setxvalue{\string\readingfilelevel::\readingfilelevel}%
- {\catcode`/ =\the\catcode`/%
- %\catcode`_ =\the\catcode`_% math ! ! !
- \catcode`" =\the\catcode`"%
- \catcode`: =\the\catcode`:%
- \catcode`; =\the\catcode`;%
- \catcode`< =\the\catcode`<%
- \catcode`> =\the\catcode`>%
- \catcode`\noexpand\\=\the\catcode`\\%
- \catcode`\noexpand\{=\the\catcode`\{%
- \catcode`\noexpand\}=\the\catcode`\}%
- \catcode`\noexpand\%=\the\catcode`\%}%
- \catcode`/ =\@@other
- %\catcode`_ =\@@other
- \catcode`" =\@@other
- \catcode`: =\@@other
- \catcode`; =\@@other
- \catcode`< =\@@other
- \catcode`> =\@@other
- \catcode`\\=\@@escape
- \catcode`\{=\@@begingroup
- \catcode`\}=\@@endgroup
- \catcode`\%=\@@comment
- \pushendofline
- \restoreendofline}
+ \the\everystartreadingfile
+ \beginrestorecatcodes
+ \setcatcodetable\prtcatcodes}
\def\stopreadingfile
- {\popendofline
- \getvalue{\string\readingfilelevel::\readingfilelevel}%
+ {\endrestorecatcodes
+ \the\everystopreadingfile
\doglobal\decrement\readingfilelevel}
\let\normalstartreadingfile\startreadingfile
@@ -658,49 +663,14 @@
\def\splitoffroot{.} \chardef\splitoffkind\zerocount
-% \def\splitfilename#1%
-% {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
-% \greedysplitstring\splitofffull\at/\to\splitoffpath\and\splitoffbase
-% \ifx\splitoffbase\empty
-% \let\splitoffpath\empty
-% \let\splitoffbase\splitofffull
-% \fi
-% \greedysplitstring\splitoffbase\at.\to\splitoffname\and\splitofftype
-% \chardef\splitoffkind % can be used to test if pathpart was empty
-% \ifx\splitoffpath\empty \zerocount \else
-% \ifx\splitoffpath\splitoffroot \plusone \else
-% \plustwo \fi\fi
-% \ifx\splitoffname\empty\let\splitoffname\splitoffbase\fi
-% \ifx\splitoffpath\empty\let\splitoffpath\splitoffroot\fi}
-%
-% better, since it also handles leading /'s
-%
-% \splitfilename{oeps/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
-% \splitfilename{/oeps/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
-% \splitfilename{/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
-
-\def\splitfilename#1%
- {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
- \greedysplitstring\splitofffull\at/\to\splitoffpath\and\splitoffbase
- \ifx\splitoffpath\splitofffull
- \let\splitoffpath\empty
- \fi
- \ifx\splitoffbase\empty
- \let\splitoffpath\empty
- \let\splitoffbase\splitofffull
- \fi
- \greedysplitstring\splitoffbase\at.\to\splitoffname\and\splitofftype
- \chardef\splitoffkind % can be used to test if pathpart was empty
- \ifx\splitoffpath\empty \zerocount \else
- \ifx\splitoffpath\splitoffroot \plusone \else
- \plustwo \fi\fi
- \ifx\splitoffname\empty\let\splitoffname\splitoffbase\fi
- \ifx\splitoffpath\empty\let\splitoffpath\splitoffroot\fi}
-
-\def\splitfiletype#1%
- {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
- \let\splitoffpath\empty
- \greedysplitstring\splitofffull\at.\to\splitoffname\and\splitofftype}
+\let\splitofffull\empty
+\let\splitoffpath\empty
+\let\splitoffbase\empty
+\let\splitoffname\empty
+\let\splitofftype\empty
+
+\let\splitfilename\gobbleoneargument % defined in mk
+\let\splitfiletype\gobbleoneargument % defined in mk
%% % gebruikt voor normale (!) files, will change to proper
%% % installer maybe combined with verb module push/popper
@@ -753,4 +723,6 @@
%% \catcode`<=\@@other
%% \catcode`>=\@@other}
+\loadmarkfile{supp-fil}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-fun.tex b/Master/texmf-dist/tex/context/base/supp-fun.tex
index 812323826ff..41cd8919917 100644
--- a/Master/texmf-dist/tex/context/base/supp-fun.tex
+++ b/Master/texmf-dist/tex/context/base/supp-fun.tex
@@ -635,12 +635,12 @@
\unexpanded\def\FirstNCharacters#1#2% \FirstNCharacters{3}{fr{\"o}beln}
{\bgroup
\scratchcounter\zerocount
- \def\docommando##1%
+ \def\docommand##1%
{\ifnum\scratchcounter=#1\else
##1\relax % catches ##1 = \"e and alike
\advance\scratchcounter\plusone
\fi}
- \handletokens#2\with\docommando
+ \handletokens#2\with\docommand
\egroup}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/supp-ini.tex b/Master/texmf-dist/tex/context/base/supp-ini.tex
index 2dc88d246ac..afa8b12d928 100644
--- a/Master/texmf-dist/tex/context/base/supp-ini.tex
+++ b/Master/texmf-dist/tex/context/base/supp-ini.tex
@@ -15,45 +15,4 @@
\unprotect
-%D If you want control, you can have it:
-
-\newif\ifeightbitcharacters \eightbitcharacterstrue
-
-%D We want to have access to the raw alternatives of the
-%D special characters. We use a \type {\xdef} instead of
-%D \type {\let} because we need an expandable token in a
-%D \type {\write}.
-
-\bgroup
-
-\catcode`B=\@@begingroup
-\catcode`E=\@@endgroup
-\catcode`.=\@@escape
-
-.catcode `.{ 12 .xdef .letteropenbrace B.string{E
-.catcode `.} 12 .xdef .letterclosebrace B.string}E
-.catcode `.& 12 .xdef .letterampersand B.string&E
-.catcode `.< 12 .xdef .letterless B.string<E
-.catcode `.> 12 .xdef .lettermore B.string>E
-.catcode `.# 12 .xdef .letterhash B.string#E
-.catcode `." 12 .xdef .letterdoublequote B.string"E
-.catcode `.' 12 .xdef .lettersinglequote B.string'E
-.catcode `.$ 12 .xdef .letterdollar B.string$E
-.catcode `.% 12 .xdef .letterpercent B.string%E
-.catcode `.^ 12 .xdef .letterhat B.string^E
-.catcode `._ 12 .xdef .letterunderscore B.string_E
-.catcode `.| 12 .xdef .letterbar B.string|E
-.catcode `.~ 12 .xdef .lettertilde B.string~E
-.catcode `.\ 12 .xdef .letterbackslash B.string\E
-.catcode `./ 12 .xdef .letterslash B.string/E
-.catcode `.? 12 .xdef .letterquestionmark B.string?E
-.catcode `.! 12 .xdef .letterexclamationmark B.string!E
-.catcode `.@ 12 .xdef .letterat B.string@E
-
- .global .let .letterescape .letterbackslash
- .global .let .letterbgroup .letteropenbrace
- .global .let .letteregroup .letterclosebrace
-
-.egroup
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-lan.tex b/Master/texmf-dist/tex/context/base/supp-lan.tex
index 83ab14df0d2..0daf134a631 100644
--- a/Master/texmf-dist/tex/context/base/supp-lan.tex
+++ b/Master/texmf-dist/tex/context/base/supp-lan.tex
@@ -11,12 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D This module needs a drastic update: can be made simplier
-%D and faster; code can move to core module.
-
-%D Also, commenting the previous versions code will clear up
-%D some memory.
-
%D \gdef\starttest
%D {\blank
%D \noindent
@@ -328,12 +322,12 @@
\endETEX
-\def\dohandlemathmodebar#1%
+\def\domathmodediscretionary#1%
{\getvalue{\strippedcsname\mathmodediscretionary\string#1}}
\def\discretionarycommand
{\relax\ifmmode
- \expandafter\dohandlemathmodebar
+ \expandafter\domathmodediscretionary
\else
\expandafter\dotextmodediscretionary
\fi}
@@ -444,8 +438,8 @@
%D normally there should be no problems with things like:
%D
%D \starttyping
-%D \installdiscretionary || +
-%D \installdiscretionary ++ =
+%D \installdiscretionaries || +
+%D \installdiscretionaries ++ =
%D \stoptyping
%D
%D The real work is done by the next set of macros. We have
@@ -558,7 +552,7 @@
%D \stoptyping
\def\currentspaceskip
- {\fontdimen2\font\!!plus\fontdimen3\font\!!minus\fontdimen4\font\relax}
+ {\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink\relax}
% \def\fakecompoundhyphen% wrong
% {\def|##1|{\compoundhyphen\nobreak\hskip-\currentspaceskip\allowbreak}}
@@ -711,8 +705,8 @@
\def\activedotextmodediscretionary#1%
{\bgroup
\let\nextnextnext\egroup
- \def\handlecompoundcharacter##1% new, needed for polish
- {\getvalue{\@nc@\string##1}}% where / is active
+% \def\handlecompoundcharacter##1% new, needed for polish
+% {\getvalue{\@nc@\string##1}}% where / is active
\def\next##1#1%
{\def\next{\activedododotextmodediscretionary#1{##1}}%
\futurelet\nextnext\next}%
@@ -1203,19 +1197,6 @@
\endETEX
%D \macros
-%D {nonbreakablespace}
-%D
-%D The following macro is taken from plain \TEX.
-
-\def\nonbreakablespace{\penalty\plustenthousand\ }
-
-\let~\nonbreakablespace
-
-% under testing:
-%
-% \unexpanded\def~{\nonbreakablespace}
-
-%D \macros
%D {midworddiscretionary}
%D
%D If needed, one can add a discretionary hyphen using \type
@@ -1270,83 +1251,6 @@
% Why not convert to ascii first? I will redo this one!
-% \unexpanded\gdef\hyphenatedurl#1% {}{} handles accents
-% {\bgroup
-% \obeyhyphens
-% \def\splitbefore##1%
-% {\setbox\scratchbox=\hbox{##1{}{}}%
-% \ifcase\urlsplitmode
-% \box\scratchbox
-% \or
-% \postwordbreak\box\scratchbox\prewordbreak
-% \or
-% \prewordbreak\discretionary{\box\scratchbox}{}{\box\scratchbox}\prewordbreak
-% \else
-% \postwordbreak\box\scratchbox\prewordbreak
-% \fi}%
-% \def\splitafter##1%
-% {\ifcase\urlsplitmode
-% ##1{}{}%
-% \or
-% \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
-% \or
-% \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
-% \else
-% \prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak
-% \fi}%
-% \def\flushurl%
-% {\savedurl\let\savedurl\empty}%
-% \def\\%
-% {\spliturl\#}%
-% \let\~=\lettertilde \let~=\~%
-% \let\/=\letterslash \let/=\/%
-% \let\savedurl\empty
-% \handletokens#1\with\scanurl
-% \egroup}
-%
-% Better (a mere copy with \dohyphens):
-
-% \bgroup \catcode`\~=\active \catcode`\/=\active
-%
-% \unexpanded\gdef\hyphenatedurl#1% {}{} handles accents
-% {\bgroup
-% \ifnum\hyphenpenalty<10000 \else
-% \def\discretionary##1##2##3{##1\allowbreak##2}%
-% \fi
-% \obeyhyphens
-% \def\splitbefore##1%
-% {\setbox\scratchbox=\hbox{##1{}{}}%
-% \ifcase\urlsplitmode
-% \box\scratchbox
-% \or
-% \postwordbreak\box\scratchbox\prewordbreak
-% \or
-% \prewordbreak\discretionary{\box\scratchbox}{}{\box\scratchbox}\prewordbreak
-% \else
-% \postwordbreak\box\scratchbox\prewordbreak
-% \fi}%
-% \def\splitafter##1%
-% {\ifcase\urlsplitmode
-% ##1{}{}%
-% \or
-% \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
-% \or
-% \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
-% \else
-% \prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak
-% \fi}%
-% \def\flushurl%
-% {\savedurl\let\savedurl\empty}%
-% \def\\%
-% {\spliturl\#}%
-% \let\~=\lettertilde\let~=\~%
-% \let\/=\letterslash\let/=\/%
-% \let\savedurl\empty
-% \handletokens#1\with\scanurl\savedurl
-% \egroup}
-%
-% \egroup
-
\bgroup \catcode`\~=\active \catcode`\/=\active
\unexpanded\gdef\hyphenatedurl#1% {}{} handles accents
@@ -1398,55 +1302,6 @@
%D \expandafter\handletokens\ascii\with\scanurl
%D \stoptyping
-% \def\scanurl#1%
-% {\ifx#1\~%
-% \flushurl\splitbefore\~%
-% \else\ifx#1\#%
-% \flushurl\splitbefore\#%
-% \else\ifx#1\&%
-% \flushurl\splitbefore\&%
-% \else\ifx#1\%%
-% \flushurl\splitbefore\%%
-% \else\ifx#1\_%
-% \flushurl\splitbefore\_%
-% \else\if\noexpand#1\relax
-% #1%
-% \else\ifnum\catcode`#1=8
-% \flushurl\splitbefore\_%
-% \else\ifnum\catcode`#1=6
-% \flushurl\splitbefore\#%
-% \else\ifnum\catcode`#1=4
-% \flushurl\splitbefore\&%
-% \else\if#1\lettertilde
-% \flushurl\splitbefore\~%
-% \else\if#1\letterpercent
-% \flushurl\splitbefore\%%
-% \else\if#1\letterunderscore
-% \flushurl\splitbefore\_%
-% \else\if#1\letterquestionmark
-% \flushurl\splitafter\letterquestionmark
-% \else\if#1\letterat
-% \flushurl\splitafter\letterat
-% \else\if#1\letterslash
-% \edef\savedurl{\savedurl\letterslash}%
-% \else\if#1+%
-% \flushurl\splitafter+%
-% \else\if#1:%
-% \flushurl\splitafter:%
-% \else\if#1.%
-% \flushurl\splitafter.%
-% \else\if#1(%
-% \flushurl\splitbefore(%
-% \else\if#1)%
-% \flushurl\splitafter)%
-% \else
-% \ifx\savedurl\empty\else
-% \splitbefore\savedurl
-% \let\savedurl\empty
-% \fi
-% #1%
-% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
\chardef\urlhyphenmethod=0
\def\scanurl#1%
@@ -1579,4 +1434,11 @@
\def\disablecompoundcharacters
{\let\handlecompoundcharacter\string}
+%D \macros
+%D {normalcompound}
+%D
+%D Handy in for instance XML:
+
+\ifx\normalcompound\undefined \let\normalcompound=| \fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-mat.tex b/Master/texmf-dist/tex/context/base/supp-mat.tex
index 5b2305f8b5f..f21ee6afae9 100644
--- a/Master/texmf-dist/tex/context/base/supp-mat.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mat.tex
@@ -12,7 +12,8 @@
%C details.
%D For practical reasons, I decided to move some math things to
-%D a support module. There is nothing spectacular here.
+%D a support module. There is nothing spectacular here. It may move
+%D back to math-ini.
\writestatus{loading}{Context Support Macros / Math}
@@ -79,6 +80,18 @@
\let\inlinemathematics \mathematics
\def\automathematics {\relax\ifhmode\@EA\inlinemathematics\else\@EA\displaymathematics\fi}
+% better, esp when used in bTABLE ... eTABLE
+
+\def\automathematics
+ {\relax
+ \ifhmode
+ \expandafter\inlinemathematics
+ \else\ifintable
+ \expandafter\expandafter\expandafter\inlinemathematics
+ \else
+ \expandafter\expandafter\expandafter\displaymathematics
+ \fi\fi}
+
%D \macros
%D {dimension, nodimension}
%D
diff --git a/Master/texmf-dist/tex/context/base/supp-mis.tex b/Master/texmf-dist/tex/context/base/supp-mis.tex
index d2105e34cf7..51205dc1ef4 100644
--- a/Master/texmf-dist/tex/context/base/supp-mis.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mis.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D I will clean up this module (a la supp-pdf.tex preamble).
+
%D Some support modules are more or less independant. This
%D module, which is not part of plain \CONTEXT, provides the
%D missing macros and declarations of registers.
@@ -20,23 +22,7 @@
%D Because \LATEX\ has no safe package loading mechanism, we
%D need to take care of possible interference.
-% \def\StartLatexHack
-% {\edef\StopLatexHack
-% {\catcode`\noexpand/=\the\catcode`/
-% \catcode`\noexpand-=\the\catcode`-
-% \catcode`\noexpand:=\the\catcode`:
-% \catcode`\noexpand;=\the\catcode`;
-% \catcode`\noexpand"=\the\catcode`"
-% \catcode`\noexpand<=\the\catcode`<
-% \catcode`\noexpand>=\the\catcode`>}%
-% \catcode`/=12 \catcode`-=12
-% \catcode`:=12 \catcode`;=12
-% \catcode`"=12 \catcode`<=12 \catcode`>=12 }
-
-%D Adapted conform request from morten.hoegholm@latex-project.org,
-%D i.e. untested by me; using strings makes Babel more happy.
-
-\def\StartLatexHack
+\def\StartLatexHack % replace this by the one in supp-pdf
{\edef\StopLatexHack
{\catcode\string`\noexpand/=\the\catcode\string`/
\catcode\string`\noexpand-=\the\catcode\string`-
@@ -189,20 +175,29 @@
\newdimen\scratchdimen % 21
\fi
-\ifnocontextobject \scratchcounter \do \newcount \scratchcounter \fi
-\ifnocontextobject \scratchtoks \do \newtoks \scratchtoks \fi
-\ifnocontextobject \scratchdimen \do \newdimen \scratchdimen \fi
-\ifnocontextobject \scratchskip \do \newskip \scratchskip \fi
-\ifnocontextobject \scratchmuskip \do \newmuskip \scratchmuskip \fi
-\ifnocontextobject \scratchbox \do \newbox \scratchbox \fi
-\ifnocontextobject \scratchread \do \newread \scratchread \fi
-\ifnocontextobject \scratchwrite \do \newwrite \scratchwrite \fi
+\def\stripnewabove#1%
+ {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}%
+
+\def\newabove\csname#1\endcsname#2% \dimen \name
+ {\csname#1\endcsname#2%
+ \ifnum\expandafter\stripnewabove\meaning#2>20\else
+ \newabove\csname#1\endcsname#2%
+ \fi}
+
+\ifnocontextobject \scratchcounter \do \newabove \csname newcount\endcsname \scratchcounter \fi
+\ifnocontextobject \scratchtoks \do \newabove \csname newtoks\endcsname \scratchtoks \fi
+\ifnocontextobject \scratchdimen \do \newabove \csname newdimen\endcsname \scratchdimen \fi
+\ifnocontextobject \scratchskip \do \newabove \csname newskip\endcsname \scratchskip \fi
+\ifnocontextobject \scratchmuskip \do \newabove \csname newmuskip\endcsname \scratchmuskip \fi
+\ifnocontextobject \scratchbox \do \csname newbox\endcsname \scratchbox \fi
+\ifnocontextobject \scratchread \do \csname newread\endcsname \scratchread \fi
+\ifnocontextobject \scratchwrite \do \csname newwrite\endcsname \scratchwrite \fi
%D Watch out, in the past we ran into troubles with \type {\onepoint}
%D (and others) mening something different in \LATEX\ then here. In
%D such situations clashes are bound to happen. For this reason the
%D assignments are no inside the test. We try to catch those situations
-%D but we cannot keep ahead of teh future.
+%D but we cannot keep ahead of the future.
\ifnocontextobject \zeropoint \do \newdimen \zeropoint \zeropoint = 0pt \fi % else problems with dimen12
\ifnocontextobject \onepoint \do \newdimen \onepoint \onepoint = 1pt \fi
@@ -660,7 +655,7 @@
\def\dodohandletokens
{\ifx\next\end \else
- \docommando{\next}%
+ \docommand{\next}%
\expandafter\dohandletokens
\fi}
@@ -668,7 +663,7 @@
{\afterassignment\dodohandletokens\let\next= }
\long\def\handletokens#1\with#2%
- {\let\docommando=#2%
+ {\let\docommand=#2%
\dohandletokens#1\end}
\fi
diff --git a/Master/texmf-dist/tex/context/base/supp-mpe.tex b/Master/texmf-dist/tex/context/base/supp-mpe.tex
index 04ee0a81376..60f517e8b2a 100644
--- a/Master/texmf-dist/tex/context/base/supp-mpe.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mpe.tex
@@ -38,7 +38,11 @@
%D \chardef\makeMPintoPDFobject\plusone
%D \stoptyping
-\writestatus{loading}{MetaPost Special Extensions}
+\ifx\writestatus\undefined
+ \immediate\write16{[Loading MPS to PDF extensions.]}
+\else
+ \writestatus{loading}{Context Support Macros / MPS extensions}
+\fi
%D We implement extensions by using the \METAPOST\ special
%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones
@@ -176,7 +180,12 @@
\def\handleMPspecialscommentx #1 % version 2
% {\doifelsedoifelse{#1}{10000}{\settrue\manyMPspecials}{\setfalse\manyMPspecials}% local
- {\ifnum10000=0#1\relax\settrue\manyMPspecials\else\setfalse\manyMPspecials\fi
+ {\ifnum10000=0#1\relax
+ \settrue \manyMPspecials
+ \else
+ \setfalse\manyMPspecials
+ \fi
+ \setMPextensions
\handleMPsequence}
% one can say (in meta-ini):
@@ -417,6 +426,11 @@
\ifnum\MPrgbnumber\lastMPgvalue>10 % really needed
\scratchcounter\MPrgbnumber\lastMPbvalue
\edef\currentMPspecial{\the\scratchcounter}%
+\let\previousMPcolorspec\currentMPcolorspec
+\edef\currentMPcolorspec{\lastMPrvalue\lastMPgvalue\lastMPbvalue}%
+\ifx\previousMPcolorspec\currentMPcolorspec \else
+ \revokeMPtransparencyspecial
+\fi
\ifnum\finiMPpath=2 % to outer level
\the\invokeMPspecials
\fi
diff --git a/Master/texmf-dist/tex/context/base/supp-mps.tex b/Master/texmf-dist/tex/context/base/supp-mps.tex
index 17d26d631ca..e03ef826c35 100644
--- a/Master/texmf-dist/tex/context/base/supp-mps.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mps.tex
@@ -53,6 +53,14 @@
% todo : sort out ^^M, \par and ; mess
%D \macros
+%D {everyMPgraphic}
+%D
+%D Because some graphics interact with \TEX\ (i.e.\ \CONTEXT), we
+%D provide a hook for additional actions: \type {\everyMPgraphic}.
+
+\newtoks\everyMPgraphic \everyMPgraphic{\everyMPgraphic\emptytoks}
+
+%D \macros
%D {startMPgraphic}
%D
%D From within \TEX\ one can execute \METAPOST\ code by putting
@@ -65,6 +73,8 @@
%D
%D This is implemented as:
+\let\stopMPgraphic\relax
+
\long\def\startMPgraphic#1\stopMPgraphic
{\startwritingMPgraphic
\writecheckedMPgraphic{#1}% % potential speedup: pass #1 as macro
@@ -97,6 +107,9 @@
\newif\ifMPgraphics \MPgraphicstrue
\newif\ifMPrun \MPrunfalse
+\newif\ifMPwrapper \MPwrappertrue
+
+\let\stopMPrun\relax
\ifCONTEXT
@@ -160,8 +173,8 @@
\ifx\MPgraphicfile\undefined
- \def\MPgraphicfile{mp\ifMPrun run\else graph\fi}
- \def\MPruntimefile{mprun}
+\def\MPgraphicfile{mp\ifMPrun run\else graph\fi}
+\def\MPruntimefile{mprun}
\fi
@@ -227,10 +240,10 @@
\let\obeyedline\space
\else
\obeylines
- \ifx\systemendofline\undefined
- \def\obeyedline{\rawcharacter{10}}%
+ \ifx\outputnewlinechar\undefined
+ \edef\obeyedline{\rawcharacter{\endlinechar}}%
\else
- \let\obeyedline\systemendofline
+ \let\obeyedline\outputnewlinechar
\fi
\fi}
@@ -315,6 +328,7 @@
%D setting the next boolean to true.
\newwrite\MPwrite
+\newwrite\MPstaticwrite
\newif\iflongMPlines \longMPlinestrue % we now have \obeyMPlines
@@ -329,13 +343,6 @@
\edef\currentwidth {\the\hsize \space}%
\edef\currentheight {\the\vsize \space}}
-% \def\writeMPgraphic % no big #1 passing here
-% {\iflongMPlines
-% \expandafter\writeMPgraphiclong
-% \else
-% \expandafter\writeMPgraphicshort
-% \fi}
-
%D The \type {;} aware method (the \type {\else} branch) also
%D takes care of \type {btex}||\type {etex}, \type
%D {verbatimtex}||\type {etex}. The space after \type {tex}
@@ -343,20 +350,49 @@
\newif\ifMPTEXgraphic
+\let\bufferedMPgraphicsline\empty
+
+\appendtoks
+ \globallet\bufferedMPgraphicsline\empty
+\to \everyMPgraphic
+
+\chardef\MPgraphicsscanmode\plustwo % 0=no scanning, 1=simple scanning, 2=less simple, 3=even less
+
+% the next fails with \chardef\MPgraphicsscanmode\plusone
+%
+% \startMPextensions
+% gp_num_points_with_tex := 3 ;
+% \stopMPextensions
+
\def\writeMPgraphic % no big #1 passing here
{\iflongMPlines
\ifMPTEXgraphic
- \@EAEAEA\writeMPgraphiclongT
+ \ifcase\MPgraphicsscanmode
+ \let\next\writeMPgraphiclongR
+ \else
+ \let\next\writeMPgraphiclongT
+ \fi
\else
- \@EAEAEA\writeMPgraphiclongN
+ \let\next\writeMPgraphiclongN
\fi
\else
\ifMPTEXgraphic
- \@EAEAEA\writeMPgraphicshortT
+ \ifcase\MPgraphicsscanmode
+ \let\next\writeMPgraphicshortN % we could \let \writeMPgraphicshortR\writeMPgraphicshortN
+ \else
+ \let\next\writeMPgraphicshortT
+ \fi
\else
- \@EAEAEA\writeMPgraphicshortN
+ \let\next\writeMPgraphicshortN
\fi
- \fi}
+ \fi
+ \next}
+
+\long\def\writeMPgraphiclongR#1% fast, no scanning
+ {\bgroup
+ \let\par\space
+ \immediate\write\MPwrite{#1}%
+ \egroup}
\long\def\writeMPgraphiclongT#1%
{\bgroup
@@ -462,10 +498,10 @@
%D {\ifforceMPTEXgraphic
%D \global\MPTEXgraphictrue
%D \else
-%D \expandafter\convertargument#1\to\MPasciiA
-%D \doifstringinstringelse\MPasciiB\MPasciiA{\global\MPTEXgraphictrue}
-%D {\doifstringinstringelse\MPasciiC\MPasciiA{\global\MPTEXgraphictrue}
-%D {\doifstringinstringelse\MPasciiD\MPasciiA{\global\MPTEXgraphictrue}
+%D \expandafter\convertargument#1\to\MPasciia
+%D \doifstringinstringelse\MPasciiB\MPasciia{\global\MPTEXgraphictrue}
+%D {\doifstringinstringelse\MPasciiC\MPasciia{\global\MPTEXgraphictrue}
+%D {\doifstringinstringelse\MPasciiD\MPasciia{\global\MPTEXgraphictrue}
%D {\global\MPTEXgraphicfalse}}}%
%D \fi}
%D \stoptyping
@@ -475,26 +511,6 @@
\newtoks\MPTEXgraphicchecks
-% \long\def\checkMPTEXgraphic#1%
-% {\ifforceMPTEXgraphic
-% \global\MPTEXgraphictrue
-% \else
-% \global\MPTEXgraphicfalse
-% \expandafter\convertargument#1\to\MPascii
-% \the\MPTEXgraphicchecks\relax % \relax is end condition!
-% \fi}
-
-% \long\def\writecheckedMPgraphic#1%
-% {\ifforceMPTEXgraphic
-% \global\MPTEXgraphictrue
-% \else
-% \global\MPTEXgraphicfalse
-% \expandafter\convertargument#1\to\MPascii
-% \the\MPTEXgraphicchecks\relax % \relax is end condition!
-% \fi
-% \flushMPTEXgraphic % verbatimtex etc
-% \writeMPgraphic{#1}}
-
\long\def\writecheckedMPgraphic#1%
{\ifforceMPTEXgraphic
\global\MPTEXgraphictrue
@@ -511,8 +527,11 @@
%D as efficient alternative. (The uglyness comes from
%D expanding after the string \type {#1}).
+\let\MPTEXchecklist\empty
+
\def\forceMPTEXcheck#1%
- {\expanded{\convertargument#1\noexpand\to
+ {\addtocommalist{#1}\MPTEXchecklist
+ \expanded{\convertargument#1\noexpand\to
\@EA\noexpand\csname MPascii#1\endcsname}%
\@EA\appendtoks
\@EA\doifincsnameelse\csname MPascii#1\endcsname\MPascii
@@ -546,7 +565,6 @@
\long\def\textext#1{\normalunexpanded{textext("#1")}} % or \detokenize
-
\def\flushMPTEXgraphic
{\ifMPTEXgraphic
\immediate\write\MPwrite{verbatimtex \the\everyMPTEXgraphic\space etex;}%
@@ -589,31 +607,87 @@
%
% better and faster
-\long\def\dodowriteMPgraphicline#1tex #2%
+% \long\def\dodowriteMPgraphicline#1tex #2%
+% {\ifx#2\relax
+% \expandafter\nododowriteMPgraphicline
+% \else
+% \expandafter\redodowriteMPgraphicline
+% \fi{#1} #2}
+%
+% \long\def\redodowriteMPgraphicline#1#2etex#3\MPend
+% {\ifx\next\empty\else\ifx\next\relax\else
+% \bgroup
+% \let\par\space
+% \convertargument#2\to\ascii
+% \immediate\write\MPwrite{#1tex \ascii etex}%
+% \egroup
+% \dowriteMPgraphicline#3tex \relax etex\MPend
+% \fi\fi}
+%
+% \long\def\nododowriteMPgraphicline#1#2\MPend
+% {\ifx\next\empty\else\ifx\next\relax\else
+% \bgroup
+% \let\par\space
+% \iflongMPlines
+% \immediate\write\MPwrite{#1;}%
+% \else
+% \long\edef\ascii{#1}%
+% \expandafter\flushMPgraphicline\ascii\empty;\relax;%
+% \fi
+% \egroup
+% \fi\fi}
+
+% extra scanning
+
+\long\def\dodowriteMPgraphicline#1tex #2% kind of ok
{\ifx#2\relax
\expandafter\nododowriteMPgraphicline
\else
- \expandafter\redodowriteMPgraphicline
+ \ifcase\MPgraphicsscanmode
+ % can't happen
+ \or
+ \@EAEAEA\redodowriteMPgraphicline
+ \or
+ \doifinstringelse{b$} {#1$}{\@EAEAEA\redodowriteMPgraphicline}%
+ {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
+ {\@EAEAEA\dododowriteMPgraphicline}}%
+ \else
+ \doifinstringelse { b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
+ {\doifinstringelse {(b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
+ {\doifinstringelse {=b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
+ {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
+ {\@EAEAEA\dododowriteMPgraphicline}}}}%
+ \fi
\fi{#1} #2}
+\def\dododowriteMPgraphicline#1#2\MPend
+ {\doifsomething{#1}{\xdef\bufferedMPgraphicsline{\bufferedMPgraphicsline#1tex }}%
+ \dowriteMPgraphicline#2tex \relax etex\MPend}
+
\long\def\redodowriteMPgraphicline#1#2etex#3\MPend
- {\ifx\next\empty\else\ifx\next\relax\else
+ {\ifx\next\empty
+ \else\ifx\next\relax
+ \else
\bgroup
\let\par\space
\convertargument#2\to\ascii
- \immediate\write\MPwrite{#1tex \ascii etex}%
+ \immediate\write\MPwrite{\bufferedMPgraphicsline#1tex \ascii etex}%
+ \globallet\bufferedMPgraphicsline\empty
\egroup
\dowriteMPgraphicline#3tex \relax etex\MPend
\fi\fi}
\long\def\nododowriteMPgraphicline#1#2\MPend
- {\ifx\next\empty\else\ifx\next\relax\else
+ {\ifx\next\empty
+ \else\ifx\next\relax
+ \else
\bgroup
\let\par\space
\iflongMPlines
- \immediate\write\MPwrite{#1;}%
+ \immediate\write\MPwrite{\bufferedMPgraphicsline#1;}%
+ \globallet\bufferedMPgraphicsline\empty
\else
- \long\edef\ascii{#1}%
+ \long\edef\ascii{\bufferedMPgraphicsline#1}%
\expandafter\flushMPgraphicline\ascii\empty;\relax;%
\fi
\egroup
@@ -624,14 +698,6 @@
%D can handle this and users may consider it being a sort
%D of error prevention bonus.
-%D \macros
-%D {everyMPgraphic}
-%D
-%D Because some graphics interact with \TEX\ (i.e.\ \CONTEXT), we
-%D provide a hook for additional actions: \type {\everyMPgraphic}.
-
-\newtoks\everyMPgraphic \everyMPgraphic{\everyMPgraphic\emptytoks}
-
\ifx\blabelgroup\undefined
\let\blabelgroup\bgroup
@@ -686,7 +752,6 @@
% no reset here !
\theMPextensions
\theMPinclusions
-% \theMPinitializations
\else
\openMPgraphicfile0{collected}%
% reset here ! global added (due to adding \blabelgroup)
@@ -697,13 +762,11 @@
\fi
\theMPinitializations % always
\ifMPrun
-% \theMPinitializations
\else
- \immediate\write\MPwrite{let mprunend = end ;}%
- \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}%
-% \ifrunMPgraphics \else
-% \theMPinitializations
-% \fi
+ \ifMPwrapper
+ \immediate\write\MPwrite{let mprunend = end ;}%
+ \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}%
+ \fi
\fi
\globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic
\globallet\stopwritingMPgraphic\dostopwritingMPgraphic}
@@ -713,14 +776,11 @@
\let\MPinputtranslation\empty
\def\openMPgraphicfile#1#2% #1=alwaysopen #2=message
- {%\doifundefinedelse{\@@MPG\@@MPG\MPgraphicfile}
- % {\donetrue
- % \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname}%
- % {\ifcase#1\donefalse\else\donetrue\fi}%
- \@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax
- %\donetrue \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
- % for the sake of plain usage
- \donetrue \@EA\@EA\csname newwrite\endcsname\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
+ {\@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax
+ \donetrue
+ % \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
+ % for the sake of plain usage
+ \@EA\@EA\csname newwrite\endcsname\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
\doglobal\addtocommalist\MPgraphicfile\MPgraphicfiles
\else
\ifcase#1\relax\donefalse\else\donetrue\fi
@@ -739,8 +799,10 @@
\def\dostopwritingMPgraphic
{\ifMPrun \else
- \immediate\write\MPwrite{endfig;}%
- \immediate\write\MPwrite{let end=mprunend;}%
+ \ifMPwrapper
+ \immediate\write\MPwrite{endfig;}%
+ \immediate\write\MPwrite{let end=mprunend;}%
+ \fi
\fi
\ifrunMPgraphics
\dodostopwritingMPgraphic
@@ -762,16 +824,16 @@
\globallet\flushMPgraphics\relax}
\def\finishwritingMPgraphics
- {\immediate\write\MPwrite{end.}%
+ {\ifMPwrapper\immediate\write\MPwrite{end.}\fi
\immediate\closeout\MPwrite}
\def\closeMPgraphicfiles
{\ifrunMPgraphics \else \ifx\MPgraphicsfiles\empty\else
- \def\docommando##1%
+ \def\docommand##1%
{\message{[flush and process ##1.mp afterwards]}%
\@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG##1\endcsname
\finishwritingMPgraphics}%
- \processcommacommand[\MPgraphicfiles]\docommando
+ \processcommacommand[\MPgraphicfiles]\docommand
\fi \fi}
\let\stopwritingMPgraphic\relax
@@ -918,22 +980,14 @@
%D \setgvalue{#1}{\getobject{MP}{#1}}}
%D \stoptyping
%D
-%D More save is to use a number for \type {{MP}{#1}} which permits
-%D redefinition.
+%D More safe is to use a number for \type {{MP}{#1}} which permits
+%D redefinition. We also saves the boundingbox. This helps positioning
+%D reused graphics in layers.
\newcount\MPobjectcounter
-% \def\douseMPbox#1%
-% {\global\advance\MPobjectcounter\plusone
-% \setobject{MP}{\number\MPobjectcounter}\vbox
-% {\forgetall
-% \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
-% \deallocateMPslot\currentMPgraphic
-% \placeMPgraphic}%
-% \setxvalue{#1}{\noexpand\getobject{MP}{\number\MPobjectcounter}}}
-%
-% The next one saves the boundingbox. This helps positioning reused
-% graphics in layers.
+\ifx\getobject\undefined \def\setobject#1#2{\setbox\scratchbox} \fi % makes dep check happy
+\ifx\getobject\undefined \def\getobject#1#2{\box \scratchbox} \fi % makes dep check happy
\def\douseMPbox#1%
{\global\advance\MPobjectcounter\plusone
@@ -959,8 +1013,8 @@
\noexpand\deallocateMPslot{\currentMPgraphic}%
\noexpand\placeMPgraphic}}
-\ifCONTEXT \else \let\douseMPbox=\nouseMPbox \fi
-\ifCONTEXT \else \let\doifobjectssupportedelse=\relax \fi
+\ifCONTEXT \else \let\douseMPbox\nouseMPbox \fi
+\ifCONTEXT \else \let\doifobjectssupportedelse\relax \fi
\long\def\handlereusableMPgraphic#1#2%
{\blabelgroup
@@ -1033,7 +1087,7 @@
{\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}%
\elabelgroup}
-\let\useMPgraphic=\reuseMPgraphic
+\let\useMPgraphic\reuseMPgraphic
\let\stopuseMPgraphic \relax % so that we can use it in \expanded
\let\stopusableMPgraphic \relax % so that we can use it in \expanded
@@ -1072,7 +1126,7 @@
%D \stoptyping
\def\includeMPgraphic#1%
- {\csname\@@MPG#1\endcsname}
+ {\executeifdefined{\@@MPG#1}}
\def\enableincludeMPgraphics
{\let\handleuseMPgraphic \secondoftwoarguments
@@ -1535,6 +1589,30 @@
%D copied back. We don't have to reduce to gray scales;
%D \METAPOST\ already takes care of that.
+%D The next macro is needed for forced conversion. This macro
+%D is copied from \type{colo-ini}, just in case one uses this
+%D module outside \CONTEXT.
+
+\ifx\@@cl@@s \undefined \def\@@cl@@s{0} \fi
+
+\ifx\convertRGBtoGRAY\undefined
+
+\def\convertRGBtoGRAY#1#2#3%
+ {\scratchdimen#1\onepoint
+ \scratchdimen300\scratchdimen
+ \scratchcounter\scratchdimen
+ \scratchdimen#2\onepoint
+ \scratchdimen590\scratchdimen
+ \advance\scratchcounter \scratchdimen
+ \scratchdimen#3\onepoint
+ \scratchdimen110\scratchdimen
+ \advance\scratchcounter \scratchdimen
+ \advance\scratchcounter \!!medcard
+ \divide\scratchcounter \!!maxcard
+ \edef\@@cl@@s{\realcolorvalue\scratchcounter}}
+
+\fi
+
%D BTW, this code is quite old, and not as complete as the
%D \PDF\ converter, which also handles spot colors and so.
@@ -1548,65 +1626,42 @@
\dodohandleMPcolor#1setrgbcolor#2#3\\%
\fi}
-\def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\%
+\def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\% old and maybe broke
{\bgroup
-%\ifnum\MPspecialsignal=123 % color spec / hardcoded hack
-\ifdim#1pt=.123pt
- \immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}%
-\else
- \ifforcegrayMPcolors
- \convertRGBtoGRAY{#1}{#2}{#3}%
- \immediate\write\scratchwrite
- {\@@cl@@s \space setgray #4}%
+ \ifdim#1pt=.123pt
+ \immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}%
\else
- \dimen0=\onepoint \advance\dimen0 -#1\points
- \dimen2=\onepoint \advance\dimen2 -#2\points
- \dimen4=\onepoint \advance\dimen4 -#3\points
- \ifreduceMPcolors
- \dimen6\dimen0
- \ifdim\dimen2<\dimen6 \dimen6\dimen2 \fi
- \ifdim\dimen4<\dimen6 \dimen6\dimen4 \fi
- \advance\dimen0 -\dimen6
- \advance\dimen2 -\dimen6
- \advance\dimen4 -\dimen6
+ \ifforcegrayMPcolors
+ \convertRGBtoGRAY{#1}{#2}{#3}%
+ \immediate\write\scratchwrite
+ {\@@cl@@s \space setgray #4}%
\else
- \dimen6\zeropoint
+ \dimen0=\onepoint \advance\dimen0 -#1\points
+ \dimen2=\onepoint \advance\dimen2 -#2\points
+ \dimen4=\onepoint \advance\dimen4 -#3\points
+ \ifreduceMPcolors
+ \dimen6\dimen0
+ \ifdim\dimen2<\dimen6 \dimen6\dimen2 \fi
+ \ifdim\dimen4<\dimen6 \dimen6\dimen4 \fi
+ \advance\dimen0 -\dimen6
+ \advance\dimen2 -\dimen6
+ \advance\dimen4 -\dimen6
+ \else
+ \dimen6\zeropoint
+ \fi
+ \immediate\write\scratchwrite
+ {\withoutpt\the\dimen0 \space
+ \withoutpt\the\dimen2 \space
+ \withoutpt\the\dimen4 \space
+ \withoutpt\the\dimen6 \space setcmykcolor #4}%
\fi
- \immediate\write\scratchwrite
- {\withoutpt\the\dimen0 \space
- \withoutpt\the\dimen2 \space
- \withoutpt\the\dimen4 \space
- \withoutpt\the\dimen6 \space setcmykcolor #4}%
\fi
-\fi
\egroup
\donetrue} % needed for message
\def\handleMPcopy
{\immediate\write\scratchwrite{\fileline}}
-%D The next macro is needed for forced conversion. This macro
-%D is copied from \type{colo-ini}, just in case one uses this
-%D module outside \CONTEXT.
-
-\ifx\convertRGBtoGRAY\undefined
-
- \def\convertRGBtoGRAY#1#2#3%
- {\scratchdimen#1\onepoint
- \scratchdimen300\scratchdimen
- \scratchcounter\scratchdimen
- \scratchdimen#2\onepoint
- \scratchdimen590\scratchdimen
- \advance\scratchcounter \scratchdimen
- \scratchdimen#3\onepoint
- \scratchdimen110\scratchdimen
- \advance\scratchcounter \scratchdimen
- \advance\scratchcounter \!!medcard
- \divide\scratchcounter \!!maxcard
- \edef\@@cl@@s{\realcolorvalue\scratchcounter}}
-
-\fi
-
%D The next examples show the color conversion macros in
%D action. These examples also demonstrate in||text \METAPOST\
%D handling. As we will see, the conversion is hooked into the
@@ -1759,10 +1814,12 @@
\bgroup
\enableincludeMPgraphics
\presetMPdefinitions % in case #2 has measures
- \doifelse{#1}{-}{\convertargument#2\to\asciiA}{\long\def\asciiA{#2}}%
- \long\xdef\MPdrawingdata{\MPdrawingdata\asciiA}%
+ \doifelse{#1}{-}{\convertargument#2\to\asciia}{\long\def\asciia{#2}}%
+ \long\xdef\MPdrawingdata{\MPdrawingdata\asciia}%
\egroup}
+\let\stopMPdrawing\relax
+
\def\MPdivten[#1]%
{\@EA\@EA\@EA\doMPdivten\@EA\@EA\@EA[\@EA#1]}
@@ -1810,12 +1867,14 @@
\let\MPclippath\empty
-\long\def\startMPclip#1#2\stopMPclip%
+\long\def\startMPclip#1#2\stopMPclip
{\blabelgroup
\long\setgvalue{MPC:#1}%
{\startMPgraphic#2\stopMPgraphic\dograbMPclippath}%
\elabelgroup}
+\let\stopMPclip\relax
+
\def\grabMPclippath#1#2#3#4#5%
{\blabelgroup
\edef\width {#3\space}\let\overlaywidth \width
@@ -1884,10 +1943,10 @@
\newcount \maxnofMPgraphics \maxnofMPgraphics = 4000 % 8000
\newcount \minnofMPgraphics \minnofMPgraphics = 1
-\newif \ifMPstaticgraphic \MPstaticgraphicfalse
+\newif \ifMPstaticgraphic \MPstaticgraphicfalse % determines slot allocation
\def\locateMPslot#1% slightly faster on one slot, much faster on multiple slots
- {\ifundefined{\number#1MP}% could be \ifcsname if needed
+ {\ifundefined{\number#1MP}% no \ifcsname
\letgvalueempty{\number#1MP}%
\expandafter\gobbletwoarguments
\else
@@ -1914,7 +1973,7 @@
\global#1\plusone
\locateMPslot#1%
% \message{[MP slot + \number#1]%
- \else\ifMPstaticgraphic
+ \else\ifMPstaticgraphic % beware not the same as static graphics
\global#1\maxnofMPgraphics
\global\advance\maxnofMPgraphics \minusone
\else
@@ -1974,38 +2033,65 @@
\useMPgraphic{@@}%
\endgroup}
-\let\stopMPcode \relax % so that we can use it in \expanded
+\let\stopMPcode\relax
%D \macros
%D {startstaticMPgraphic}
%D
%D Dedicated to Aditya Mahajan. See meta-ini for usage.
+% \long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic
+% {\bgroup
+% \MPstaticgraphictrue
+% \setMPrandomseedfalse
+% \def\MPgraphicfile{#1}% no \jobname here
+% \let\allocateMPslot \gobbleoneargument
+% \let\deallocateMPslot\gobbleoneargument
+% \let\runMPgraphic \gobbleoneargument
+% \MPextensions\emptytoks
+% \MPinitializations\emptytoks
+% \runMPgraphicstrue
+% \MPwrapperfalse
+% \enableincludeMPgraphics
+% \def\sometxt##1{\string\sometxt{##1}}%
+% \currentMPgraphic\plusone % hack, else no close
+% \startMPgraphic#2\stopMPgraphic
+% \executeMPgraphicfile
+% \egroup}
+
+% different version, less messy hooked into the rest
+
\long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic
- {\bgroup
- \setMPrandomseedfalse
+ {\blabelgroup
\def\MPgraphicfile{#1}% no \jobname here
- \let\allocateMPslot \gobbleoneargument
- \let\deallocateMPslot\gobbleoneargument
- \let\runMPgraphic \gobbleoneargument
- \runMPgraphicstrue
+ \let\MPwrite\MPstaticwrite
+ \immediate\openout\MPwrite=\MPgraphicfile.mp
+ \setMPrandomseedfalse
\enableincludeMPgraphics
- \currentMPgraphic\plusone % hack, else no close
- \startMPgraphic#2\stopMPgraphic
+ \def\sometxt##1{\string\sometxt{##1}}%
+ \the\everyMPgraphic
+ \presetMPdefinitions
+ \theMPinclusions % brrr
+ \writeMPgraphic{\letterpercent mpenvironment: \the\everyMPTEXgraphic}%
+ \writeMPgraphic{beginfig(1);}%
+ \writeMPgraphic{#2}%
+ \writeMPgraphic{endfig; end.}%
+ \immediate\closeout\MPwrite
+ \immediate\closeout\MPwrite
+ \runMPgraphicstrue
\executeMPgraphicfile
- \egroup}
-
+ \elabelgroup}
\ifx\doifmode\undefined
\def\executeMPgraphicfile
{\executesystemcommand
{texmfstart --ifchanged=\MPgraphicfile.mp
- texexec --mpgraphic \MPgraphicfile.mp}}
+ texexec --mpstatic \MPgraphicfile.mp}}
\else
\def\executeMPgraphicfile
{\doifmode{*\v!first}{\executesystemcommand
{texmfstart --ifchanged=\MPgraphicfile.mp
- texexec --mpgraphic \MPgraphicfile.mp}}}
+ texexec --mpstatic \MPgraphicfile.mp}}}
\fi
%D Special for \XETEX\ (problem with newlines). This will go
diff --git a/Master/texmf-dist/tex/context/base/supp-num.tex b/Master/texmf-dist/tex/context/base/supp-num.tex
index a5a9114c1b0..73b28e3de20 100644
--- a/Master/texmf-dist/tex/context/base/supp-num.tex
+++ b/Master/texmf-dist/tex/context/base/supp-num.tex
@@ -93,6 +93,8 @@
%D the grouped call, the other branch handles the fuzzy
%D delimited calls.
+\ifx\mbox\undefined \let\mbox\normalhbox \fi
+
% \unexpanded\def\digits
% {\bgroup\let~@\doifnextcharelse\bgroup\dodigits\grabdigit}
@@ -219,7 +221,7 @@
%D The signs can be made smaller and sqeezed into the width
-%D of a digit. Watch the \type {\fontdimen22} trickery (this
+%D of a digit. Watch the \type {\mathaxisheight} trickery (this
%D font related register stored the math axis).
% \def\scandigits#1%
@@ -304,9 +306,9 @@
{\ifcase\digitsignmode#1\else
\hbox
{\setbox\scratchbox\hbox{0}%
- \scratchdimen\fontdimen22\textfont2
+ \scratchdimen\mathaxisheight\textfont2
\def\digitsgn##1##2%
- {\advance\scratchdimen-\fontdimen22##12
+ {\advance\scratchdimen-\mathaxisheight##12
\raise\scratchdimen
\hbox to \wd\scratchbox{\hss$##2#1$\hss}}%
\ifcase\digitsignmode\or
diff --git a/Master/texmf-dist/tex/context/base/supp-pdf.tex b/Master/texmf-dist/tex/context/base/supp-pdf.tex
index 656a8f6fbce..754efa84795 100644
--- a/Master/texmf-dist/tex/context/base/supp-pdf.tex
+++ b/Master/texmf-dist/tex/context/base/supp-pdf.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=supp-pdf,
-%D version=2004.12.16,
+%D version=2006.09.02, % 2004.12.16,
%D title=\CONTEXT\ Support Macros,
%D subtitle=\METAPOST\ to \PDF\ conversion,
%D author=Hans Hagen \& others (see text),
@@ -11,6 +11,142 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\ifx\writestatus\undefined
+ \immediate\write16{[Loading MPS to PDF converter (version 2006.09.02).]}
+\else
+ \writestatus{loading}{Context Support Macros / PDF}
+\fi
+
+%D This module is not optimized because it is used outside
+%D \CONTEXT\ and we cannot forsee what interference will take
+%D place. We no longer load supp-mis. I got too tired of
+%D keeping track of interferences with non \CONTEXT\ usage so
+%D I moved the necessary code in here and use a derived version
+%D in \CONTEXT. When I have the time I will clean up some of the
+%D code that is of no use for non||\CONTEXT\ users.
+
+\ifx\contextversion\undefined
+
+ \chardef\mptopdfstoredatcode\catcode`\@
+
+ \catcode\string`@=11
+
+ \def\unprotect
+ {\let\@@mpstopdf@@unprotect \unprotect
+ \let\@@mpstopdf@@protect \protect
+ \edef\protect
+ {\noexpand \let \noexpand \protect \noexpand \@@mpstopdf@@protect
+ \noexpand \let \noexpand \unprotect \noexpand \@@mpstopdf@@unprotect
+ % context specific
+ \catcode\string`\noexpand @=\the\catcode\string`@
+ \catcode\string`\noexpand !=\the\catcode\string`!
+ \catcode\string`\noexpand ?=\the\catcode\string`?
+ % latex specific
+ \catcode\string`\noexpand /=\the\catcode\string`/
+ \catcode\string`\noexpand -=\the\catcode\string`-
+ \catcode\string`\noexpand :=\the\catcode\string`:
+ \catcode\string`\noexpand ;=\the\catcode\string`;
+ \catcode\string`\noexpand "=\the\catcode\string`"
+ \catcode\string`\noexpand <=\the\catcode\string`<
+ \catcode\string`\noexpand >=\the\catcode\string`>
+ \catcode\string`\noexpand `=\the\catcode\string``}
+ \catcode\string`@=11 \catcode\string`!=11 \catcode\string`?=11
+ \catcode\string`/=12 \catcode\string`-=12
+ \catcode\string`:=12 \catcode\string`;=12
+ \catcode\string`>=12 \catcode\string`<=12
+ \catcode\string`"=12 \catcode\string``=12 }
+
+ \def\defineMPtoPDFfallbacks
+ {% shortcuts
+ \chardef\@@escape 0
+ \chardef\@@begingroup 1
+ \chardef\@@endgroup 2
+ \chardef\@@endofline 5
+ \chardef\@@ignore 9
+ \chardef\@@space 10
+ \chardef\@@letter 11
+ \chardef\@@other 12
+ \chardef\@@active 13
+ \chardef\@@comment 14
+ % placeholders
+ \ifx\withoutpt \undefined \let\withoutpt \@@mptopdf@@withoutpt \fi
+ \ifx\twodigitrounding \undefined \let\twodigitrounding \@@mptopdf@@twodigitrounding \fi
+ \ifx\forgetall \undefined \let\forgetall \@@mptopdf@@forgetall \fi
+ \ifx\uncatcodespecials \undefined \let\uncatcodespecials \@@mptopdf@@uncatcodespecials \fi
+ \ifx\setnaturalcatcodes\undefined \let\setnaturalcatcodes\@@mptopdf@@setnaturalcatcodes \fi
+ \ifx\dospecials \undefined \let\dospecials \@@mptopdf@@dospecials \fi}
+
+ \def\@@mptopdf@@forgetall
+ {\parskip0pt\leftskip0pt\parindent0pt\everypar{}}
+
+ \def\@@mptopdf@@twodigitrounding#1%
+ {#1}%
+
+ \def\@@mptopdf@@uncatcodespecials
+ {\def\do##1{\catcode`##1=\@@other}\dospecials
+ \catcode`\ =\@@space
+ \catcode`\^^L=\@@ignore
+ \catcode`\^^M=\@@endofline
+ \catcode`\^^?=\@@ignore}
+
+ \def\@@mptopdf@@setnaturalcatcodes
+ {\catcode`\!=\@@other \catcode`\?=\@@other \catcode`\@=\@@other
+ \catcode`\#=\@@other \catcode`\&=\@@other \catcode`\|=\@@other
+ \catcode`\$=\@@other \catcode`\^=\@@other \catcode`\_=\@@other
+ \catcode`\*=\@@other \catcode`\/=\@@other
+ \catcode`\-=\@@other \catcode`+=\@@other
+ \catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other
+ \catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other
+ \catcode`\:=\@@other \catcode`\;=\@@other
+ \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other
+ \catcode`\(=\@@other \catcode`\)=\@@other
+ \catcode`\{=\@@other \catcode`\}=\@@other
+ \catcode`\\=\@@other \catcode`\%=\@@other}
+
+ \def\@@mptopdf@@dospecials
+ {\do\ \do\\\do\{\do\}\do\$%
+ \do\#\do\^\do\_\do\&\do\%%
+ \do\~\do\^^A\do\^^K}
+
+ {
+ \catcode`\.=12
+ \catcode`\p=12
+ \catcode`\t=12
+ \gdef\@@MPTOPDF@@WITHOUTPT#1pt{#1}
+ }
+
+ \def\@@mptopdf@@withoutpt#1%
+ {\expandafter\@@MPTOPDF@@WITHOUTPT#1}
+
+% \def\@@mptopdf@@newabove#1#2% \dimen \name
+% {#1#2%
+% \ifnum\expandafter\gobblesixarguments\meaning#2>20\else
+% \expandafter\@@mptopdf@@newabove\expandafter#1\expandafter#2%
+% \fi}
+
+ \def\@@mptopdf@@stripnewabove#1%
+ {\ifnum10<9#1 #1\else\expandafter\@@mptopdf@@stripnewabove\fi}%
+
+ \def\@@mptopdf@@newabove\csname#1\endcsname#2% \dimen \name
+ {\csname#1\endcsname#2%
+ \ifnum\expandafter\@@mptopdf@@stripnewabove\meaning#2>20\else
+ \@@mptopdf@@newabove\csname#1\endcsname#2%
+ \fi}
+
+ \@@mptopdf@@newabove \csname newcount\endcsname \scratchcounter
+ \@@mptopdf@@newabove \csname newdimen\endcsname \scratchdimen
+ \csname newbox\endcsname \scratchbox
+
+ \expandafter \newif \csname ifdone\endcsname
+
+ \catcode`\@=\mptopdfstoredatcode
+
+\else
+
+ \let\defineMPtoPDFfallbacks\relax
+
+\fi
+
%D These macros are written as generic as possible. Some
%D general support macro's are loaded from a small module
%D especially made for non \CONTEXT\ use. In this module I
@@ -25,23 +161,10 @@
%D his initials. (We keep the old code around because it's a
%D nice illustration on how a module like this evolves.)
-% Beware, we cannot use \zeropoint here since it may be
-% defined in the range \dimen 0 - 20 which we happen to use
-% as scratch registers; inside context we may consider
-% using dedicated registers.
-
-% fails: ( ) vect10 9.96265 fshow % \040\040\040\040
-%
-% some optimizations are possible, but we need to be generic
-
-%D First we take care of non||\CONTEXT\ use (newlines needed,
-%D expandafter not -).
-
-\ifx \undefined \writestatus \input supp-mis.tex \relax \fi
-
-\ifx \undefined \convertMPtoPDF \else \expandafter \endinput \fi
-
-\ifx \undefined \StartLatexHack \else \StartLatexHack \fi
+%D Beware, we cannot use \zeropoint here since it may be
+%D defined in the range \dimen 0 - 20 which we happen to use
+%D as scratch registers; inside context we may consider
+%D using dedicated registers.
%D This module handles some \PDF\ conversion and insertions
%D topics. By default, the macros use the \PDFTEX\ primitive
@@ -49,8 +172,6 @@
%D default engine for \TEX\ distributions, we need a more complex
%D test.
-\writestatus{loading}{Context Support Macros / PDF (2004.03.26)}
-
\unprotect
\ifx\PDFcode\undefined
@@ -69,7 +190,7 @@
%D First we define a handy constant:
-\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
+\bgroup \defineMPtoPDFfallbacks \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
%D \macros
%D {pdfimage,pdfimages,pdfclippedimage}
@@ -94,12 +215,6 @@
%D \pdfclippedimage <optional dimensions> {file} {l} {r} {t} {b}
%D \stoptyping
-% \ifx\pdftexversion\undefined % no \m!systems for the sake of latex
-% \writestatus{systems}{Why not use pdf(e)TeX binaries?}
-% \protect
-% \expandafter\endinput
-% \fi
-
\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13
\def\pdfimage#1#%
@@ -114,11 +229,8 @@
\def\dopdfimages#1#2#3%
{\immediate\pdfximage#1{#2}%
- \immediate\pdfobj
- {[ << /Image \the\pdflastximage\space0 R
- /DefaultForPrinting true >> ]}%
- \immediate\pdfximage#1
- attr {/Alternates \the\pdflastobj\space0 R}{#3}%
+ \immediate\pdfobj{[ << /Image \the\pdflastximage\space0 R /DefaultForPrinting true >> ]}%
+ \immediate\pdfximage#1 attr {/Alternates \the\pdflastobj\space0 R}{#3}%
\pdfrefximage\pdflastximage}
\def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom}
@@ -165,218 +277,12 @@
\fi \fi
-%D \macros
-%D {convertPDFtoPDF}
-%D
-%D \PDFTEX\ supports verbatim inclusion of \PDF\ code. The
-%D following macro takes care of inserting externally defined
-%D illustrations in \PDF\ format. According to a suggestion
-%D Tanmoy Bhattacharya posted to the \PDFTEX\ mailing list, we
-%D first skip lines until \type{stream} is reached and then
-%D copy lines until \type{endstream} is encountered. This
-%D scheme only works with vectorized graphics in which no
-%D indirect references to objects are used. Bitmaps also don't
-%D work. Interpreting their specifications is beyond the
-%D current implementation.
-%D
-%D \starttyping
-%D \convertPDFtoPDF
-%D {filename}
-%D {x scale} {y scale}
-%D {x offset } {y offset}
-%D {width} {height}
-%D \stoptyping
-%D
-%D When the scales are set to~1, the last last four values
-%D are the same as the bounding box, e.g.
-%D
-%D \starttyping
-%D \convertPDFtoPDF{mp-pra-1.pdf} {1} {1}{-1bp}{-1bp}{398bp}{398bp}
-%D \convertPDFtoPDF{mp-pra-1.pdf}{.5}{.5} {0bp} {0bp}{199bp}{199bp}
-%D \stoptyping
-%D
-%D Keep in mind, that this kind of copying only works for
-%D pure and valid pdf code (without fonts).
-
-%D The scanning and copying is straightforward and quite fast.
-%D To speed up things we use two constants.
-
-\def\@@PDFstream@@ {stream}
-\def\@@PDFendstream@@ {endstream}
-
-%D \macros
-%D {PDFmediaboxprefered}
-%D
-%D If needed, the macros can scan for the mediabox that
-%D specifies the dimensions and offsets of the graphic. When
-%D we say:
-%D
-%D \starttyping
-%D \PDFmediaboxpreferedtrue
-%D \stoptyping
-%D
-%D the mediabox present in the file superseded the user
-%D specified, already scaled and calculated offset and
-%D dimensions. Beware: the user supplied values are not the
-%D bounding box ones!
-
-%D This code has become obsolete.
-
-% \newif\ifPDFmediaboxprefered
-
-\def\setPDFboundingbox#1#2#3#4#5#6%
- {\dimen0=#1\dimen0=#5\dimen0
- \ScaledPointsToBigPoints{\number\dimen0}\PDFxoffset
- \dimen0=#3\dimen0=#5\dimen0
- \xdef\PDFwidth{\the\dimen0}%
- \dimen0=#2\dimen0=#6\dimen0
- \ScaledPointsToBigPoints{\number\dimen0}\PDFyoffset
- \dimen0=#4\dimen0=#6\dimen0
- \xdef\PDFheight{\the\dimen0}%
- \global\let\PDFxoffset\PDFxoffset
- \global\let\PDFyoffset\PDFyoffset}
-
-\def\setPDFmediabox#1[#2 #3 #4 #5]#6\done
- {\dimen2=#2bp\dimen2=-\dimen2 % \dimen2=-#2bp also works since tex handles --
- \dimen4=#3bp\dimen4=-\dimen4 % \dimen4=-#3bp also works since tex handles --
- \dimen6=#4bp\advance\dimen6 \dimen2
- \dimen8=#5bp\advance\dimen8 \dimen4
- \setPDFboundingbox{\dimen2}{\dimen4}{\dimen6}{\dimen8}\PDFxscale\PDFyscale}
-
-% \def\checkPDFmediabox#1/MediaBox#2#3\done
-% {\ifx#2\relax \else
-% \message{mediabox}%
-% \setPDFmediabox#2#3\done
-% \fi}
-
-%D We use the general macro \type{\doprocessfile} and feed this
-%D with a line handling macro that changes it's behavior when
-%D the stream operators are encountered.
-
-% \def\handlePDFline
-% {\ifx\@@PDFstream@@\fileline
-% \let\doprocessPDFline\copyPDFobject
-% \startPDFtoPDF
-% \else\ifPDFmediaboxprefered
-% \expandafter\checkPDFmediabox\fileline/MediaBox\relax\done
-% \fi\fi}
-
-% \def\copyPDFobject
-% {\ifx\@@PDFendstream@@\fileline
-% \ifPDFmediaboxprefered
-% \let\doprocessPDFline\findPDFmediabox
-% \else
-% \let\doprocessPDFline\relax
-% \fi
-% \else
-% \advance\scratchcounter 1
-% \PDFcode{\fileline}%
-% \fi}
-
-% \def\findPDFmediabox
-% {\expandafter\checkPDFmediabox\fileline/MediaBox\relax\done}
-
%D The main conversion macro wraps the \PDF\ codes in a box
%D that is output as an object. The graphics are embedded
%D in~\type{q} and~\type{Q} and are scaled and positioned using
%D one transform call (\type{cm}). This saves some additional
%D scaling.
-%D \starttyping
-%D \def\startPDFtoPDF%
-%D {\setbox0=\vbox\bgroup
-%D \message{[PDF to PDF \PDFfilename}%
-%D \forgetall
-%D \scratchcounter=0
-%D \let\stopPDFtoPDF=\dostopPDFtoPDF}
-%D
-%D \def\dostopPDFtoPDF%
-%D {\ifnum\scratchcounter<0 \scratchcounter=1 \fi
-%D \message{(\the\scratchcounter\space lines)]}%
-%D \egroup
-%D \wd0=\PDFwidth
-%D \vbox to \PDFheight
-%D {\forgetall
-%D \vfill
-%D \PDFcode{q}%
-%D \PDFcode{1 0 0 1 \PDFxoffset\space \PDFyoffset\space cm}%
-%D \PDFcode{\PDFxscale\space 0 0 \PDFyscale\space 0 0 cm}%
-%D \box0
-%D \PDFcode{Q}}}
-%D
-%D \def\stopPDFtoPDF%
-%D {\message{[PDF to PDF \PDFfilename\space not found]}}
-%D
-%D \def\convertPDFtoPDF#1#2#3#4#5#6#7%
-%D {\bgroup
-%D \def\PDFfilename{#1}%
-%D \def\PDFxscale {#2}%
-%D \def\PDFyscale {#3}%
-%D \setPDFboundingbox{#4}{#5}{#6}{#7}{1}{1}%
-%D \uncatcodespecials
-%D \endlinechar=-1
-%D \let\doprocessPDFline=\handlePDFline
-%D \doprocessfile\scratchread\PDFfilename\doprocessPDFline
-%D \stopPDFtoPDF
-%D \egroup}
-
-\def\convertPDFtoPDF#1#2#3#4#5#6#7%
- {\message{[PDF to PDF use \string\PDFcode instead]}%
- \vbox{use the direct method instead}}
-
-%D \macros
-%D {dogetPDFmediabox}
-%D
-%D The next macro can be used to find the mediabox of a \PDF\
-%D illustration.
-%D
-%D \starttyping
-%D \dogetPDFmediabox
-%D {filename}
-%D {new dimen}{new dimen}{new dimen}{new dimen}
-%D \stoptyping
-%D
-%D Beware of dimen clashes: this macro uses the 5~default
-%D scratch registers! When no file or mediabox is found, the
-%D dimensions are zeroed.
-
-\def\dogetPDFmediabox#1#2#3#4#5%
- {\bgroup
- \def\PDFxscale{1}%
- \def\PDFyscale{1}%
- \uncatcodespecials
- \endlinechar\minusone
- \def\checkPDFtypepage##1/Type /Page##2##3\done%
- {\ifx##2\relax
- \else\if##2s% accept /Page and /Pages
- \let\doprocessPDFline\findPDFmediabox
- \else
- \let\doprocessPDFline\findPDFmediabox
- \fi\fi}%
- \def\findPDFtypepage
- {\expandafter\checkPDFtypepage\fileline/Type /Page\relax\done}%
- \def\checkPDFmediabox##1/MediaBox##2##3\done%
- {\ifx##2\relax \else
- \setPDFmediabox##2##3\done
- \fileprocessedtrue
- \fi}%
- \def\findPDFmediabox
- {\expandafter\checkPDFmediabox\fileline/MediaBox\relax\done}%
- \let\doprocessPDFline\findPDFtypepage
- \doprocessfile\scratchread{#1}\doprocessPDFline
- \egroup
- \ifx\PDFxoffset\undefined
- #2\zeropoint
- #3\zeropoint
- #4\zeropoint
- #5\zeropoint
- \else
- #2=\PDFxoffset\onebasepoint
- #3=\PDFyoffset\onebasepoint
- #4=\PDFwidth
- #5=\PDFheight
- \fi}
-
%D \macros
%D {convertMPtoPDF}
%D
@@ -440,6 +346,9 @@
\edef \PSMetaPostSpecial {\letterpercent\letterpercent MetaPostSpecial:}
\edef \PSMetaPostSpecials {\letterpercent\letterpercent MetaPostSpecials:}
\edef \PSPage {\letterpercent\letterpercent Page:}
+\edef \PSBeginProlog {\letterpercent\letterpercent BeginProlog}
+\edef \PSEndProlog {\letterpercent\letterpercent EndProlog}
+\edef \PSEof {\letterpercent\letterpercent EOF}
%D By the way, the \type {setcmykcolor} operator is not
%D output by \METAPOST\ but can result from converting the
@@ -505,17 +414,17 @@
\def\@@MP{@@MP}
\def\setMPargument% #1%
- {\advance\nofMParguments \plusone
+ {\advance\nofMParguments 1
\expandafter\def
\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1}
\def\letMPargument
- {\advance\nofMParguments \plusone
+ {\advance\nofMParguments 1
\expandafter\let
\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname}
\def\setMPsequence#1 %
- {\advance\nofMParguments \plusone
+ {\advance\nofMParguments 1
\expandafter\def
\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}%
\handleMPsequence}
@@ -527,12 +436,12 @@
{\csname\@@MP\the\nofMPsegments\number#1\endcsname}
\def\dogMPa#1%
- {\@EAEAEA\do\csname\@@MP0\number#1\endcsname}
+ {\expandafter\expandafter\expandafter\do\csname\@@MP0\number#1\endcsname}
\def\setMPkeyword#1 %
{\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}%
- \advance\nofMPsegments \plusone
- \nofMParguments\zerocount}
+ \advance\nofMPsegments 1
+ \nofMParguments0}
\def\getMPkeyword% #1%
{\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname}
@@ -549,7 +458,7 @@
%D when dealing with comments.
\def\doresetMPstack
- {\nofMParguments\zerocount}
+ {\nofMParguments0\relax}
\def\resetMPstack
{\let\handleMPgraphic\handleMPendgraphic
@@ -597,6 +506,7 @@
%D when needed we either ignore or obey them
\bgroup
+\defineMPtoPDFfallbacks
\catcode`\|=\@@comment
\catcode`\%=\@@active
\catcode`\[=\@@active
@@ -653,6 +563,7 @@
%D that we cannot change the catcodes in between.
\bgroup
+\defineMPtoPDFfallbacks
\catcode`\%=\@@active
\gdef\startMPscanning{\let%=\startMPconversion}
\egroup
@@ -680,17 +591,15 @@
%D speed up the conversion by handling the \type{path}
%D seperately.
-\def\@EAEAEA{\expandafter\expandafter\expandafter} % to be sure
-
\def\dohandleMPsequence#1%
{\ifdone
\ifcase\lccode`#1\relax
- \@EAEAEA\dohandleMPsequenceA
+ \expandafter\expandafter\expandafter\dohandleMPsequenceA
\else
- \@EAEAEA\dohandleMPsequenceB
+ \expandafter\expandafter\expandafter\dohandleMPsequenceB
\fi
\else
- \@EA\dohandleMPsequenceC
+ \expandafter\dohandleMPsequenceC
\fi#1}
%\def\dohandleMPsequenceA#1 %
@@ -699,80 +608,203 @@
\let\dohandleMPsequenceA\setMPsequence
+% \def\dohandleMPsequenceB#1 %
+% {\edef\somestring{#1}%
+% \ifx\somestring\PSmoveto
+% \edef\lastMPmoveX{\gMPa1}%
+% \edef\lastMPmoveY{\gMPa2}%
+% \PDFcode{\!MPgMPa1 \!MPgMPa2 m}%
+% \resetMPstack
+% \else\ifx\somestring\PSnewpath
+% \let\handleMPsequence\handleMPpath
+% \else\ifx\somestring\PSgsave
+% \PDFcode{q}%
+% \resetMPstack
+% \else\ifx\somestring\PSgrestore
+% \PDFcode{Q}%
+% \resetMPstack
+% \else\ifx\somestring\PSdtransform % == setlinewidth
+% \let\handleMPsequence\handleMPdtransform
+% % after that we will encounter more tokens until setlinewidth+pop
+% % or pop+setlinewidth which we catch next; we explicitly need to
+% % reset the stack since [] n setdash may follow; a more clever
+% % approach would be to read on till the condition is met, but it's
+% % the only pop / setlinewidth we will encounter so ...
+% \else\ifx\somestring\PSsetlinewidth
+% % already handled in dtransform
+% \resetMPstack
+% \else\ifx\somestring\PSpop
+% % already handled in dtransform
+% \resetMPstack
+% \else\ifx\somestring\PSconcat
+% \cleanupMPconcat
+% \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
+% \resetMPstack
+% \else\ifx\somestring\PSsetrgbcolor
+% \handleMPrgbcolor
+% \resetMPstack
+% \else\ifx\somestring\PSsetcmykcolor
+% \handleMPcmykcolor
+% \resetMPstack
+% \else\ifx\somestring\PSsetgray
+% \handleMPgraycolor
+% \resetMPstack
+% \else\ifx\somestring\PStranslate
+% \PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
+% \resetMPstack
+% \else\ifx\somestring\PSsetdash
+% \handleMPsetdash
+% \resetMPstack
+% \else\ifx\somestring\PSsetlinejoin
+% \PDFcode{\gMPa1 j}%
+% \resetMPstack
+% \else\ifx\somestring\PSsetmiterlimit
+% \PDFcode{\gMPa1 M}%
+% \resetMPstack
+% \else\ifx\somestring\PSfshow
+% \PDFcode{n}%
+% \handleMPfshow
+% \resetMPstack
+% \else\ifx\somestring\PSsetlinecap
+% \PDFcode{\gMPa1 J}%
+% \resetMPstack
+% \else\ifx\somestring\PSrlineto
+% \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
+% \resetMPstack
+% \else\ifx\somestring\PSscale
+% \PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
+% \resetMPstack
+% \else\ifx\somestring\PSspecial
+% \handleMPspecialcommand
+% \resetMPstack
+% \else
+% \handleMPgraphic% {#1}%
+% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+% \handleMPsequence}
+
+\def\installMPSkeywordN#1#2%
+ {\expandafter\def\csname\@@MP:N:#1\endcsname{#2}}
+
+\def\installMPSshortcutN#1#2% todo: \let
+ {\expandafter\let\csname\@@MP:N:#1\expandafter\endcsname\csname\@@MP:N:#2\endcsname}
+
\def\dohandleMPsequenceB#1 %
{\edef\somestring{#1}%
- \ifx\somestring\PSmoveto
- \edef\lastMPmoveX{\gMPa1}%
- \edef\lastMPmoveY{\gMPa2}%
- \PDFcode{\!MPgMPa1 \!MPgMPa2 m}%
- \resetMPstack
- \else\ifx\somestring\PSnewpath
- \let\handleMPsequence\handleMPpath
- \else\ifx\somestring\PSgsave
- \PDFcode{q}%
- \resetMPstack
- \else\ifx\somestring\PSgrestore
- \PDFcode{Q}%
- \resetMPstack
- \else\ifx\somestring\PSdtransform % == setlinewidth
- \let\handleMPsequence\handleMPdtransform
- % after that we will encounter more tokens until setlinewidth+pop
- % or pop+setlinewidth which we catch next; we explicitly need to
- % reset the stack since [] n setdash may follow; a more clever
- % approach would be to read on till the condition is met, but it's
- % the only pop / setlinewidth we will encounter so ...
- \else\ifx\somestring\PSsetlinewidth
- % already handled in dtransform
- \resetMPstack
- \else\ifx\somestring\PSpop
- % already handled in dtransform
- \resetMPstack
- \else\ifx\somestring\PSconcat
- \cleanupMPconcat
- \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
- \resetMPstack
- \else\ifx\somestring\PSsetrgbcolor
- \handleMPrgbcolor
- \resetMPstack
- \else\ifx\somestring\PSsetcmykcolor
- \handleMPcmykcolor
- \resetMPstack
- \else\ifx\somestring\PSsetgray
- \handleMPgraycolor
- \resetMPstack
- \else\ifx\somestring\PStranslate
- \PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
- \resetMPstack
- \else\ifx\somestring\PSsetdash
- \handleMPsetdash
- \resetMPstack
- \else\ifx\somestring\PSsetlinejoin
- \PDFcode{\gMPa1 j}%
- \resetMPstack
- \else\ifx\somestring\PSsetmiterlimit
- \PDFcode{\gMPa1 M}%
- \resetMPstack
- \else\ifx\somestring\PSfshow
- \PDFcode{n}%
- \handleMPfshow
- \resetMPstack
- \else\ifx\somestring\PSsetlinecap
- \PDFcode{\gMPa1 J}%
- \resetMPstack
- \else\ifx\somestring\PSrlineto
- \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
- \resetMPstack
- \else\ifx\somestring\PSscale
- \PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
- \resetMPstack
- \else\ifx\somestring\PSspecial
- \handleMPspecialcommand
- \resetMPstack
+ \ifcsname\@@MP:N:\somestring\endcsname
+ \csname\@@MP:N:\somestring\expandafter\endcsname
\else
- \handleMPgraphic% {#1}%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \expandafter\handleMPgraphic
+ \fi
\handleMPsequence}
+\ifx\eTeXversion\undefined
+ \def\dohandleMPsequenceB#1 %
+ {\edef\somestring{#1}%
+ \expandafter\ifx\csname\@@MP:N:\somestring\endcsname\relax
+ \expandafter\handleMPgraphic
+ \else
+ \csname\@@MP:N:\somestring\expandafter\endcsname
+ \fi
+ \handleMPsequence}
+\fi
+
+\installMPSkeywordN \PSmoveto
+ {\edef\lastMPmoveX{\gMPa1}%
+ \edef\lastMPmoveY{\gMPa2}%
+ \resetMPstack}
+\installMPSkeywordN \PSnewpath
+ {\let\handleMPsequence\handleMPpath}
+\installMPSkeywordN \PSgsave
+ {\PDFcode{q}%
+ \resetMPstack}
+\installMPSkeywordN \PSgrestore
+ {\PDFcode{Q}%
+ \resetMPstack}
+\installMPSkeywordN \PSdtransform % == setlinewidth
+ {\let\handleMPsequence\handleMPdtransform}
+ % after that we will encounter more tokens until setlinewidth+pop
+ % or pop+setlinewidth which we catch next; we explicitly need to
+ % reset the stack since [] n setdash may follow; a more clever
+ % approach would be to read on till the condition is met, but it's
+ % the only pop / setlinewidth we will encounter so ...
+\installMPSkeywordN \PSsetlinewidth
+ {% already handled in dtransform
+ \resetMPstack}
+\installMPSkeywordN \PSpop
+ {% already handled in dtransform
+ \resetMPstack}
+\installMPSkeywordN \PSconcat
+ {\cleanupMPconcat
+ \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
+ \resetMPstack}
+\installMPSkeywordN \PSsetrgbcolor
+ {\handleMPrgbcolor
+ \resetMPstack}
+\installMPSkeywordN \PSsetcmykcolor
+ {\handleMPcmykcolor
+ \resetMPstack}
+\installMPSkeywordN \PSsetgray
+ {\handleMPgraycolor
+ \resetMPstack}
+\installMPSkeywordN \PStranslate
+ {\PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
+ \resetMPstack}
+\installMPSkeywordN \PSsetdash
+ {\handleMPsetdash
+ \resetMPstack}
+\installMPSkeywordN \PSsetlinejoin
+ {\PDFcode{\gMPa1 j}%
+ \resetMPstack}
+\installMPSkeywordN \PSsetmiterlimit
+ {\PDFcode{\gMPa1 M}%
+ \resetMPstack}
+\installMPSkeywordN \PSfshow
+ {%\PDFcode{n}% removed !
+ \handleMPfshow
+ \resetMPstack}
+\installMPSkeywordN \PSsetlinecap
+ {\PDFcode{\gMPa1 J}%
+ \resetMPstack}
+\installMPSkeywordN \PSrlineto
+ {\flushMPmoveto
+ \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
+ \resetMPmoveto
+ \resetMPstack}
+\installMPSkeywordN \PSscale
+ {\PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
+ \resetMPstack}
+\installMPSkeywordN \PSspecial
+ {\handleMPspecialcommand
+ \resetMPstack}
+
+\installMPSshortcutN {n} \PSnewpath
+\installMPSshortcutN {p} \PSclosepath
+\installMPSshortcutN {l} \PSlineto
+\installMPSshortcutN {r} \PSrlineto
+\installMPSshortcutN {m} \PSmoveto
+\installMPSshortcutN {c} \PScurveto
+\installMPSshortcutN {C} \PSsetcmykcolor
+\installMPSshortcutN {G} \PSsetgray
+\installMPSshortcutN {R} \PSsetrgbcolor
+\installMPSshortcutN {lj} \PSsetlinejoin
+\installMPSshortcutN {ml} \PSsetmiterlimit
+\installMPSshortcutN {lc} \PSsetlinecap
+\installMPSshortcutN {sd} \PSsetdash
+\installMPSshortcutN {S} \PSstroke
+\installMPSshortcutN {F} \PSfill
+\installMPSshortcutN {W} \PSclip
+
+\installMPSshortcutN {q} \PSgsave
+\installMPSshortcutN {Q} \PSgrestore
+
+\installMPSshortcutN {s} \PSscale
+\installMPSshortcutN {t} \PSconcat
+\installMPSshortcutN {P} \PSshowpage
+
+\installMPSkeywordN {hlw} {\PDFcode{\gMPa1 w}\resetMPstack}
+\installMPSkeywordN {vlw} {\PDFcode{\gMPa1 w}\resetMPstack}
+\installMPSkeywordN {rd} {\PDFcode{[] 0 d}\resetMPstack}
+
\def\dohandleMPsequenceC#1 %
{\edef\somestring{#1}%
\handleMPgraphic % {#1}%
@@ -805,9 +837,11 @@
\def\handleMPendgraphic % #1%
{\ifx\somestring\PSshowpage
\let\handleMPsequence\finishMPgraphic
+ \else\ifx\somestring\PSEof
+ \let\handleMPsequence\finishMPgraphic
\else
\letMPargument\somestring % {#1}%
- \fi}
+ \fi\fi}
\def\handleMPbegingraphic % #1%
{\ifx\somestring\PSBoundingBox
@@ -818,18 +852,34 @@
\def\handleMPsequence{\handleMPboundingbox3}%
\else\ifx\somestring\PSshowpage
\let\handleMPsequence\finishMPgraphic
+ \else\ifx\somestring\PSEof
+ \let\handleMPsequence\finishMPgraphic
\else\ifx\somestring\PSPage
\let\handleMPsequence\handleMPpage
\else\ifx\somestring\PSMetaPostSpecials
\let\handleMPsequence\handleMPspecialscomment
\else\ifx\somestring\PSMetaPostSpecial
\let\handleMPsequence\handleMPspecialcomment
+ \else\ifx\somestring\PSBeginProlog
+ \let\handleMPsequence\handleMPprolog
\else
\letMPargument\somestring % {#1}%
- \fi\fi\fi\fi\fi\fi\fi}
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi}
\let\handleMPgraphic=\handleMPbegingraphic
+%D New: we can best filter the prolog because nowdays it can contain
+%D quite some code.
+
+% hm, catcode mess, so we need to tweak %'s catcode here
+% \long\expandafter\def\expandafter\handleMPprolog\expandafter#\expandafter1\PSEndProlog%
+% but today i'm not in the mood for ugly stuff
+
+\long\def\handleMPprolog#1EndProlog %
+ {\doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
%D We check for three kind of bounding boxes: the normal one
%D and two high precision ones:
%D
@@ -850,20 +900,20 @@
{\ifnum#1>\currentMPboundingbox
\xdef\MPllx{#2}\xdef\MPlly{#3}%
\xdef\MPurx{#4}\xdef\MPury{#5}%
- \dimen0=#2\onepoint
+ \dimen0=#2pt
\dimen0=-\MPxscale\dimen0
- \dimen2=#3\onepoint
+ \dimen2=#3pt
\dimen2=-\MPyscale\dimen2
\xdef\MPxoffset{\withoutpt\the\dimen0}%
\xdef\MPyoffset{\withoutpt\the\dimen2}%
- \dimen0=#2\onebasepoint
+ \dimen0=#2bp
\dimen0=-\dimen0
- \dimen2=#3\onebasepoint
+ \dimen2=#3bp
\dimen2=-\dimen2
- \advance\dimen0 #4\onebasepoint
+ \advance\dimen0 #4bp
\dimen0=\MPxscale\dimen0
\xdef\MPwidth{\the\dimen0}%
- \advance\dimen2 #5\onebasepoint
+ \advance\dimen2 #5bp
\xdef\MPyshift{\the\dimen2}% unscaled
\dimen2=\MPyscale\dimen2
\xdef\MPheight{\the\dimen2}%
@@ -873,7 +923,7 @@
\let\handleMPsequence\dohandleMPsequence
\let\next\handleMPsequence
\ifskipemptyMPgraphic
- \ifdim\MPheight=\zeropoint\relax\ifdim\MPwidth=\zeropoint\relax
+ \ifdim\MPheight=0pt\relax\ifdim\MPwidth=0pt\relax
\def\next{\endinput\finishMPgraphic}%
\fi\fi
\fi
@@ -931,31 +981,31 @@
\let\ \relax % mp breaks long lines and appends a \
\edef\size{\gMPa\nofMParguments}%
\ifx\size\PSnfont % round font size (to pt)
- \advance\nofMParguments \minusone
- \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
- \ifdim\scratchdimen<\onepoint
+ \advance\nofMParguments -1
+ \expandafter\scratchdimen\gMPa\nofMParguments pt\relax
+ \ifdim\scratchdimen<1pt
\def\size{1pt}%
\else
- \advance\scratchdimen .5\onepoint
+ \advance\scratchdimen .5pt
\def\size##1.##2\relax{\def\size{##1pt}}%
\expandafter\size\the\scratchdimen\relax
\fi
\else
\edef\size{\size bp}%
\fi
- \advance\nofMParguments \minusone
+ \advance\nofMParguments -1
%\font\temp=\gMPa\nofMParguments\space at \size
\let\temp\relax % to be sure
\setMPfshowfont{\gMPa\nofMParguments}\size
- \advance\nofMParguments \minusone
+ \advance\nofMParguments -1
\temp
\MPfshowcommand
- {\ifnum\nofMParguments=\plusone
+ {\ifnum\nofMParguments=1
\def\do(##1){##1}%
\dogMPa1%
\else
% we need to catch ( a ) (a a a) (\123 \123 \123) etc
- \scratchcounter\plusone
+ \scratchcounter1
\def\dodo##1% Andreas Fieger's bug: (\304...)
{\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
\ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
@@ -963,7 +1013,7 @@
\dogMPa\scratchcounter\MPspacechar
\let\do\relax
\loop
- \advance\scratchcounter \plusone
+ \advance\scratchcounter 1
\ifnum\scratchcounter<\nofMParguments\relax
\gMPa\scratchcounter\MPspacechar
\repeat
@@ -971,25 +1021,11 @@
\dogMPa\scratchcounter
\fi
\unskip}}%
- %
- % this fails in some versions of pdftex
- %
- % \dimen0=\lastMPmoveY bp
- % \advance\dimen0 by \ht0
- % \ScaledPointsToBigPoints{\number\dimen0}\lastMPmoveY
- % \PDFcode{n q 1 0 0 1 \lastMPmoveX\space\lastMPmoveY\space cm}%
- % \dimen0=\ht0
- % \advance\dimen0 by \dp0
- % \box0
- % \vskip-\dimen0
- % \PDFcode{Q}%
- % \egroup}
- %
\setbox\scratchbox\hbox
- {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint\box\scratchbox}%
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \wd\scratchbox\zeropoint
+ {\hskip\lastMPmoveX bp\raise\lastMPmoveY bp\box\scratchbox}%
+ \ht\scratchbox0pt%
+ \dp\scratchbox0pt%
+ \wd\scratchbox0pt%
\box\scratchbox
\egroup}
@@ -1031,11 +1067,11 @@
{\bgroup
\ignoreMPspecials
\def\somestring{[}%
- \scratchcounter\plusone
+ \scratchcounter1
\loop
\ifnum\scratchcounter<\nofMParguments
\edef\somestring{\somestring\space\gMPa\scratchcounter}%
- \advance\scratchcounter \plusone
+ \advance\scratchcounter 1
\repeat
\edef\somestring{\somestring]\gMPa\scratchcounter\space d}%
\PDFcode{\somestring}%
@@ -1069,7 +1105,7 @@
%D so we can use this one to trigger setting the linewidth.
\def\handleMPdtransform
- {\ifdim\gMPa1\onepoint>\zeropoint
+ {\ifdim\gMPa1 pt>0pt
\PDFcode{\gMPa1 w}%
\def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}%
\else
@@ -1113,7 +1149,7 @@
\let\closeMPpath\relax
\let\flushMPpath\flushnormalMPpath
\resetMPstack
- \nofMPsegments\plusone
+ \nofMPsegments1
\let\handleMPsequence\dohandleMPpath
\dohandleMPpath}
@@ -1159,19 +1195,19 @@
% \def\flushnormalMPpath
% {\scratchcounter\nofMPsegments
-% \nofMPsegments\plusone
+% \nofMPsegments 1
% \loop
% \flushnormalMPsegment
-% \advance\nofMPsegments \plusone
+% \advance\nofMPsegments 1
% \ifnum\nofMPsegments<\scratchcounter
% \repeat}
%
% \def\flushconcatMPpath
% {\scratchcounter\nofMPsegments
-% \nofMPsegments\plusone
+% \nofMPsegments 1
% \loop
% \flushconcatMPsegment
-% \advance\nofMPsegments \plusone
+% \advance\nofMPsegments 1
% \ifnum\nofMPsegments<\scratchcounter
% \repeat}
%
@@ -1179,14 +1215,14 @@
\def\doflushsomeMPpath
{\dodoflushsomeMPpath
- \advance\nofMPsegments \plusone
+ \advance\nofMPsegments 1
\ifnum\nofMPsegments<\scratchcounter
\expandafter\doflushsomeMPpath
\fi}
\def\flushsomeMPpath
{\scratchcounter\nofMPsegments
- \nofMPsegments\plusone
+ \nofMPsegments 1
\doflushsomeMPpath}
\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath}
@@ -1224,7 +1260,7 @@
%OLD \def\doMPreducedimen#1
%OLD {\count0\MPconcatfactor
-%OLD \advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\count0
+%OLD \advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\count0
%OLD \divide\dimen#1 \count0\relax}
%OLD % too inaccurate (see old pragma logo)
@@ -1234,7 +1270,7 @@
%OLD \divide\dimen#1 \count0\relax}
%OLD \def\doMPreducedimen#1
-%OLD {\advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\MPconcatfactor
+%OLD {\advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\MPconcatfactor
%OLD \divide\dimen#1 \MPconcatfactor}
%D The transformation code is rewritten by Daniel H. Luecking who
@@ -1258,13 +1294,13 @@
\newdimen\MPscratchDim % will be assigned global
\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt
- {\MPscratchCnt\zerocount
+ {\MPscratchCnt0
\doMPadjustdimen}
\def\doMPadjustdimen
- {\ifdim\MPscratchDim>\onepoint
+ {\ifdim\MPscratchDim>1pt
\divide\MPscratchDim 2
- \advance\MPscratchCnt \plusone
+ \advance\MPscratchCnt 1
\expandafter\doMPadjustdimen
\fi}
@@ -1292,14 +1328,14 @@
\def\doMPreadjustdimen
{\ifnum\MPscratchCnt>2
\divide\scratchdimen 2
- \advance\MPscratchCnt \minusone
+ \advance\MPscratchCnt -1
\expandafter\doMPreadjustdimen
\fi}
\def\MPreciprocaldeterminant
{\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y
\advance\scratchdimen - \withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y
- \ifdim\scratchdimen<\zeropoint % we need a positive dimension
+ \ifdim\scratchdimen<0pt % we need a positive dimension
\scratchdimen-\scratchdimen % for \MPadjustdimen (?)
\doMPreciprocal
\scratchdimen-\scratchdimen
@@ -1313,7 +1349,7 @@
% todo: dimexpr
\def\doMPreciprocal % replace \scratchdimen with its reciprocal
- {\ifdim\scratchdimen=\onepoint \else
+ {\ifdim\scratchdimen=1pt \else
\MPadjustdimen
\scratchcounter\MPnumerator
\divide\scratchcounter\scratchdimen
@@ -1322,20 +1358,20 @@
\fi}
%OLD \def\presetMPconcat
-%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0 % r_x
-%OLD \dimen 2=\gMPs2\onepoint \doMPreducedimen 2 % s_x
-%OLD \dimen 4=\gMPs3\onepoint \doMPreducedimen 4 % s_y
-%OLD \dimen 6=\gMPs4\onepoint \doMPreducedimen 6 % r_y
-%OLD \dimen 8=\gMPs5\onepoint \doMPreducedimen 8 % t_x
-%OLD \dimen10=\gMPs6\onepoint \doMPreducedimen10 } % t_y
+%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0 % r_x
+%OLD \dimen 2=\gMPs2pt \doMPreducedimen 2 % s_x
+%OLD \dimen 4=\gMPs3pt \doMPreducedimen 4 % s_y
+%OLD \dimen 6=\gMPs4pt \doMPreducedimen 6 % r_y
+%OLD \dimen 8=\gMPs5pt \doMPreducedimen 8 % t_x
+%OLD \dimen10=\gMPs6pt \doMPreducedimen10 } % t_y
%OLD
%OLD \def\presetMPscale
-%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0
-%OLD \dimen 2 \zeropoint
-%OLD \dimen 4 \zeropoint
-%OLD \dimen 6=\gMPs2\onepoint \doMPreducedimen 6
-%OLD \dimen 8 \zeropoint
-%OLD \dimen10 \zeropoint}
+%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0
+%OLD \dimen 2=0pt
+%OLD \dimen 4=0pt
+%OLD \dimen 6=\gMPs2pt \doMPreducedimen 6
+%OLD \dimen 8=0pt
+%OLD \dimen10=0pt}
\def\cleanupMPconcat
{\ignoreMPspecials
@@ -1344,24 +1380,24 @@
\keepMPspecials}
\def\presetMPconcat
- {\dimen 0=\gMPs1\onepoint % s_x
- \dimen 2=\gMPs2\onepoint % r_x
- \dimen 4=\gMPs3\onepoint % r_y
- \dimen 6=\gMPs4\onepoint % s_y
- \dimen 8=\gMPs5\onepoint % t_x
- \dimen10=\gMPs6\onepoint} % t_y
+ {\dimen 0=\gMPs1pt % s_x
+ \dimen 2=\gMPs2pt % r_x
+ \dimen 4=\gMPs3pt % r_y
+ \dimen 6=\gMPs4pt % s_y
+ \dimen 8=\gMPs5pt % t_x
+ \dimen10=\gMPs6pt} % t_y
\def\presetMPscale
- {\dimen 0=\gMPs1\onepoint
- \dimen 2 \zeropoint
- \dimen 4 \zeropoint
- \dimen 6=\gMPs2\onepoint
- \dimen 8 \zeropoint
- \dimen10 \zeropoint}
+ {\dimen 0=\gMPs1pt
+ \dimen 2=0pt
+ \dimen 4=0pt
+ \dimen 6=\gMPs2pt
+ \dimen 8=0pt
+ \dimen10=0pt}
\def\noMPtranslate % use this one grouped
- {\dimen 8 \zeropoint % t_x
- \dimen10 \zeropoint} % t_y
+ {\dimen 8=0pt % t_x
+ \dimen10=0pt} % t_y
%D \starttyping
%D \def\doMPconcat#1#2#3#4%
@@ -1537,18 +1573,18 @@
%OLD {\dimen12=#1pt % p_x
%OLD \dimen14=#3pt % p_y
%OLD %
-%OLD \chardef\MPfactor\zerocount
+%OLD \chardef\MPfactor0
%OLD \ifdim\dimen4<\MPcriteriumB\ifdim\dimen4>-\MPcriteriumB
%OLD \ifdim\dimen6<\MPcriteriumB\ifdim\dimen6>-\MPcriteriumB
%OLD \ifdim\dimen8<\MPcriteriumB\ifdim\dimen8>-\MPcriteriumB
%OLD \ifdim\dimen10<\MPcriteriumB\ifdim\dimen10>-\MPcriteriumB
-%OLD \chardef\MPfactor\plusone
+%OLD \chardef\MPfactor1
%OLD \fi\fi
%OLD \fi\fi
%OLD \fi\fi
%OLD \fi\fi
%OLD \ifcase\MPfactor % spurious 0 removed
-%OLD \chardef\MPfactor\plusone
+%OLD \chardef\MPfactor1
%OLD \ifdim\dimen12<\MPcriteriumA\ifdim\dimen12>-\MPcriteriumA
%OLD \ifdim\dimen14<\MPcriteriumA\ifdim\dimen14>-\MPcriteriumA
%OLD \chardef\MPfactor16
@@ -1590,8 +1626,8 @@
%OLD \multiply \dimen20 \dimen10
%OLD \advance \dimen12 -\dimen20
%OLD %
-%OLD \ifdim\dimen16=\onepoint \else
-%OLD \ifdim\dimen16>\MPconcatfactor \onepoint \relax
+%OLD \ifdim\dimen16=1pt \else
+%OLD \ifdim\dimen16>\MPconcatfactor 1pt \relax
%OLD \doMPreducedimen16
%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18
%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12
@@ -1621,8 +1657,8 @@
%D If this should ever cause problems, the scale factors can be reduced.
% \def\doMPconcat#1#2#3#4%
-% {\dimen12=#1pt % p_x % #1\onepoint
-% \dimen14=#3pt % p_y % #3\onepoint
+% {\dimen12=#1pt % p_x % #1pt
+% \dimen14=#3pt % p_y % #3pt
% \advance\dimen12 -\dimen8 % p_x - t_x
% \advance\dimen14 -\dimen10 % p_y - t_y
% \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
@@ -1636,8 +1672,8 @@
% \edef#4{\withoutpt\the\dimen14}} % p_y^\prime
\def\doMPconcat#1#2#3#4%
- {\dimen12=#1pt % p_x % #1\onepoint
- \dimen14=#3pt % p_y % #3\onepoint
+ {\dimen12=#1pt % p_x % #1pt
+ \dimen14=#3pt % p_y % #3pt
\advance\dimen12 -\dimen8 % p_x - t_x
\advance\dimen14 -\dimen10 % p_y - t_y
\dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
@@ -1917,7 +1953,7 @@
\fi
\let\handleMPsequence\dohandleMPsequence
\resetMPstack
- \nofMPsegments\zerocount
+ \nofMPsegments0
\handleMPsequence}
%D The following \METAPOST\ code is quite valid but, when
@@ -1936,7 +1972,7 @@
{\ifcase\finiMPpath
\ifnum\nofMPsegments<3 % n is one ahead
\message{omitting zero clip path}%
- \nofMPsegments\zerocount
+ \nofMPsegments0
\fi
\fi}
@@ -1959,9 +1995,9 @@
\def\dohandleMPpath#1%
{\ifcase\lccode`#1\relax
- \@EA\dohandleMPpathA
+ \expandafter\dohandleMPpathA
\else
- \@EA\dohandleMPpathB
+ \expandafter\dohandleMPpathB
\fi#1}
%\def\dohandleMPpathA#1 %
@@ -1970,44 +2006,118 @@
\let\dohandleMPpathA\setMPsequence
+% \def\dohandleMPpathB#1 %
+% {\def\somestring{#1}%
+% \ifx\somestring\PSlineto
+% \setMPkeyword0
+% \else\ifx\somestring\PScurveto
+% \setMPkeyword1
+% \else\ifx\somestring\PSrlineto
+% \setMPkeyword2
+% \else\ifx\somestring\PSmoveto
+% \setMPkeyword3
+% \else\ifx\somestring\PSclip
+% % \chardef\finiMPpath0 % already
+% \let\handleMPsequence\processMPpath
+% \else\ifx\somestring\PSgsave
+% \chardef\finiMPpath3
+% \else\ifx\somestring\PSgrestore
+% \else\ifx\somestring\PSfill
+% \ifcase\finiMPpath
+% \chardef\finiMPpath2
+% \let\handleMPsequence\processMPpath
+% \fi
+% \else\ifx\somestring\PSstroke
+% \ifcase\finiMPpath
+% \chardef\finiMPpath1
+% \fi
+% \let\handleMPsequence\processMPpath
+% \else\ifx\somestring\PSclosepath
+% \def\closeMPpath{\PDFcode{h}}%
+% \else\ifx\somestring\PSconcat
+% \cleanupMPconcat
+% \let\flushMPpath\flushconcatMPpath
+% \handleMPpathconcat
+% \else\ifx\somestring\PSscale
+% \let\flushMPpath\flushconcatMPpath
+% \handleMPpathscale
+% \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+% \handleMPsequence}
+
+\def\installMPSkeywordP#1#2%
+ {\expandafter\def\csname\@@MP:P:#1\endcsname{#2}}
+
+\def\installMPSshortcutP#1#2% todo: \let
+ {\expandafter\let\csname\@@MP:P:#1\expandafter\endcsname\csname\@@MP:P:#2\endcsname}
+
\def\dohandleMPpathB#1 %
{\def\somestring{#1}%
- \ifx\somestring\PSlineto
- \setMPkeyword0
- \else\ifx\somestring\PScurveto
- \setMPkeyword1
- \else\ifx\somestring\PSrlineto
- \setMPkeyword2
- \else\ifx\somestring\PSmoveto
- \setMPkeyword3
- \else\ifx\somestring\PSclip
- % \chardef\finiMPpath0 % already
- \let\handleMPsequence\processMPpath
- \else\ifx\somestring\PSgsave
- \chardef\finiMPpath3
- \else\ifx\somestring\PSgrestore
- \else\ifx\somestring\PSfill
- \ifcase\finiMPpath
- \chardef\finiMPpath2
- \let\handleMPsequence\processMPpath
- \fi
- \else\ifx\somestring\PSstroke
- \ifcase\finiMPpath
- \chardef\finiMPpath1
- \fi
- \let\handleMPsequence\processMPpath
- \else\ifx\somestring\PSclosepath
- \def\closeMPpath{\PDFcode{h}}%
- \else\ifx\somestring\PSconcat
- \cleanupMPconcat
- \let\flushMPpath\flushconcatMPpath
- \handleMPpathconcat
- \else\ifx\somestring\PSscale
- \let\flushMPpath\flushconcatMPpath
- \handleMPpathscale
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \ifcsname\@@MP:P:\somestring\endcsname
+ \csname\@@MP:P:\somestring\expandafter\endcsname
+ \fi
\handleMPsequence}
+\ifx\eTeXversion\undefined
+ \def\dohandleMPpathB#1 %
+ {\def\somestring{#1}%
+ \csname\@@MP:P:\somestring\endcsname
+ \handleMPsequence}
+\fi
+
+\installMPSkeywordP \PSlineto
+ {\setMPkeyword0 }
+\installMPSkeywordP \PScurveto
+ {\setMPkeyword1 }
+\installMPSkeywordP \PSrlineto
+ {\setMPkeyword2 }
+\installMPSkeywordP \PSmoveto
+ {\edef\lastMPmoveX{\gMPs1}%
+ \edef\lastMPmoveY{\gMPs2}%
+ \resetMPstack
+ \setMPkeyword3 }
+\installMPSkeywordP \PSclip
+ {% \chardef\finiMPpath\zerocount % already
+ \let\handleMPsequence\processMPpath}
+\installMPSkeywordP \PSgsave
+ {\chardef\finiMPpath3 }
+\installMPSkeywordP \PSgrestore
+ {}
+\installMPSkeywordP \PSfill
+ {\ifcase\finiMPpath
+ \chardef\finiMPpath2
+ \let\handleMPsequence\processMPpath
+ \fi}
+\installMPSkeywordP \PSstroke
+ {\ifcase\finiMPpath
+ \chardef\finiMPpath1
+ \fi
+ \let\handleMPsequence\processMPpath}
+\installMPSkeywordP \PSclosepath
+ {\def\closeMPpath{\PDFcode{h}}}
+\installMPSkeywordP \PSconcat
+ {\cleanupMPconcat
+ \let\flushMPpath\flushconcatMPpath
+ \handleMPpathconcat}
+\installMPSkeywordP \PSscale
+ {\let\flushMPpath\flushconcatMPpath
+ \handleMPpathscale}
+
+\installMPSshortcutP {l} \PSlineto
+\installMPSshortcutP {r} \PSrlineto
+\installMPSshortcutP {m} \PSmoveto
+\installMPSshortcutP {c} \PScurveto
+
+\installMPSshortcutP {q} \PSgsave
+\installMPSshortcutP {Q} \PSgrestore
+\installMPSshortcutP {S} \PSstroke
+\installMPSshortcutP {F} \PSfill
+\installMPSshortcutP {B} \PSgsave
+\installMPSshortcutP {W} \PSclip
+\installMPSshortcutP {p} \PSclosepath
+
+\installMPSshortcutP {s} \PSscale
+\installMPSshortcutP {t} \PSconcat
+
%D The main conversion command is:
%D
%D \starttyping
@@ -2055,10 +2165,11 @@
\def\convertMPtoPDF % #1#2#3%
{\bgroup
+ \defineMPtoPDFfallbacks
\ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
\setbox\scratchbox\vbox\bgroup
- \xdef\MPheight{\zeropoint}%
- \xdef\MPwidth {\zeropoint}%
+ \xdef\MPheight{0pt}%
+ \xdef\MPwidth {0pt}%
\forgetall
\offinterlineskip
\startMPresources
@@ -2074,15 +2185,7 @@
\let\setMPextensions\relax
\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
- {% the following line is needed for latex where onepoint is not
- % onepoint but a number (maxdimen); some day i'll make a latex
- % variant of this file so that i no longer have to deal with such
- % issues; then i'll also speed up this module using a few context
- % tricks
- %
- \let\onepoint\onerealpoint
- %
- \setMPspecials
+ {\setMPspecials
\setMPextensions
\the\everyMPtoPDFconversion
\catcode`\^^M=\@@endofline
@@ -2092,65 +2195,16 @@
\xdef\MPyscale{#3}%
\xdef\MPxoffset{0}%
\xdef\MPyoffset{0}%
- \xdef\MPyshift{\zeropoint}%
+ \xdef\MPyshift{0pt}%
\donefalse
\let\handleMPsequence\dohandleMPsequence
\message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway
\input#1\relax}
-% strange rounding/clip in pdftex/viewer
-%
-% \def\finishMPgraphic
-% {\stopMPresources
-% \egroup
-% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
-% \chardef\makeMPintoPDFobject=0
-% \fi\fi
-% \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
-% \chardef\makeMPintoPDFobject=1
-% \fi\fi
-% \setbox\scratchbox=\vbox
-% {\forgetall
-% \hbox
-% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
-% \lower\MPyshift\box\scratchbox % unscaled shift
-% \PDFcode{Q}}}%
-% \ht\scratchbox\MPheight
-% \wd\scratchbox\MPwidth
-% \dp\scratchbox\zeropoint
-% \ifcase\makeMPintoPDFobject
-% \box\scratchbox
-% \or
-% \immediate\pdfxform resources{\currentPDFresources}\scratchbox
-% \xdef\lastPDFMPobject{\the\pdflastxform}%
-% \pdfrefxform\lastPDFMPobject
-% \global\let\currentPDFresources\empty
-% \else
-% \box\scratchbox
-% \fi
-% \egroup}
-%
-% funny clip in viewer
-%
-% \setbox\scratchbox=\vbox
-% {\forgetall
-% \dimen0=\MPllx bp
-% \dimen2=\MPlly bp
-% \setbox\scratchbox=\hbox{\hskip-\dimen0\raise-\dimen2\box\scratchbox}%
-% \ht\scratchbox=\zeropoint
-% \dp\scratchbox=\zeropoint
-% \wd\scratchbox=\zeropoint
-% \hbox
-% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space 0 0 cm}%
-% \lower\MPshift\box\scratchbox
-% \PDFcode{Q}}}%
-
-% \let\PDFMPformoffset\zeropoint
-
\def\PDFMPformoffset
- {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
+ {\ifx\objectoffset\undefined0pt\else\objectoffset\fi}
-\chardef\blackoutMPgraphic\zerocount % in ConTeXt \plusone
+\chardef\blackoutMPgraphic0 % in ConTeXt 1
\def\finishMPgraphic
{\stopMPresources
@@ -2164,7 +2218,7 @@
\PDFcode{Q}}}%
\ht\scratchbox\MPheight
\wd\scratchbox\MPwidth
- \dp\scratchbox\zeropoint\relax
+ \dp\scratchbox0pt\relax
\dopackageMPgraphic\scratchbox
\egroup
\endinput}
@@ -2174,28 +2228,28 @@
\def\dopackageMPgraphic#1% #1 = boxregister
{%\ifx\pdfxform\undefined
- % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
+ % \chardef\makeMPintoPDFobject0 % no pdftex at all
%\else\ifx\pdftexversion\undefined
- % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
+ % \chardef\makeMPintoPDFobject0 % no pdftex at all
%\else\ifnum\pdftexversion<14
- % \chardef\makeMPintoPDFobject\zerocount % no resource support
+ % \chardef\makeMPintoPDFobject0 % no resource support
%\else
% % keep the default value
%\fi\fi\fi
\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
% an existing value of 2 signals object support (set elsewhere)
- \chardef\makeMPintoPDFobject\plusone
+ \chardef\makeMPintoPDFobject1
\fi\fi
\ifcase\makeMPintoPDFobject
\box#1%
\or
\scratchdimen\PDFMPformoffset\relax
- \ifdim\scratchdimen>\zeropoint % compensate for error
+ \ifdim\scratchdimen>0pt % compensate for error
\setbox#1\vbox spread 2\scratchdimen
{\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}%
\fi
\setMPPDFobject{\currentPDFresources}{#1}%
- \ifdim\scratchdimen>\zeropoint % compensate for error
+ \ifdim\scratchdimen>0pt % compensate for error
\vbox to \MPheight
{\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}%
\else
@@ -2262,6 +2316,4 @@
%D does all the calculations. Converting other \POSTSCRIPT\
%D files would drive both me and \TEX\ crazy.
-\ifx\undefined\StopLatexHack \else \StopLatexHack \fi
-
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-vis.tex b/Master/texmf-dist/tex/context/base/supp-vis.tex
index efe47751fe2..1c3daf1e1da 100644
--- a/Master/texmf-dist/tex/context/base/supp-vis.tex
+++ b/Master/texmf-dist/tex/context/base/supp-vis.tex
@@ -265,7 +265,7 @@
\fi
-\def~{\normalpenalty\!!tenthousand\ }
+\ifx\contextversion\undefined \def~{\normalpenalty\!!tenthousand\ } \fi
%D \macros
%D {makeruledbox}
@@ -353,6 +353,10 @@
\let\dowithruledbox\relax
+\let\ruledheight\!!zeropoint
+\let\ruleddepth \!!zeropoint
+\let\ruledwidth \!!zeropoint
+
\def\makeruledbox#1%
{\edef\ruledheight{\the\ht#1}%
\edef\ruleddepth {\the\dp#1}%
@@ -1872,7 +1876,7 @@
\ifx\bodyfontsize\undefined
\edef\defaulttestrulewidth{\the\testrulewidth}
\else
- \def\defaulttestrulewidth{.02\bodyfontsize} % still dutch
+ \def\defaulttestrulewidth{.02\bodyfontsize}
\fi
\def\showmakeup
diff --git a/Master/texmf-dist/tex/context/base/symb-cow.tex b/Master/texmf-dist/tex/context/base/symb-cow.tex
index 6fd32a53517..09f90030289 100644
--- a/Master/texmf-dist/tex/context/base/symb-cow.tex
+++ b/Master/texmf-dist/tex/context/base/symb-cow.tex
@@ -60,53 +60,72 @@
\def\CowLogo#1%
{\getglyph{CowsLogo}{\char#1\relax}}
+\chardef\CowPragmaNormal= 1
+\chardef\CowPragmaShaded=20
+
\startsymbolset[cownormal]
-\definesymbol[CowPragma] [\CowLogo{1}]
-\definesymbol[CowConTeXt] [\CowLogo{2}]
-\definesymbol[CowConTeXtComplete][\CowLogo{3}]
-\definesymbol[CowConTeXtShadow] [\CowLogo{4}]
-\definesymbol[CowConTeXtContour] [\CowLogo{5}]
-\definesymbol[CowConTeXtOutline] [\CowLogo{6}]
-\definesymbol[CowConTeXtDots] [\CowLogo{7}]
-\definesymbol[CowMP] [\CowLogo{8}]
-\definesymbol[CowMPComplete] [\CowLogo{9}]
-\definesymbol[CowTeX] [\CowLogo{10}]
-\definesymbol[CowTeXComplete] [\CowLogo{11}]
-\definesymbol[CowBoo] [\CowLogo{12}]
-\definesymbol[CowCow] [\CowLogo{13}]
-\definesymbol[CowExampleComplete][\CowLogo{14}]
-\definesymbol[CowFoxetComplete] [\CowLogo{15}]
-\definesymbol[CowMetafun] [\CowLogo{16}]
-\definesymbol[CowMetafunComplete][\CowLogo{17}]
-\definesymbol[CowTEX] [\CowLogo{18}]
-\definesymbol[CowTeX] [\CowLogo{18}]
-\definesymbol[CowWiki] [\CowLogo{19}]
+\definesymbol[CowPragmaADE] [\CowLogo{0}]
+\definesymbol[CowPragma] [\CowLogo{1}]
+\definesymbol[CowConTeXt] [\CowLogo{2}]
+\definesymbol[CowConTeXtComplete] [\CowLogo{3}]
+\definesymbol[CowConTeXtShadow] [\CowLogo{4}]
+\definesymbol[CowConTeXtContour] [\CowLogo{5}]
+\definesymbol[CowConTeXtOutline] [\CowLogo{6}]
+\definesymbol[CowConTeXtDots] [\CowLogo{7}]
+\definesymbol[CowMP] [\CowLogo{8}]
+\definesymbol[CowMPComplete] [\CowLogo{9}]
+\definesymbol[CowTeX] [\CowLogo{10}]
+\definesymbol[CowTeXComplete] [\CowLogo{11}]
+\definesymbol[CowBoo] [\CowLogo{12}]
+\definesymbol[CowCow] [\CowLogo{13}]
+\definesymbol[CowExampleComplete] [\CowLogo{14}]
+\definesymbol[CowFoxetComplete] [\CowLogo{15}]
+\definesymbol[CowMetafun] [\CowLogo{16}]
+\definesymbol[CowMetafunComplete] [\CowLogo{17}]
+\definesymbol[CowTEXComplete] [\CowLogo{18}]
+\definesymbol[CowWikiComplete] [\CowLogo{19}]
+\definesymbol[CowPragmaADEComplete][\CowLogo{20}]
+\definesymbol[CowPragmaComplete] [\CowLogo{21}]
+\definesymbol[CowExample] [\CowLogo{22}]
+\definesymbol[CowFoxet] [\CowLogo{23}]
+\definesymbol[CowTEX] [\CowLogo{24}]
+\definesymbol[CowWiki] [\CowLogo{25}]
+\definesymbol[CowCowTeXtComplete] [\CowLogo{26}]
+\definesymbol[CowCowTeXt] [\CowLogo{27}]
\stopsymbolset
\startsymbolset[cowcontour]
-\definesymbol[CowPragma] [\CowContour{1}]
-\definesymbol[CowConTeXt] [\CowContour{2}]
-\definesymbol[CowConTeXtComplete][\CowContour{3}]
-\definesymbol[CowConTeXtShadow] [\CowContour{4}]
-\definesymbol[CowConTeXtContour] [\CowContour{5}]
-\definesymbol[CowConTeXtOutline] [\CowContour{6}]
-\definesymbol[CowConTeXtDots] [\CowContour{7}]
-\definesymbol[CowMP] [\CowContour{8}]
-\definesymbol[CowMPComplete] [\CowContour{9}]
-\definesymbol[CowTeX] [\CowContour{10}]
-\definesymbol[CowTeXComplete] [\CowContour{11}]
-\definesymbol[CowBoo] [\CowContour{12}]
-\definesymbol[CowCow] [\CowContour{13}]
-\definesymbol[CowExampleComplete][\CowContour{14}]
-\definesymbol[CowFoxetComplete] [\CowContour{15}]
-\definesymbol[CowMetafun] [\CowContour{16}]
-\definesymbol[CowMetafunComplete][\CowContour{17}]
-\definesymbol[CowTEX] [\CowContour{18}]
-\definesymbol[CowTeX] [\CowContour{18}]
-\definesymbol[CowWiki] [\CowContour{19}]
+\definesymbol[CowPragmaADE] [\CowLogo{0}]
+\definesymbol[CowPragma] [\CowLogo{1}]
+\definesymbol[CowConTeXt] [\CowLogo{2}]
+\definesymbol[CowConTeXtComplete] [\CowLogo{3}]
+\definesymbol[CowConTeXtShadow] [\CowLogo{4}]
+\definesymbol[CowConTeXtContour] [\CowLogo{5}]
+\definesymbol[CowConTeXtOutline] [\CowLogo{6}]
+\definesymbol[CowConTeXtDots] [\CowLogo{7}]
+\definesymbol[CowMP] [\CowLogo{8}]
+\definesymbol[CowMPComplete] [\CowLogo{9}]
+\definesymbol[CowTeX] [\CowLogo{10}]
+\definesymbol[CowTeXComplete] [\CowLogo{11}]
+\definesymbol[CowBoo] [\CowLogo{12}]
+\definesymbol[CowCow] [\CowLogo{13}]
+\definesymbol[CowExampleComplete] [\CowLogo{14}]
+\definesymbol[CowFoxetComplete] [\CowLogo{15}]
+\definesymbol[CowMetafun] [\CowLogo{16}]
+\definesymbol[CowMetafunComplete] [\CowLogo{17}]
+\definesymbol[CowTEXComplete] [\CowLogo{18}]
+\definesymbol[CowWikiComplete] [\CowLogo{19}]
+\definesymbol[CowPragmaADEComplete][\CowLogo{20}]
+\definesymbol[CowPragmaComplete] [\CowLogo{21}]
+\definesymbol[CowExample] [\CowLogo{22}]
+\definesymbol[CowFoxet] [\CowLogo{23}]
+\definesymbol[CowTEX] [\CowLogo{24}]
+\definesymbol[CowWiki] [\CowLogo{25}]
+\definesymbol[CowCowTeXtComplete] [\CowLogo{26}]
+\definesymbol[CowCowTeXt] [\CowLogo{27}]
\stopsymbolset
diff --git a/Master/texmf-dist/tex/context/base/symb-ini.tex b/Master/texmf-dist/tex/context/base/symb-ini.tex
index a3a9048b82b..3cf50e411e3 100644
--- a/Master/texmf-dist/tex/context/base/symb-ini.tex
+++ b/Master/texmf-dist/tex/context/base/symb-ini.tex
@@ -200,6 +200,9 @@
\def\figuresymbol
{\dodoubleempty\dofiguresymbol}
+\ifx\externalfigure \undefined \def\externalfigure[#1][#2]{#1} \fi
+\ifx\resetexternalfigures\undefined \let\resetexternalfigures\relax \fi
+
\def\dofiguresymbol[#1][% #2]%
{\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,}% #2]}
diff --git a/Master/texmf-dist/tex/context/base/symb-mis.tex b/Master/texmf-dist/tex/context/base/symb-mis.tex
index 5a24ab832fd..c63053abbef 100644
--- a/Master/texmf-dist/tex/context/base/symb-mis.tex
+++ b/Master/texmf-dist/tex/context/base/symb-mis.tex
@@ -132,8 +132,11 @@
%D The next two symbols are for Daniel Flipo:
-\definesymbol [Numero] [N\high{\nocap{o}\kern.2em}]
-\definesymbol [numero] [n\high{\nocap{o}\kern.2em}]
+\ifx\high \undefined \let\high \firstofoneargument \fi % todo
+\ifx\notsmallcapped\undefined \let\notsmallcapped\firstofoneargument \fi % todo
+
+\definesymbol [Numero] [N\high{\notsmallcapped{o}\kern.2em}]
+\definesymbol [numero] [n\high{\notsmallcapped{o}\kern.2em}]
\def\Numero{\symbol[Numero]}
\def\numero{\symbol[numero]}
diff --git a/Master/texmf-dist/tex/context/base/symb-run.tex b/Master/texmf-dist/tex/context/base/symb-run.tex
index 3ad195f8243..4e714832c52 100644
--- a/Master/texmf-dist/tex/context/base/symb-run.tex
+++ b/Master/texmf-dist/tex/context/base/symb-run.tex
@@ -24,8 +24,8 @@
\setupcolors[\c!state=\v!start]% to prevent mps color conversion
\dontcomplain
\def\doshowsymbols% global needed due to grouping in alignment
- {\expanded{\globalprocesscommalist[\symbolset{#1}]}\docommando}%
- \def\docommando##1%
+ {\expanded{\globalprocesscommalist[\symbolset{#1}]}\docommand}%
+ \def\docommand##1%
{\vbox
{\forgetall
\tttf
diff --git a/Master/texmf-dist/tex/context/base/syst-cat.mkii b/Master/texmf-dist/tex/context/base/syst-cat.mkii
new file mode 100644
index 00000000000..6146102586e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-cat.mkii
@@ -0,0 +1,61 @@
+%D \module
+%D [ file=syst-cat,
+%D version=2006.09.18,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=Catcode Handling,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\def\newcatcodetable#1%
+ {\global\advance\cctdefcounter\plusone
+ \global\mathchardef#1\cctdefcounter
+ \expandafter\xdef\csname @@ccn:\number\cctdefcounter\endcsname{\string#1}% logging
+ \expandafter\newtoks\csname @@cct:\number\cctdefcounter\endcsname}
+
+\mathchardef\currentcatcodetable\zerocount
+
+\newtoks \setdefaultlowercatcodes
+\newtoks \setdefaultuppercatcodes
+
+\def\next#1% we don't have a proper loop defined yet
+ {\edef\nextnext{#1{\the#1\catcode\the\cctcountera\space\ifnum\catcode\cctcountera=11 11\else12\fi}}%
+ \nextnext\ifnum\cctcountera<\cctcounterb \advance\cctcountera\plusone \expandafter\next\expandafter#1\fi}
+
+\cctcountera 0 \cctcounterb 127 \next\setdefaultlowercatcodes
+\cctcountera 128 \cctcounterb 255 \next\setdefaultuppercatcodes
+
+% \chardef\activehackcode=`~
+
+% \def\next#1% we don't have a proper loop defined yet
+% {\catcode\cctcountera 13
+% \cctcounterc\uccode\activehackcode
+% \uccode\activehackcode\cctcountera
+% \catcode\uccode\activehackcode 13
+% \uppercase{\edef~{\detokenize{~}}}%
+% \uccode\activehackcode\cctcounterc
+% \ifnum\cctcountera<\cctcounterb \advance\cctcountera\plusone \expandafter\next\expandafter#1\fi}
+
+% \cctcountera 128 \cctcounterb 255 \next\setdefaultuppercatcodes
+
+\recatcodeuppercharactersfalse
+
+\def\catcodetable#1%
+ {\mathchardef\currentcatcodetable#1%
+ \the\setdefaultlowercatcodes
+ \ifrecatcodeuppercharacters\the\setdefaultuppercatcodes\fi
+ \the\csname @@cct:\number#1\endcsname}
+
+\long\def\startcatcodetable#1#2\stopcatcodetable
+ {\global\csname @@cct:\number#1\endcsname{#2}}
+
+\long\def\startextendcatcodetable#1#2\stopextendcatcodetable
+ {\global\csname @@cct:\number#1\endcsname\expandafter{\the\csname @@cct:\number#1\endcsname#2}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-cat.tex b/Master/texmf-dist/tex/context/base/syst-cat.tex
new file mode 100644
index 00000000000..53bfc29b252
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-cat.tex
@@ -0,0 +1,397 @@
+%D \module
+%D [ file=syst-cat,
+%D version=2006.09.18,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=Catcode Handling,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D A long standing wish has been the availability of catcode
+%D arrays. Because traditional \TEX\ does ot provide this we
+%D implement a fake method in the Mark II file.
+
+\ifx\zerocount\undefined \chardef \zerocount= 0 \fi
+\ifx\plusone \undefined \chardef \plusone = 1 \fi
+\ifx\minusone \undefined \newcount\minusone \minusone =-1 \fi
+
+\newif \ifrecatcodeuppercharacters % only used in good old tex
+
+\newcount\cctdefcounter \cctdefcounter\plusone % 0 = signal
+
+\newcount\cctcountera
+\newcount\cctcounterb
+\newcount\cctcounterc
+
+\loadmarkfile{syst-cat}
+
+%D The next command can be defined in a cleaner way in the
+%D Mk IV file but we want to have a fast one with a minimal
+%D chance for interference.
+
+\chardef\activehackcode=`\~
+
+%D Once a catcode is assigned, the next assignments will happen faster.
+
+\def\letcatcodecommand {\afterassignment\letcatcodecommanda\cctcountera}
+\def\letcatcodecommanda{\afterassignment\letcatcodecommandb\cctcounterb}
+
+\def\letcatcodecommandb % each time time
+ {\ifcsname CCD:\number\cctcountera:\number\cctcounterb\endcsname
+ \csname CCD:\number\cctcountera:\number\cctcounterb\expandafter\endcsname
+ \else
+ \expandafter\letcatcodecommandc
+ \fi}
+
+\def\letcatcodecommandc % only first time
+ {\expandafter\gdef\csname CCD:\number\cctcountera:\number\cctcounterb\expandafter\endcsname\expandafter
+ {\expandafter\let\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname}%
+ \reinstatecatcodecommanda
+ \csname CCD:\number\cctcountera:\number\cctcounterb\endcsname}
+
+\def\reinstatecatcodecommand{\afterassignment\reinstatecatcodecommanda\cctcounterb}
+
+\def\reinstatecatcodecommanda % can be used when a direct definition has been done
+ {\bgroup % and the selector has been lost
+ \uccode\activehackcode\cctcounterb
+ \catcode\uccode\activehackcode13
+ \uppercase{\xdef~{\noexpand\catcodecommand{\number\cctcounterb}}}%
+ \egroup}
+
+\chardef\defaultcatcodetable\zerocount
+
+\def\catcodecommand#1%
+ {\csname CCC:\number
+ \ifcsname CCC:\number\currentcatcodetable:\number#1\endcsname
+ \currentcatcodetable \else \defaultcatcodetable
+ \fi
+ :\number#1\endcsname}
+
+%D Here we define some catcode regimes:
+
+\ifx\nilcatcodes \undefined \newcatcodetable \nilcatcodes \fi
+\ifx\texcatcodes \undefined \newcatcodetable \texcatcodes \fi
+\ifx\ctxcatcodes \undefined \newcatcodetable \ctxcatcodes \fi
+\ifx\vrbcatcodes \undefined \newcatcodetable \vrbcatcodes \fi
+\ifx\prtcatcodes \undefined \newcatcodetable \prtcatcodes \fi
+\ifx\xmlcatcodesn\undefined \newcatcodetable \xmlcatcodesn \fi % normal
+\ifx\xmlcatcodese\undefined \newcatcodetable \xmlcatcodese \fi % entitle
+\ifx\xmlcatcodesr\undefined \newcatcodetable \xmlcatcodesr \fi % reduce
+
+% was redefined in core-job anyway: \catcode`\^^L = 13 % ascii form-feed
+
+\startcatcodetable \nilcatcodes
+ \catcode`\^^I = 10 % ascii tab is a blank space
+ \catcode`\^^M = 5 % ascii return is end-line
+ \catcode`\^^L = 5 % ascii form-feed
+ \catcode`\ = 10 % ascii space is blank space
+ \catcode`\^^Z = 9 % ascii eof is ignored
+\stopcatcodetable
+
+\startcatcodetable \vrbcatcodes % probably less needed
+ \catcode`\^^I = 12
+ \catcode`\^^M = 12
+ \catcode`\^^L = 12
+ \catcode`\ = 12
+ \catcode`\^^Z = 12
+\stopcatcodetable
+
+\startcatcodetable \texcatcodes
+ \catcode`\^^I = 10
+ \catcode`\^^M = 5
+ \catcode`\^^L = 5
+ \catcode`\ = 10
+ \catcode`\^^Z = 9
+ \catcode`\\ = 0
+ \catcode`\{ = 1
+ \catcode`\} = 2
+ \catcode`\$ = 3
+ \catcode`\& = 4
+ \catcode`\# = 6
+ \catcode`\^ = 7
+ \catcode`\_ = 8
+ \catcode`\% = 14
+\stopcatcodetable
+
+\startcatcodetable \ctxcatcodes
+ \catcode`\^^I = 10
+ \catcode`\^^M = 5
+% \catcode`\^^J = 10 % new
+ \catcode`\^^L = 5
+ \catcode`\ = 10
+ \catcode`\^^Z = 9
+ \catcode`\\ = 0
+ \catcode`\{ = 1
+ \catcode`\} = 2
+ \catcode`\$ = 3
+ \catcode`\& = 4
+ \catcode`\# = 6
+ \catcode`\^ = 7
+ \catcode`\_ = 8
+ \catcode`\% = 14
+ \catcode`\~ = 13
+ \catcode`\| = 13
+\stopcatcodetable
+
+\startcatcodetable \prtcatcodes
+ \catcode`\^^I = 10
+ \catcode`\^^M = 5
+ \catcode`\^^L = 5
+ \catcode`\ = 10
+ \catcode`\^^Z = 9
+ \catcode`\\ = 0
+ \catcode`\{ = 1
+ \catcode`\} = 2
+ \catcode`\$ = 3
+ \catcode`\& = 4
+ \catcode`\# = 6
+ \catcode`\^ = 7
+ \catcode`\_ = 8
+ \catcode`\% = 14
+ \catcode`\@ = 11
+ \catcode`\! = 11
+ \catcode`\? = 11
+ \catcode`\~ = 13
+ \catcode`\| = 13
+\stopcatcodetable
+
+\startcatcodetable \xmlcatcodesn
+ \catcode`\^^I = 10 % ascii tab is a blank space
+ \catcode`\^^M = 5 % ascii return is end-line
+ \catcode`\^^L = 5 % ascii form-feed
+ \catcode`\ = 10 % ascii space is blank space
+ \catcode`\^^Z = 9 % ascii eof is ignored
+ \catcode`\& = 13 % entity
+ \catcode`\< = 13 % element
+ \catcode`\> = 12
+ \catcode`\" = 12 % probably not needed any more
+ \catcode`\/ = 12 % probably not needed any more
+ \catcode`\' = 12 % probably not needed any more
+ \catcode`\~ = 12 % probably not needed any more
+ \catcode`\# = 12 % probably not needed any more
+ \catcode`\\ = 12 % probably not needed any more
+\stopcatcodetable
+
+\startcatcodetable \xmlcatcodese
+ \catcode`\^^I = 10 % ascii tab is a blank space
+ \catcode`\^^M = 5 % ascii return is end-line
+ \catcode`\^^L = 5 % ascii form-feed
+ \catcode`\ = 10 % ascii space is blank space
+ \catcode`\^^Z = 9 % ascii eof is ignored
+ \catcode`\& = 13 % entity
+ \catcode`\< = 13 % element
+ \catcode`\> = 12
+ \catcode`\# = 13
+ \catcode`\$ = 13
+ \catcode`\% = 13
+ \catcode`\\ = 13
+ \catcode`\^ = 13
+ \catcode`\_ = 13
+ \catcode`\{ = 13
+ \catcode`\} = 13
+ \catcode`\| = 13
+ \catcode`\~ = 13
+\stopcatcodetable
+
+\startcatcodetable \xmlcatcodesr
+ \catcode`\^^I = 10 % ascii tab is a blank space
+ \catcode`\^^M = 5 % ascii return is end-line
+ \catcode`\^^L = 5 % ascii form-feed
+ \catcode`\ = 10 % ascii space is blank space
+ \catcode`\^^Z = 9 % ascii eof is ignored
+ \catcode`\& = 13 % entity
+ \catcode`\< = 13 % element
+ \catcode`\> = 12
+ \catcode`\# = 13
+ \catcode`\$ = 13
+ \catcode`\% = 13
+ \catcode`\\ = 13
+ \catcode`\^ = 13
+ \catcode`\_ = 13
+ \catcode`\{ = 13
+ \catcode`\} = 13
+ \catcode`\| = 13
+ \catcode`\~ = 13
+\stopcatcodetable
+
+\letcatcodecommand \ctxcatcodes `\| \relax
+\letcatcodecommand \ctxcatcodes `\~ \relax
+
+%letcatcodecommand \prtcatcodes `\| \relax % falls back on ctx
+%letcatcodecommand \prtcatcodes `\~ \relax % falls back on ctx
+
+\letcatcodecommand \xmlcatcodesn `\& \relax
+\letcatcodecommand \xmlcatcodesn `\< \relax
+
+\letcatcodecommand \xmlcatcodese `\& \relax
+\letcatcodecommand \xmlcatcodese `\< \relax
+
+\letcatcodecommand \xmlcatcodesr `\& \relax
+\letcatcodecommand \xmlcatcodesr `\< \relax
+
+\letcatcodecommand \xmlcatcodese `\# \relax
+\letcatcodecommand \xmlcatcodese `\$ \relax
+\letcatcodecommand \xmlcatcodese `\% \relax
+\letcatcodecommand \xmlcatcodese `\\ \relax
+\letcatcodecommand \xmlcatcodese `\^ \relax
+\letcatcodecommand \xmlcatcodese `\_ \relax
+\letcatcodecommand \xmlcatcodese `\{ \relax
+\letcatcodecommand \xmlcatcodese `\} \relax
+\letcatcodecommand \xmlcatcodese `\| \relax
+\letcatcodecommand \xmlcatcodese `\~ \relax
+
+\letcatcodecommand \xmlcatcodesr `\# \relax
+\letcatcodecommand \xmlcatcodesr `\$ \relax
+\letcatcodecommand \xmlcatcodesr `\% \relax
+\letcatcodecommand \xmlcatcodesr `\\ \relax
+\letcatcodecommand \xmlcatcodesr `\^ \relax
+\letcatcodecommand \xmlcatcodesr `\_ \relax
+\letcatcodecommand \xmlcatcodesr `\{ \relax
+\letcatcodecommand \xmlcatcodesr `\} \relax
+\letcatcodecommand \xmlcatcodesr `\| \relax
+\letcatcodecommand \xmlcatcodesr `\~ \relax
+
+ \catcodetable \ctxcatcodes
+\let\defaultcatcodetable\ctxcatcodes
+\let\xmlcatcodes \xmlcatcodesn
+
+%D \macros
+%D {restorecatcodes,
+%D beginrestorecatcodes,endrestorecatcodes}
+%D
+%D We're not finished dealing \CATCODES\ yet. In \CONTEXT\ we
+%D use only one auxiliary file, which deals with tables of
+%D contents, registers, two pass tracking, references etc. This
+%D file, as well as files concerning graphics, is processed when
+%D needed, which can be in the mid of typesetting verbatim.
+%D However, when reading in data in verbatim mode, we should
+%D temporary restore the normal \CATCODES, and that's exactly
+%D what the next macros do. Saving the catcodes can be
+%D disabled by saying \type{\localcatcodestrue}.
+
+\let\savedcatcodetable\relax
+
+\newcount\catcoderestorelevel
+
+\def\pushcatcodetable
+ {\advance\catcoderestorelevel\plusone
+ \tracepushcatcodetable
+ \expandafter\mathchardef\csname scct:\number\catcoderestorelevel\endcsname\currentcatcodetable}
+
+% \def\popcatcodetable
+% {\expandafter\catcodetable\csname scct:\number\catcoderestorelevel\endcsname
+% \tracepopcatcodetable
+% \advance\catcoderestorelevel\minusone}
+
+\def\popcatcodetable
+ {\ifcase\catcoderestorelevel
+ \immediate\write16{}%
+ \immediate\write16{Fatal error: catcode push/pop mismatch. Fix this!}\wait\end
+ \immediate\write16{}%
+ \else
+ \expandafter\catcodetable\csname scct:\number\catcoderestorelevel\endcsname
+ \tracepopcatcodetable
+ \advance\catcoderestorelevel\minusone
+ \fi}
+
+\def\restorecatcodes % takes previous level
+ {\ifnum\catcoderestorelevel>\plusone
+ \expandafter\catcodetable\csname scct:\number\numexpr\catcoderestorelevel-1\relax\endcsname
+ \fi}
+
+\newtoks\everycatcodetable
+
+\def\setcatcodetable#1%
+ {\catcodetable#1%
+ \the\everycatcodetable
+ \tracesetcatcodetable}
+
+\def\dotracecatcodetable#1{\immediate\write16{[#1]}}
+
+\def\tracecatcodetables
+ {\def\tracesetcatcodetable {\dotracecatcodetable{set \catcodetablename\space at \number\catcoderestorelevel}}%
+ \def\tracepushcatcodetable{\dotracecatcodetable{push \catcodetablename\space from \catcodetableprev\space at \number\catcoderestorelevel}}%
+ \def\tracepopcatcodetable {\dotracecatcodetable{pop \catcodetablename\space to \catcodetableprev\space at \number\catcoderestorelevel}}}
+
+\def\catcodetableprev
+ {\ifnum\numexpr\catcoderestorelevel-1\relax>\zerocount
+ \csname @@ccn:\number\csname scct:\number\numexpr\catcoderestorelevel-1\relax\endcsname\endcsname
+ \else
+ -%
+ \fi}
+
+\def\catcodetablename
+ {\ifnum\currentcatcodetable>\zerocount
+ \csname @@ccn:\number\currentcatcodetable\endcsname
+ \else
+ -%
+ \fi}
+
+\ifx\empty\undefined \def\empty{} \fi
+
+\let\tracesetcatcodetable \empty
+\let\tracepushcatcodetable\empty
+\let\tracepopcatcodetable \empty
+
+% \def\beginrestorecatcodes{\pushcatcodetable\catcodetable\ctxcatcodes}
+% \def\endrestorecatcodes {\popcatcodetable}
+
+\def\beginrestorecatcodes{\pushcatcodetable}
+\def\endrestorecatcodes {\popcatcodetable}
+
+\def\unprotect {\pushcatcodetable\setcatcodetable\prtcatcodes}
+\def\protect {\popcatcodetable}
+
+%D \macros
+%D {installactivecharacter}
+
+
+\def\installactivecharacter#1 %
+ {\edef\temp{\detokenize{#1}}%
+ \cctcounterc\expandafter`\temp\relax % relax needed
+ \expandafter\startextendcatcodetable
+ \expandafter\ctxcatcodes\expandafter\catcode\the\cctcounterc=13
+ \stopextendcatcodetable
+ \letcatcodecommand \ctxcatcodes \cctcounterc \temp \relax
+ \ifnum\currentcatcodetable=\ctxcatcodes \setcatcodetable\ctxcatcodes \fi}
+
+%D \macros
+%D {defineactivecharacter}
+%D
+%D Use this one with care, esp in combination with catcode
+%D vectors. There are better ways now.
+
+\chardef\activehackcode=`~
+
+\def\defineactivecharacter #1 #2%
+ {\cctcounterc\uccode\activehackcode
+ \uccode\activehackcode\expandafter\doifnumberelse\expandafter{\string#1}\empty`#1%
+ \catcode\uccode\activehackcode13
+ \uppercase{\def\next{~}}%
+ \uccode\activehackcode\cctcounterc
+ \expandafter\expandafter\expandafter\def\expandafter\next\expandafter
+ {\expandafter\dohandleactivecharacter\next{#2}}}
+
+\chardef\activecharactermode\plusone % overloading still backward compatible
+
+\def\dodohandleactivecharacter#1#2{#2}
+\def\donthandleactivecharacter#1#2{\noexpand#1}
+
+\def\dohandleactivecharacter
+ {\ifcase\activecharactermode
+ \expandafter\donthandleactivecharacter
+ \else
+ \expandafter\dodohandleactivecharacter
+ \fi}
+
+\def\makecharacteractive #1 {\catcode`#1\active}
+
+%D Handy for debugging:
+
+% \tracecatcodetables
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-chr.tex b/Master/texmf-dist/tex/context/base/syst-chr.tex
new file mode 100644
index 00000000000..085d7429f0d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-chr.tex
@@ -0,0 +1,131 @@
+%D \module
+%D [ file=syst-chr,
+%D version=1997.01.03, % moved code
+%D title=\CONTEXT\ System Macros,
+%D subtitle=Character Related Things,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D We want to have access to the raw alternatives of the
+%D special characters. We use a \type {\xdef} instead of
+%D \type {\let} because we need an expandable token in a
+%D \type {\write}.
+
+\bgroup
+
+\catcode`B=\@@begingroup
+\catcode`E=\@@endgroup
+\catcode`.=\@@escape
+
+.catcode `.{ 12 .xdef .letteropenbrace B.string{E
+.catcode `.} 12 .xdef .letterclosebrace B.string}E
+.catcode `.& 12 .xdef .letterampersand B.string&E
+.catcode `.< 12 .xdef .letterless B.string<E
+.catcode `.> 12 .xdef .lettermore B.string>E
+.catcode `.# 12 .xdef .letterhash B.string#E
+.catcode `." 12 .xdef .letterdoublequote B.string"E
+.catcode `.' 12 .xdef .lettersinglequote B.string'E
+.catcode `.$ 12 .xdef .letterdollar B.string$E
+.catcode `.% 12 .xdef .letterpercent B.string%E
+.catcode `.^ 12 .xdef .letterhat B.string^E
+.catcode `._ 12 .xdef .letterunderscore B.string_E
+.catcode `.| 12 .xdef .letterbar B.string|E
+.catcode `.~ 12 .xdef .lettertilde B.string~E
+.catcode `.\ 12 .xdef .letterbackslash B.string\E
+.catcode `./ 12 .xdef .letterslash B.string/E
+.catcode `.? 12 .xdef .letterquestionmark B.string?E
+.catcode `.! 12 .xdef .letterexclamationmark B.string!E
+.catcode `.@ 12 .xdef .letterat B.string@E
+.catcode `.: 12 .xdef .lettercolon B.string:E
+
+ .global .let .letterescape .letterbackslash
+ .global .let .letterbgroup .letteropenbrace
+ .global .let .letteregroup .letterclosebrace
+ .global .let .letterleftbrace .letteropenbrace
+ .global .let .letterrightbrace .letterclosebrace
+
+.egroup
+
+%D \macros % check this one
+%D {setcatcodes,uncatcodespecials,
+%D uncatcodecharacters,uncatcodespacetokens,
+%D setnaturalcatcodes,
+%D setverbosecscharacters}
+%D
+%D As its name says, \type{\uncatcodecharacters} resets the
+%D \CATCODE\ of characters. When we use an upper bound of
+%D 127 or 255, depending in \type{\ifeightbitcharacters}. By
+%D counting down, we only have to use one counter. The
+%D macro \type{\setcatcodes} can be uses to set alternative
+%D values. The macro \type{\resetspecialcharacters} resets
+%D characters with special meanings. This macro is not used
+%D in the verbatim macros, but is best defined in this module.
+
+\newtoks\everycommoncatcodes % gone
+\newtoks\everynaturalcatcodes % gone
+\newtoks\everynormalcatcodes % gone
+
+\def\uncatcodespacetokens
+ {\catcode`\ =\@@space
+ \catcode`\^^L=\@@ignore
+ \catcode`\^^M=\@@endofline
+ \catcode`\^^?=\@@ignore}
+
+\def\uncatcodespecials {\setcatcodetable\nilcatcodes \uncatcodespacetokens}
+\def\setnaturalcatcodes {\setcatcodetable\nilcatcodes}
+\def\setnormalcatcodes {\setcatcodetable\ctxcatcodes} % maybe \texcatcodes
+\def\uncatcodecharacters {\setcatcodetable\nilcatcodes} % was fast version, gone now
+\def\uncatcodeallcharacters{\setcatcodetable\nilcatcodes} % was slow one, with restore
+
+%D Next follows a definition that lets some shortcuts expand to
+%D themselves.
+
+\def\setverbosecscharacter#1%
+ {\edef#1{\string#1}}
+
+\bgroup \catcode`\|=13 \catcode`\~=13
+
+\gdef\setverbosecscharacters % temporary hack
+ {\setverbosecscharacter |\setverbosecscharacter ~% context specific
+ \setverbosecscharacter\|\setverbosecscharacter\~%
+ \setverbosecscharacter\:\setverbosecscharacter\;%
+ \setverbosecscharacter\+\setverbosecscharacter\-%
+ \setverbosecscharacter\[\setverbosecscharacter\]%
+ \setverbosecscharacter\.\setverbosecscharacter\\%
+ \setverbosecscharacter\)\setverbosecscharacter\(%
+ \setverbosecscharacter\0\setverbosecscharacter\1%
+ \setverbosecscharacter\2\setverbosecscharacter\3%
+ \setverbosecscharacter\4\setverbosecscharacter\5%
+ \setverbosecscharacter\6\setverbosecscharacter\7%
+ \setverbosecscharacter\8\setverbosecscharacter\9%
+ \setverbosecscharacter\n\setverbosecscharacter\s%
+ \setverbosecscharacter\/}
+
+\egroup
+
+%D \macros
+%D {frenchspacing,nonfrenchspacing}
+%D
+%D This code should move.
+
+\def\setfrenchspacing#1%
+ {\sfcode`\.#1 \sfcode`\,#1\relax
+ \sfcode`\?#1 \sfcode`\!#1\relax
+ \sfcode`\:#1 \sfcode`\;#1\relax}
+
+\def\frenchspacing
+ {\setfrenchspacing{1000}}
+
+\def\resetfrenchspacing
+ {\sfcode`\.3000 \sfcode`\,1250
+ \sfcode`\?3000 \sfcode`\!3000
+ \sfcode`\:2000 \sfcode`\;1500 }
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-con.mkii b/Master/texmf-dist/tex/context/base/syst-con.mkii
new file mode 100644
index 00000000000..d5d044f31b3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-con.mkii
@@ -0,0 +1,148 @@
+%D \module
+%D [ file=syst-con,
+%D version=2000.12.10, % actually very old -)
+%D title=\CONTEXT\ System Macros,
+%D subtitle=Conversions,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D These macros may look slow but are actually rather fast due to
+%D the fact that \TEX\ handles conditional pretty fast. We need
+%D a two step approach in order to stay relax clean in fully
+%D expandable macros.
+
+\def\dolchexnumber#1\relax
+ {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
+ 8\or 9\or a\or b\or c\or d\or e\or f\else 0\fi}
+
+\def\douchexnumber#1\relax
+ {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
+ 8\or 9\or A\or B\or C\or D\or E\or F\else 0\fi}
+
+\def\dolchexnumbers#1\relax
+ {\ifcase#1
+ 00\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 0a\or 0b\or 0c\or 0d\or 0e\or 0f\or
+ 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 1a\or 1b\or 1c\or 1d\or 1e\or 1f\or
+ 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 2a\or 2b\or 2c\or 2d\or 2e\or 2f\or
+ 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or 38\or 39\or 3a\or 3b\or 3c\or 3d\or 3e\or 3f\or
+ 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or 48\or 49\or 4a\or 4b\or 4c\or 4d\or 4e\or 4f\or
+ 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or 58\or 59\or 5a\or 5b\or 5c\or 5d\or 5e\or 5f\or
+ 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or 68\or 69\or 6a\or 6b\or 6c\or 6d\or 6e\or 6f\or
+ 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or 78\or 79\or 7a\or 7b\or 7c\or 7d\or 7e\or 7f\or
+ 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or 88\or 89\or 8a\or 8b\or 8c\or 8d\or 8e\or 8f\or
+ 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or 98\or 99\or 9a\or 9b\or 9c\or 9d\or 9e\or 9f\or
+ a0\or a1\or a2\or a3\or a4\or a5\or a6\or a7\or a8\or a9\or aa\or ab\or ac\or ad\or ae\or af\or
+ b0\or b1\or b2\or b3\or b4\or b5\or b6\or b7\or b8\or b9\or ba\or bb\or bc\or bd\or be\or bf\or
+ c0\or c1\or c2\or c3\or c4\or c5\or c6\or c7\or c8\or c9\or ca\or cb\or cc\or cd\or ce\or cf\or
+ d0\or d1\or d2\or d3\or d4\or d5\or d6\or d7\or d8\or d9\or da\or db\or dc\or dd\or de\or df\or
+ e0\or e1\or e2\or e3\or e4\or e5\or e6\or e7\or e8\or e9\or ea\or eb\or ec\or ed\or ee\or ef\or
+ f0\or f1\or f2\or f3\or f4\or f5\or f6\or f7\or f8\or f9\or fa\or fb\or fc\or fd\or fe\or ff\fi}
+
+\def\douchexnumbers#1\relax
+ {\ifcase#1
+ 00\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 0A\or 0B\or 0C\or 0D\or 0E\or 0F\or
+ 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 1A\or 1B\or 1C\or 1D\or 1E\or 1F\or
+ 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 2A\or 2B\or 2C\or 2D\or 2E\or 2F\or
+ 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or 38\or 39\or 3A\or 3B\or 3C\or 3D\or 3E\or 3F\or
+ 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or 48\or 49\or 4A\or 4B\or 4C\or 4D\or 4E\or 4F\or
+ 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or 58\or 59\or 5A\or 5B\or 5C\or 5D\or 5E\or 5F\or
+ 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or 68\or 69\or 6A\or 6B\or 6C\or 6D\or 6E\or 6F\or
+ 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or 78\or 79\or 7A\or 7B\or 7C\or 7D\or 7E\or 7F\or
+ 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or 88\or 89\or 8A\or 8B\or 8C\or 8D\or 8E\or 8F\or
+ 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or 98\or 99\or 9A\or 9B\or 9C\or 9D\or 9E\or 9F\or
+ A0\or A1\or A2\or A3\or A4\or A5\or A6\or A7\or A8\or A9\or AA\or AB\or AC\or AD\or AE\or AF\or
+ B0\or B1\or B2\or B3\or B4\or B5\or B6\or B7\or B8\or B9\or BA\or BB\or BC\or BD\or BE\or BF\or
+ C0\or C1\or C2\or C3\or C4\or C5\or C6\or C7\or C8\or C9\or CA\or CB\or CC\or CD\or CE\or CF\or
+ D0\or D1\or D2\or D3\or D4\or D5\or D6\or D7\or D8\or D9\or DA\or DB\or DC\or DD\or DE\or DF\or
+ E0\or E1\or E2\or E3\or E4\or E5\or E6\or E7\or E8\or E9\or EA\or EB\or EC\or ED\or EE\or EF\or
+ F0\or F1\or F2\or F3\or F4\or F5\or F6\or F7\or F8\or F9\or FA\or FB\or FC\or FD\or FE\or FF\fi}
+
+\def\dooctnumber#1\relax
+ {\ifcase#1
+ 000\or 001\or 002\or 003\or 004\or 005\or 006\or 007\or
+ 010\or 011\or 012\or 013\or 014\or 015\or 016\or 017\or
+ 020\or 021\or 022\or 023\or 024\or 025\or 026\or 027\or
+ 030\or 031\or 032\or 033\or 034\or 035\or 036\or 037\or
+ 040\or 041\or 042\or 043\or 044\or 045\or 046\or 047\or
+ 050\or 051\or 052\or 053\or 054\or 055\or 056\or 057\or
+ 060\or 061\or 062\or 063\or 064\or 065\or 066\or 067\or
+ 070\or 071\or 072\or 073\or 074\or 075\or 076\or 077\or
+ 100\or 101\or 102\or 103\or 104\or 105\or 106\or 107\or
+ 110\or 111\or 112\or 113\or 114\or 115\or 116\or 117\or
+ 120\or 121\or 122\or 123\or 124\or 125\or 126\or 127\or
+ 130\or 131\or 132\or 133\or 134\or 135\or 136\or 137\or
+ 140\or 141\or 142\or 143\or 144\or 145\or 146\or 147\or
+ 150\or 151\or 152\or 153\or 154\or 155\or 156\or 157\or
+ 160\or 161\or 162\or 163\or 164\or 165\or 166\or 167\or
+ 170\or 171\or 172\or 173\or 174\or 175\or 176\or 177\or
+ 200\or 201\or 202\or 203\or 204\or 205\or 206\or 207\or
+ 210\or 211\or 212\or 213\or 214\or 215\or 216\or 217\or
+ 220\or 221\or 222\or 223\or 224\or 225\or 226\or 227\or
+ 230\or 231\or 232\or 233\or 234\or 235\or 236\or 237\or
+ 240\or 241\or 242\or 243\or 244\or 245\or 246\or 247\or
+ 250\or 251\or 252\or 253\or 254\or 255\or 256\or 257\or
+ 260\or 261\or 262\or 263\or 264\or 265\or 266\or 267\or
+ 270\or 271\or 272\or 273\or 274\or 275\or 276\or 277\or
+ 300\or 301\or 302\or 303\or 304\or 305\or 306\or 307\or
+ 310\or 311\or 312\or 313\or 314\or 315\or 316\or 317\or
+ 320\or 321\or 322\or 323\or 324\or 325\or 326\or 327\or
+ 330\or 331\or 332\or 333\or 334\or 335\or 336\or 337\or
+ 340\or 341\or 342\or 343\or 344\or 345\or 346\or 347\or
+ 350\or 351\or 352\or 353\or 354\or 355\or 356\or 357\or
+ 360\or 361\or 362\or 363\or 364\or 365\or 366\or 367\or
+ 370\or 371\or 372\or 373\or 374\or 375\or 376\or 377\fi}
+
+\def\lchexnumber #1{\@EA\dolchexnumber \number#1\relax}
+\def\uchexnumber #1{\@EA\douchexnumber \number#1\relax}
+\def\lchexnumbers#1{\@EA\dolchexnumbers\number#1\relax}
+\def\uchexnumbers#1{\@EA\douchexnumbers\number#1\relax}
+\def\octnumber #1{\@EA\dooctnumber \number#1\relax}
+
+%D No beauty but ok:
+
+\dostepwiserecurse{0}{9}{1}{\setevalue{@@uc@@\recurselevel}{\recurselevel}}
+
+\setvalue{@@uc@@a}{A} \setvalue{@@uc@@A}{A}
+\setvalue{@@uc@@b}{B} \setvalue{@@uc@@B}{B}
+\setvalue{@@uc@@c}{C} \setvalue{@@uc@@C}{C}
+\setvalue{@@uc@@d}{D} \setvalue{@@uc@@D}{D}
+\setvalue{@@uc@@e}{E} \setvalue{@@uc@@E}{E}
+\setvalue{@@uc@@f}{F} \setvalue{@@uc@@F}{F}
+
+\def\hexstringtonumber#1% {FF}
+ {\dohexstringtonumber#1}
+
+\def\dohexstringtonumber#1#2% FF
+ {"\csname @@uc@@#1\endcsname\csname @@uc@@#2\endcsname}
+
+%D The next conversion macro produces raw characters. We have to
+%D construct the macro in a special way to avoid problems with
+%D characters with special meanings. So, we revert to the
+%D lowercase conversion trick to bypass \TEX's input parser.
+
+\bgroup
+
+\catcode`\^^@=12 % ascii null == ignored in plain
+\catcode`\^^?=12 % ascii delete == invalid in plain
+
+\let\or\relax
+
+\xdef\rawcharacter{ ^^00\or}
+
+\dorecurse{255}
+ {\lccode`a=\recurselevel
+ \lowercase{\xdef\rawcharacter{\rawcharacter \string a\or}}} % string is needed for XeTeX
+
+\@EA\gdef\@EA\rawcharacter\@EA#\@EA1\@EA
+ {\@EA\ifcase\@EA#\@EA1\rawcharacter\fi}
+
+\egroup
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-con.tex b/Master/texmf-dist/tex/context/base/syst-con.tex
index cbef0dedc26..653d689284c 100644
--- a/Master/texmf-dist/tex/context/base/syst-con.tex
+++ b/Master/texmf-dist/tex/context/base/syst-con.tex
@@ -20,7 +20,7 @@
%D defining these in \type {font-ini}, we now have a dedicated
%D module.
-\catcode127=12 % \@@letter
+\catcode127=12 % other, just to be sure
%D \macros
%D {lchexnumber,uchexnumber,lchexnumbers,uchexnumbers}
@@ -48,108 +48,17 @@
%D [\expandafter\uchexnumber\expandafter{\the\zerocount}]
%D \stoptyping
-\def\lchexnumber#1%
- {\@EA\dolchexnumber\number#1\relax}
-
-\def\dolchexnumber#1\relax % \def\lchexnumber#1%
- {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
- 8\or 9\or a\or b\or c\or d\or e\or f\else 0\fi}
-
-\def\uchexnumber#1%
- {\@EA\douchexnumber\number#1\relax}
-
-\def\douchexnumber#1\relax % \def\uchexnumber#1%
- {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
- 8\or 9\or A\or B\or C\or D\or E\or F\else 0\fi}
-
-\let\hexnumber=\uchexnumber
-
-\def\lchexnumbers#1%
- {\@EA\dolchexnumbers\number#1\relax}
-
-\def\dolchexnumbers#1\relax % \def\lchexnumbers#1%
- {\ifcase#1
- 00\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 0a\or 0b\or 0c\or 0d\or 0e\or 0f\or
- 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 1a\or 1b\or 1c\or 1d\or 1e\or 1f\or
- 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 2a\or 2b\or 2c\or 2d\or 2e\or 2f\or
- 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or 38\or 39\or 3a\or 3b\or 3c\or 3d\or 3e\or 3f\or
- 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or 48\or 49\or 4a\or 4b\or 4c\or 4d\or 4e\or 4f\or
- 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or 58\or 59\or 5a\or 5b\or 5c\or 5d\or 5e\or 5f\or
- 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or 68\or 69\or 6a\or 6b\or 6c\or 6d\or 6e\or 6f\or
- 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or 78\or 79\or 7a\or 7b\or 7c\or 7d\or 7e\or 7f\or
- 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or 88\or 89\or 8a\or 8b\or 8c\or 8d\or 8e\or 8f\or
- 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or 98\or 99\or 9a\or 9b\or 9c\or 9d\or 9e\or 9f\or
- a0\or a1\or a2\or a3\or a4\or a5\or a6\or a7\or a8\or a9\or aa\or ab\or ac\or ad\or ae\or af\or
- b0\or b1\or b2\or b3\or b4\or b5\or b6\or b7\or b8\or b9\or ba\or bb\or bc\or bd\or be\or bf\or
- c0\or c1\or c2\or c3\or c4\or c5\or c6\or c7\or c8\or c9\or ca\or cb\or cc\or cd\or ce\or cf\or
- d0\or d1\or d2\or d3\or d4\or d5\or d6\or d7\or d8\or d9\or da\or db\or dc\or dd\or de\or df\or
- e0\or e1\or e2\or e3\or e4\or e5\or e6\or e7\or e8\or e9\or ea\or eb\or ec\or ed\or ee\or ef\or
- f0\or f1\or f2\or f3\or f4\or f5\or f6\or f7\or f8\or f9\or fa\or fb\or fc\or fd\or fe\or ff\fi}
-
-\def\uchexnumbers#1%
- {\@EA\douchexnumbers\number#1\relax}
-
-\def\douchexnumbers#1\relax % \def\uchexnumbers#1%
- {\ifcase#1
- 00\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 0A\or 0B\or 0C\or 0D\or 0E\or 0F\or
- 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 1A\or 1B\or 1C\or 1D\or 1E\or 1F\or
- 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 2A\or 2B\or 2C\or 2D\or 2E\or 2F\or
- 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or 38\or 39\or 3A\or 3B\or 3C\or 3D\or 3E\or 3F\or
- 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or 48\or 49\or 4A\or 4B\or 4C\or 4D\or 4E\or 4F\or
- 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or 58\or 59\or 5A\or 5B\or 5C\or 5D\or 5E\or 5F\or
- 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or 68\or 69\or 6A\or 6B\or 6C\or 6D\or 6E\or 6F\or
- 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or 78\or 79\or 7A\or 7B\or 7C\or 7D\or 7E\or 7F\or
- 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or 88\or 89\or 8A\or 8B\or 8C\or 8D\or 8E\or 8F\or
- 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or 98\or 99\or 9A\or 9B\or 9C\or 9D\or 9E\or 9F\or
- A0\or A1\or A2\or A3\or A4\or A5\or A6\or A7\or A8\or A9\or AA\or AB\or AC\or AD\or AE\or AF\or
- B0\or B1\or B2\or B3\or B4\or B5\or B6\or B7\or B8\or B9\or BA\or BB\or BC\or BD\or BE\or BF\or
- C0\or C1\or C2\or C3\or C4\or C5\or C6\or C7\or C8\or C9\or CA\or CB\or CC\or CD\or CE\or CF\or
- D0\or D1\or D2\or D3\or D4\or D5\or D6\or D7\or D8\or D9\or DA\or DB\or DC\or DD\or DE\or DF\or
- E0\or E1\or E2\or E3\or E4\or E5\or E6\or E7\or E8\or E9\or EA\or EB\or EC\or ED\or EE\or EF\or
- F0\or F1\or F2\or F3\or F4\or F5\or F6\or F7\or F8\or F9\or FA\or FB\or FC\or FD\or FE\or FF\fi}
+\let\lchexnumber \gobbleoneargument
+\let\uchexnumber \gobbleoneargument
+\let\lchexnumbers\gobbleoneargument
+\let\uchexnumbers\gobbleoneargument
%D \macros
%D {octnumber}
%D
%D For unicode remapping purposes, we need octal numbers.
-\def\octnumber#1%
- {\@EA\dooctnumber\number#1\relax}
-
-\def\dooctnumber#1\relax % \def\octnumber#1%
- {\ifcase#1
- 000\or 001\or 002\or 003\or 004\or 005\or 006\or 007\or
- 010\or 011\or 012\or 013\or 014\or 015\or 016\or 017\or
- 020\or 021\or 022\or 023\or 024\or 025\or 026\or 027\or
- 030\or 031\or 032\or 033\or 034\or 035\or 036\or 037\or
- 040\or 041\or 042\or 043\or 044\or 045\or 046\or 047\or
- 050\or 051\or 052\or 053\or 054\or 055\or 056\or 057\or
- 060\or 061\or 062\or 063\or 064\or 065\or 066\or 067\or
- 070\or 071\or 072\or 073\or 074\or 075\or 076\or 077\or
- 100\or 101\or 102\or 103\or 104\or 105\or 106\or 107\or
- 110\or 111\or 112\or 113\or 114\or 115\or 116\or 117\or
- 120\or 121\or 122\or 123\or 124\or 125\or 126\or 127\or
- 130\or 131\or 132\or 133\or 134\or 135\or 136\or 137\or
- 140\or 141\or 142\or 143\or 144\or 145\or 146\or 147\or
- 150\or 151\or 152\or 153\or 154\or 155\or 156\or 157\or
- 160\or 161\or 162\or 163\or 164\or 165\or 166\or 167\or
- 170\or 171\or 172\or 173\or 174\or 175\or 176\or 177\or
- 200\or 201\or 202\or 203\or 204\or 205\or 206\or 207\or
- 210\or 211\or 212\or 213\or 214\or 215\or 216\or 217\or
- 220\or 221\or 222\or 223\or 224\or 225\or 226\or 227\or
- 230\or 231\or 232\or 233\or 234\or 235\or 236\or 237\or
- 240\or 241\or 242\or 243\or 244\or 245\or 246\or 247\or
- 250\or 251\or 252\or 253\or 254\or 255\or 256\or 257\or
- 260\or 261\or 262\or 263\or 264\or 265\or 266\or 267\or
- 270\or 271\or 272\or 273\or 274\or 275\or 276\or 277\or
- 300\or 301\or 302\or 303\or 304\or 305\or 306\or 307\or
- 310\or 311\or 312\or 313\or 314\or 315\or 316\or 317\or
- 320\or 321\or 322\or 323\or 324\or 325\or 326\or 327\or
- 330\or 331\or 332\or 333\or 334\or 335\or 336\or 337\or
- 340\or 341\or 342\or 343\or 344\or 345\or 346\or 347\or
- 350\or 351\or 352\or 353\or 354\or 355\or 356\or 357\or
- 360\or 361\or 362\or 363\or 364\or 365\or 366\or 367\or
- 370\or 371\or 372\or 373\or 374\or 375\or 376\or 377\fi}
+\let\octnumber\gobbleoneargument
%D \macros
%D {hexstringtonumber}
@@ -158,54 +67,23 @@
%D a decimal number, thereby taking care of lowercase characters
%D as well.
-\dostepwiserecurse{0}{9}{1}{\setevalue{@@uc@@\recurselevel}{\recurselevel}}
-
-\setvalue{@@uc@@a}{A} \setvalue{@@uc@@A}{A}
-\setvalue{@@uc@@b}{B} \setvalue{@@uc@@B}{B}
-\setvalue{@@uc@@c}{C} \setvalue{@@uc@@C}{C}
-\setvalue{@@uc@@d}{D} \setvalue{@@uc@@D}{D}
-\setvalue{@@uc@@e}{E} \setvalue{@@uc@@E}{E}
-\setvalue{@@uc@@f}{F} \setvalue{@@uc@@F}{F}
-
-\def\hexstringtonumber#1% {FF}
- {\dohexstringtonumber#1}
-
-\def\dohexstringtonumber#1#2% FF
- {"\csname @@uc@@#1\endcsname\csname @@uc@@#2\endcsname}
+\let\hexstringtonumber\gobbleoneargument
%D \macros
%D {rawcharacter}
%D
-%D This conversion macro produces raw characters. We have to
-%D construct the macro in a special way to avoid problems with
-%D characters with special meanings. So, we revert to the
-%D lowercase conversion trick to bypass \TEX's input parser.
-
-\bgroup
-
-\catcode`\^^@=12 % ascii null == ignored in plain
-\catcode`\^^?=12 % ascii delete == invalid in plain
-
-\let\or\relax
-
-\xdef\rawcharacter{ ^^00\or}
+%D This macro can be used to produce proper 8 bit characters
+%D that we sometimes need in backends and round||trips.
-\dorecurse{255}
- {\lccode`a=\recurselevel
- \lowercase{\xdef\rawcharacter{\rawcharacter \string a\or}}} % string is needed for XeTeX
-
-\@EA\gdef\@EA\rawcharacter\@EA#\@EA1\@EA
- {\@EA\ifcase\@EA#\@EA1\rawcharacter\fi}
-
-\egroup
+\let\rawcharacter\gobbleoneargument
%D \macros
-%D {threedigits}
+%D {twodigits, threedigits}
%D
-%D This one provides three digits always.
+%D These macros provides two or three digits always:
-\def\threedigits#1%
- {\ifnum#1<10 00\else\ifnum#1<100 0\fi\fi\number#1}
+\def\twodigits #1{\ifnum #1<10 0\fi\number#1}
+\def\threedigits#1{\ifnum#1<100 \ifnum#1<10 0\fi0\fi\number#1}
%D \macros{modulonumber}
%D
@@ -257,4 +135,10 @@
\endTEX
+%D Plugins
+
+\loadmarkfile{syst-con}
+
+\let\hexnumber\uchexnumber
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-etx.tex b/Master/texmf-dist/tex/context/base/syst-etx.tex
index e2770cfe976..093c3d17f88 100644
--- a/Master/texmf-dist/tex/context/base/syst-etx.tex
+++ b/Master/texmf-dist/tex/context/base/syst-etx.tex
@@ -228,7 +228,7 @@
%D are needed, but, for critical editions, we may need many
%D more, so:
-\chardef\@@insallocation=32
+\chardef\@@insallocation = 32
%D However, there's a bug in \ETEX\ versions smaller than 2.2,
%D so we need to play safe:
@@ -240,11 +240,9 @@
\def\myalloc@#1#2#3#4#5%
{\global\advance\count1#1by\@ne
\ifnum\count1#1>\@@medallocation \else
- \global\advance\insc@unt by -\@@insallocation
- \ifnum\count1#1<\insc@unt \else
- \global\count1#1=\@@medallocation % \wait
+ \ifnum\count1#1<\numexpr\@@medallocation-\@@insallocation\relax\else
+ \global\count1#1=\numexpr\@@medallocation+\@ne\relax % \wait
\fi
- \global\advance\insc@unt by +\@@insallocation
\fi
\ifnum\count1#1>#4%
\global\count1#1=#4%
@@ -254,6 +252,16 @@
\global#3#5=\allocationnumber
\wlog{\string#5=\string#2\the\allocationnumber}}
+\def\newinsert#1%
+ {\ifnum\insc@unt>\numexpr\@@medallocation-\@@insallocation\relax
+ \global\advance\insc@unt by\m@ne
+ \allocationnumber=\insc@unt
+ \global\chardef#1=\allocationnumber
+ \wlog{\string#1=\string\insert\the\allocationnumber}%
+ \else
+ \errmessage{No room for a new insert \string#1 (\number\insc@unt)}%
+ \fi}
+
\endETEX
%D These macros can be checked by tests like:
diff --git a/Master/texmf-dist/tex/context/base/syst-ext.tex b/Master/texmf-dist/tex/context/base/syst-ext.tex
index 82e6bc2e77c..262d5f0b0df 100644
--- a/Master/texmf-dist/tex/context/base/syst-ext.tex
+++ b/Master/texmf-dist/tex/context/base/syst-ext.tex
@@ -320,6 +320,9 @@
\def\increment{\doifnextcharelse(\dodoincrement\doincrement}
\def\decrement{\doifnextcharelse(\dododecrement\dodecrement}
+\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
+\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
+
%D \macros
%D {newsignal}
%D
@@ -378,10 +381,12 @@
%D use the following alternative, which fools \TEX\ about
%D the new commands being \type {\outer} ones.
-\def\newskimen#1%
- {\ifx#1\undefined
- \csname new\ifnum\count11>\count12 skip\else dimen\fi\endcsname#1%
- \fi}
+% \def\newskimen#1%
+% {\ifx#1\undefined
+% \csname new\ifnum\count11>\count12 skip\else dimen\fi\endcsname#1%
+% \fi}
+
+\let\newskimen\newdimen % it's all etex or later now
%D \macros
%D {strippedcsname}
@@ -402,10 +407,12 @@
%D
%D Slower but better:
-{\catcode`.=\@@escape .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack
+\ifx\letterbackslash\undefined
+ {\catcode`.=0 .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack
+\fi
-\def\strippedcsname
- {\expandafter\dostrippedcsname\string}
+\def\strippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx}
+ {\expandafter\dostrippedcsname\string#1}
\def\dostrippedcsname#1%
{\if\noexpand#1\letterbackslash\else#1\fi}
@@ -773,30 +780,6 @@
{\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
\global\advance\outerrecurse \minusone }
-%D The third alternative looks a bit different and uses a
-%D pseudo counter. When this macro is nested, we have to use
-%D different counters. This time we use keywords.
-%D
-%D \starttyping
-%D \def\alfa{2} \def\beta{100} \def\gamma{3}
-%D
-%D \for \n=55 \to 100 \step 1 \do {... \n ...}
-%D \for \n=\alfa \to \beta \step \gamma \do {... \n ...}
-%D \for \n=\n \to 120 \step 1 \do {... \n ...}
-%D \for \n=120 \to 100 \step -3 \do {... \n ...}
-%D \for \n=55 \to 100 \step 2 \do {... \n ...}
-%D \stoptyping
-%D
-%D Only in the third example we need to predefine \type{\n}.
-%D The use of \type{\od} as a dilimiter would have made nested
-%D use more problematic.
-
-% maybe this one will become obsolete
-
-\def\for#1=#2\to#3\step#4\do#5%
- {\dostepwiserecurse{#2}{#3}{#4}
- {\let#1\recurselevel#5\let#1\recurselevel}}
-
%D \macros
%D {doloop,exitloop}
%D
@@ -943,6 +926,88 @@
%D {\exitloopnow} instead. Beware, this is more sensitive
%D for conditional errors.
+%D Krzysztof Leszczynski suggested to provide access to the level by
+%D means of a \type {#1}. I decided to pass the more frquently used
+%D level as \type {#1} and the less favoured depth as \type {#2}. The
+%D intended usage is:
+%D
+%D \starttyping
+%D \dorecurse{3}{\definesymbol[test-#1][xx-#1]}
+%D
+%D \def\test{\dorecurse{3}{\definesymbol[test-##1][xx-##1]}} \test
+%D
+%D \symbol[test-1]\quad\symbol[test-2]\quad\symbol[test-3]
+%D \stoptyping
+%D
+%D Since the hashed arguments are expanded, we don't need tricky
+%D expansion here.
+%D
+%D \starttyping
+%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}}
+%D \stoptyping
+
+\def\expandrecursecontent
+ {\csname\@@arecurse\recursedepth\@EA\@EA\@EA\endcsname\@EA\@EA\@EA{\@EA\recurselevel\@EA}\@EA{\recursedepth}}
+
+\long\def\xdorecurse#1#2%
+ {\global\advance\outerrecurse \plusone
+ \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}%
+ \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
+ \@EA\dodorecurse\@EA1\@EA{\number#1}}
+
+\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
+ {\global\advance\outerrecurse \plusone
+ \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#4}%
+ \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
+ \ifnum#3>0\relax
+ \ifnum#2<#1\relax
+ \let\nextrecurse\exitstepwiserecurse
+ \else
+ \let\nextrecurse\dodostepwiserecurse
+ \fi
+ \else
+ \ifnum#3<0\relax
+ \ifnum#1<#2\relax
+ \let\nextrecurse\exitstepwiserecurse
+ \else
+ \let\nextrecurse\dodostepwisereverse
+ \fi
+ \else
+ \let\nextrecurse\exitstepwiserecurse
+ \fi
+ \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}}
+
+\long\def\doloop#1%
+ {\global\advance\outerrecurse \plusone
+ \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#1}%
+ \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
+ \let\endofloop\dodoloop
+ \dodoloop1} % no \plusone else \recurselevel wrong
+
+%D This alternative looks a bit different and uses a
+%D pseudo counter. When this macro is nested, we have to use
+%D different counters. This time we use keywords.
+%D
+%D \starttyping
+%D \def\alfa{2} \def\beta{100} \def\gamma{3}
+%D
+%D \for \n=55 \to 100 \step 1 \do {... \n ...}
+%D \for \n=\alfa \to \beta \step \gamma \do {... \n ...}
+%D \for \n=\n \to 120 \step 1 \do {... \n ...}
+%D \for \n=120 \to 100 \step -3 \do {... \n ...}
+%D \for \n=55 \to 100 \step 2 \do {... \n ...}
+%D \stoptyping
+%D
+%D Only in the third example we need to predefine \type{\n}.
+%D The use of \type{\od} as a dilimiter would have made nested
+%D use more problematic.
+
+%D Don't use this one, it's kind of obsolete.
+
+\def\for#1=#2\to#3\step#4\do#5%
+ {\dostepwiserecurse{#2}{#3}{#4}
+ {\let#1\recurselevel#5\let#1\recurselevel}}
+
%D \macros
%D {newevery,everyline,EveryLine,EveryPar}
%D
@@ -1167,6 +1232,41 @@
{\@EA\defconvertcommand\@EA#1\csname#2\endcsname}
%D \macros
+%D {doifassignmentelse}
+%D
+%D A lot of \CONTEXT\ commands take optional arguments, for
+%D instance:
+%D
+%D \starttyping
+%D \dothisorthat[alfa,beta]
+%D \dothisorthat[first=foo,second=bar]
+%D \dothisorthat[alfa,beta][first=foo,second=bar]
+%D \stoptyping
+%D
+%D Although a combined solution is possible, we prefer a
+%D seperation. The next command takes care of propper
+%D handling of such multi||faced commands.
+%D
+%D \starttyping
+%D \doifassignmentelse {...} {then ...} {else ...}
+%D \stoptyping
+
+% not robust
+%
+% \def\doifassignmentelse%
+% {\doifinstringelse{=}}
+%
+% readable
+%
+% \def\doifassignmentelse#1%
+% {\convertargument#1\to\ascii
+% \doifinstringelse{=}{\ascii}}
+
+\def\doifassignmentelse#1%
+ {\convertargument#1\to\ascii
+ \doifinstringelse=\ascii}
+
+%D \macros
%D {convertasciiafter}
%D
%D Sometimes we need to convert an argument to a string (letters
@@ -1261,6 +1361,17 @@
\def\showvalue#1%
{\expandafter\show\csname#1\endcsname}
+\beginETEX
+
+\def\showvalue#1%
+ {\ifcsname#1\endcsname
+ \expandafter\show\csname#1\endcsname
+ \else
+ \show\undefined
+ \fi}
+
+\endETEX
+
\long\def\showargument#1%
{\convertargument#1\to\ascii\show\ascii}
@@ -1452,9 +1563,9 @@
{}}
\def\ConvertConstantAfter#1#2#3%
- {\CheckConstantAfter{#2}\asciiA
- \CheckConstantAfter{#3}\asciiB
- #1{\asciiA}{\asciiB}}
+ {\CheckConstantAfter{#2}\asciia
+ \CheckConstantAfter{#3}\asciib
+ #1{\asciia}{\asciib}}
%D \macros
%D {assignifempty}
@@ -2281,18 +2392,18 @@
%D
%D \starttyping
%D \def\doifintokselse#1#2% #1 en #2 zijn toks
-%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciiA
-%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciiB
-%D \doifinstringelse\asciiA\asciiB}
+%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia
+%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib
+%D \doifinstringelse\asciia\asciib}
%D \stoptyping
%D
%D Better:
%D
%D \starttyping
%D \def\doifintokselse#1#2% #1 en #2 zijn toks
-%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciiA
-%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciiB
-%D \doifstringinstringelse\asciiA\asciiB}
+%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia
+%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib
+%D \doifstringinstringelse\asciia\asciib}
%D \stoptyping
%D
%D Even better:
@@ -2300,18 +2411,18 @@
\beginETEX
\def\doifintokselse#1#2% #1 en #2 zijn toks
- {\@EA\convertargument\the#1\to\asciiA
- \@EA\convertargument\the#2\to\asciiB
- \doifstringinstringelse\asciiA\asciiB}
+ {\@EA\convertargument\the#1\to\asciia
+ \@EA\convertargument\the#2\to\asciib
+ \doifstringinstringelse\asciia\asciib}
\endETEX
\beginTEX
\def\doifintokselse#1#2% #1 en #2 zijn toks
- {\edef\asciiA{\the#1}\convertcommand\asciiA\to\asciiA
- \edef\asciiB{\the#2}\convertcommand\asciiB\to\asciiB
- \doifstringinstringelse\asciiA\asciiB}
+ {\edef\asciia{\the#1}\convertcommand\asciia\to\asciia
+ \edef\asciib{\the#2}\convertcommand\asciib\to\asciib
+ \doifstringinstringelse\asciia\asciib}
\endTEX
@@ -2322,12 +2433,12 @@
%D Hm.
-\def\flushtoks#1%
+\def\flushtoks#1% nb: can reassing to #1 again, hence the indirectness
{\@@scratchtoks#1\relax
\dodoglobal#1\emptytoks
\the\@@scratchtoks\relax}
-\let\dotoks=\the
+\let\dotoks\the
%D \macros
%D {makecounter,pluscounter,minuscounter,
@@ -2434,7 +2545,7 @@
{\global\@EA\let\csname#1\endcsname\zerocountervalue} % see earlier
\def\countervalue#1%
- {\csname#1\endcsname}
+ {\ifcsname#1\endcsname\csname#1\endcsname\fi}
\def\pluscounter#1%
{\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname+\plusone\relax}}
@@ -2796,7 +2907,7 @@
\ifx\!!stringd\empty\else
\edef#3{#3\ifx#3\empty\else,\fi\!!stringd}%
\fi
- \def\docommando####1{\edef#3{#3,####1}}%
+ \def\docommand####1{\edef#3{#3,####1}}%
\else
\edef#3{#3\ifx#3\empty\else,\fi##1}%
\fi}%
@@ -2910,10 +3021,10 @@
\def\withoutunit#1#2%
{\begingroup
\scratchdimen#1\relax
- \@EA\convertargument\the\scratchdimen\to\asciiA
- \@EA\convertargument#2\to\asciiB
- %\@EA\@EA\@EA\beforesplitstring\@EA\asciiA\@EA\at\asciiB\to\!!stringa
- \@EA\beforesplitstring\@EA\asciiA\@EA\at\asciiB\to\!!stringa
+ \@EA\convertargument\the\scratchdimen\to\asciia
+ \@EA\convertargument#2\to\asciib
+ %\@EA\@EA\@EA\beforesplitstring\@EA\asciia\@EA\at\asciib\to\!!stringa
+ \@EA\beforesplitstring\@EA\asciia\@EA\at\asciib\to\!!stringa
\!!stringa
\endgroup}
@@ -3143,110 +3254,6 @@
\definecomplexorsimple\setlocalhsize
%D \macros
-%D {processtokens}
-%D
-%D We fully agree with (most) typographers that inter||letter
-%D spacing is only permitted in fancy titles, we provide a
-%D macro that can be used to do so. Because this is
-%D (definitely and fortunately) no feature of \TEX, we have to
-%D step through the token list ourselves.
-%D
-%D \starttyping
-%D \processtokens {before} {between} {after} {space} {tokens}
-%D \stoptyping
-%D
-%D An example of a call is:
-%D
-%D \startbuffer
-%D \processtokens {[} {+} {]} {\space} {hello world}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This results in:
-%D
-%D \getbuffer
-%D
-%D The list of tokens may contain spaces, while \type{\\},
-%D \type{{}} and \type{\ } are handled as space too.
-
-% \def\dodoprocesstokens%
-% {\ifx\next\lastcharacter
-% \after
-% \let\next=\relax
-% \else\ifx\next\bgroup
-% \def\next%
-% {\dowithnextbox
-% {\before\box\nextbox
-% \let\before=\between
-% \doprocesstokens}
-% \hbox\bgroup}%
-% \else
-% \expandafter\if\space\next
-% \before\white
-% \else
-% \before\next
-% \fi
-% \let\before=\between
-% \let\next=\doprocesstokens
-% \fi\fi
-% \next}
-%
-% \def\doprocesstokens% the space after = is essential
-% {\afterassignment\dodoprocesstokens\let\next= }
-%
-% \def\processtokens#1#2#3#4#5%
-% {\bgroup
-% \def\lastcharacter{\lastcharacter}%
-% \def\space{ }%
-% \let\\=\space
-% \def\before{#1}%
-% \def\between{#2}%
-% \def\after{#3}%
-% \def\white{#4}%
-% \doprocesstokens#5\lastcharacter
-% \egroup}
-
-\def\dodoprocesstokens
- {\ifx\nextprocessedtoken\lastcharacter
- \after
- \let\nextprocessedtoken\relax
- \else\ifx\nextprocessedtoken\bgroup
- \def\nextprocessedtoken
- {\dowithnextbox
- {\before{\copy\nextbox}% \before can use nextbox several times
- \let\before\between
- \doprocesstokens}
- \hbox\bgroup}%
- \else
- \expandafter\if\space\nextprocessedtoken
- \after\white
- \let\before\savedbefore
- \else
- \before\nextprocessedtoken
- \let\before\between
- \fi
- \let\nextprocessedtoken\doprocesstokens
- \fi\fi
- \nextprocessedtoken}
-
-\def\doprocesstokens% the space after = is essential
- {\afterassignment\dodoprocesstokens\let\nextprocessedtoken= }
-
-\def\processtokens#1#2#3#4#5%
- {\begingroup
- \def\lastcharacter{\lastcharacter}%
- \def\space{ }%
- \let\\=\space
- \def\before{#1}%
- \def\between{#2}%
- \def\after{#3}%
- \def\white{#4}%
- \let\savedbefore\before
- \doprocesstokens#5\lastcharacter
- \endgroup}
-
-%D \macros
%D {doifvalue,doifnotvalue,doifelsevalue,
%D doifnothing,doifsomething,doifelsenothing,
%D doifvaluenothing,doifvaluesomething,doifelsevaluenothing}
@@ -3471,6 +3478,64 @@
\def\DOIFINSTRINGELSE {\ExpandBothAfter\p!DOIFINSTRINGELSE}
%D \macros
+%D {dosingleargumentwithset,
+%D dodoubleargumentwithset,dodoubleemptywithset,
+%D dotripleargumentwithset,dotripleemptywithset}
+%D
+%D These maybe too mysterious macros enable us to handle more
+%D than one setup at once.
+%D
+%D \starttyping
+%D \dosingleargumentwithset \command[#1]
+%D \dodoubleargumentwithset \command[#1][#2]
+%D \dotripleargumentwithset \command[#1][#2][#3]
+%D \dodoubleemptywithset \command[#1][#2]
+%D \dotripleemptywithset \command[#1][#2][#3]
+%D \stoptyping
+%D
+%D The first macro calls \type{\command[##1]} for each string
+%D in the set~\type{#1}. The second one calls for
+%D \type{\commando[##1][#2]} and the third, well one may guess.
+%D These commands support constructions like:
+%D
+%D \starttyping
+%D \def\dodefinesomething[#1][#2]%
+%D {\getparameters[\??xx#1][#2]}
+%D
+%D \def\definesomething%
+%D {\dodoubleargumentwithset\dodefinesomething}
+%D \stoptyping
+%D
+%D Which accepts calls like:
+%D
+%D \starttyping
+%D \definesomething[alfa,beta,...][variable=...,...]
+%D \stoptyping
+%D
+%D Now a whole bunch of variables like \type{\@@xxalfavariable}
+%D and \type{\@@xxbetavariable} is defined.
+
+\def\dodoublewithset#1#2%
+ {\def\dododoublewithset[##1][##2]%
+ {\doifsomething{##1}
+ {\def\dodododoublewithset####1{#2[####1][##2]}%
+ \processcommalist[##1]\dodododoublewithset}}%
+ #1\dododoublewithset}
+
+\def\dodoubleemptywithset {\dodoublewithset\dodoubleempty}
+\def\dodoubleargumentwithset{\dodoublewithset\dodoubleargument}
+
+\def\dotriplewithset#1#2%
+ {\def\dodotriplewithset[##1][##2][##3]%
+ {\doifsomething{##1}
+ {\def\dododotriplewithset####1{#2[####1][##2][##3]}%
+ \processcommalist[##1]\dododotriplewithset}}%
+ #1\dodotriplewithset}
+
+\def\dotripleemptywithset {\dotriplewithset\dotripleempty}
+\def\dotripleargumentwithset{\dotriplewithset\dotripleargument}
+
+%D \macros
%D {stripcharacters,stripspaces}
%D
%D The next command was needed first when we implemented
@@ -3795,14 +3860,14 @@
%D following one:
%D
%D \starttyping
-%D \processlist{beginsym}{endsym}{separator}\docommando list
+%D \processlist{beginsym}{endsym}{separator}\docommand list
%D \stoptyping
%D
%D This one supports arbitrary open and close symbols as well
%D as user defined separators.
%D
%D \starttyping
-%D \processlist(){=>}\docommando(a=>b=>c=>d)
+%D \processlist(){=>}\docommand(a=>b=>c=>d)
%D \stoptyping
\long\def\processlist#1#2#3#4% no blank skipping !
@@ -4085,13 +4150,13 @@
%D {\ifx#1\endoftoken
%D \expandafter\nohandletokens
%D \else
-%D \docommando{#1}%
+%D \docommand{#1}%
%D \expandafter\dohandletokens
%D \fi
%D #2\end}
%D
%D \long\def\handletokens#1\with#2%
-%D {\let\docommando=#2\relax
+%D {\let\docommand=#2\relax
%D \dohandletokens#1\endoftoken\end}
%D \stoptyping
%D
@@ -4102,7 +4167,7 @@
%D \starttyping
%D \def\dodohandletokens%
%D {\ifx\next\end \else
-%D \docommando{\next}%
+%D \docommand{\next}%
%D \expandafter\dohandletokens
%D \fi}
%D
@@ -4110,7 +4175,7 @@
%D {\afterassignment\dodohandletokens\let\next= }
%D
%D \long\def\handletokens#1\with#2%
-%D {\let\docommando=#2%
+%D {\let\docommand=#2%
%D \dohandletokens#1\end}
%D \stoptyping
@@ -4232,7 +4297,7 @@
{\gdef\dododohandletokens{#2}% permits more complex #2's
\dohandletokens#1\end}
-%D A previous version said \type{\docommando=#2}, but to enable
+%D A previous version said \type{\docommand=#2}, but to enable
%D use in alignments, I decided to use another placeholder, one
%D that is not sensitive to the global assignment.
@@ -4293,15 +4358,17 @@
%D \getbuffer[example]
%D \macros
-%D {iftrialtypesetting}
+%D {iftrialtypesetting, ifvisible}
%D
%D The next boolean is at first sight a strange one. Sometimes
%D one does a trial typesetting run, for instance to determine
%D dimensions. Some mechanisms, like object inclusion, can fail
%D on such trials. Temporary setting the next boolean to true,
-%D helps a lot.
+%D helps a lot. The second boolena can be used to inhibit
+%D processing completely.
-\newif\iftrialtypesetting
+\newif\iftrialtypesetting \trialtypesettingfalse
+\newif\ifvisible \visibletrue
%D \macros
%D {startlocal, startglobal}
@@ -4350,22 +4417,24 @@
\beginTEX
- \def\twodigitrounding#1{#1}
+ \let\integerrounding \firstofoneargument
+ \let\onedigitrounding\firstofoneargument
+ \let\twodigitrounding\firstofoneargument
\endTEX
\beginETEX \dimexpr
- \def\dotwodigitrounding#1.#2#3#4\relax%
- {\ifx#2*#1\else#1.#2#3\fi}
-
- % \def\twodigitrounding#1%
- % {\@EA\@EA\@EA\dotwodigitrounding\@EA\WITHOUTPT
- % \the\dimexpr#1pt+.005pt\relax000.*00\relax}
+ \def\dointegerrounding #1.#2\relax {#1}
+ \def\doonedigitrounding#1.#2#3\relax {\ifx#2*#1\else#1.#2\fi}
+ \def\dotwodigitrounding#1.#2#3#4\relax{\ifx#2*#1\else#1.#2#3\fi}
+ \def\integerrounding#1%
+ {\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr#1\points+32768sp\relax.\relax}
+ \def\onedigitrounding#1%
+ {\@EA\@EA\@EA\doonedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+32768sp\relax00.*0\relax}
\def\twodigitrounding#1%
- {\@EA\@EA\@EA\dotwodigitrounding\@EA\WITHOUTPT
- \the\dimexpr#1\points+.005\points\relax000.*00\relax}
+ {\@EA\@EA\@EA\dotwodigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+32768sp\relax000.*00\relax}
\endETEX
@@ -4668,8 +4737,8 @@
\def\serializecommalist[#1]%
{\let\serializedcommalist\empty
- \def\docommando##1{\edef\serializedcommalist{\serializedcommalist##1}}%
- \processcommacommand[#1]\docommando}
+ \def\docommand##1{\edef\serializedcommalist{\serializedcommalist##1}}%
+ \processcommacommand[#1]\docommand}
%D \macros
%D {purenumber}
diff --git a/Master/texmf-dist/tex/context/base/syst-fnt.tex b/Master/texmf-dist/tex/context/base/syst-fnt.tex
new file mode 100644
index 00000000000..40733c4f8ee
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-fnt.tex
@@ -0,0 +1,43 @@
+%D \module
+%D [ file=syst-fnt,
+%D version=2006.08.11,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=Font Things,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% formal names cf the tb \& tbt
+
+\unprotect
+
+\def\fontslantperpoint {\fontdimen1}
+\def\fontinterwordspace {\fontdimen2}
+\def\fontinterwordstretch{\fontdimen3}
+\def\fontinterwordshrink {\fontdimen4}
+\def\fontexheight {\fontdimen5}
+\def\fontemwidth {\fontdimen6}
+\def\fontextraspace {\fontdimen7}
+
+\def\slantperpoint {\fontdimen1\font}
+\def\interwordspace {\fontdimen2\font}
+\def\interwordstretch {\fontdimen3\font}
+\def\interwordshrink {\fontdimen4\font}
+\def\exheight {\fontdimen5\font}
+\def\emwidth {\fontdimen6\font}
+\def\extraspace {\fontdimen7\font}
+
+\def\mathsupdisplay {\fontdimen13}
+\def\mathsupnormal {\fontdimen14}
+\def\mathsupcramped {\fontdimen15}
+\def\mathsubnormal {\fontdimen16}
+\def\mathsubcombined {\fontdimen17}
+\def\mathaxisheight {\fontdimen22}
+
+\def\currentspaceskip {\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink\relax}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-gen.tex b/Master/texmf-dist/tex/context/base/syst-gen.tex
index 71e156b629b..94a622c76c8 100644
--- a/Master/texmf-dist/tex/context/base/syst-gen.tex
+++ b/Master/texmf-dist/tex/context/base/syst-gen.tex
@@ -99,7 +99,24 @@
%D And because this module implements \type{\writestatus}, we
%D just say:
-\abortinputifdefined\writestatus
+% \abortinputifdefined\writestatus
+
+%D \macros
+%D {overloaded, superseded, forwarded, predefined}
+%D
+%D This prefix is used as signal for the \CONTEXT\ dependency
+%D checking features. The first four prefixes don't do anything
+%D useful, apart from signaling parsers.
+
+\def\overloaded{} % local change at the macro level
+\def\superseded{} % global change at the module level, replaces previous definitions
+\def\predefined{} % defined (first) here, but may be redefined anytime (no need for \overloaded)
+\def\forwarded {} % definition at the module level, only done when undefined
+
+\def\forwarded#1#2{\ifx#2\undefined\else\expandafter\gobbleforwarded\fi#1#2}
+
+\def\gobbleforwarded#1
+ {}
%D Normally we tell the users what module is being loaded.
%D However, the command that is needed for this is not yet
@@ -154,7 +171,7 @@
\newcount\protectionlevel
\ifx\protect\undefined
- \def\protect{\message{<too much protection>}}
+ \def\protect{\writestatus{protection}{too much protection}}
\else
% a simple version is already defined
\fi
@@ -165,90 +182,65 @@
%D don't take arguments, unless lines are obeyed, I decided
%D to put it there as a reminder. I only mention this once.
-\chardef\protectionthreshold=10
-%chardef\protectionthreshold=0 % for testing
-
-% \def\unprotect
-% {\ifcase\protectionlevel
-% \edef\doprotectcharacters%
-% {\catcode`\noexpand @=\the\catcode`@
-% \catcode`\noexpand !=\the\catcode`!
-% \catcode`\noexpand ?=\the\catcode`? }%
-% \let\protect\doprotect
-% \fi
-% \catcode`@=11
-% \catcode`!=11
-% \catcode`?=11
-% \advance\protectionlevel 1
-% \ifnum\protectionlevel>\protectionthreshold
-% \message{<unprotect \the\protectionlevel>}%
-% \fi}
-%
-% \def\doprotect%
-% {\ifnum\protectionlevel=1
-% \doprotectcharacters
-% \let\doprotectcharacters\relax
-% \let\protect\normalprotect
-% \fi
-% \ifnum\protectionlevel>\protectionthreshold
-% \message{<protect \the\protectionlevel>}%
-% \fi
-% \advance\protectionlevel -1 }
-
-\def\saveprotectedcharacters
- {\edef\doprotectcharacters
- {\catcode`\noexpand @\the\catcode`@
- \catcode`\noexpand !\the\catcode`!
- \catcode`\noexpand ?\the\catcode`? }}
-
-\def\setprotectedcharacters
- {\catcode`@=11
- \catcode`!=11
- \catcode`?=11 }
-
-\def\unprotect
- {\ifcase\protectionlevel
- \saveprotectedcharacters
- \let\protect\doprotect
- \fi
- \setprotectedcharacters
- \advance\protectionlevel 1
- \ifnum\protectionlevel>\protectionthreshold
- \reportunprotection
- \fi}
-
-\def\doprotect
- {\ifcase\protectionlevel\or
- \doprotectcharacters
- \let\doprotectcharacters\relax
- \let\protect\normalprotect
- \fi
- \ifnum\protectionlevel>\protectionthreshold
- \reportprotection
- \fi
- \advance\protectionlevel -1 }
-
-\def\reportunprotection {\message{<unprotect \protectionstate>}}
-\def\reportprotection {\message{<protect \protectionstate>}}
-\def\reportprotectionstate{\message{<protectionstate \protectionstate>}}
-
-\def\protectionstate
- {\the\protectionlevel
- \ifcase\protectionthreshold
- :\space
- @=\the\catcode`@\space\space
- !=\the\catcode`!\space\space
- ?=\the\catcode`?%
- \fi}
-
-\ifx\everyeof\undefined
-
- \let\checkprotection\relax
+\ifx\unprotect\undefined
+
+ \chardef\protectionthreshold=10
+
+ \def\saveprotectedcharacters
+ {\edef\doprotectcharacters
+ {\catcode`\noexpand @\the\catcode`@
+ \catcode`\noexpand !\the\catcode`!
+ \catcode`\noexpand ?\the\catcode`? }}
+
+ \def\setprotectedcharacters
+ {\catcode`@=11
+ \catcode`!=11
+ \catcode`?=11 }
+
+ \def\unprotect
+ {\ifcase\protectionlevel
+ \saveprotectedcharacters
+ \let\protect\doprotect
+ \fi
+ \setprotectedcharacters
+ \advance\protectionlevel 1
+ \ifnum\protectionlevel>\protectionthreshold
+ \reportunprotection
+ \fi}
+
+ \def\doprotect
+ {\ifcase\protectionlevel\or
+ \doprotectcharacters
+ \let\doprotectcharacters\relax
+ \let\protect\normalprotect
+ \fi
+ \ifnum\protectionlevel>\protectionthreshold
+ \reportprotection
+ \fi
+ \advance\protectionlevel -1 }
+
+ \def\reportunprotection {\writestatus{protection}{unprotect \protectionstate}}
+ \def\reportprotection {\writestatus{protection}{protect \protectionstate}}
+ \def\reportprotectionstate{\writestatus{protection}{state \protectionstate}}
+
+ \def\protectionstate
+ {\the\protectionlevel
+ \ifcase\protectionthreshold
+ :\space
+ @=\the\catcode`@\space\space
+ !=\the\catcode`!\space\space
+ ?=\the\catcode`?%
+ \fi}
+
+ \ifx\everyeof\undefined
+ \let\checkprotection\relax
+ \else
+ \def\checkprotection{\everyeof{\writestatus{protection}{state: \protectionstate}}}
+ \fi
\else
- \def\checkprotection
- {\everyeof{\writestatus{protection}{state: \protectionstate}}}
+ \let\reportprotectionstate\relax
\fi
@@ -257,14 +249,6 @@
\unprotect
-%D So, now we can redefine a previously defined macro as
-%D follows:
-
-\def\setprotectedcharacters
- {\catcode`@\@@letter
- \catcode`!\@@letter
- \catcode`?\@@letter}
-
%D \macros
%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment,
%D @@endofline,@@parameter,@@superscript,@@subscript,
@@ -302,21 +286,35 @@
%D {scratchcounter,
%D scratchdimen,scratchskip,scratchmuskip,
%D scratchbox,
-%D scratchtoks,
-%D ifdone}
+%D scratchtoks}
%D
%D Because we often need counters on a temporary basis, we
%D define the \COUNTER\ \type{\scratchcounter}. This is a
%D real \COUNTER, and not a pseudo one, as we will meet
%D further on. We also define some other scratch registers.
-\newcount \scratchcounter
-\newdimen \scratchdimen
-\newskip \scratchskip
-\newmuskip \scratchmuskip
-\newbox \scratchbox
-\newtoks \scratchtoks
-\newif \ifdone
+\chardef\newabovelimit=20
+
+\def\stripnewabove#1%
+ {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}%
+
+\def\newabove#1#2% \dimen \name
+ {#1#2%
+ \ifnum\expandafter\stripnewabove\meaning#2>\newabovelimit\else
+ \expandafter\newabove\expandafter#1\expandafter#2%
+ \fi}
+
+\newabove \newcount \scratchcounter \newabove \newcount \globalscratchcounter
+\newabove \newdimen \scratchdimen \newabove \newdimen \globalscratchdimen
+\newabove \newskip \scratchskip \newabove \newskip \globalscratchskip
+\newabove \newmuskip \scratchmuskip \newabove \newmuskip \globalscratchmuskip
+\newabove \newtoks \scratchtoks \newabove \newtoks \globalscratchtoks
+ \newbox \scratchbox \newbox \globalscratchbox
+
+%D \macros
+%D {ifdone}
+
+\newif\ifdone
%D \macros
%D {ifCONTEXT}
@@ -348,8 +346,8 @@
\dimendef\!!dimenj=18 %skipdef\!!skipe=8
\dimendef\!!dimenk=20 %skipdef\!!skipf=10
-\let\!!stringa=\empty \let\!!stringb=\empty \let\!!stringc=\empty
-\let\!!stringd=\empty \let\!!stringe=\empty \let\!!stringf=\empty
+\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
@@ -358,27 +356,26 @@
\newif\if!!donea \newif\if!!doneb \newif\if!!donec
\newif\if!!doned \newif\if!!donee \newif\if!!donef
-\ifx \z@\undefined \else \let\zeropoint\z@ \fi
-\ifx \@ne\undefined \else \let\plusone \@ne \fi
-\ifx\m@ne\undefined \else \let\minusone \m@ne \fi
+\ifx\data\undefined \else \let\data \relax \fi % dep checker
-\ifx\zeropoint\undefined \csname newdimen\endcsname\zeropoint \fi % plain
-\ifx\plusone \undefined \chardef\plusone =1 \fi
-\ifx\plustwo \undefined \chardef\plustwo =2 \fi
-\ifx\plusthree\undefined \chardef\plusthree=3 \fi
-\ifx\plusfour \undefined \chardef\plusfour =4 \fi
-\ifx\plusfive \undefined \chardef\plusfive =5 \fi
-\ifx\minusone \undefined \count\minusone \minusone=-1 \fi
+%D Beware: we don't reuse plain counters, too dangerous
+%D when <= 20 (e.g. in supp-pdf this messed up things).
-\ifx\@m\undefined \else \let\plusthousand \@m \fi
-\ifx\@M\undefined \else \let\plusttenhousand\@M \fi
+\newdimen \zeropoint
+\newcount \zerocount
+\newcount \minusone
+ \minusone = -1
-\ifx\plusten \undefined \mathchardef\plusten = 10 \fi
-\ifx\plushundred \undefined \mathchardef\plushundred = 100 \fi
-\ifx\plusthousand \undefined \mathchardef\plusthousand = 1000 \fi
-\ifx\plustenthousand\undefined \mathchardef\plustenthousand=10000 \fi
+\chardef \plusone = 1
+\chardef \plustwo = 2
+\chardef \plusthree = 3
+\chardef \plusfour = 4
+\chardef \plusfive = 5
-\newcount\zerocount
+\mathchardef \plusten = 10
+\mathchardef \plushundred = 100
+\mathchardef \plusthousand = 1000
+\mathchardef \plustenthousand = 10000
%D \macros
%D {s!,c!,e!,p!,v!,@@,??}
@@ -2362,6 +2359,21 @@
\@EA\gobbleoneargument
\fi}
+\long\def\doifnotinstring#1%%
+ {\edef\@@@instring{#1}% expand #1 here
+ \ifx\@@@instring\empty
+ \@EA\gobbletwoarguments
+ \else
+ \@EA\dodoifnotinstring
+ \fi}
+
+\long\def\dodoifnotinstring#1%
+ {\p!doifinstringelse\@@@instring{#1}%
+ \@EA\gobbleoneargument
+ \else
+ \@EA\firstofoneargument
+ \fi}
+
%D \starttyping
%D \beginTEX
%D
@@ -2682,9 +2694,9 @@
% not needed
%
% \def\rawprocessallactionsinset[#1]#2[#3]%
-% {\def\docommando##1%
+% {\def\docommand##1%
% {\rawprocessaction[##1][#3]}%
-% \processcommalist[#1]\docommando}
+% \processcommalist[#1]\docommand}
%D When we process the list \type{a,b,c,d,e}, the raw routine
%D takes over 30\% less time, when we feed $20+$ character
@@ -3165,41 +3177,6 @@
\processcommalist[#5]\docopyparameter}}
%D \macros
-%D {doifassignmentelse}
-%D
-%D A lot of \CONTEXT\ commands take optional arguments, for
-%D instance:
-%D
-%D \starttyping
-%D \dothisorthat[alfa,beta]
-%D \dothisorthat[first=foo,second=bar]
-%D \dothisorthat[alfa,beta][first=foo,second=bar]
-%D \stoptyping
-%D
-%D Although a combined solution is possible, we prefer a
-%D seperation. The next command takes care of propper
-%D handling of such multi||faced commands.
-%D
-%D \starttyping
-%D \doifassignmentelse {...} {then ...} {else ...}
-%D \stoptyping
-
-% not robust
-%
-% \def\doifassignmentelse%
-% {\doifinstringelse{=}}
-%
-% readable
-%
-% \def\doifassignmentelse#1%
-% {\convertargument#1\to\ascii
-% \doifinstringelse{=}{\ascii}}
-
-\def\doifassignmentelse#1%
- {\convertargument#1\to\ascii
- \doifinstringelse=\ascii}
-
-%D \macros
%D {ifparameters,checkparameters}
%D
%D A slightly different one is \type{\checkparameters}, which
@@ -3768,70 +3745,6 @@
{\thirdargumentfalse#1[{#2}][{#3}][]}}
%D \macros
-%D {dosingleargumentwithset,
-%D dodoubleargumentwithset,dodoubleemptywithset,
-%D dotripleargumentwithset,dotripleemptywithset}
-%D
-%D These maybe too mysterious macros enable us to handle more
-%D than one setup at once.
-%D
-%D \starttyping
-%D \dosingleargumentwithset \command[#1]
-%D \dodoubleargumentwithset \command[#1][#2]
-%D \dotripleargumentwithset \command[#1][#2][#3]
-%D \dodoubleemptywithset \command[#1][#2]
-%D \dotripleemptywithset \command[#1][#2][#3]
-%D \stoptyping
-%D
-%D The first macro calls \type{\command[##1]} for each string
-%D in the set~\type{#1}. The second one calls for
-%D \type{\commando[##1][#2]} and the third, well one may guess.
-%D These commands support constructions like:
-%D
-%D \starttyping
-%D \def\dodefinesomething[#1][#2]%
-%D {\getparameters[\??xx#1][#2]}
-%D
-%D \def\definesomething%
-%D {\dodoubleargumentwithset\dodefinesomething}
-%D \stoptyping
-%D
-%D Which accepts calls like:
-%D
-%D \starttyping
-%D \definesomething[alfa,beta,...][variable=...,...]
-%D \stoptyping
-%D
-%D Now a whole bunch of variables like \type{\@@xxalfavariable}
-%D and \type{\@@xxbetavariable} is defined.
-
-% \def\dosingleargumentwithset#1%
-% {\def\dodosinglewithset[##1]%
-% {\def\dododosinglewithset####1{#1[####1]}%
-% \processcommalist[##1]\dododosinglewithset}%
-% \dosingleargument\dodosinglewithset}%
-
-\def\dodoublewithset#1#2%
- {\def\dododoublewithset[##1][##2]%
- {\doifsomething{##1}
- {\def\dodododoublewithset####1{#2[####1][##2]}%
- \processcommalist[##1]\dodododoublewithset}}%
- #1\dododoublewithset}
-
-\def\dodoubleemptywithset {\dodoublewithset\dodoubleempty}
-\def\dodoubleargumentwithset{\dodoublewithset\dodoubleargument}
-
-\def\dotriplewithset#1#2%
- {\def\dodotriplewithset[##1][##2][##3]%
- {\doifsomething{##1}
- {\def\dododotriplewithset####1{#2[####1][##2][##3]}%
- \processcommalist[##1]\dododotriplewithset}}%
- #1\dodotriplewithset}
-
-\def\dotripleemptywithset {\dotriplewithset\dotripleempty}
-\def\dotripleargumentwithset{\dotriplewithset\dotripleargument}
-
-%D \macros
%D {strippedcsname}
%D
%D The next macro can be very useful when using \type{\csname}
@@ -4326,8 +4239,8 @@
\endgroup}
%D \macros
-%D {writestring,writeline,
-%D writestatus,statuswidth}
+%D {writestring,writeline,writebanner,
+%D writestatus,statuswidth,normalwritestatus}
%D
%D Maybe one didn't notice, but we've already introduced a
%D macro for showing messages. In the multi||lingual modules,
@@ -4344,81 +4257,49 @@
%D of the identification string with the macro \type
%D {\statuswidth}.
-% \chardef\statuswidth=15
-%
-% \def\writestring%
-% {\immediate\write16}
-%
-% \def\writeline%
-% {\writestring{}}
-%
-% \def\dosplitstatus#1#2\end%
-% {\ifx#1?%
-% \loop
-% \advance\scratchcounter by 1
-% \ifnum\scratchcounter<\statuswidth
-% \edef\messagecontentA{\messagecontentA\space}%
-% \repeat
-% \else
-% \advance\scratchcounter by 1
-% \ifnum\scratchcounter<\statuswidth
-% \edef\messagecontentA{\messagecontentA#1}%
-% \fi
-% \dosplitstatus#2\end
-% \fi}
-%
-% \def\writestatus#1#2%
-% {\begingroup
-% \let\messagecontentA=\empty
-% \edef\messagecontentB{#2}% maybe it's \the\scratchcounter
-% \scratchcounter=0
-% \expandafter\dosplitstatus#1?\end
-% \writestring{\messagecontentA\space:\space\messagecontentB}%
-% \endgroup}
-
\chardef\statuswidth=15
\chardef\statuswrite=16
-\newtoks\everywritestring
+\ifx\writestring\undefined
-\def\writestring#1%
- {\begingroup
- \the\everywritestring
- \immediate\write\statuswrite{#1}%
- \endgroup}
+ \newtoks\everywritestring
-\def\writeline
- {\immediate\write\statuswrite{}}
+ \def\writedirect {\immediate\write\statuswrite}
+ \def\writeline {\writedirect{}}
+ \def\writestring#1{\begingroup\the\everywritestring\writedirect{#1}\endgroup}
+
+\fi
%D First we present the normal \TEX\ variant, later we will
%D show the \ETEX-way.
-\beginTEX
-
-\newcount\statuscounter
-
-\def\dosplitstatus#1%
- {\advance\statuscounter \minusone
- \ifcase\statuscounter
- \expandafter\nosplitstatus
- \else
- \scratchtoks\@EA{\the\scratchtoks#1}%
- \expandafter\dosplitstatus
- \fi}
-\def\nosplitstatus#1\end
- {}
+\beginTEX
-\def\writestatus#1#2%
- {\begingroup
- \scratchtoks\emptytoks
- \statuscounter\statuswidth
- \expandafter\dosplitstatus#1%
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\end
- \@EA\writestring\@EA{\the\scratchtoks\space:\space#2}%
- \endgroup}
+ \newcount\statuscounter
+
+ \def\dosplitstatus#1%
+ {\advance\statuscounter \minusone
+ \ifcase\statuscounter
+ \expandafter\nosplitstatus
+ \else
+ \scratchtoks\@EA{\the\scratchtoks#1}%
+ \expandafter\dosplitstatus
+ \fi}
+
+ \def\nosplitstatus#1\end
+ {}
+
+ \def\writestatus#1#2%
+ {\begingroup
+ \scratchtoks\emptytoks
+ \statuscounter\statuswidth
+ \expandafter\dosplitstatus#1%
+ \space\space\space\space\space\space\space
+ \space\space\space\space\space\space\space
+ \space\space\space\space\space\space\end
+ \@EA\writestring\@EA{\the\scratchtoks\space:\space#2}%
+ \endgroup}
\endTEX
@@ -4453,13 +4334,13 @@
\beginTEX
-\def\dosplitstatus#1%
- {\advance\statuscounter \minusone
- \ifcase\statuscounter
- \expandafter\nosplitstatus
- \fi
- \scratchtoks\@EA{\the\scratchtoks#1}%
- \dosplitstatus}
+ \def\dosplitstatus#1%
+ {\advance\statuscounter \minusone
+ \ifcase\statuscounter
+ \expandafter\nosplitstatus
+ \fi
+ \scratchtoks\@EA{\the\scratchtoks#1}%
+ \dosplitstatus}
\endTEX
@@ -4470,19 +4351,19 @@
\beginETEX \numexpr
-\def\writestatus#1#2%
- {\writestring{\expandafter\dosplitstatus\expandafter\statuswidth#1%
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\end
- \space:\space#2}}
+ \def\normalwritestatus#1#2%
+ {\writestring{\expandafter\dosplitstatus\expandafter\statuswidth#1%
+ \space\space\space\space\space\space\space
+ \space\space\space\space\space\space\space
+ \space\space\space\space\space\space\end
+ \space:\space#2}}
-\def\dosplitstatus#1#2%
- {\ifcase#1 \expandafter\nosplitstatus\fi#2%
- \expandafter\dosplitstatus\expandafter{\the\numexpr#1+\minusone\relax}}
+ \def\dosplitstatus#1#2%
+ {\ifcase#1 \expandafter\nosplitstatus\fi#2%
+ \expandafter\dosplitstatus\expandafter{\the\numexpr#1+\minusone\relax}}
-\def\nosplitstatus#1\end
- {}
+ \def\nosplitstatus#1\end
+ {}
\endETEX
@@ -4512,6 +4393,9 @@
%D Finally we do what from now on will be done at the top of
%D the files: we tell the user what we are loading.
+\ifx\writestatus\undefined \let\writestatus\normalwritestatus \fi
+\ifx\writebanner\undefined \def\writebanner{\writestring} \fi
+
\writestatus{loading}{Context System Macros / General}
%D Well, the real final command is the one that resets the
diff --git a/Master/texmf-dist/tex/context/base/syst-mtx.tex b/Master/texmf-dist/tex/context/base/syst-mtx.tex
new file mode 100644
index 00000000000..c865560b83f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-mtx.tex
@@ -0,0 +1,66 @@
+%D \module
+%D [ file=syst-mtx,
+%D version=2006.08.11,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=\METATEX\ specifics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\ifx\directlua\undefined \endinput \fi
+
+\unprotect
+
+%D Since the number of chars exceed 256 now, we can use \type
+%D {\chardef} instead of the more limited \type {\mathchardef}.
+
+\def\newcount {\myalloc@0\count \countdef \@@maxallocation}
+\def\newdimen {\myalloc@1\dimen \dimendef \@@maxallocation}
+\def\newskip {\myalloc@2\skip \skipdef \@@maxallocation}
+\def\newmuskip {\myalloc@3\muskip \muskipdef \@@maxallocation}
+\def\newbox {\myalloc@4\box \chardef \@@maxallocation}
+\def\newtoks {\myalloc@5\toks \toksdef \@@maxallocation}
+\def\newread {\myalloc@6\read \chardef \@@minallocation}
+\def\newwrite {\myalloc@7\write \chardef \@@minallocation}
+\def\newmarks {\myalloc@8\marks \chardef \@@maxallocation}
+\def\newlanguage{\myalloc@9\language\chardef \@@minallocation}
+
+\def\newfam#1{\chardef#1=15 }
+
+\count18=1
+
+\mathchardef\@@minallocation = 16
+\mathchardef\@@medallocation = 256
+\mathchardef\@@maxallocation = 32767
+\chardef \@@insallocation = 32
+
+\def\myalloc@#1#2#3#4#5%
+ {\global\advance\count1#1by\@ne
+ \ifnum\count1#1>\@@medallocation \else
+ \ifnum\count1#1<\numexpr\@@medallocation-\@@insallocation\relax\else
+ \global\count1#1=\numexpr\@@medallocation+\@ne\relax % \wait
+ \fi
+ \fi
+ \ifnum\count1#1>#4%
+ \global\count1#1=#4%
+ \errmessage{No room for (\string#2) \string#5}%
+ \fi
+ \allocationnumber=\count1#1%
+ \global#3#5=\allocationnumber
+ \wlog{\string#5=\string#2\the\allocationnumber}}
+
+\def\newinsert#1%
+ {\ifnum\insc@unt>\numexpr\@@medallocation-\@@insallocation\relax
+ \global\advance\insc@unt by\m@ne
+ \allocationnumber=\insc@unt
+ \global\chardef#1=\allocationnumber
+ \wlog{\string#1=\string\insert\the\allocationnumber}%
+ \else
+ \errmessage{No room for a new insert \string#1 (\number\insc@unt)}%
+ \fi}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-new.tex b/Master/texmf-dist/tex/context/base/syst-new.tex
index 6112b6f6f83..dca897ac0cc 100644
--- a/Master/texmf-dist/tex/context/base/syst-new.tex
+++ b/Master/texmf-dist/tex/context/base/syst-new.tex
@@ -1,5 +1,5 @@
%D \module
-%D [ file=supp-new,
+%D [ file=syst-new,
%D version=1997.01.03,
%D title=\CONTEXT\ Support Macros,
%D subtitle=New Ones,
@@ -16,24 +16,6 @@
\unprotect
-% moved from core-ntb
-
-\def\v!oddeven#1{\ifodd#1\v!odd\else\v!even\fi}
-
-% For myself
-
-\newcount\nofprofiled
-
-\def\profilemacro#1%
- {\nofprofiled\zerocount
- \letvalue{\string#1\string#1}#1%
- \appendtoks
- \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}%
- \to \everystoptext
- \unexpanded\def#1%
- {\global\advance\nofprofiled\plusone
- \csname\string#1\string#1\endcsname}}
-
% pretty ugly but fast
% \copycsname xxx\endcsname\csname ..\endcsname
@@ -55,88 +37,6 @@
\expanded{\addtocommalist{#2}\@EA\noexpand\csname#1\endcsname}}
% faster, and looks okay
-
-\dostepwiserecurse{0}{255}{1}
- {\@EA\chardef\csname-\recurselevel\endcsname\recurselevel}
-
-\newtoks\withminorcharacters
-\newtoks\withlowercharacters
-\newtoks\withuppercharacters
-
-% \thewithcharacter#1 % self
-
-\dostepwiserecurse{0}{31}{1}
- {\expanded
- {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
- \noexpand\to\withminorcharacters}}
-
-\dostepwiserecurse{32}{127}{1}
- {\expanded
- {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
- \noexpand\to\withlowercharacters}}
-
-\dostepwiserecurse{128}{255}{1}
- {\expanded
- {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
- \noexpand\to\withuppercharacters}}
-
-\def\doassigncatcodes#1%
- {\def\withcharacter##1{\catcode##1#1}%
- \the\withminorcharacters
- \the\withlowercharacters
- \ifeightbitcharacters\the\withuppercharacters\fi}
-
-\def\makeallother
- {\doassigncatcodes\@@other}
-
-\chardef\obeyedlccode=`. % so <32 and >127 chars become .
-
-% \def\obeylccodes
-% {\def\withcharacter##1{\lccode##1##1}%
-% \the\withlowercharacters
-% \def\withcharacter##1{\lccode##1\obeyedlccode}%
-% \the\withminorcharacters
-% \ifeightbitcharacters\the\withuppercharacters\fi}
-
-\def\setownlccode #1{\lccode#1#1}
-\def\setobeyedlccode#1{\lccode#1\obeyedlccode}
-
-\def\obeylccodes % also eightbitcharacters
- {\let\withcharacter\setownlccode
- \the\withlowercharacters
- \let\withcharacter\setobeyedlccode
- \the\withminorcharacters
- \the\withuppercharacters
- \relax}
-
-\def\retainlccodes % also eightbitcharacters
- {\let\withcharacter\setownlccode
- \the\withlowercharacters
- \the\withminorcharacters
- \the\withuppercharacters
- \relax}
-
-% not faster
-%
-% \newtoks \retainedlccodes
-% \dostepwiserecurse{0}{255}{1}
-% {\appendetoks\lccode\recurselevel=\recurselevel\to\retainedlccodes}
-% \appendetoks\relax\to\retainedlccodes
-
-%D This one is much faster in \ETEX. Hm, I misinterpreted
-%D the specs; it does not work.
-%
-% \ifx\normallanguage\undefined \let\normallanguage\language \fi
-% \let\doobeylccodes\obeylccodes
-%
-% \beginETEX \lccode
-% \begingroup
-% \normallanguage\zerocount
-% \doobeylccodes
-% \patterns{dummy}
-% \endgroup
-% \def\obeylccodes{\normallanguage\zerocount}
-% \endETEX
\def\unspaced#1%
{\dounspaced#1\end}
@@ -209,10 +109,10 @@
%
% \def\buildarray[#1][#2]%
% {\scratchcounter=0
-% \def\docommando##1%
+% \def\docommand##1%
% {\advance\scratchcounter by 1
% \setvalue{@@aa#1\the\scratchcounter}{##1}}%
-% \processcommalist[#2]\docommando
+% \processcommalist[#2]\docommand
% \setevalue{@@aa#1}{\the\scratchcounter}}%
%
% \def\setarrayelement#1#2{\setvalue{@@aa#1#2}}
@@ -245,9 +145,18 @@
% {\bgroup
% \afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end}
-\def\dodoifnonzeropositiveelse#1#2\end#3#4%
+\def\dodoifnonzeropositiveelse#1#2\end % #3#4%
{\ifx#1\relax
- \ifcase\scratchcounter\endgroup#4\else\endgroup#3\fi\else\endgroup#4%
+ \ifcase\scratchcounter
+ \endgroup
+ \@EAEAEA\secondoftwoarguments
+ \else
+ \endgroup
+ \@EAEAEA\firstoftwoarguments
+ \fi
+ \else
+ \endgroup
+ \@EA\secondoftwoarguments
\fi}
\def\doifnonzeropositiveelse#1%
@@ -284,10 +193,15 @@
\gdef\SPLITSKIP#1pt plus #2pt minus #3pt%
{\DOSPLITSKIP#1 #2 #3 }}
+% \def\DOSPLITSKIP#1 #2 #3
+% {\dimen0=#1pt\dimen2=#2pt\dimen4=#3pt
+% \advance\dimen2 -\onepoint
+% \advance\dimen4 -\onepoint}
+
\def\DOSPLITSKIP#1 #2 #3
- {\dimen0=#1pt\dimen2=#2pt\dimen4=#3pt
- \advance\dimen2 -\onepoint
- \advance\dimen4 -\onepoint}
+ {\dimen0=#1\onepoint
+ \dimen2=\dimexpr#2\onepoint-\onepoint\relax
+ \dimen4=\dimexpr#3\onepoint-\onepoint\relax}
% \def\minimaxskip#1#2%
% {\splitskip#2\relax
@@ -338,8 +252,7 @@
%D Standaard kan een spatie (zoals ~) uitrekken. Dit is in
%D overzichten niet altijd de bedoeling, vandaar:
-%\def\fixedspace%
-% {\hskip\fontdimen2\font\relax}
+% \def\fixedspace{\hskip\interwordspace\relax}
%\def\ExpandSecondAfter#1#2#3%
% {\!!toksa={#2}%
@@ -406,11 +319,15 @@
\writestatus\m!systems{starting feature test}\wait
\resettimer
\featuretest\zerocount \dotestfeature
- \scratchdimen\elapsedtime\s!sp
- \writestatus\m!systems{feature test done (\expandafter\withoutpt\the\scratchdimen s)}%
+ \writestatus\m!systems{feature test done (\elapsedseconds s)}%
\wait
\egroup}
+\def\elapsedseconds{\expandafter\withoutpt\the\dimexpr\elapsedtime sp\relax}
+
+\def\showtimer#1%
+ {\writestatus{runtime}{\elapsedseconds\space s / #1}}
+
% \edef\elapsedtime{\expandafter\withoutpt\the\dimexpr\elapsedtime\relax s}%
% \writestatus\m!systems{feature test done (\elapsedtime)}%
@@ -435,16 +352,16 @@
{\begingroup
#2=\zeropoint
\dimentoaddto\zeropoint
- \def\docommando%
+ \def\docommand%
{\advance#2 \dimentoaddto
- \futurelet\next\dodocommando}%
- \def\dodocommando%
+ \futurelet\next\dodocommand}%
+ \def\dodocommand%
{\ifx\next\relax
\expanded{\endgroup#2=\the#2}%
\else
- \@EA\afterassignment\@EA\docommando\@EA\dimentoaddto
+ \@EA\afterassignment\@EA\docommand\@EA\dimentoaddto
\fi}%
- \docommando#1\relax}
+ \docommand#1\relax}
\def\adddimenmacro#1\to#2%
{\adddimenregister#1\to\scratchdimen
@@ -879,4 +796,74 @@
\def\ignoreimplicitspaces
{\doifnextcharelse\relax\relax\relax}
+%D \macros
+%D {newconstant}
+
+\beginETEX
+
+\def\newconstant#1%
+ {\def\donewconstant{\xdef#1{\numexpr\the\scratchcounter\relax}}%
+ \afterassignment\donewconstant\scratchcounter}
+
+\endETEX
+
+\beginTEX
+
+\def\newconstant#1%
+ {\def\donewconstant{\xdef#1{\the\scratchcounter\space}}
+ \afterassignment\donewconstant\scratchcounter}
+
+\endTEX
+
+% new
+%
+% \startnointerference
+% all kind of code
+% \stopnointerference
+
+\newbox\nointerferencebox
+
+\def\startnointerference
+ {\setbox\nointerferencebox\vbox
+ \bgroup}
+
+\def\stopnointerference
+ {\egroup
+ \setbox\nointerferencebox\box\voidb@x}
+
\protect \endinput
+
+
+% \def\appendtovaluelist#1#2%
+% {\ifcsname#1\endcsname
+% \expandafter\ifx\csname#1\endcsname\empty
+% \expandafter\def\csname#1\endcsname{#2}%
+% \else
+% \expandafter\def\csname#1\expandafter\expandafter\expandafter\endcsname
+% \expandafter\expandafter\expandafter{\csname#1\endcsname,#2}%
+% \fi
+% \else
+% \expandafter\def\csname#1\endcsname{#2}%
+% \fi}
+%
+% or
+%
+% \def\appendtovaluelist#1%
+% {\ifcsname#1\endcsname
+% \expandafter\ifx\csname#1\endcsname\empty
+% \expandafter\noappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname
+% \else
+% \expandafter\doappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname
+% \fi
+% \else
+% \expandafter\noappendtovaluelist\csname#1\expandafter\endcsname
+% \fi}
+
+% \def\doappendtovaluelist#1#2{\expandafter\def\expandafter#1\expandafter{#1,#2}}
+% \def\noappendtovaluelist#1#2{\def#1{#2}}
+
+% \appendtovaluelist{mylist}{aap}
+% \appendtovaluelist{mylist}{noot}
+% \appendtovaluelist{mylist}{mies}
+
+% \showvalue{mylist}
diff --git a/Master/texmf-dist/tex/context/base/syst-omg.tex b/Master/texmf-dist/tex/context/base/syst-omg.tex
index da620fa7e7d..1bedb195b82 100644
--- a/Master/texmf-dist/tex/context/base/syst-omg.tex
+++ b/Master/texmf-dist/tex/context/base/syst-omg.tex
@@ -16,43 +16,6 @@
\ifx\OmegaVersion\undefined \endinput \fi
-% \def\newcount {\myalloc@0\count \countdef \@@maxallocation}
-% \def\newdimen {\myalloc@1\dimen \dimendef \@@maxallocation}
-% \def\newskip {\myalloc@2\skip \skipdef \@@maxallocation}
-% \def\newmuskip {\myalloc@3\muskip \muskipdef \@@maxallocation}
-% \def\newbox {\myalloc@4\box \mathchardef\@@maxallocation}
-% \def\newtoks {\myalloc@5\toks \toksdef \@@maxallocation}
-% \def\newread {\myalloc@6\read \chardef \@@minallocation}
-% \def\newwrite {\myalloc@7\write \chardef \@@minallocation}
-% \def\newmarks {\myalloc@8\marks \mathchardef\@@maxallocation}
-% \def\newlanguage{\myalloc@9\language\chardef \@@minallocation}
-%
-% \def\newfam#1{\chardef#1=15 }
-%
-% \count18=1
-%
-% \mathchardef\@@minallocation= 16
-% \mathchardef\@@medallocation= 256
-% \mathchardef\@@maxallocation=32767
-% \chardef \@@insallocation= 8
-%
-% \def\myalloc@#1#2#3#4#5%
-% {\global\advance\count1#1by\@ne
-% \ifnum\count1#1>\@@medallocation \else
-% \global\advance\insc@unt by -\@@insallocation
-% \ifnum\count1#1<\insc@unt \else
-% \global\count1#1=\@@medallocation % \wait
-% \fi
-% \global\advance\insc@unt by +\@@insallocation
-% \fi
-% \ifnum\count1#1>#4%
-% \global\count1#1=#4%
-% \errmessage{No room for (\string#2) \string#5}%
-% \fi
-% \allocationnumber=\count1#1%
-% \global#3#5=\allocationnumber
-% \wlog{\string#5=\string#2\the\allocationnumber}}
-
\unprotect
\def\newcount {\myalloc@0\count \countdef \@@maxallocation}
@@ -73,17 +36,14 @@
\mathchardef\@@minallocation = 16
\mathchardef\@@medallocation = 256
\mathchardef\@@maxallocation = 32767
-
-\chardef\@@insallocation=24
+\chardef \@@insallocation = 32
\def\myalloc@#1#2#3#4#5%
{\global\advance\count1#1by\@ne
\ifnum\count1#1>\@@medallocation \else
- \global\advance\insc@unt by -\@@insallocation
- \ifnum\count1#1<\insc@unt \else
- \global\count1#1=\@@medallocation % \wait
+ \ifnum\count1#1<\numexpr\@@medallocation-\@@insallocation\relax\else
+ \global\count1#1=\numexpr\@@medallocation+\@ne\relax % \wait
\fi
- \global\advance\insc@unt by +\@@insallocation
\fi
\ifnum\count1#1>#4%
\global\count1#1=#4%
@@ -93,6 +53,16 @@
\global#3#5=\allocationnumber
\wlog{\string#5=\string#2\the\allocationnumber}}
+\def\newinsert#1%
+ {\ifnum\insc@unt>\numexpr\@@medallocation-\@@insallocation\relax
+ \global\advance\insc@unt by\m@ne
+ \allocationnumber=\insc@unt
+ \global\chardef#1=\allocationnumber
+ \wlog{\string#1=\string\insert\the\allocationnumber}%
+ \else
+ \errmessage{No room for a new insert \string#1 (\number\insc@unt)}%
+ \fi}
+
%D We need to catch a (rather crappy) automatic OMEGA
%D mechanism. Unfortunately loading of the SGML vectors
%D happens automatically without control over the regime
@@ -100,13 +70,15 @@
\ifx\SGMLFontEntity\undefined \else
- \let\normalSGMLFontEntity\SGMLFontEntity
+ \errmessage{This version of Omega is way to buggy (+ \string\SGMLFontEntity\space mess)!}
- \def\SGMLFontEntity#1#2#3#4#5%
- {\convertargument#3\to\ascii
- \ExpandBothAfter\doifinstringelse{\letterbackslash}{\ascii}
- {\normalSGMLFontEntity{#1}{#2}{#3}{#4}{#5}}
- {\normalSGMLFontEntity{#1}{#2}{\string#3}{#4}{#5}}}
+% \let\normalSGMLFontEntity\SGMLFontEntity
+%
+% \def\SGMLFontEntity#1#2#3#4#5%
+% {\convertargument#3\to\ascii
+% \expanded{\doifinstringelse{\letterbackslash}{\ascii}}
+% {\normalSGMLFontEntity{#1}{#2}{#3}{#4}{#5}}
+% {\normalSGMLFontEntity{#1}{#2}{\string#3}{#4}{#5}}}
\fi
diff --git a/Master/texmf-dist/tex/context/base/syst-pdt.tex b/Master/texmf-dist/tex/context/base/syst-pdt.tex
new file mode 100644
index 00000000000..79ecc8cbaa8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-pdt.tex
@@ -0,0 +1,48 @@
+%D \module
+%D [ file=syst-pdt,
+%D version=2006.08.11,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=\PDFTEX\ specifics,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\ifx\pdftexversion\undefined \endinput \fi
+
+\unprotect
+
+% new after 1.10, watch the change in prefix
+
+\bindprimitive quitvmode ptexquitvmode
+\bindprimitive noligatures ptexnoligatures
+\bindprimitive setrandomseed ptexsetrandomseed
+\bindprimitive uniformdeviate ptexuniformdeviate
+
+\bindprimitive quitvmode pdfquitvmode
+\bindprimitive noligatures pdfnoligatures
+\bindprimitive setrandomseed pdfsetrandomseed
+\bindprimitive uniformdeviate pdfuniformdeviate
+
+\bindprimitive resettimer pdfresettimer
+\bindprimitive elapsedtime pdfelapsedtime
+
+% new per 1.40
+
+\bindprimitive ifprimitive ifpdfprimitive
+\bindprimitive primitive pdfprimitive
+\bindprimitive ifabsdim ifpdfabsdim
+\bindprimitive ifabsnum ifpdfabsnum
+
+\ifx\pdfobjcompresslevel\undefined \newcount\pdfobjcompresslevel \fi
+
+\def\nopdfcompression % for myself
+ {\pdfcompresslevel \zerocount
+ \pdfobjcompresslevel\zerocount}
+
+\let\normalnoligatures\noligatures
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/syst-pln.tex b/Master/texmf-dist/tex/context/base/syst-pln.tex
index 4259eb04ee2..0b74d6d0fe6 100644
--- a/Master/texmf-dist/tex/context/base/syst-pln.tex
+++ b/Master/texmf-dist/tex/context/base/syst-pln.tex
@@ -392,8 +392,8 @@
\def\lbrack{[}
\def\rbrack{]}
-\let\endgraf=\par
-\let\endline=\cr
+\let\endgraf\par
+\let\endline\cr
\def\space{ }
\def\empty{}
@@ -411,13 +411,17 @@
\let\repeat=\fi
%D The original (no \type {@@pln} there):
-
-\def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next}
-
+%D
+%D \starttyping
+%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next}
+%D \stoptyping
+%D
%D A more efficient alternative:
-
-\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi}
-
+%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}
@@ -575,20 +579,6 @@
% end to tab code
-%D Users are advised not to use the following macros:
-
-\def\hang
- {\hangindent\parindent}
-
-\def\textindent#1%
- {\indent
- \llap{#1\enspace}%
- \ignorespaces}
-
-\def\narrower
- {\advance\leftskip \parindent
- \advance\rightskip\parindent}
-
%D Useful, used too, but sometimes dangerous:
\def\leavevmode{\unhbox\voidb@x}
@@ -616,10 +606,6 @@
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}
-%D Used at all?
-
-\def\slash{/\penalty\exhyphenpenalty} % a `/' that acts like a `-'
-
%D Replaced later on:
\def\line {\hbox to\hsize}
@@ -627,14 +613,9 @@
\def\rightline #1{\line{\hss#1}}
\def\centerline#1{\line{\hss#1\hss}}
-%D These are used by TaBlE:
-
-\newif\ifh@
-\newif\ifv@
-
%D Let's end in the plain way:
-\def\fmtname {ConTeXt Minimized Plain TeX}
-\def\fmtversion{3.1415926}
+\ifx\fmtname \undefined \def\fmtname {ConTeXt Minimized Plain TeX} \fi
+\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-prm.tex b/Master/texmf-dist/tex/context/base/syst-prm.tex
index 4eda366e5c7..e54c2e20cb1 100644
--- a/Master/texmf-dist/tex/context/base/syst-prm.tex
+++ b/Master/texmf-dist/tex/context/base/syst-prm.tex
@@ -100,11 +100,29 @@
\fi
+\ifx\directlua\undefined
+
+ \long\gdef\beginMETATEX#1\endMETATEX%
+ {}
+
+\else
+
+ \gdef\beginMETATEX%
+ {\bgroup\obeylines\dobeginMETATEX}
+
+ \gdef\dobeginMETATEX#1
+ {\egroup\immediate\write16%
+ {system (METATEX) : [line \the\inputlineno] \detokenize{#1}}}
+
+ \global\let\endMETATEX\relax
+
+\fi
+
\egroup
%D Let's get rid of this one:
-\def\wlog#1{}
+% \def\wlog#1{}
%D Just for tracing purposes we set:
@@ -131,22 +149,47 @@
\def\dump{\the\everydump\normaldump}
-%D Ligature prevention (for instance, ec encoding has ligatures
-%D in mono spaced fonts). Alas, we need to do some testing in order
-%S to get to the ptex'd one.
-
-\def\checkpdftexprimitive #1
- {\expandafter\ifx\csname #1\endcsname\relax
- \expandafter\ifx\csname pdf#1\endcsname\relax
- \expandafter\ifx\csname ptex#1\endcsname\relax
- \expandafter\let\csname normal#1\endcsname \undefined \else
- \expandafter\let\csname normal#1\expandafter\endcsname\csname ptex#1\endcsname \fi \else
- \expandafter\let\csname normal#1\expandafter\endcsname\csname pdf#1\endcsname \fi \else
- \expandafter\let\csname normal#1\expandafter\endcsname\csname #1\endcsname \fi}
-
-\checkpdftexprimitive quitvmode
-\checkpdftexprimitive noligatures
-\checkpdftexprimitive setrandomseed
-\checkpdftexprimitive uniformdeviate
+%D \macros
+%D {bindprimitive}
+
+\beginTEX
+
+\def\bindprimitive#1 #2 % new old
+ {\expandafter\ifx\csname#1\endcsname\relax \expandafter\ifx\csname#2\endcsname\relax \else
+ \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname
+ \fi\fi}
+
+\endTEX
+
+\beginETEX
+
+\def\bindprimitive#1 #2 % new old
+ {\ifcsname#1\endcsname \else\ifcsname#2\endcsname
+ \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname
+ \fi\fi}
+
+\endETEX
+
+% %D Ligature prevention (for instance, ec encoding has ligatures
+% %D in mono spaced fonts). Alas, we need to do some testing in order
+% %D to get to the ptex'd one.
+
+% \def\checkpdftexprimitive #1
+% {\expandafter\ifx\csname #1\endcsname\relax
+% \expandafter\ifx\csname pdf#1\endcsname\relax
+% \expandafter\ifx\csname ptex#1\endcsname\relax
+% \expandafter\let\csname normal#1\endcsname \undefined \else
+% \expandafter\let\csname normal#1\expandafter\endcsname\csname ptex#1\endcsname \fi \else
+% \expandafter\let\csname normal#1\expandafter\endcsname\csname pdf#1\endcsname \fi \else
+% \expandafter\let\csname normal#1\expandafter\endcsname\csname #1\endcsname \fi}
+
+% \checkpdftexprimitive quitvmode
+% \checkpdftexprimitive noligatures
+% \checkpdftexprimitive setrandomseed
+% \checkpdftexprimitive uniformdeviate
+
+%D We preserve \TEX's ending:
+
+\ifx\normalend\undefined \let\normalend\end \fi
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-rtp.mkii b/Master/texmf-dist/tex/context/base/syst-rtp.mkii
new file mode 100644
index 00000000000..a1c6abe2eed
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-rtp.mkii
@@ -0,0 +1,18 @@
+%D \module
+%D [ file=syst-rtp, % copied from core-job
+%D version=1997.03.31,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Run Time Processes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\def\executesystemcommand{\immediate\write18}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-rtp.tex b/Master/texmf-dist/tex/context/base/syst-rtp.tex
new file mode 100644
index 00000000000..958265f13ff
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-rtp.tex
@@ -0,0 +1,22 @@
+%D \module
+%D [ file=syst-rtp, % copied from core-job
+%D version=1997.03.31,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Run Time Processes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Core Macros / Run Time Processes}
+
+\unprotect
+
+\let\executesystemcommand\gobbleoneargument
+
+\loadmarkfile{syst-rtp}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-str.mkii b/Master/texmf-dist/tex/context/base/syst-str.mkii
new file mode 100644
index 00000000000..e50df0103bb
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-str.mkii
@@ -0,0 +1,119 @@
+%D \module
+%D [ file=syst-str,
+%D version=2006.09.18,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=String Processing,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+%D We need a convenient way to change lccode vectors.
+
+\dostepwiserecurse{0}{255}{1}
+ {\@EA\chardef\csname-\recurselevel\endcsname\recurselevel}
+
+\newtoks\withminorcharacters
+\newtoks\withlowercharacters
+\newtoks\withuppercharacters
+
+\dostepwiserecurse{0}{31}{1}
+ {\expanded
+ {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
+ \noexpand\to\withminorcharacters}}
+
+\dostepwiserecurse{32}{127}{1}
+ {\expanded
+ {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
+ \noexpand\to\withlowercharacters}}
+
+\dostepwiserecurse{128}{255}{1}
+ {\expanded
+ {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
+ \noexpand\to\withuppercharacters}}
+
+\chardef\obeyedlccode=`. % so <32 and >127 chars become .
+
+%D \macros
+%D {retainlccodes}
+%D
+%D One way of manipulating characters is changing the their
+%D \type{\lccode} and applying \type{\lowcase}. An example of
+%D this can be found in \type{spec-mis}.
+
+\def\setownlccode #1{\lccode#1#1}
+\def\setobeyedlccode#1{\lccode#1\obeyedlccode}
+
+\def\obeylccodes
+ {\let\withcharacter\setownlccode
+ \the\withlowercharacters
+ \let\withcharacter\setobeyedlccode
+ \the\withminorcharacters
+ \the\withuppercharacters
+ \relax}
+
+\def\retainlccodes
+ {\let\withcharacter\setownlccode
+ \the\withlowercharacters
+ \the\withminorcharacters
+ \the\withuppercharacters
+ \relax}
+
+%D The string macros:
+
+\def\replacecharacters#1#2#3% macro characters replacement
+ {\bgroup
+ \edef\ascii{#1}%
+ \retainlccodes
+ \def\docommand##1{\lccode\expandafter`\csname##1\endcsname=\expandafter`\csname#3\endcsname}%
+ \handletokens#2\with\docommand
+ \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
+ \egroup
+ \dodoglobal\let#1\globalascii}
+
+% \bgroup
+% \catcode`\ =\@@other % needed in order to get it visible
+% \lccode`\ =`\-
+% \lowercase{\xdef\globalascii{aap noot}}%
+% \egroup
+%
+% [\globalascii] {\tttf [\globalascii]}
+%
+% interesting:
+%
+% \setvalue{xxx}{oeps}
+% \setvalue{test-test}{\getvalue{xxx}oeps}
+% \bgroup\lccode`\ =`\-\lowercase{\egroup\csname test test\endcsname}
+%
+% \setvalue{test\string~test}{\getvalue{xxx}oeps}
+% \bgroup\lccode`\ =`\~\lowercase{\egroup\csname test test\endcsname}
+%
+% \bgroup\catcode`\~=\@@letter\lowercase{\egroup\csname test~test\endcsname}
+
+\def\separatestring#1\to#2%
+ {\bgroup
+ \retainlccodes
+ \lccode `\ =`\,%
+ % when typesetting: \catcode`\ =\@@other
+ \edef\ascii{#1}%
+ \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
+ \egroup
+ \let#2\globalascii}
+
+\def\unspacefilename#1\to#2%
+ {\bgroup
+ \def\obeyedspace{-}%
+ \sanitizefilename#1\to\ascii
+ \retainlccodes
+ \lccode `\ =`\-%
+ % when typesetting: \catcode`\ =\@@other
+ \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
+ \egroup
+ \let#2\globalascii}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-str.tex b/Master/texmf-dist/tex/context/base/syst-str.tex
new file mode 100644
index 00000000000..15db004a3ab
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/syst-str.tex
@@ -0,0 +1,40 @@
+%D \module
+%D [ file=syst-str,
+%D version=2006.09.18,
+%D title=\CONTEXT\ System Macros,
+%D subtitle=String Processing,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context System Macro's / Strings}
+
+%D These macros were defined elsewhere but for practical reasons
+%D we moved them here. This way we can more easily provide Mk IV
+%D support.
+
+\unprotect
+
+%D I got tired of making dedicated clean up macros using the
+%D same mechanism again and again, so now we have:
+%D
+%D \starttyping
+%D \def\xxxx{abc.d} \replacecharacters\xxxx{a.}{-} \xxxx
+%D \stoptyping
+
+\let\replacecharacters\gobblethreearguments % macro characters replacement
+
+%D Hm?
+
+\def\separatestring #1\to#2{}
+\def\unspacefilename#1\to#2{}
+
+%D Plugins:
+
+\loadmarkfile{syst-str}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-tex.tex b/Master/texmf-dist/tex/context/base/syst-tex.tex
index ddf1d82af87..44549dab48a 100644
--- a/Master/texmf-dist/tex/context/base/syst-tex.tex
+++ b/Master/texmf-dist/tex/context/base/syst-tex.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D This file is used by mptopdf.
+
%D We've build \CONTEXT\ on top of \PLAIN\ \TEX. Because we
%D want to make the format file as independant as possible of
%D machine dependant font encodings, we have to bypass the
diff --git a/Master/texmf-dist/tex/context/base/syst-var.tex b/Master/texmf-dist/tex/context/base/syst-var.tex
index 6dbaae92d0f..8753017b53b 100644
--- a/Master/texmf-dist/tex/context/base/syst-var.tex
+++ b/Master/texmf-dist/tex/context/base/syst-var.tex
@@ -1,5 +1,5 @@
%D \module
-%D [ file=syst-con,
+%D [ file=syst-var,
%D version=2005.07.04, % moved code
%D title=\CONTEXT\ System Macros,
%D subtitle=Variables,
@@ -13,11 +13,6 @@
\writestatus{loading}{Context System Macro's / Variables}
-\ifx\undefined\globalscratchcounter \newcount \globalscratchcounter \fi
-\ifx\undefined\globalscratchdimen \newdimen \globalscratchdimen \fi
-\ifx\undefined\globalscratchskip \newskip \globalscratchskip \fi
-\ifx\undefined\globalscratchmuskip \newmuskip\globalscratchmuskip \fi
-\ifx\undefined\globalscratchbox \newbox \globalscratchbox \fi
-\ifx\undefined\globalscratchtoks \newtoks \globalscratchtoks \fi
+% will be used some day
\endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-xtx.tex b/Master/texmf-dist/tex/context/base/syst-xtx.tex
index af6d6e8dffd..3c60b7824ed 100644
--- a/Master/texmf-dist/tex/context/base/syst-xtx.tex
+++ b/Master/texmf-dist/tex/context/base/syst-xtx.tex
@@ -20,23 +20,28 @@
\ifx\scratchread\undefined \newread\scratchread \fi
-\immediate\openin\scratchread=unicode-letters.tex \ifeof\scratchread
- \immediate\openin\scratchread=xplain.tex \ifeof\scratchread
- % no initialization file
+\def\setcclcuc #1 #2 #3 %
+ {\global\catcode"#1=11
+ \global\lccode "#1="#2
+ \global\uccode "#1="#3 }
+
+\immediate\openin\scratchread=enco-xtx.tex \ifeof\scratchread
+ \immediate\openin\scratchread=unicode-letters.tex \ifeof\scratchread
+ \immediate\openin\scratchread=xplain.tex \ifeof\scratchread
+ % no initialization file
+ \else
+ \input xplain.tex
+ \fi
\else
- \input xplain.tex\relax
+ \input unicode-letters.tex
\fi
\else
- \input unicode-letters.tex\relax
- % begin of patch (turkish patterns need this)
- \begingroup
- \catcode`\{=1 \catcode`\}=2 \catcode`\#=6
- \def\C #1 #2 #3 {\global\uccode"#1="#2 \global\lccode"#1="#3 } % case mappings (non-letter)
- \def\L #1 #2 #3 {\global\catcode"#1=11 \C #1 #2 #3 } % letter with case mappings
- \L 201C 201C 201C
- \L 201D 201D 201D
- \endgroup
- % end of patch
+ \input enco-xtx.tex
\fi
+% patch needed for turkish
+
+\setcclcuc 201C 201C 201C
+\setcclcuc 201D 201D 201D
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/thrd-tab.tex b/Master/texmf-dist/tex/context/base/thrd-tab.tex
index 2abd3fb3df9..a2123efef73 100644
--- a/Master/texmf-dist/tex/context/base/thrd-tab.tex
+++ b/Master/texmf-dist/tex/context/base/thrd-tab.tex
@@ -1,22 +1,22 @@
% Since this file is not available in every distribution, we
-% have copied the original in this file. The manuals to
-% Wichura's PiCTeX and TaBlE packages are not available on
+% have copied the original in this file. The manuals to
+% Wichura's PiCTeX and TaBlE packages are not available on
% line and are distributed by respectively the TeX Users Group
-% and Personal TeX Inc. Many macros of TaBlE are overloaded
-% and/or extended in core-tab.tex. The extensions concern
-% splitting over pages, color and consistent spacing.
+% and Personal TeX Inc. Many macros of TaBlE are overloaded
+% and/or extended in core-tab.tex. The extensions concern
+% splitting over pages, color and consistent spacing.
-% TABLE 1.0
+% TABLE 1.0
% Copyright Michael J. Wichura August 1988
% The TABLE macros are divided into sections, roughly according to
% function:
-
+
% Section Name Function
-% a Allocation Allocates storage registers for parameters.
+% a Allocation Allocates storage registers for parameters.
% f Format Reads format section; builds preamble for \halign;
% processes \ReFormat command.
-% g Get Value Converts "spec"'s (as in spec_{LT}) to
+% g Get Value Converts "spec"'s (as in spec_{LT}) to
% corresponding "values"'s (as in value_{LT}).
% h Hacks Utility macros; error messages; miscellaneous commands.
% k Keys Definition and scanning of format keys.
@@ -24,51 +24,51 @@
% s Struts Macros for struts.
% t Tables Sets up \halign for table; end-of-row processing;
% alternate vertical rules; spanning; horizontal
-% lines; stretching and shrinking; repositioning
+% lines; stretching and shrinking; repositioning
% commands.
-
-% The name of each internal macro begins with the prefix "\!t", the
-% "!" having category code 11, followed by the letter of the section
-% in which the macro is defined. For example, a macro beginning "\!th"
+
+% The name of each internal macro begins with the prefix "\!t", the
+% "!" having category code 11, followed by the letter of the section
+% in which the macro is defined. For example, a macro beginning "\!th"
% is defined in Section h (Hacks). There a few exceptions:
% the general purpose macros "\!ttemp", "\!ttempa", "\!ttempb", and
% "\!tnext" are repeatedly defined on the spot as the need arises.
-
-% External macros (and active characters) are defined in the following
+
+% External macros (and active characters) are defined in the following
% sections:
% Macro Section
% " t
% \- t
% \= t
-% \ActivateBarAndQuote h
-% \AugmentedTableStrut s
+% \ActivateBarAndQuote h
+% \AugmentedTableStrut s
% \BackSpace h
% \BeginFormat f
% \BeginTable t
% \BeginTableParBox a
% \Center t
-% \ColumnWidthFactor a
+% \ColumnWidthFactor a
% \ColumnWidthUnit a
-% \DQuote h
+% \DQuote h
% \EndFormat k (\EndFormat is actually a key)
% \EndTable t
% \EndTableParBox a
% \Enlarge s
% \enlarge s
-% \EveryTable a
+% \EveryTable a
% \EveryTableParBox a
% \Expand t
-% \InterColumnSpaceFactor a
+% \InterColumnSpaceFactor a
% \InterColumnSpaceUnit a
% \JustCenter t
% \JustLeft t
% \JustRight t
-% \KernFactor a
-% \KernUnit a
+% \KernFactor a
+% \KernUnit a
% \Left t
% \LeftTabskip a
-% \LineThicknessFactor a
-% \LineThicknessUnit a
+% \LineThicknessFactor a
+% \LineThicknessUnit a
% \LongLines t
% \Lower h
% \MakeStrut s
@@ -89,41 +89,45 @@
% \SetTableToWidth t
% \Smash h
% \StandardTableStrut s
-% \StrutDepthFactor a
-% \StrutHeightFactor a
-% \StrutUnit a
+% \StrutDepthFactor a
+% \StrutHeightFactor a
+% \StrutUnit a
% \TaBlE h
% \TracingFormats a
% \TracingKeys a
% \Use t
% \use t
-% \VBar h
+% \VBar h
% \Vspace h
-% \VspaceFactor a
+% \VspaceFactor a
% \WidenTableBy t
-% \\ t
+% \\ t
% \_ t
% \| t
% | t
% ~ t
-%
+%
+
\catcode `\!=11
\catcode `\@=11
+\newif\ifh@ % normally in plain tex
+\newif\ifv@ % normally in plain tex
+
% Don't try to read the TABLE macros until after you've read the
% TABLE manual. The internal documentation of the macros is
% sketchy; you need the manual to understand what's going on.
% You should also review the material on \halign s in the TeXbook,
% since TABLE uses an \halign to perform its alignments.
-
+
% In studying the TABLE macros, you should start by skimming the
% macros in the "miscellaneous hacks", "error messages", and "loops"
% subsections of Section h, as well as the "\GetValue" macro in
% Section g; these macros are called many times by the other macros.
-% To continue with a "bottom-up" approach, read next Sections k,
-% f, and t. (Top-downers should reverse the order.) The other
+% To continue with a "bottom-up" approach, read next Sections k,
+% f, and t. (Top-downers should reverse the order.) The other
% Sections can be looked at as the need arises.
-
+
% *********************************************************************
@@ -136,10 +140,10 @@
% TABLE PARAMETERS: Units
% *********************************************************************
-\newdimen\LineThicknessUnit
-\newdimen\StrutUnit
-\newskip \InterColumnSpaceUnit
-\newdimen\ColumnWidthUnit
+\newdimen\LineThicknessUnit
+\newdimen\StrutUnit
+\newskip \InterColumnSpaceUnit
+\newdimen\ColumnWidthUnit
\newdimen\KernUnit
\let\!taLTU=\LineThicknessUnit % Used in preamble
@@ -168,11 +172,11 @@
\InterColumnSpaceUnit=\the\NormalTICSU
\ColumnWidthUnit =\the\NormalTCWU
\KernUnit =\the\NormalTKU}
-
+
\NormalTableUnits
-% The user should issue \NormalTableUnits when setting a table
-% in a different point size, since the Table...Units themselves
+% The user should issue \NormalTableUnits when setting a table
+% in a different point size, since the Table...Units themselves
% are static while the Normal...Units vary with the point size.
@@ -180,11 +184,11 @@
% TABLE PARAMETERS: Factors
% *********************************************************************
-\newcount\LineThicknessFactor
-\newcount\StrutHeightFactor
-\newcount\StrutDepthFactor
-\newcount\InterColumnSpaceFactor
-\newcount\ColumnWidthFactor
+\newcount\LineThicknessFactor
+\newcount\StrutHeightFactor
+\newcount\StrutDepthFactor
+\newcount\InterColumnSpaceFactor
+\newcount\ColumnWidthFactor
\newcount\KernFactor
\newcount\VspaceFactor
@@ -212,13 +216,13 @@
% *********************************************************************
\def\BeginTableParBox#1{%
- \vtop\bgroup
+ \vtop\bgroup
\hsize=#1
- \normalbaselines
+ \normalbaselines
\let~=\!ttTie
\let\-=\!ttDH
- \the\EveryTableParBox}
-
+ \the\EveryTableParBox}
+
\def\EndTableParBox{%
\MakeStrut{0pt}{\StrutDepthFactor\StrutUnit}
\egroup} % finishes the \vtop begun by \BeginTableParbox
@@ -228,7 +232,7 @@
\parindent=0pt
\raggedright
\rightskip=0pt plus 4em % Provide more stretch
- \relax}
+ \relax}
% *********************************************************************
@@ -296,7 +300,7 @@
% ACTIVATE BAR AND QUOTE: Makes | and " active if they aren't
% already active (in which case the user will probably have given
% them special meanings); definitions are provided which effectively
-% undoes the activeness outside a Table.
+% undoes the activeness outside a Table.
{\catcode`\|=13 \catcode`\"=13
\gdef\ActivateBarAndQuote{%
@@ -315,11 +319,11 @@
\catcode`\"=13
\def"{\char`\"}%
\fi}}
-
+
% ****************************************************************
% Macros for | and " having category code 12.
% ****************************************************************
-{\catcode `\|=12 \catcode `\"=12
+{\catcode `\|=12 \catcode `\"=12
\gdef\VBar{|}
\gdef\DQuote{"}}
@@ -330,15 +334,15 @@
% MESSAGE <Message>: Writes out <Message> to terminal and log file.
\def\!thMessage#1{\immediate\write16{#1}\ignorespaces}
-
+
% X: Abbreviation for expandafter
\let\!thx=\expandafter
% GOBBLE: Eats next token
-\def\!thGobble#1{}
+\def\!thGobble#1{}
% SPACE TOKEN
-\def\\{\let\!thSpaceToken= }\\
+\def\\{\let\!thSpaceToken= }\\
% HEIGHT, DEPTH, AND WIDTH
\def\!thHeight{height}
@@ -377,7 +381,7 @@
\edef\!ttemp{#2}%
\errhelp=\!thx{\!ttemp}%
\!thMessage{%
- ^^J\!thReadErrorMsg\!thErrorMsgA
+ ^^J\!thReadErrorMsg\!thErrorMsgA
^^J\!thReadErrorMsg\!thErrorMsgB}%
\errmessage{#1}%
\endgroup}
@@ -399,7 +403,7 @@
% ****************************************************************
-% LOOP MACRO
+% LOOP MACRO
% ****************************************************************
% LOOP ... REPEAT macro from TUGboat Vol 8 #2: 1987
@@ -409,7 +413,7 @@
#1%
\!thx \!thIterate
\fi}%
- \!thIterate
+ \!thIterate
\let\!thIterate\relax}
@@ -427,21 +431,21 @@
\else
\expandafter\!thDoVCS
\fi}
-
+
% DO VCS
\def\!thDoVCS#1{%
\setbox\z@\hbox{#1}%
\!thFinishVCS}
-
+
% DO MATH VCS
\def\!thDoMathVCS#1#2{%
\setbox\z@\hbox{$\m@th#1{#2}$}%
\!thFinishVCS}
-
+
% FINISH VCS
\def\!thFinishVCS{%
\vbox to\z@{\vss\box\z@\vss}}
-
+
% ***************************************************************
% RAISE AND LOWER
@@ -450,7 +454,7 @@
% Like TeX's \raise and \lower, except: (1) The first argument
% to these commands is a dimension expressed in TABLE's usual conventions;
% the default is (StrutHeightFactor+StrutDepthFactor)*StrutUnit/2
-% (2) like \smash, these commands function in math mode as well
+% (2) like \smash, these commands function in math mode as well
% as horizontal mode; (3) again like \smash, the result is declared
% to have height and depth 0pt
@@ -490,12 +494,12 @@
\else
\expandafter\!thDoSimpleRaise
\fi}
-
+
% DO SIMPLE RAISE
\def\!thDoSimpleRaise#1{%
\setbox\z@\hbox{\raise \!taDimenA\hbox{#1}}%
\!thFinishRaise} % From Plain TeX: \ht0=0pt \dp0=0pt \box0
-
+
% DO MATH RAISE
\def\!thDoMathRaise#1#2{%
\setbox\z@\hbox{\raise \!taDimenA\hbox{$\m@th#1{#2}$}}%
@@ -504,10 +508,10 @@
% FINISH RAISE. This is the same as Plain's \finsm@sh; some macro
% packages redefine \finsm@sh.
\def\!thFinishRaise{%
- \ht\z@\z@
+ \ht\z@\z@
\dp\z@\z@
\box\z@}
-
+
% ***************************************************************
% BACK SPACE
@@ -517,14 +521,14 @@
\def\!thKernBack{%
\kern -
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
+ \ifnum \!tgCode=1
+ \ifx \!tgValue\empty
\the\KernFactor
\else
\!tgValue % user-specified integer
\fi
\KernUnit
- \else
+ \else
\!tgValue % user-specified dimension
\fi
\ignorespaces}%
@@ -540,14 +544,14 @@
\def\!thVspace{%
\vskip
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
+ \ifnum \!tgCode=1
+ \ifx \!tgValue\empty
\the\VspaceFactor
\else
\!tgValue % user-specified integer
\fi
\StrutUnit
- \else
+ \else
\!tgValue % user-specified skip
\fi
\egroup} % Ends the \noalign
@@ -565,25 +569,25 @@
% +(n+1) (rule columns)
% + 2 (dummy data columns)
% ____
-% 2n+3
+% 2n+3
% columns.
-
+
% FORMATs job is to create an \halign preamble for the alignment
% of these (2n+3) columns. The preamble consists of templates
% for the various columns, strung together with &'s and interlaced
% with \tabskip glue specifications.
-
+
% FORMAT constructs the template for a nomimal data column according
% to the user-specified format keys. As the keys are read from left
-% to right, the template is built up "from the inside out" (as
+% to right, the template is built up "from the inside out" (as
% illustrated in Section 3.1.9 of the manual), the inner-most part
% being the "#" sign. A "|" in the format terminates template
-% building; the completed template is adjoined to preamble along
+% building; the completed template is adjoined to preamble along
% with the template for the following rule column.
% Minimum column widths, if specified, are implemented by creating
-% an "artificial row" with data entries of the form
-% \hskip <minimum column width>.
+% an "artificial row" with data entries of the form
+% \hskip <minimum column width>.
% This row has zero height and depth and is completely invisible.
@@ -591,14 +595,14 @@
\def\BeginFormat{%
\catcode`\|=12 % Inhibit expansion if | immediately follows a <number>
\catcode`\"=12 % read by \getvalue.
- \!taPreamble={}%
+ \!taPreamble={}%
\!taColumnNumber=0
\skip0 =\InterColumnSpaceUnit
\multiply\skip0 \InterColumnSpaceFactor
\divide\skip0 2
\!taRuleColumnTemplate=\!thx{%
\!thx\tabskip\the\skip0 }%
- \!taLastRegularTabskip=\skip0
+ \!taLastRegularTabskip=\skip0
\!taOnceOnlyTabskipfalse
\!taBeginFormattrue % Used to intercept key "]"
\def\!tfRowOfWidths{}% Artificial Table Row with horizontal struts
@@ -618,11 +622,11 @@
\ifnum \!taCountA<\!taColumnNumber
\advance\!taCountA 1
\aftergroup \!tfAOAO
- \repeat
+ \repeat
\aftergroup }%
\endgroup
\fi
- \fi
+ \fi
\ifx [\!ttemp % \!tgGetValue sets \!ttemp = token after w
\!thx\!tfSetWidthText
\else
@@ -634,22 +638,22 @@
&\omit&\omit}
% SET WIDTH TEXT
-\def\!tfSetWidthText [#1]{% #1 = specified text
+\def\!tfSetWidthText [#1]{% #1 = specified text
\def\!tfWidthText{#1}%
\ReadFormatKeys}
% SET WIDTH VALUE
\def\!tfSetWidthValue{%
- \!taMinimumColumnWidth =
- \ifnum \!tgCode=1
+ \!taMinimumColumnWidth =
+ \ifnum \!tgCode=1
\ifx\!tgValue\empty % Use default multiplier if user didn't specify one
\ColumnWidthFactor
\else
- \!tgValue
+ \!tgValue
\fi
\ColumnWidthUnit
\else
- \!tgValue
+ \!tgValue
\fi
\def\!tfWidthText{}% Override possible prior `w[sample entry]'
\ReadFormatKeys}
@@ -659,7 +663,7 @@
\def\!tfSetTabskip{%
\ifnum \!tgCode=1
\skip0 =\InterColumnSpaceUnit
- \multiply\skip0
+ \multiply\skip0
\ifx \!tgValue\empty
\InterColumnSpaceFactor % Default integer
\else
@@ -669,13 +673,13 @@
\skip0 =\!tgValue % User-specified <skip>
\fi
\divide\skip0 by 2
- \ifnum\!taColumnNumber=0
+ \ifnum\!taColumnNumber=0
\!thToksEdef\!taRuleColumnTemplate={%
- \the\!taRuleColumnTemplate
+ \the\!taRuleColumnTemplate
\tabskip \the\skip0 }
\else
\!thToksEdef\!taDataColumnTemplate={%
- \the\!taDataColumnTemplate
+ \the\!taDataColumnTemplate
\tabskip \the\skip0 }
\fi
\if!taOnceOnlyTabskip
@@ -706,10 +710,10 @@
\noexpand\hfil
\the\!taRuleColumnTemplate} % has \tabskips, when column number=0
\!tfAdjoinPriorColumn}
-
+
% SET ALTERNATE VRULE: Invoked by the key "\|", in the form
% \|{<template for (rule) column>}. The "{" and "}" are mandatory,
-% and the <template for column> must contain a "#". The key system
+% and the <template for column> must contain a "#". The key system
% CAN'T be used to set up this template. The <template> can have the
% form "\span\macro".
\def\!tfSetAlternateVrule{%
@@ -725,7 +729,7 @@
\def\!tfAdjoinPriorColumn{%
\ifnum \!taColumnNumber=0
\!taPreamble=\!taRuleColumnTemplate % New \tabskip may have been added
- \ifnum \TracingFormats>0
+ \ifnum \TracingFormats>0
\!tfShowRuleTemplate
\fi
\else
@@ -754,7 +758,7 @@
\advance \!taColumnNumber 1
% Initialize data-column template, restoring last "regular" tabskip
% after a "once only" tabskip
- \if!taOnceOnlyTabskip
+ \if!taOnceOnlyTabskip
\!thToksEdef\!taDataColumnTemplate={%
####\tabskip \the\!taLastRegularTabskip}
\else
@@ -763,7 +767,7 @@
% Remaining initializations
\!taRuleColumnTemplate{}% # is inserted by \SetVrule, or \SetAlternateVrule
\!taLeftGlue{\hfil}% % Default positioning is "center"
- \!taRightGlue{\hfil}%
+ \!taRightGlue{\hfil}%
\!taMinimumColumnWidth=0pt
\def\!tfWidthText{}%
\!taOnceOnlyTabskipfalse % Set true by key "o"
@@ -771,7 +775,7 @@
% UPDATE ROW OF WIDTHS
\def\!tfUpdateRowOfWidths{%
- % If user had a "w[<Text>]" key, set <Text> according to the
+ % If user had a "w[<Text>]" key, set <Text> according to the
% template for this column, and find the width of the result
\ifx \!tfWidthText\empty
\else % set specified text according to current template & find width
@@ -818,7 +822,7 @@
\!thMessage{%
\space \space w: \the\!taMinimumColumnWidth}
\fi}
-
+
% FINISH UP: Invoked by the keys "." and \EndFormat
\def\!tfFinishFormat{%
@@ -842,7 +846,7 @@
^^J\!thReadErrorMsg\!tkFixIt}%
\fi
\!thToksEdef\!taPreamble={%
- ####\tabskip\LeftTabskip
+ ####\tabskip\LeftTabskip
&
\the\!taPreamble \tabskip\RightTabskip
&
@@ -860,7 +864,7 @@
% ERROR MESSAGE FOR NOT ENOUGH "|"'s
\!thStoreErrorMsg\!tfTooFewBarsA{%
- There must be at least 2 "|"'s (and/or "\string \|"'s)}
+ There must be at least 2 "\string|"'s (and/or "\string \|"'s)}
\!thStoreErrorMsg\!tfTooFewBarsB{%
between \string\BeginFormat\space and \string\EndFormat\space (or ".").}
@@ -871,8 +875,8 @@
\def\ReFormat[{%
\omit
\!taDataColumnTemplate{##}%
- \!taLeftGlue{}%
- \!taRightGlue{}%
+ \!taLeftGlue{}%
+ \!taRightGlue{}%
\catcode`\|=12 % Inhibit expansion if | immediately follows a <number>
\catcode`\"=12 % read by \getvalue. Actually, '|' and '"' shouldn't
\ReadFormatKeys}% appear in a \ReFormat cmd; this is here as a safeguard.
@@ -880,7 +884,7 @@
% END REFORMAT: Invoked by the key "]"
\def\!tfEndReFormat{%
\ifnum \TracingFormats>0
- \!thMessage{ReF:
+ \!thMessage{ReF:
\the\!taLeftGlue
\hbox{\the\!taDataColumnTemplate}% White lie
\the\!taRightGlue}
@@ -905,11 +909,11 @@
% GET_VALUE{<return macro>}<tokens> functions as follows:
-% If <tokens> has the form <(stuff)>, then
+% If <tokens> has the form <(stuff)>, then
% code=2 and value=<stuff>
% Otherwise <tokens> has the form <DDDXYZ> where <DDD> denotes (a possibly
-% empty) string of consecutive digits (0,1,2,...,9) terminated by the first
+% empty) string of consecutive digits (0,1,2,...,9) terminated by the first
% character <X> (possibly a blank) that is not a digit. In this case
% code=1 and value=<DDD> (= <null>, if <DDD> is non-empty).
@@ -924,10 +928,10 @@
% "\GetValue{\macro} (1in)" 1 null
-% GET_VALUE{<macro to execute after value is found>}
+% GET_VALUE{<macro to execute after value is found>}
\def\!tgGetValue#1{%
\def\!tgReturn{#1}% Set return
- \futurelet\!ttemp\!tgCheckForParen}% Now \!ttemp is the token
+ \futurelet\!ttemp\!tgCheckForParen}% Now \!ttemp is the token
% immediately after {}
% CHECK_PAREN: See if \!ttemp is a (
@@ -951,7 +955,7 @@
\ifx\!ttemp\!thSpaceToken
\!thx \!tgReturn % <blank space> means no value was specified
\else
- \!thx \!tgCheckForDigit
+ \!thx \!tgCheckForDigit
\fi}
% CHECK_DIGIT: \!ttemp is not a <blank space>; if its a digit (0,1,...,9)
@@ -1000,7 +1004,7 @@
\if!taDigit
\!thx \!tgGetNumber
\else
- \!thx \!tgReturn
+ \!thx \!tgReturn
\fi}
% GET_NUMBER
@@ -1016,20 +1020,20 @@
% MISCELANEOUS "RETURNS" FROM \getvalue
% ********************************************************************
-% SET UP PAR BOX: Puts \BeginTableParBox{<user-specified \hsize>}
+% SET UP PAR BOX: Puts \BeginTableParBox{<user-specified \hsize>}
% to the left of "#" and \EndTableParBox to the right of "#".
\def\!tgSetUpParBox{%
\edef\!ttemp{%
\noexpand \ReadFormatKeys
b{\noexpand \BeginTableParBox{%
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
+ \ifnum \!tgCode=1
+ \ifx \!tgValue\empty
\the\ColumnWidthFactor
\else
\!tgValue % user-specified integer
\fi
- \!taCWU % \ColumnWidthUnit
- \else
+ \!taCWU % \ColumnWidthUnit
+ \else
\!tgValue % user-specified dimension
\fi}}}%
\!ttemp
@@ -1039,14 +1043,14 @@
\def\!tgInsertKern{%
\edef\!ttemp{%
\kern
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
+ \ifnum \!tgCode=1
+ \ifx \!tgValue\empty
\the\KernFactor
\else
\!tgValue % user-specified integer
\fi
\!taKU % \KernUnit
- \else
+ \else
\!tgValue % user-specified dimension
\fi}%
\edef\!ttemp{%
@@ -1067,7 +1071,7 @@
% DEFINING NEW KEYS
% ****************************************************************
-% NEW FORMAT KEY <Key Letter>: Must be followed by
+% NEW FORMAT KEY <Key Letter>: Must be followed by
% <Parameter Text> <Replacement Text>
% Sets up a new key letter command by expanding (essentially) to
% \expandafter \def \csname !tk<Key Letter>\endcsname
@@ -1081,13 +1085,13 @@
\fi
\!thx\ifx \!ttempb \relax
\!thx\!tkDefineKey
- \else
+ \else
\!thx\!tkRejectKey
\fi}
% REPORT NEW KEY
\def\!tkReportNewKey{%
- \!taToksA\!thx{\!ttempa}%
+ \!taToksA\!thx{\!ttempa}%
\!thMessage{NEW KEY: "\the\!taToksA"}}
% DEFINE KEY
@@ -1096,7 +1100,7 @@
% DUPLICATE KEY
\def\!tkRejectKey{%
- \!taToksA\!thx{\!ttempa}%
+ \!taToksA\!thx{\!ttempa}%
\!thError{Key letter "\the\!taToksA" already used}
{\!thReadErrorMsg\!tkFixIt}
\def\!tkGarbage}%
@@ -1117,7 +1121,7 @@
\ifnum \TracingKeys>1
\!tkReportKey
\fi
- \!thx\ifx \!ttempb\relax
+ \!thx\ifx \!ttempb\relax
\!thx\!tkReplaceKey
\else
\!thx\!ttempb
@@ -1125,7 +1129,7 @@
% REPORT KEY
\def\!tkReportKey{%
- \!taToksA\!thx{\!ttempa}%
+ \!taToksA\!thx{\!ttempa}%
\!thMessage{KEY: "\the\!taToksA"}}
% REPLACE KEY
@@ -1172,17 +1176,17 @@
\!taDataColumnTemplate=\!thx{\!thx{\the\!taDataColumnTemplate}}%
\ReadFormatKeys}
-% Key "*": "*{N}{KEY LETTERS}" is equivalent to specifying
+% Key "*": "*{N}{KEY LETTERS}" is equivalent to specifying
% <KEY LETTERS> N times.
% KEY LETTERS may contain further * specifications
\NewFormatKey *#1#2{%
\!taCountA=#1\relax
\!taToksA={}%
- \!thLoop
+ \!thLoop
\ifnum \!taCountA > 0
\!taToksA\!thx{\the\!taToksA #2}%
\advance\!taCountA -1
- \repeat
+ \repeat
\!thx\ReadFormatKeys\the\!taToksA}
@@ -1204,19 +1208,19 @@
% Key "c": Centered column.
\NewFormatKey c{%
- \ReadFormatKeys
+ \ReadFormatKeys
\LeftGlue\hfil
\RightGlue\hfil}
% Key "l": Left-adjusted column.
\NewFormatKey l{%
- \ReadFormatKeys
+ \ReadFormatKeys
\LeftGlue{} % In case more than one positioning key is specified.
\RightGlue\hfil}
% Key "r": Right-adjusted column.
\NewFormatKey r{%
- \ReadFormatKeys
+ \ReadFormatKeys
\LeftGlue\hfil
\RightGlue{}}
@@ -1235,19 +1239,19 @@
\h@true
\v@false
\!tgGetValue{\!tgInsertKern}}
-
+
% Key "j": Adds a kern to the right of "#"
\NewFormatKey j{%
\h@false
\v@true
\!tgGetValue{\!tgInsertKern}}
-
+
% ****************************************************************
% NUMERIC ITEM KEYS
% ****************************************************************
-% Key "n": numeric item , non-math mode.
+% Key "n": numeric item , non-math mode.
\NewFormatKey n{%
\def\!tnStyle{}%
\futurelet\!tnext\!tnTestForBracket}
@@ -1330,7 +1334,7 @@
% Key "o": Apply the \tabskip stated for this column ONLY to the
% inter-column space just to the right of this column; restore the
-% the previous \tabskip for subsequent columns.
+% the previous \tabskip for subsequent columns.
\NewFormatKey o{%
\!taOnceOnlyTabskiptrue
\!tkTestForBeginFormat o{\!tgGetValue{\!tfSetTabskip}}}
@@ -1355,11 +1359,11 @@
% Key ".": PERIOD -- end of \BeginFormat section.
\NewFormatKey .{%
- \!tkTestForBeginFormat.{\!tfFinishFormat}}
+ \!tkTestForBeginFormat.{\!tfFinishFormat}}
% Key "\EndFormat": Equivalent to "."
\NewFormatKey \EndFormat{%
- \!tkTestForBeginFormat\EndFormat{\!tfFinishFormat}}
+ \!tkTestForBeginFormat\EndFormat{\!tfFinishFormat}}
% Key "]": End of \ReFormat section
\NewFormatKey ]{%
@@ -1373,38 +1377,38 @@
% TEST FOR BEGIN FORMAT{<Key>}{Intended Action}: This test is run
% on keys that can only be used by \BeginFormat --- "s", "o",
% "|", "\|", "w", ".", and "\EndFormat".
-\def\!tkTestForBeginFormat#1#2{%
- \if!taBeginFormat
+\def\!tkTestForBeginFormat#1#2{%
+ \if!taBeginFormat
\def\!ttemp{#2}%
- \!thx \!ttemp
+ \!thx \!ttemp
\else
- \toks0={#1}%
+ \toks0={#1}%
\toks2=\!thx{\string\ReFormat}%
\!thx \!tkImproperUse
- \fi}
+ \fi}
% TEST FOR RE FORMAT{<Key>}{Intended Action}: This test is run
% on the key "]", which can only be used by \ReFormat.
-\def\!tkTestForReFormat#1#2{%
- \if!taBeginFormat
- \toks0={#1}%
+\def\!tkTestForReFormat#1#2{%
+ \if!taBeginFormat
+ \toks0={#1}%
\toks2=\!thx{\string\BeginFormat}%
\!thx \!tkImproperUse
\else
\def\!ttemp{#2}%
- \!thx \!ttemp
- \fi}
+ \!thx \!ttemp
+ \fi}
% IMPROPER USE OF KEY
-\def\!tkImproperUse{%
+\def\!tkImproperUse{%
\!thError{\!thReadErrorMsg\!tkBadUseA "\the\toks0 "}%
{\!thReadErrorMsg\!tkBadUseB \the\toks2 \space command.
^^J\!thReadErrorMsg\!tkBadKey}%
\!tkReplaceKeyA}
-
-% ERROR MESSAGES FOR IMPROPER USE OF KEY
-\!thStoreErrorMsg\!tkBadUseA{Improper use of key }
-\!thStoreErrorMsg\!tkBadUseB{%
+
+% ERROR MESSAGES FOR IMPROPER USE OF KEY
+\!thStoreErrorMsg\!tkBadUseA{Improper use of key }
+\!thStoreErrorMsg\!tkBadUseB{%
The key mentioned above can't be used in a }
@@ -1413,7 +1417,7 @@
% SECTION n: NUMERIC
% *********************************************************************
-% NOTE: THE SPACE BETWEEN A NUMERIC ENTRY AND THE FOLLOWING '|', '"',
+% NOTE: THE SPACE BETWEEN A NUMERIC ENTRY AND THE FOLLOWING '|', '"',
% OR '\|' IS MANDATORY.
% EMPTY NUMERIC ENTRIES ARE NOT ALLOWED: USE '{}' OR '\omit' INSTEAD.
@@ -1434,7 +1438,7 @@
\def\!tnConvertCode #1.#2.#3!{%
\begingroup
\aftergroup\edef \aftergroup\!ttemp \aftergroup{%
- \aftergroup[%
+ \aftergroup[%
\!taCountA #1
\!thLoop
\ifnum \!taCountA>0
@@ -1446,16 +1450,16 @@
\else
\aftergroup.
\!taCountA #2
- \!thLoop
+ \!thLoop
\ifnum \!taCountA>0
\advance\!taCountA -1
\aftergroup0
\repeat
- \fi
+ \fi
\aftergroup]\aftergroup}%
\endgroup\relax
\!thx\!tnGetArgument\!ttemp}
-
+
% GET ARGUMENT: [<sample left field> <optional .<sample right field>>
\def\!tnGetArgument[#1]{%
\!tnMakeNumericTemplate\!tnStyle#1..!}
@@ -1554,7 +1558,7 @@
\setbox\z@=\hbox{#1}%
\fi
\!TsFinishEnlarge}
-
+
\def\!TsEnlargeMath#1#2{%
\setbox\z@=\hbox{$\m@th#1{#2}$}%
\!TsFinishEnlarge}
@@ -1605,14 +1609,14 @@
\def\!ttBeginTable{%
\ifx [\!tnext
\def\!tnext{\!ttBeginTableA}%
- \else
+ \else
\def\!tnext{\!ttBeginTableA[c]}%
\fi
\!tnext}
\def\!ttBeginTableA[#1]{%
\if #1u% % "unboxed" table
- \ifmmode
+ \ifmmode
\def\!ttEndTable{% % user had better be in display math mode
\relax}% % and have only one table at the outer level
\else % user had better be in vertical mode
@@ -1656,7 +1660,7 @@
\catcode`\"=\active
\catcode`\~=\active
\def |{\unskip\!ttRightGlue&&}% Use rule-column template
- \def\|{\unskip\!ttRightGlue&\omit\!ttAlternateVrule}%
+ \def\|{\unskip\!ttRightGlue&\omit\!ttAlternateVrule}%
% Override rule-column template
\def"{\unskip\!ttRightGlue&\omit&}% Omit rule-column template
\def~{\kern .5em}% ~ now has the width of a digit
@@ -1672,7 +1676,7 @@
\the\EveryTable}
\egroup
-\let\!ttRightGlue=\relax % This may be changed, in a group, by
+\let\!ttRightGlue=\relax % This may be changed, in a group, by
% \JustCenter, etc
% DO HALIGN: Invoked by END FORMAT (or the key ".")
@@ -1682,8 +1686,8 @@
\halign \the\!taTableSpread \bgroup
\span\the\!taPreamble
\ifx \!tfRowOfWidths \empty
- \else
- \!tfRowOfWidths \cr %
+ \else
+ \!tfRowOfWidths \cr %
\fi}
% END TABLE
@@ -1698,10 +1702,10 @@
% END OF ROW: When followed by
% 0, inserts no strut
-% +, inserts an AugmentedTableStrut (with <x-height> and <x-depth>
+% +, inserts an AugmentedTableStrut (with <x-height> and <x-depth>
% as arguments
% anything else, inserts a StandardTableStrut,
-% and finished off the row with a \cr.
+% and finished off the row with a \cr.
\def\!ttEndOfRow{%
\futurelet\!tnext\!ttTestForBlank}
@@ -1713,7 +1717,7 @@
\else
\!thx\!ttTestForZero
\fi}
-
+
% TEST FOR ZERO
\def\!ttTestForZero{%
\ifx 0\!tnext
@@ -1732,16 +1736,16 @@
% DO ZERO: No strut
\def\!ttDoZero#1{% #1 eats the 0
- \cr}
+ \cr}
% DO PLUS: Insert "Extra" strut; #2=extra height, #3=extra depth, both
% as integers (units of \StrutUnit)
\def\!ttDoPlus#1#2#3{% #1 eats the +
\AugmentedTableStrut{#2}{#3}%
- \cr}
+ \cr}
% DO STANDARD: Insert standard table strut
-\def\!ttDoStandard{%
+\def\!ttDoStandard{%
\StandardTableStrut
\cr}
@@ -1751,7 +1755,7 @@
% *********************************************************************
% A '\|' can appear in a rule-column in place of a '|', '"', or '&'.
-
+
% If '\|' is immediately followed by a blank, a string of digits, or
% (...) [... had better be a <dimen>], a \vrule is placed in the
% rule column; the thickness of the \vrule follows TABLE's usual
@@ -1759,14 +1763,14 @@
% If '\|' is immediately followed by a '*', a user-specified default
% "pseudo"-rule is placed in the rule column. This P.R. is specified
-% by the parameterless macro \PseudoVrule. For example,
+% by the parameterless macro \PseudoVrule. For example,
% to place a "double rule" into a rule column, you could make the definition
% \def\PseudoVrule{\hfil\vrule \hskip1pt \vrule\hfil}
% If none of the above cases applies, a non-space token follows '\|':
% that token is placed in the rule-column. To put a '*' in a
% rule-column, enter '\|{*}'. '\|\PseudoVrule' has the same effect
-% as '\|*'.
+% as '\|*'.
% ALTERNATE VRULE
\def\!ttAlternateVrule{%
@@ -1793,7 +1797,7 @@
\ifx \!ttemp\!thSpaceToken % blank after "\|"
\!thx\!ttInsertVrule
\else
- \!thx\!ttAVTestForStar
+ \!thx\!ttAVTestForStar
\fi}
% TEST FOR STAR
@@ -1806,10 +1810,10 @@
% INSERT VRULE
\def\!ttInsertVrule{%
- \hfil
+ \hfil
\vrule \!thWidth
\ifnum \!tgCode=1
- \ifx \!tgValue\empty
+ \ifx \!tgValue\empty
\LineThicknessFactor
\else
\!tgValue
@@ -1839,19 +1843,19 @@
% USE: Version of \multispan for rule-&-column tables
% *********************************************************************
-% USE
-% \use <number> spans the next <number> data columns.
+% USE
+% \use <number> spans the next <number> data columns.
\def\!ttuse#1{%
- \ifnum #1>\@ne
- \omit
+ \ifnum #1>\@ne
+ \omit
\mscount=#1 % \mscount is in Plain
\advance\mscount by \m@ne
\advance\mscount by \mscount
- \!thLoop
- \ifnum\mscount>\@ne
+ \!thLoop
+ \ifnum\mscount>\@ne
\sp@n % from Plain (\span\omit \advance\mscount\m@ne)
- \repeat
- \span
+ \repeat
+ \span
\fi}
\def\!ttUse#1[{%
@@ -1863,7 +1867,7 @@
% HRULES
% *********************************************************************
-% FULL HORIZONTAL RULE: Draws a rule across the table,
+% FULL HORIZONTAL RULE: Draws a rule across the table,
% using \noalign{\hrule}
\def\!ttFullHrule{%
\noalign
@@ -1888,9 +1892,9 @@
\!ttGetHalfRuleThickness % Sets \dimen0 to half of specified thickness
\leaders \hrule \!thHeight \dimen0 \!thDepth \dimen0 \hfill
\null % prevents an \unskip from annihilating the \leaders
- \ignorespaces}
+ \ignorespaces}
-% LONG HORIZONTAL RULE: This rule requires special coding.
+% LONG HORIZONTAL RULE: This rule requires special coding.
% It must be preceded and followed by '&', instead of the usual
% '|' or '"'. However, '\_' can follow '\use' in the usual manner.
% And in fact, to insert long-rules in two or more contiguous columns,
diff --git a/Master/texmf-dist/tex/context/base/type-buy.tex b/Master/texmf-dist/tex/context/base/type-buy.tex
index 5f10bb95ee6..7598371f6c3 100644
--- a/Master/texmf-dist/tex/context/base/type-buy.tex
+++ b/Master/texmf-dist/tex/context/base/type-buy.tex
@@ -66,6 +66,7 @@
\definefontsynonym [SerifBoldItalic] [LucidaBright-DemiItalic]
\definefontsynonym [SerifBoldSlanted] [LucidaBright-DemiItalic]
\definefontsynonym [SerifCaps] [LucidaBrightSmallcaps]
+ \definefontsynonym [SerifBoldCaps] [LucidaBrightSmallcaps-Demi]
\stoptypescript
\starttypescript [sans] [lucida] [name]
diff --git a/Master/texmf-dist/tex/context/base/type-enc.tex b/Master/texmf-dist/tex/context/base/type-enc.tex
index 435affba740..4209e0bb656 100644
--- a/Master/texmf-dist/tex/context/base/type-enc.tex
+++ b/Master/texmf-dist/tex/context/base/type-enc.tex
@@ -560,38 +560,38 @@
% \usetypescript[modern-base][t2a]
% \setupbodyfont[modern,10pt]
-% \starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
-% \definefontsynonym [ComputerModern] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-Italic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-Slanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-Bold] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-BoldItalic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-BoldSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-Caps] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModern-CapsSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \stoptypescript
+\starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
+ \definefontsynonym [ComputerModern] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-Italic] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-Slanted] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-Bold] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-BoldItalic] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-BoldSlanted] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-Caps] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModern-CapsSlanted] [\typescriptprefix{c:\typescriptthree}sc1000] [encoding=\typescriptthree]
+\stoptypescript
-% \starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
-% \definefontsynonym [ComputerModernSans] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-Italic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-Slanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-Bold] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-BoldItalic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-BoldSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-Caps] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernSans-CapsSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \stoptypescript
+\starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2]
+ \definefontsynonym [ComputerModernSans] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernSans-Italic] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModernSans-Slanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModernSans-Bold] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernSans-BoldItalic] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModernSans-BoldSlanted] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernSans-Caps] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernSans-CapsSlanted] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+\stoptypescript
-% \starttypescript [modo] [computer-modern] [t2a,t2b,t2c,x2]
-% \definefontsynonym [ComputerModernMono] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-Italic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-Slanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-Bold] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-BoldItalic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-BoldSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-Caps] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \definefontsynonym [ComputerModernMono-CapsSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
-% \stoptypescript
+\starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2]
+ \definefontsynonym [ComputerModernMono] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModernMono-Italic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModernMono-Slanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernMono-Bold] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernMono-BoldItalic] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernMono-BoldSlanted] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+ \definefontsynonym [ComputerModernMono-Caps] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree]
+ %definefontsynonym [ComputerModernMono-CapsSlanted] [\typescriptprefix{c:\typescriptthree}1000] [encoding=\typescriptthree]
+\stoptypescript
% Computer Concrete (AMS)
diff --git a/Master/texmf-dist/tex/context/base/type-gyr.tex b/Master/texmf-dist/tex/context/base/type-gyr.tex
index b5063201d1f..07b9b311127 100644
--- a/Master/texmf-dist/tex/context/base/type-gyr.tex
+++ b/Master/texmf-dist/tex/context/base/type-gyr.tex
@@ -11,8 +11,78 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% \usetypescriptfile[type-gyr]
+% \definetypeface[pagella][rm][serif][pagella][default][encoding=t5]
+% \setupbodyfont[pagella]
+% \starttext
+% \startlines
+% hello world 123
+% {hello \Var[sc] world 123}
+% {\it hello \Var[sc]world \Var[reset] 123}
+% {\bf hello \Var[osf] {\Var[reset] world} 123}
+% {\bi hello world \Var[osf]123}
+% {\sc hello \Var[sc] world \Var[reset] 123}
+% \stoplines
+% \showfont[SerifItalicCaps]
+% \stoptext
+
\starttypescriptcollection[gyre]
+%D First we define the new ones. Watch how we use the systematic name composition.
+
+\definetypescriptprefix [n:pagella] [TeXGyrePagella]
+\definetypescriptprefix [n:termes] [TeXGyreTermes]
+\definetypescriptprefix [n:bonum] [TeXGyreBonum]
+
+\definetypescriptprefix [f:pagella] [pl]
+\definetypescriptprefix [f:termes] [tm]
+\definetypescriptprefix [f:bonum] [bk]
+
+\starttypescript [serif] [pagella,termes,bonum] [texnansi,ec,8r,t5,qx]
+ \loadmapfile[\typescriptthree-q\typescriptprefix{f:\typescripttwo}.map]
+
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r-sc] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri-sc] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b-sc] [encoding=\typescriptthree]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi-sc] [encoding=\typescriptthree]
+
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Slanted] [\typescriptprefix{n:\typescripttwo}-Italic]
+ \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldSlanted] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
+\stoptypescript
+
+\starttypescript [serif] [pagella,termes,bonum] [name]
+ \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular]
+ \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
+ \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold]
+ \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
+ \definefontsynonym [SerifCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
+ \definefontsynonym [SerifSlanted] [\typescriptprefix{n:\typescripttwo}-Slanted]
+ \definefontsynonym [SerifBoldSlanted] [\typescriptprefix{n:\typescripttwo}-BoldSlanted]
+
+ \definefontvariant [Serif][osf][Caps]
+ \definefontvariant [Serif][sc] [Caps]
+
+ \definefontsynonym [SerifRegular] [\typescriptprefix{n:\typescripttwo}-Regular]
+ \definefontsynonym [SerifRegularCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
+ \definefontsynonym [SerifItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
+ \definefontsynonym [SerifBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
+ \definefontsynonym [SerifBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
+ \definefontsynonym [SerifCapsCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
+ \definefontsynonym [SerifSlantedCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
+ \definefontsynonym [SerifBoldSlantedCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
+
+\stoptypescript
+
+\starttypescript [map] [pagella,termes,bonum] [ec,texnansi,t5,8r]
+ \loadmapfile[\typescriptthree-q\typescriptprefix{f:\typescripttwo}.map]
+\stoptypescript
+
+%D Here we overload the older (URW) fonts.
+
% TeXGyrePagella
%
% qplr TeXGyrePagella-Regular
@@ -23,14 +93,54 @@
\starttypescript [serif] [palatino] [texnansi,ec,8r,t5,qx]
\loadmapfile[\typescriptthree-qpl.map]
- \definefontsynonym [Palatino] [\typescriptthree-qplr] [encoding=\typescriptthree]
- \definefontsynonym [Palatino-Italic] [\typescriptthree-qplri] [encoding=\typescriptthree]
- \definefontsynonym [Palatino-Bold] [\typescriptthree-qplb] [encoding=\typescriptthree]
- \definefontsynonym [Palatino-BoldItalic] [\typescriptthree-qplbi] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino] [\typescriptthree-qplr] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-Italic] [\typescriptthree-qplri] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-Bold] [\typescriptthree-qplb] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-BoldItalic] [\typescriptthree-qplbi] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-Caps] [\typescriptthree-qplr-sc] [encoding=\typescriptthree]
\definefontsynonym [Palatino-Slanted] [Palatino-Italic]
\definefontsynonym [Palatino-BoldSlanted] [Palatino-BoldItalic]
- \definefontsynonym [Palatino-Caps] [Palatino]
+\stoptypescript
+
+% TeXGyreTermes
+%
+% qtmr TeXGyreTermes-Regular
+% qtmri TeXGyreTermes-Italic
+% qtmb TeXGyreTermes-Bold
+% qtmbi TeXGyreTermes-BoldItalic
+
+\starttypescript [serif] [times] [texnansi,ec,8r,t5,qx]
+ \loadmapfile[\typescriptthree-qtm.map]
+
+ \definefontsynonym [Times-Roman] [\typescriptthree-qtmr] [encoding=\typescriptthree]
+ \definefontsynonym [Times-Italic] [\typescriptthree-qtmri] [encoding=\typescriptthree]
+ \definefontsynonym [Times-Bold] [\typescriptthree-qtmb] [encoding=\typescriptthree]
+ \definefontsynonym [Times-BoldItalic] [\typescriptthree-qtmbi] [encoding=\typescriptthree]
+ \definefontsynonym [Times-Caps] [\typescriptthree-qtmr-sc] [encoding=\typescriptthree]
+
+ \definefontsynonym [Times-Slanted] [Times-Italic]
+ \definefontsynonym [Times-BoldSlanted] [Times-BoldItalic]
+\stoptypescript
+
+% TeXGyreBonum
+%
+% qtmr TeXGyreBonum-Regular
+% qtmri TeXGyreBonum-Italic
+% qtmb TeXGyreBonum-Bold
+% qtmbi TeXGyreBonum-BoldItalic
+
+\starttypescript [serif] [bookman] [texnansi,ec,8r,t5,qx]
+ \loadmapfile[\typescriptthree-qbk.map]
+
+ \definefontsynonym [Bookman-Light] [\typescriptthree-qbkr] [encoding=\typescriptthree]
+ \definefontsynonym [Bookman-LightItalic] [\typescriptthree-qbkri] [encoding=\typescriptthree]
+ \definefontsynonym [Bookman-DemiBold] [\typescriptthree-qbkb] [encoding=\typescriptthree]
+ \definefontsynonym [Bookman-DemiBoldItalic] [\typescriptthree-qbkbi] [encoding=\typescriptthree]
+ \definefontsynonym [Bookman-Light-Caps] [\typescriptthree-qbkr-sc] [encoding=\typescriptthree]
+
+ \definefontsynonym [Bookman-LightSlanted] [Bookman-LightItalic]
+ \definefontsynonym [Bookman-DemiBoldSlanted] [Bookman-DemiBoldItalic]
\stoptypescript
\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/type-ini.tex b/Master/texmf-dist/tex/context/base/type-ini.tex
index 16de327411e..3244cc430f9 100644
--- a/Master/texmf-dist/tex/context/base/type-ini.tex
+++ b/Master/texmf-dist/tex/context/base/type-ini.tex
@@ -70,11 +70,6 @@
\let\typescriptfiles\empty
-% \unexpanded\def\usetypescriptfile[#1]%
-% {\doifelse{#1}\v!reset
-% {\let\typescriptfiles\empty}
-% {\addtocommalist{#1}\typescriptfiles}}
-
\unexpanded\def\usetypescriptfile[#1]%
{\doifelse{#1}\v!reset
{\let\typescriptfiles\empty}
diff --git a/Master/texmf-dist/tex/context/base/type-map.tex b/Master/texmf-dist/tex/context/base/type-map.tex
index d6d8e2fcbef..968e42511b8 100644
--- a/Master/texmf-dist/tex/context/base/type-map.tex
+++ b/Master/texmf-dist/tex/context/base/type-map.tex
@@ -65,11 +65,11 @@
\starttypescript [map] [modern,modern-vari,modern-cond,computer-modern,latin-modern,latin-modern-vari,latin-modern-cond,] [ec,texnansi,qx,t5]
% this was what we had at the start and what fits best into our naming scheme
% well, all those changes in lm gave too many user problem reports so i revert to:
- \loadmapfile[\typescriptthree-public-lm.map]
+ % \loadmapfile[\typescriptthree-public-lm.map]
% this one also fits into the naming scheme but has been dropped by the distributers
% \loadmapfile[\typescriptthree-lm.map]
% this is what the latest distributions provide
- % \loadmapfile[lm-\typescriptthree.map] % maybe some day
+ \loadmapfile[lm-\typescriptthree.map] % maybe some day
\stoptypescript
% \usetypescript [map] [latin-modern-os] [ec] % lm is loaded under ec regime
diff --git a/Master/texmf-dist/tex/context/base/type-run.tex b/Master/texmf-dist/tex/context/base/type-run.tex
index 5070c791e4c..1b64c102ec6 100644
--- a/Master/texmf-dist/tex/context/base/type-run.tex
+++ b/Master/texmf-dist/tex/context/base/type-run.tex
@@ -35,18 +35,17 @@
\dochecktypescript{##2}\typescripttwo \ifdone
\dochecktypescript{##3}\typescriptthree\ifdone
\def\next%
- {\def\stoptypescript%
- {\egroup\type{\stoptypescript}}
+ {\def\stoptypescript{\egroup\type{\stoptypescript}}
% what follows now is quite ugly
\skipfirstverbatimlinefalse
- \processdisplayverbatim{\stoptypescript}%
\type{\starttypescript}
\doifsomething{##1}{\type{[##1]}}
\doifsomething{##2}{\type{[##2]}}
- \doifsomething{##3}{\type{[##3]}}}
+ \doifsomething{##3}{\type{[##3]}}
+ \processdisplayverbatim{\stoptypescript}}%
\fi\fi\fi
\next}
- \processcommacommand[\typescriptfiles]\dodousetypescript
+ \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript
\egroup}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/unic-004.tex b/Master/texmf-dist/tex/context/base/unic-004.tex
index 4ab7d5fb5ab..7404bbedec8 100644
--- a/Master/texmf-dist/tex/context/base/unic-004.tex
+++ b/Master/texmf-dist/tex/context/base/unic-004.tex
@@ -223,6 +223,7 @@
\cyrillicchekhakassian \or % 04CC Khakassian che
\cyrillicEMtail \or % 04CD EM with tail
\cyrillicemtail \or % 04CE em with tail
+ \unknownchar \or % 04CF Added to fix off-by-1 error
\cyrillicAbreve \or % 04D0 A with breve (\uchar1{2})
\cyrillicabreve \or % 04D1 a with breve (\uchar1{3})
\cyrillicAdiaeresis \or % 04D2 A with diaeresis (\uchar0{196})
diff --git a/Master/texmf-dist/tex/context/base/unic-005.tex b/Master/texmf-dist/tex/context/base/unic-005.tex
index 06abac6a62d..d15b74dbe44 100644
--- a/Master/texmf-dist/tex/context/base/unic-005.tex
+++ b/Master/texmf-dist/tex/context/base/unic-005.tex
@@ -15,7 +15,7 @@
\startunicodevector 5
\expandafter\strippedcsname
- \ifcase\numexpr#1-224\relax
+ \ifcase\numexpr#1-208\relax % Was 224 - changed to fix off-by-16 error
\hebrewAlef \or % 05D0
\hebrewBet \or
\hebrewGimel \or
diff --git a/Master/texmf-dist/tex/context/base/unic-ini.tex b/Master/texmf-dist/tex/context/base/unic-ini.tex
index 00651384f57..68632338ef8 100644
--- a/Master/texmf-dist/tex/context/base/unic-ini.tex
+++ b/Master/texmf-dist/tex/context/base/unic-ini.tex
@@ -353,6 +353,8 @@
%D problems; somehow \type {\numexpr} cannot look beyond this
%D sign, and expects a number.
+\ifx\tttf\undefined \let\tttf\relax \fi
+
\def\utfunichar #1{{\tttf U\low{\tx\unicodenumber{#1}}}}
\def\utfunisplit #1{{\tttf U\low{\tx\unicodepair{#1}}}}
\def\utfuniboth #1{{\tttf U\low{\tx\unicodenumber{#1}->\unicodepair{#1}}}}
diff --git a/Master/texmf-dist/tex/context/base/verb-ini.tex b/Master/texmf-dist/tex/context/base/verb-ini.tex
index 43b563a80cd..c76e0847f69 100644
--- a/Master/texmf-dist/tex/context/base/verb-ini.tex
+++ b/Master/texmf-dist/tex/context/base/verb-ini.tex
@@ -356,6 +356,18 @@
\def\doflushverbatimline
{\expandafter\dodoverbatimline\expandafter{\savedverbatimline}}
+\def\doverbatimbeginofline#1% linenumber (optional provided by mkiv / todo)
+ {\dontleavehmode
+ \strut
+ \the\everyline}
+
+\def\doverbatimendofline
+ {\par}
+
+\def\doverbatimemptyline
+ {\strut
+ \par}
+
\let\handleverbatimline=\relax
% \def\initializeverbatimline%
@@ -374,28 +386,6 @@
{\global\let\savedverbatimline\empty
\global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi}
-% \let\donextemptyverbatimline\relax
-
-% \def\presetemptyverbatimline
-% {\ifcase\verbatimstatus
-% \global\chardef\verbatimstatus\plusone
-% \or
-% \or
-% \donextemptyverbatimline
-% \or
-% \doflushverbatimline
-% \global\let\savedverbatimline\empty
-% \doemptyverbatimline
-% \global\chardef\verbatimstatus\plustwo
-% \else
-% \kern\zeropoint
-% \doverbatimnobreak
-% \doflushverbatimline
-% \global\let\savedverbatimline\empty
-% \doemptyverbatimline
-% \global\chardef\verbatimstatus\plustwo
-% \fi}
-
\chardef\verbatimemptylinemode\zerocount
\def\presetemptyverbatimline
@@ -444,15 +434,6 @@
\fi
\global\let\savedverbatimline\verbatimline}
-% \def\presetlastverbatimline
-% {\ifcase\verbatimstatus \or \or \or
-% \doflushverbatimline
-% \else
-% \kern\zeropoint
-% \doverbatimnobreak
-% \doflushverbatimline
-% \fi}
-
\def\presetlastverbatimline
{\ifcase \verbatimstatus
\or
@@ -558,202 +539,6 @@
\obeycharacters
\the\everysetupverbatim}
-%D \macros
-%D {eightbitcharacters,
-%D setcatcodes,uncatcodespecials,
-%D uncatcodecharacters,uncatcodespacetokens,
-%D setnaturalcatcodes}
-%D
-%D As its name says, \type{\uncatcodecharacters} resets the
-%D \CATCODE\ of characters. When we use an upper bound of
-%D 127 or 255, depending in \type{\ifeightbitcharacters}. By
-%D counting down, we only have to use one counter. The
-%D macro \type{\setcatcodes} can be uses to set alternative
-%D values. The macro \type{\resetspecialcharacters} resets
-%D characters with special meanings. This macro is not used
-%D in the verbatim macros, but is best defined in this module.
-
-\def\doprocesscatcodes#1% using a toks does not speed this up
- {\scratchcounter\ifeightbitcharacters 255\else 127\fi\relax
- \loop
- \savecatcode
- #1\relax
- \advance\scratchcounter \minusone
- \ifnum\scratchcounter>\minusone
- \repeat
- \let\savecatcode\relax
- \let\restorecatcodes\dorestorecatcodes}
-
-\def\uncatcodespecials
- {\doprocesscatcodes
- {\ifnum\catcode\scratchcounter=\@@letter\relax\else
- \catcode\scratchcounter=\@@other
- \fi}%
- \uncatcodespacetokens}
-
-\def\uncatcodespacetokens
- {\catcode`\ =\@@space
- \catcode`\^^L=\@@ignore
- \catcode`\^^M=\@@endofline
- \catcode`\^^?=\@@ignore}
-
-\def\setcatcodes#1%
- {\doprocesscatcodes{\catcode\scratchcounter=#1}}
-
-\def\uncatcodeallcharacters % slow one, with restore
- {\setcatcodes\@@letter}
-
-\def\uncatcodecharacters % quick one
- {\setnaturalcatcodes}
-
-\newtoks\everycommoncatcodes
-\newtoks\everynaturalcatcodes
-\newtoks\everynormalcatcodes
-
-\def\setcommoncatcodes
- {\catcode`\!\@@other \catcode`\?\@@other \catcode`\@\@@other
- \catcode`\=\@@other \catcode`\<\@@other \catcode`\>\@@other
- \catcode`\*\@@other \catcode`\/\@@other
- \catcode`\-\@@other \catcode`\+\@@other
- \catcode`\:\@@other \catcode`\;\@@other
- \catcode`\.\@@other \catcode`\,\@@other
- \catcode`\'\@@other \catcode`\"\@@other \catcode`\`\@@other
- \catcode`\(\@@other \catcode`\)\@@other
- \the\everycommoncatcodes}
-
-\def\setnaturalcatcodes % see elsewhere, merge 'm
- {\setcommoncatcodes
- \uncatcodespacetokens
- \catcode`\#\@@other
- \catcode`\$\@@other
- \catcode`\%\@@other
- \catcode`\&\@@other
- \catcode`\\\@@other
- \catcode`\^\@@other
- \catcode`\_\@@other
- \catcode`\{\@@other
- \catcode`\|\@@other
- \catcode`\}\@@other
- \catcode`\~\@@other
- \the\everynaturalcatcodes}
-
-\def\setnormalcatcodes
- {\setcommoncatcodes
- \uncatcodespacetokens
- \catcode`\#\@@parameter
- \catcode`\$\@@mathshift
- \catcode`\%\@@comment
- \catcode`\&\@@alignment
- \catcode`\\\@@escape
- \catcode`\^\@@superscript
- \catcode`\_\@@subscript
- \catcode`\{\@@begingroup
- \catcode`\|\@@active
- \catcode`\}\@@endgroup
- \catcode`\~\@@active
- \the\everynormalcatcodes}
-
-%D \macros
-%D {localcatcodes,
-%D restorecatcodes,
-%D beginrestorecatcodes,endrestorecatcodes}
-%D
-%D We're not finished dealing \CATCODES\ yet. In \CONTEXT\ we
-%D use only one auxiliary file, which deals with tables of
-%D contents, registers, two pass tracking, references etc. This
-%D file, as well as files concerning graphics, is processed when
-%D needed, which can be in the mid of typesetting verbatim.
-%D However, when reading in data in verbatim mode, we should
-%D temporary restore the normal \CATCODES, and that's exactly
-%D what the next macros do. Saving the catcodes can be
-%D disabled by saying \type{\localcatcodestrue}.
-
-%D The previous macros call for \type{\savecatcode}, which is
-%D implemented as:
-
-\def\@@aa@@{@@aa@@}
-\def\@@cc@@{@@cc@@}
-
-\newif\iflocalcatcodes
-
-\def\savecatcode
- {\iflocalcatcodes \else
- \saverestoreactivecatcode
- {\@EA\let\csname\@@aa@@\the\scratchcounter\endcsname~}%
- \@EA\chardef\csname\@@cc@@\the\scratchcounter\endcsname
- \catcode\scratchcounter
- \fi}
-
-%D It's counterpart is:
-
-\def\restorecatcode
- {\@EA\catcode\@EA\scratchcounter
- \csname\@@cc@@\the\scratchcounter\endcsname
- \saverestoreactivecatcode
- {\@EA\let\@EA~\csname\@@aa@@\the\scratchcounter\endcsname}}
-
-%D Especially when we enable pretty printing, we need to
-%D restore the meaning of active characters too. Just think of
-%D using \type{||} in headers and footers.
-
-\def\saverestoreactivecatcode#1%
- {\edef\saveduccode{\the\uccode`~}%
- \uccode`~=\scratchcounter
- \uppercase{#1}%
- \uccode`~=\saveduccode}
-
-%D When we want to restore \CATCODES\ we call for
-%D \type{\restorecatcodes}, which default to \type{\relax}
-
-\let\restorecatcodes=\relax
-
-%D or when we've saved things calls for:
-
-\def\dorestorecatcodes
- {\iflocalcatcodes \else
- \doprocesscatcodes\restorecatcode
- \fi}
-
-%D We also provide an alternative, that forces grouping
-%D when needed. An application of this macros can be found in
-%D buffering data.
-
-\def\beginrestorecatcodes
- {\ifx\restorecatcodes\relax
- \let\endrestorecatcodes\relax
- \else
- \bgroup
- \restorecatcodes
- \let\beginrestorecatcodes\bgroup
- \let\endrestorecatcodes \egroup
- \fi}
-
-%D \macros
-%D {makeallother}
-%D
-%D With \type {\makeallother} each character ($>0$) gets the
-%D category code 12.
-%D
-%D The next alternative was okay when memory was still low.
-%D
-%D \starttyping
-%D \def\makeallother
-%D {\dorecurse{255}{\catcode\recurselevel=\@@other}}
-%D \stoptyping
-%D
-%D Today we prebuild a token list:
-
-\ifx\makeallother\undefined
-
- \newtoks\makeallothertoks
-
- \dorecurse{255}
- {\@EA\appendtoks\@EA\catcode\recurselevel=\@@other\to\makeallothertoks}
-
- \def\makeallother{\the\makeallothertoks}
-
-\fi
-
%D The main copying routine of display verbatim does an
%D ordinary string||compare on the saved closing command and
%D the current line. The space after \type{#1} in the
@@ -799,22 +584,14 @@
\let\doopenupverbatimline=\empty
-% \long\def\dodoverbatimline#1%
-% {\leavevmode
-% \doopenupverbatimline
-% \the\everyline\strut\processverbatimline{#1\relax}%
-% \EveryPar{}%
-% \global\lineparfalse
-% \obeyedline\par}
-
\let\beginverbatimline\relax
\let\endverbatimline \relax
\long\def\dodoverbatimline#1% we don't want to group
{\bgroup % due to pretty status
\iflinepar\else\EveryPar{}\fi
- \leavevmode
- \xdef\dokeepverbatimlinedata
+ \dontleavehmode % \leavevmode
+ \xdef\dokeepverbatimlinedata % why was this?
{\parindent \the\parindent
\hangindent\the\hangindent
\hangafter \the\hangafter
@@ -909,20 +686,6 @@
\chardef\spacespertab=7
-%\def\doprocesstabskip%
-% {\obeyedspace % \hskip.5em or \hbox to .5em{}
-% \ifdone
-% \advance\scratchcounter 1
-% \let\next\doprocesstabskip
-% \donefalse
-% \else\ifnum\scratchcounter>\spacespertab
-% \let\next\relax
-% \else
-% \advance\scratchcounter 1
-% \let\next\doprocesstabskip
-% \fi\fi
-% \next}
-
\def\doprocesstabskip
{\obeyedspace % \hskip.5em or \hbox to .5em{}
\ifdone
@@ -938,27 +701,6 @@
\let\endoftabskipping=\relax % will become obsolete
-% \def\doprocesstabskipline#1%
-% {\bgroup
-% \scratchcounter1
-% \dodoprocesstabskipline#1\relax\endoftabskipping
-% \egroup}
-%
-% \def\dodoprocesstabskipline#1#2\endoftabskipping
-% {\ifnum\scratchcounter>\spacespertab
-% \scratchcounter\plusone
-% \donetrue
-% \else
-% \advance\scratchcounter \plusone
-% \donefalse
-% \fi
-% \ifx#1\relax
-% \let\next\relax
-% \else
-% \def\next{#1\dodoprocesstabskipline#2\endoftabskipping}%
-% \fi
-% \next}
-
\def\doprocesstabskipline#1%
{\bgroup
\scratchcounter\plusone
@@ -991,8 +733,6 @@
\chardef\tabskipmode=1 % 0=quit 1=no test 2=test on active>128
-%
-
\long\def\processverbatimline#1{#1} % remove the fake grouping
%D \macros
@@ -1512,22 +1252,6 @@
%D that ends the line and/or does not belong to the verbatim
%D data.
-% \def\handlenextnextpretty#1#2#3%
-% {\def\dohandlenextnextpretty%
-% {\ifx\next\bgroup % something {}
-% \let\next=#2%
-% \else\ifx\next\relax % end of line / signal
-% \let\next=#2%
-% %\else\ifx\next\egroup % end of line / no signal
-% % \let\next=#2%
-% %\else\ifx\next\par % end of line / \par
-% % \let\next=#2%
-% \else
-% \let\next=#1%
-% \fi\fi%\fi\fi
-% \next{#3}}%
-% \futurelet\next\dohandlenextnextpretty}
-
\def\handlenextnextpretty#1#2#3%
{\def\dohandlenextnextpretty%
{\ifx\next\bgroup % something {}
@@ -1983,31 +1707,6 @@
\def\permitshiftedendofverbatim
{\let\doifendofverbatim\doifinstringelse}
-% \def\processdisplayverbatim#1%
-% {\par
-% \bgroup
-% \escapechar=-1
-% \xdef\verbatimname{\string#1}%
-% \egroup
-% \def\endofdisplayverbatim{\csname\verbatimname\endcsname}%
-% \bgroup
-% \parindent\zeropoint
-% \ifdim\lastskip<\parskip
-% \removelastskip
-% \vskip\parskip
-% \fi
-% \parskip\zeropoint
-% \processingverbatimtrue
-% \expandafter\let\csname\verbatimname\endcsname=\relax
-% \expandafter\convertargument\csname\verbatimname\endcsname
-% \to\endofverbatimcommand
-% \verbatimfont
-% \setverbatimspaceskip
-% \global\linepartrue % needed for paragraph numbering
-% \setupcopyverbatim
-% \initializeverbatimline
-% \copyverbatimline}
-
{\obeylines%
\long\gdef\copyverbatimline#1
{\convertargument#1 \to\next%
@@ -2026,58 +1725,6 @@
%D As a bonus, we provide the next alternative, which takes
%D end tags like \type {Hello World!}.
-% \def\processtaggeddisplayverbatim#1%
-% {\par
-% \let\endofdisplayverbatim\relax
-% \convertargument#1\to\endofverbatimcommand
-% \bgroup
-% \parindent\zeropoint
-% \ifdim\lastskip<\parskip
-% \removelastskip
-% \vskip\parskip
-% \fi
-% \parskip\zeropoint
-% \processingverbatimtrue
-% \verbatimfont
-% \setverbatimspaceskip
-% \global\linepartrue % needed for paragraph numbering
-% \setupcopyverbatim
-% \initializeverbatimline
-% \copyverbatimline}
-
-% \def\doprocessdisplayverbatim#1#2%
-% {\par
-% \bgroup
-% \escapechar-1
-% \xdef\verbatimname{\string#2}%
-% \egroup
-% \ifcase#1%
-% \let\endofdisplayverbatim\relax
-% \else
-% \def\endofdisplayverbatim{\csname\verbatimname\endcsname}%
-% \fi
-% \bgroup
-% \parindent\zeropoint
-% \ifdim\lastskip<\parskip
-% \removelastskip
-% \vskip\parskip
-% \fi
-% \parskip\zeropoint
-% \processingverbatimtrue
-% \ifcase#1%
-% \convertargument#2\to\endofverbatimcommand
-% \else
-% \expandafter\let\csname\verbatimname\endcsname=\relax
-% \expandafter\convertargument\csname\verbatimname\endcsname
-% \to\endofverbatimcommand
-% \fi
-% \verbatimfont
-% \setverbatimspaceskip
-% \global\linepartrue % needed for paragraph numbering
-% \setupcopyverbatim
-% \initializeverbatimline
-% \copyverbatimline}
-
\def\doprocessdisplayverbatim#1#2%
{\par
\beginofverbatimlines
@@ -2131,14 +1778,14 @@
\def\doinstallprettyescape[#1][#2]#3 #4%
{\bgroup
\doglobal\decrement\prettyescapecnt
- \def\docommando##1%
+ \def\docommand##1%
{\def\next{\dodoinstallprettyescape{##1}{#3}{#4}}%
\catcode`#3=\@@active
\@EA\scantokens\@EA{\next}}%
\iffirstargument
- \processcommalist[#1]\docommando
+ \processcommalist[#1]\docommand
\else
- \docommando\empty
+ \docommand\empty
\fi}
\def\dodoinstallprettyescape#1#2#3%
diff --git a/Master/texmf-dist/tex/context/base/verb-mp.tex b/Master/texmf-dist/tex/context/base/verb-mp.tex
index c7ab2071f64..318da96bf21 100644
--- a/Master/texmf-dist/tex/context/base/verb-mp.tex
+++ b/Master/texmf-dist/tex/context/base/verb-mp.tex
@@ -8,46 +8,48 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Support Macros / Pretty METAPOST Verbatim}
% bug: in mp-char.mp the char should not be highlighted
-%D This module was first used when I documented our new
-%D company logo. This interpreter is modeled after the \PERL\
-%D one.
+% can be simplified
+
+%D This module was first used when I documented our new
+%D company logo. This interpreter is modeled after the \PERL\
+%D one.
%D
%D \startMP
%D beginfig(1);
-%D z1 = (0,0);
-%D z2 = (100,0);
+%D z1 = (0,0);
+%D z2 = (100,0);
%D z3 = (0,100);
%D draw z1--z2--z3--cycle;
%D endfig;
-%D \stopMP
+%D \stopMP
%D
-%D Of course we cannot (yet) provide a nice layout, so some
-%D formatting is still needed.
+%D Of course we cannot (yet) provide a nice layout, so some
+%D formatting is still needed.
\unprotect
%D \macros
%D {prettyMPvariables}
-%D
-%D Identifiers and system variables are typeset in a different
-%D style. One can turn of this mechanism for the variables by
-%D setting th enext boolean.
-%D
+%D
+%D Identifiers and system variables are typeset in a different
+%D style. One can turn of this mechanism for the variables by
+%D setting th enext boolean.
+%D
-\doglobal\newif\ifprettyMPvariables
+\doglobal\newif\ifprettyMPvariables
\global\prettyMPvariablestrue
-%D We support \METAFONT\ as well as \METAPOST.
+%D We support \METAFONT\ as well as \METAPOST.
-\gdef\MPsetcontrols%
+\gdef\MPsetcontrols
{\saveprettycontrols
\everyprettyend
{\endMPtypesix}%
@@ -58,8 +60,9 @@
{\endMPtypesix}%
\let\obeytabs=\ignoretabs}
-\gdef\setupprettyMPtype%
+\gdef\setupprettyMPtype
{\def\prettyidentifier{MP}%
+ \global\inMPtexmodefalse
\MPsetvariables
\MPsetcontrols
\MPsethandlers
@@ -67,11 +70,11 @@
\doglobal\newif\ifinMPtexmode
-\gdef\MPsetvariables%
+\gdef\MPsetvariables
{\global\inMPtexmodefalse
\global\let\MPsequence=\empty}
-\gdef\MPsetspecials%
+\gdef\MPsetspecials
{\setpretty`\;=11 \setpretty`\$=12 \setpretty`\@=12 \setpretty`\#=12
\setpretty`\%=20
\setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32
@@ -100,7 +103,7 @@
\setpretty`\'=81 \setpretty`\"=82
\setpretty`\{=90 \setpretty`\}=90 }
-\gdef\MPsethandlers%
+\gdef\MPsethandlers
{\installprettyhandler 11 \MPtypeone
\installprettyhandler 12 \MPtypeone
\installprettyhandler 20 \MPtypetwo
@@ -135,7 +138,7 @@
\fi
\next}
-\gdef\MPtypetwo%
+\gdef\MPtypetwo
{\endMPtypesix
\ifnewpretty\expandafter\handlenewpretty\fi\doMPtypetwo}
@@ -171,7 +174,7 @@
\beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
\fi}
-\gdef\endMPtypesix%
+\gdef\endMPtypesix
{\ifx\MPsequence\empty\else
\doifprettyidentifierelse{\MPsequence}{\MPidentifiers}
{\doifprettyidentifierelse{\MPsequence}{\MPbtex}
@@ -184,12 +187,12 @@
{\global\inMPtexmodefalse}{}%
\fi
\beginofpretty[\!!prettytwo]%
- {\prettyidentifierfont\MPsequence}%
+ {\prettyidentifierfont\MPsequence}%
\endofpretty}}
{\ifprettyMPvariables
\doifprettyidentifierelse{\MPsequence}{\MPvariables}
{\beginofpretty[\!!prettytwo]%
- {\prettyvariablefont\MPsequence}%
+ {\prettyvariablefont\MPsequence}%
\endofpretty}
{\MPsequence}%
\else
@@ -198,7 +201,7 @@
\global\let\MPsequence=\empty
\fi}
-\gdef\MPtypesixone%
+\gdef\MPtypesixone
{\endMPtypesix
\getpretty}
@@ -215,7 +218,7 @@
\gdef\MPtypeeightone#1%
{\endMPtypesix
- \ifinMPtexmode%
+ \ifinMPtexmode
\getpretty{#1}%
\else
\beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
@@ -248,114 +251,114 @@
\useprettyidentifiers \MPidentifiers \MPsetspecials
btex etex verbatimtex
-%D \METAPOST\ internal variables \& predefined variables:
+%D \METAPOST\ internal variables \& predefined variables:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- charcode day linecap linejoin miterlimit month pausing
- prologues showstopping time tracingcapsules tracingchoices
- tracingcommands tracingequations tracinglostchars
- tracingmacros tracingonline tracingoutput tracingrestores
- tracingspecs tracingstats tracingtitles truecorners
- warningcheck year
+ charcode day linecap linejoin miterlimit month pausing
+ prologues showstopping time tracingcapsules tracingchoices mpprocset
+ tracingcommands tracingequations tracinglostchars
+ tracingmacros tracingonline tracingoutput tracingrestores
+ tracingspecs tracingstats tracingtitles truecorners
+ warningcheck year
\useprettyidentifiers \MPvariables \MPsetspecials
- ahangle ahlength bboxmargin defaultpen defaultscale
- labeloffset background currentpen currentpicture cuttings
- defaultfont extra_beginfig extra_endfig
+ ahangle ahlength bboxmargin defaultpen defaultscale
+ labeloffset background currentpen currentpicture cuttings
+ defaultfont extra_beginfig extra_endfig
%D \METAPOST\ predefined constants:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- false nullpicture pencircle true
+ false nullpicture pencircle true
\useprettyidentifiers \MPvariables \MPsetspecials
- beveled black blue bp butt cc cm dd ditto down epsilon
+ beveled black blue bp butt cc cm dd ditto down epsilon
evenly fullcircle green halfcircle identity in infinity left
- mitered mm origin pensquare pt quartercircle red right
- rounded squared unitsquare up white withdots
+ mitered mm origin pensquare pt quartercircle red right
+ rounded squared unitsquare up white withdots
-%D \METAPOST\ operators:
+%D \METAPOST\ operators:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- and angle arclength arctime ASCII bluepart boolean bot
+ and angle arclength arctime ASCII bluepart boolean bot
char color cosd cycle decimal directiontime floor fontsize
greenpart hex infont intersectiontimes known length llcorner
- lrcorner makepath makepen mexp mlog normaldeviate not
- numeric oct odd or path pair pen penoffset picture point
- postcontrol precontrol redpart reverse rotated scaled
- shifted sind slanted sqrt str string subpath substring
- transform transformed ulcorner uniformdeviate unknown
- urcorner xpart xscaled xxpart xypart ypart yscaled yxpart
- yypart zscaled
+ lrcorner makepath makepen mexp mlog normaldeviate not
+ numeric oct odd or path pair pen penoffset picture point
+ postcontrol precontrol redpart reverse rotated scaled
+ shifted sind slanted sqrt str string subpath substring
+ transform transformed ulcorner uniformdeviate unknown
+ urcorner xpart xscaled xxpart xypart ypart yscaled yxpart
+ yypart zscaled
\useprettyidentifiers \MPvariables \MPsetspecials
- abs bbox ceiling center cutafter cutbefore dir
+ abs bbox ceiling center cutafter cutbefore dir
directionpoint div dotprod intersectionpoint inverse mod lft
- round rt unitvector whatever
+ round rt unitvector whatever
%D \METAPOST\ commands:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- addto clip input interim let newinternal save setbounds
- shipout show showdependencies showtoken showvariable
- special
+ addto clip input interim let newinternal save setbounds
+ shipout show showdependencies showtoken showvariable
+ special
\useprettyidentifiers \MPvariables \MPsetspecials
- cutdraw draw drawarrow drawdblarrow fill filldraw
- loggingall pickup tracingall tracingnone undraw unfill
- unfilldraw drawdot
+ cutdraw draw drawarrow drawdblarrow fill filldraw
+ loggingall pickup tracingall tracingnone undraw unfill
+ unfilldraw drawdot
%D \METAPOST\ macro||like functions:
\useprettyidentifiers \MPvariables \MPsetspecials
buildcycle dashpattern decr dotlabel dotlabels drawoptions
- incr label labels max min thelabel z
+ incr label labels max min thelabel z
%D More \METAPOST:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- begingroup endgroup of curl tension and controls
- reflectedabout rotatedaround interpath on off beginfig
- endfig def vardef enddef epxr suffix text primary secondary
- tertiary primarydef secondarydef tertiarydef top bottom
- ulft urt llft lrt randomseed also contour doublepath
- withcolor withpen dashed if else elseif fi for endfor
+ begingroup endgroup of curl tension and controls
+ reflectedabout rotatedaround interpath on off beginfig
+ endfig def vardef enddef epxr suffix text primary secondary
+ tertiary primarydef secondarydef tertiarydef top bottom
+ ulft urt llft lrt randomseed also contour doublepath
+ withcolor withpen dashed if else elseif fi for endfor
forsuffixes forever downto upto step until end
%D \METAFONT\ stuff:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- charlist extensible fontdimen headerbyte kern ligtable
- boundarychar chardp charext charht charic charwd designsize
- fontmaking charexists
+ charlist extensible fontdimen headerbyte kern ligtable
+ boundarychar chardp charext charht charic charwd designsize
+ fontmaking charexists
\useprettyidentifiers \MPvariables \MPsetspecials
- beginchar blacker capsule_end change_width
- define_blacker_pixels define_corrected_pixels
- define_good_x_pixels define_good_y_pixels
- define_horizontal_corrected_pixels define_pixels
- define_whole_blacker_pixels define_whole_pixels
- define_whole_vertical_blacker_pixels
- define_whole_vertical_pixels endchar extra_beginchar
- extra_endchar extra_setup font_coding_scheme
- font_extra_space
+ beginchar blacker capsule_end change_width
+ define_blacker_pixels define_corrected_pixels
+ define_good_x_pixels define_good_y_pixels
+ define_horizontal_corrected_pixels define_pixels
+ define_whole_blacker_pixels define_whole_pixels
+ define_whole_vertical_blacker_pixels
+ define_whole_vertical_pixels endchar extra_beginchar
+ extra_endchar extra_setup font_coding_scheme
+ font_extra_space
%D \METAFONT\ no||op stuff:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- cullit currenttransform gfcorners grayfont hround
- imagerules lowres_fix nodisplays notransforms openit
- displaying currentwindow screen_rows screen_cols
- pixels_per_inch cull display openwindow numspecial
- totalweight autorounding fillin proofing tracingpens
- xoffset chardx granularity smoothing turningcheck yoffset
+ cullit currenttransform gfcorners grayfont hround
+ imagerules lowres_fix nodisplays notransforms openit
+ displaying currentwindow screen_rows screen_cols
+ pixels_per_inch cull display openwindow numspecial
+ totalweight autorounding fillin proofing tracingpens
+ xoffset chardx granularity smoothing turningcheck yoffset
chardy hppp tracingedges vppp
%D \METAPOST\ goodies:
\useprettyidentifiers \MPidentifiers \MPsetspecials
- extra_beginfig extra_endfig mpxbreak
+ extra_beginfig extra_endfig mpxbreak
-\protect
+\protect
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/verb-sql.tex b/Master/texmf-dist/tex/context/base/verb-sql.tex
index 555ba304b3b..ddac5cd25e1 100644
--- a/Master/texmf-dist/tex/context/base/verb-sql.tex
+++ b/Master/texmf-dist/tex/context/base/verb-sql.tex
@@ -8,61 +8,61 @@
%D copyright={Berend de Boer \& Hans Hagen}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Support Macros / Pretty SQL Verbatim}
%D \quotation {He, I want pretty pretting too!}, Berend cried out
-%D one day, \quotation {But now for \SQL.}. This query language
-%D shows code like:
-%D
+%D one day, \quotation {But now for \SQL.}. This query language
+%D shows code like:
+%D
%D \startbuffer
%D \startSQL
-%D select * -- some comment
+%D select * -- some comment
%D from tableA
%D where 1 = 2
%D \stopSQL
-%D \stopbuffer
+%D \stopbuffer
%D
-%D \typebuffer
+%D \typebuffer
%D
%D and this should become something pretty like:
%D
%D \getbuffer
%D
-%D or, with Berend's preferences:
+%D or, with Berend's preferences:
%D
%D \startbuffer[setup]
%D \setuptyping
%D [SQL]
%D [text=yes,palet=,icommand=\bf,vcommand=,ccommand=\it]
-%D \stopbuffer
+%D \stopbuffer
%D
%D \getbuffer[setup]
%D \getbuffer
%D
-%D This kind of pretty printing is accomplished by:
+%D This kind of pretty printing is accomplished by:
%D
-%D \typebuffer
-
-%D Like we did with the \JAVASCRIPT\ driver, we will borrow
+%D \typebuffer
+
+%D Like we did with the \JAVASCRIPT\ driver, we will borrow
%D most of the macros from the \PERL\ driver.
\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi
\unprotect
-%D \SQL\ has the one line comment sequence \type{--} and the
-%D multi line comment delimiters \type{/*} and \type{*/}. The
+%D \SQL\ has the one line comment sequence \type{--} and the
+%D multi line comment delimiters \type{/*} and \type{*/}. The
%D next counter keeps track of multi line comment nesting.
\newcount\SQLcommentlevel
-%D We need to handle \type{%}, \type{#} and \type{-} a bit
-%D different than in the \PERL\ driver. Compared to the
-%D \JAVASCRIPT\ driver |<|we copied most of the code from
-%D that one|>|, we now also have type~45.
+%D We need to handle \type{%}, \type{#} and \type{-} a bit
+%D different than in the \PERL\ driver. Compared to the
+%D \JAVASCRIPT\ driver |<|we copied most of the code from
+%D that one|>|, we now also have type~45.
\gdef\SQLsetspecials%
{\PLsetspecials
@@ -73,7 +73,7 @@
\setpretty`\*=44
\setpretty`\-=45 }
-%D We need three additional handlers:
+%D We need three additional handlers:
\gdef\SQLsethandlers%
{\PLsethandlers
@@ -81,14 +81,14 @@
\installprettyhandler 44 \SQLtypefourfour
\installprettyhandler 45 \SQLtypefourfive }
-%D Next we have to do some general housekeeping.
+%D Next we have to do some general housekeeping.
\gdef\SQLsetcontrols%
{\PLsetcontrols
\def\flushrestofverbatimline%
{\endPLtypesix
- \ifcase\SQLcommentlevel
- \inPLcommentfalse
+ \ifcase\SQLcommentlevel
+ \inPLcommentfalse
\verbatimfont
\fi
\PLverbosefalse
@@ -108,8 +108,8 @@
\SQLsetspecials
\PLsetdiagnostics}
-%D We have to look upto four characters ahead. If you don't
-%D grab the picture, just skip reading these macros.
+%D We have to look upto four characters ahead. If you don't
+%D grab the picture, just skip reading these macros.
\gdef\SQLtypefourthree%
{\handlenextnextpretty\doSQLtypefourthree\PLtypefourtwo}
@@ -160,8 +160,8 @@
\ifnum\prettytype=43
\SQLtogglecomment{#1}#2%
\global\advance\SQLcommentlevel by -1
- \ifcase\SQLcommentlevel
- \global\inPLcommentfalse
+ \ifcase\SQLcommentlevel
+ \global\inPLcommentfalse
\prettyverbatimfont
\fi
\else
@@ -170,8 +170,8 @@
\expandafter#2%
\fi}
-%D Much of the indirect calls (\type {dodo..}) is due to
-%D looking ahead as well as midway pretty print changing.
+%D Much of the indirect calls (\type {dodo..}) is due to
+%D looking ahead as well as midway pretty print changing.
\gdef\SQLtypefourfive%
{\handlenextnextpretty\doSQLtypefourfive\PLtypefourtwo}
@@ -207,7 +207,7 @@
\expandafter\next
\fi}
-%D We need a different list of reserved words. This list
+%D We need a different list of reserved words. This list
%D replaces the \PERL\ one.
\useprettyidentifiers \SQLidentifiers \SQLsetspecials
@@ -222,9 +222,9 @@
references return revoce right rollback rule select set
sum table then to tran transaction trigger truncate
uncommited union unique update use values varying view
- when where while with work
+ when where while with work primary
\useprettyidentifiers \SQLvariables \SQLsetspecials
not-yet-defined
-\protect \endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/verb-tex.tex b/Master/texmf-dist/tex/context/base/verb-tex.tex
index 431703c2a42..29f4deea393 100644
--- a/Master/texmf-dist/tex/context/base/verb-tex.tex
+++ b/Master/texmf-dist/tex/context/base/verb-tex.tex
@@ -8,14 +8,14 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\writestatus{loading}{Context Support Macros / Pretty TEX Verbatim}
-%D The original module \type{supp-ver} had the \TEX\
-%D interpreter built in. The current implementation is more
-%D natural and less complicated.
+%D The original module \type{supp-ver} had the \TEX\
+%D interpreter built in. The current implementation is more
+%D natural and less complicated.
%D \startTEX
%D \definetyping[niceTEX][option=TEX,paletpalet=graypretty]
@@ -71,15 +71,18 @@
%D \FC prettyfour \MC blue \MC 0.8 \MC 0.8 \MC 0.6 \MC 0.75 \LC\LR
%D \HL
%D \stoptable
-%D
+%D
%D Outside \CONTEXT\ these colors are defined in
%D \type{verb-ini}, in \CONTEXT\ their definitions can be found
%D in \type{core-ver}, where in fact we use the color palet
%D mechanism. That way we can use different schemes i a quite
-%D natural way.
+%D natural way.
\gdef\setupprettyTEXtype
{\def\prettyidentifier{TEX}%
+ \global\inTEXcommandfalse
+ \global\firstinTEXcommandfalse
+ \global\inTEXparameterfalse
\TEXsetcontrols
\TEXsethandlers
\TEXsetspecials}
@@ -269,19 +272,14 @@
\getpretty}
%\gdef\TEXtypezero
-% {\disableprettyafterwards % only when enabled of course
+% {\disableprettyafterwards % only when enabled of course
% \ifnewpretty\expandafter\handlenewpretty\fi\TEXtypethree}
-\bgroup
-\catcode`\%=\@@other
-\xdef\texcommentsymbol{%}
-\egroup
-
-\beginETEX \scantokens
+\beginETEX \scantokens
\long\gdef\naturalTEXtext#1#2\relax% local alternative for \naturaltextext
{\convertargument#2\to\ascii
- \doifinstringelse{\texcommentsymbol}{\ascii}
+ \doifinstringelse{\letterpercent}{\ascii}
{\long\def\next{\TEXtypethree{#1}#2\relax}}
%{\long\def\next{\bgroup\prettynaturalfont\restorecatcodes\scantokens{\ignorespaces#2}\egroup}}%
{\long\def\next{\bgroup\prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#2}}\egroup}}%
@@ -293,8 +291,8 @@
{\ifnaturaltextext
\expandafter\naturalTEXtext
\else
- \disableprettyafterwards % only when enabled of course
+ \disableprettyafterwards % only when enabled of course
\expandafter\handlenewpretty\expandafter\TEXtypethree
\fi}
-\protect \endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-fig-00.tex b/Master/texmf-dist/tex/context/base/x-fig-00.tex
index 858d23bf382..cb4677fdc41 100644
--- a/Master/texmf-dist/tex/context/base/x-fig-00.tex
+++ b/Master/texmf-dist/tex/context/base/x-fig-00.tex
@@ -8,85 +8,85 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-% \readfile{x-res-04} \donothing \donothing \endinput
+% \readfile{x-res-04} \donothing \donothing \endinput
-% naast label, ook fig als ref en dan naar fig ref springen
+% naast label, ook fig als ref en dan naar fig ref springen
%D This module implements an interface to a figure database
-%D and file. The database is formatted in \XML\ conforming
-%D the following \DTD:
+%D and file. The database is formatted in \XML\ conforming
+%D the following \DTD:
%D
%D \typefile{x-fig-00.dtd}
%D
-%D A figure base coded this way looks like:
-%D
+%D A figure base coded this way looks like:
+%D
%D \starttyping
-%D <!-- texexec --pdf --use=fig-01 figtest.xml -->
-%D
-%D <figurelibrary language="nl">
-%D
+%D <!-- texexec --pdf --use=fig-01 figtest.xml -->
+%D
+%D <figurelibrary language="nl">
+%D
%D <description>
%D <organization>PRAGMA Advanced Document Engineering</organization>
%D <project>Manuals</project>
%D <product>Beginners Manual</product>
%D <comment>A bunch of figures.</comment>
%D </description>
-%D
+%D
%D <figure>
%D <file>koe.pdf</file>
%D <label>a dutch cow</label>
%D <copyright>Corel Draw Suite</copyright>
%D <comment>I bet that you've seen this cow before.</comment>
%D </figure>
-%D
+%D
%D <figure>
%D <dummy width="4cm" height="3cm">non existent</dummy>
%D <label>a european cow</label>
%D <copyright>Nobody</copyright>
%D <comment>When will we talk about European cows?</comment>
%D </figure>
-%D
-%D </figurelibrary>
-%D \stoptyping
-%D
-%D You can convert this base into a \PDF\ file using
-%D \TEXEXEC\ and another module in this suite.
-%D
-%D \starttyping
+%D
+%D </figurelibrary>
+%D \stoptyping
+%D
+%D You can convert this base into a \PDF\ file using
+%D \TEXEXEC\ and another module in this suite.
+%D
+%D \starttyping
%D texexec --pdf --use=fig-make yourfile.xml
-%D \stoptyping
-%D
-%D You can now select a graphic from this file using the
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D You can now select a graphic from this file using the
+%D
+%D \starttyping
%D \externalfigure[a dutch cow][width=4cm]
-%D \stoptyping
+%D \stoptyping
+%D
+%D This module overloads this command so that a figure is
+%D it first searched in the list of databases.
%D
-%D This module overloads this command so that a figure is
-%D it first searched in the list of databases.
-%D
-%D \starttyping
+%D \starttyping
%D \usemodule [fig-base]
%D \usefigurebases[yourfile]
-%D \stoptyping
-%D
-%D The special keyword \type {reset} can be used to reset
+%D \stoptyping
+%D
+%D The special keyword \type {reset} can be used to reset
%D this list.
\startcommands dutch english
german czech
italian romanian
- usefigurebase: gebruikfiguurbestand usefigurebase
- usefigurebase usefigurebase
- usefigurebase usefigurebase
+ usefigurebase: gebruikfiguurbestand usefigurebase
+ usefigurebase usefigurebase
+ usefigurebase usefigurebase
-\stopcommands
+\stopcommands
-\unprotect
+\unprotect
\consultutilityfilefalse
@@ -121,7 +121,7 @@
\traceXMLelementsfalse
\startXMLmapping[-][figbase]
\resetfigurefilebase
- \XMLerase{file}
+ \XMLerase{file}
\XMLerase{dummy}
\XMLerase{label}
\xdef\figurefilebase{#1}%
@@ -151,28 +151,69 @@
\globalletempty\figurefilebasepath
\globalletempty\figurefilepage}
-\let\normalcalculateexternalfigure\calculateexternalfigure
-
-\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- {\resetfigurefilebase
- \ifx\figurebaselist\empty
- \normalcalculateexternalfigure
- [#1][#2][#3][#4][#5][#6]%
- \else
- \def\docommando##1%
- {\getfigurefilename{##1}{#3}%
- \ifx\figurefilename\empty\else\quitcommalist\fi}%
- \processcommacommand[\figurebaselist]\docommando
- \ifx\figurefilename\empty
- \stripspaces\from#3\to\figurefilename % to be sure
- \normalcalculateexternalfigure
- [#1][#2][\figurefilename][#4][#5][#6]%
- \else
- \let\figurepathlist\figurefilebasepath
- \normalcalculateexternalfigure
- [#1][#2][\figurefilebase.pdf][\c!page=\figurefilepage,#4][#5][#6]%
- \fi
- \fi}
+\ifx\doanalyzefiguredimensionsfromfile\undefined
+
+ % will become obsolete once the new core-fig is used
+
+ \let\normalcalculateexternalfigure\calculateexternalfigure
+
+ \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+ {\resetfigurefilebase
+ \ifx\figurebaselist\empty
+ \normalcalculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+ \else
+ \def\docommand##1%
+ {\doshowfigurestate{base : check #3 in ##1}%
+ \getfigurefilename{##1}{#3}%
+ \ifx\figurefilename\empty\else\quitcommalist\fi}%
+ \processcommacommand[\figurebaselist]\docommand
+ \ifx\figurefilename\empty
+ \stripspaces\from#3\to\figurefilename % to be sure
+ \normalcalculateexternalfigure[#1][#2][\figurefilename][#4][#5][#6]%
+ \else
+ \doiffileelse{\figurefilebase.pdf}
+ {\let\figurepathlist\figurefilebasepath
+ \normalcalculateexternalfigure
+ [#1][#2][\figurefilebase.pdf]%
+ [\c!page=\figurefilepage,#4][#5][#6]}
+ {\@EA\stripspaces\@EA\from\figurefilename\to\figurefilename
+ \normalcalculateexternalfigure[#1][#2][\figurefilename][#4][#5][#6]}%
+ \fi
+ \fi}
+
+\else
+
+ % todo: use different internal names, \figurebasepage and such
+
+ \def\doanalyzefiguredimensionsfromfile
+ {\ifcase\figurestatus \ifx\figurebaselist\empty \else
+ \resetfigurefilebase
+ \doshowfigurestate{base list : \figurebaselist}%
+ \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile
+ \ifx\figurefilename\empty
+ \doshowfigurestate{base warning : no matching name found}%
+ \else
+ \doiffileelse{\figurefilebase.pdf}
+ {\doshowfigurestate{base file : \figurefilebase.pdf}%
+ \doshowfigurestate{base page : \figurefilepage}%
+ \let\figurepathlist\figurefilebasepath
+ \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel
+ \let\wantedfigurepage\figurefilepage}
+ {\doshowfigurestate{base missing : \figurefilebase.pdf}}
+ \fi
+ \ifcase\figurestatus
+ \analyzefigurefilename\expandedfigurename\wantedfigurelabel
+ \fi
+ \fi \fi}
+
+ \def\dodoanalyzefiguredimensionsfromfile#1%
+ {\doshowfigurestate{base check : \wantedfigurename\space in #1}%
+ \getfigurefilename{#1}\wantedfigurename
+ \ifx\figurefilename\empty\else
+ \quitcommalist
+ \fi}
+
+\fi
\def\usefigurebase[#1]%
{\doifelse{#1}\v!reset
@@ -183,7 +224,7 @@
\resetfigurefilebase
-\protect \endinput
+\protect \endinput
\usefigurebase[figtest]
diff --git a/Master/texmf-dist/tex/context/base/x-fig-01.tex b/Master/texmf-dist/tex/context/base/x-fig-01.tex
index e74cfc483de..c2f97fea901 100644
--- a/Master/texmf-dist/tex/context/base/x-fig-01.tex
+++ b/Master/texmf-dist/tex/context/base/x-fig-01.tex
@@ -228,8 +228,8 @@
[\XMLpop{file}]
[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}%
[GridPg]%
- \freezedimenmacro\naturalfigurewidth \let\FigWid\naturalfigurewidth
- \freezedimenmacro\naturalfigureheight\let\FigHei\naturalfigureheight
+ \let\FigWid\figurenaturalwidth
+ \let\FigHei\figurenaturalheight
\advance\hsize by -150pt
\hskip10pt
\advance\hsize by -10pt
diff --git a/Master/texmf-dist/tex/context/base/x-newmme.tex b/Master/texmf-dist/tex/context/base/x-newmme.tex
index 9763de11490..73e574bd587 100644
--- a/Master/texmf-dist/tex/context/base/x-newmme.tex
+++ b/Master/texmf-dist/tex/context/base/x-newmme.tex
@@ -345,16 +345,8 @@
\defineXMLentity [lparent] {\getXMLentity{lparenthesis}}
\defineXMLentity [rparent] {\getXMLentity{rparenthesis}}
-% \bgroup
-% \catcode`\{=12 \doglobal\convertargument{\to\mmllbrace
-% \catcode`\}=12 \doglobal\convertargument}\to\mmlrbrace
-% \egroup
-
-% \expanded{\defineXMLentity[\mmllbrace]}{\getXMLentity{lbrace}}
-% \expanded{\defineXMLentity[\mmlrbrace]}{\getXMLentity{rbrace}}
-
-\expanded{\defineXMLentity[\iftrue \string{\else}\fi]}{\getXMLentity{lbrace}}
-\expanded{\defineXMLentity[\iffalse{\else\string}\fi]}{\getXMLentity{rbrace}}
+\defineXMLentity [\letterleftbrace ] {\getXMLentity{lbrace}}
+\defineXMLentity [\letterrightbrace] {\getXMLentity{rbrace}}
\defineXMLentity [{[}] {\getXMLentity{lbracket}}
\defineXMLentity [{]}] {\getXMLentity{rbracket}}
diff --git a/Master/texmf-dist/tex/context/base/x-newmml.tex b/Master/texmf-dist/tex/context/base/x-newmml.tex
index 32b98525d53..690c9ca7043 100644
--- a/Master/texmf-dist/tex/context/base/x-newmml.tex
+++ b/Master/texmf-dist/tex/context/base/x-newmml.tex
@@ -638,6 +638,32 @@
\endgroup
\stopsetups
+\startsetups mmc:interval:fetch
+ \defineXMLnested [interval]
+ [closure=closed]
+ {\directsetup{mmc:interval:fetch:start}}
+ {\directsetup{mmc:interval:fetch:stop}}
+\stopsetups
+
+\startsetups mmc:interval:fetch:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:interval:fetch:stop
+ \stopsavingXMLelements
+ \globallet\MMCintervalfrom\empty
+ \globallet\MMCintervalto \empty
+ \ifcase\XMLstacklevel
+ \or
+ \xdef\MMCintervalfrom{\getXMLstackdata\plusone}
+ \or
+ \xdef\MMCintervalfrom{\getXMLstackdata\plusone}
+ \xdef\MMCintervalto {\getXMLstackdata\plustwo}
+ \fi
+ \endgroup
+\stopsetups
+
\setupMMLappearance[interval][\c!alternative=\v!a,\c!separator={,}]
\mapXMLvalue {mmc:int} {closed}
@@ -753,6 +779,24 @@
\endgroup
\stopsetups
+\startsetups mmc:lambda:simple
+ \defineXMLnested
+ [lambda]
+ {\directsetup{mmc:lambda:simple:start}}
+ {\directsetup{mmc:lambda:simple:stop}}
+\stopsetups
+
+\startsetups mmc:lambda:simple:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:lambda:simple:stop
+ \stopsavingXMLelements
+ \XMLfirstnamed{apply}
+ \endgroup
+\stopsetups
+
% compose
\defineXMLcommand [compose] {\directsetup{mmc:compose}}
@@ -1425,7 +1469,8 @@
\halign{$\scriptstyle\hss##\hss$\cr#1\crcr}}}
\def\MMLcSUMandPRODUCT#1#2%
- {\XMLdoifonstackelse{condition,bvar,lowlimit}
+ {\begingroup
+ \XMLdoifonstackelse{condition,bvar,lowlimit}
{\def\MMLcSUMlow
{_{\XMLdoifonstackelse{condition}
{\collectXMLnamedstack{condition}{\crcr}%
@@ -1439,8 +1484,22 @@
\XMLdoifonstackelse{uplimit}
{\def\MMLcSUMup{^{\XMLfirstnamed{uplimit}}}}
{\let\MMLcSUMup\empty}%
+ \XMLdoifonstackelse{interval} % open math converter gives this
+ {\begingroup
+ \directsetup{mmc:interval:fetch}%
+ \XMLfirstnamed{interval}%
+ \endgroup
+ \ifx\MMCintervalfrom\empty\else
+ \def\MMLcSUMlow{_{\XMLdoifonstackelse{bvar}{\XMLfirstnamed{bvar}{=}}{}\MMCintervalfrom}}%
+ \fi
+ \ifx\MMCintervalto\empty \else
+ \def\MMLcSUMup{^{\MMCintervalto}}%
+ \fi}
+ {}%
\MMLcreset#2\doMMLlimits{#1}\MMLcSUMup\MMLcSUMlow
- \MMLcreset\XMLfirstnamed{apply,ci}}
+ \directsetup{mmc:lambda:simple}% a bit of open math conversion mess
+ \MMLcreset\XMLfirstnamed{apply,lambda,ci}%
+ \endgroup}
\defineXMLcommand [limit] {\directsetup{mmc:limit}}
@@ -1714,7 +1773,7 @@
% best is to grab the apply (independent of order), (*1*), so:
%
\XMLdoifonstackelse {apply} {
- \doifelseMMCfunctioninapply \XMLstackposition \MMLcfunctionlist \donefalse \donetrue
+ \doifelseMMCfunctioninapply \XMLstackposition {\MMLcfunctionlist,divide} \donefalse \donetrue
} {
\donefalse
}
@@ -2231,19 +2290,19 @@
\def\MMLpTABLEmapper#1#2%
{\doifXMLparelse{mtable}{#1}
{\newcounter\MMLcounter
- \def\docommando##1%
+ \def\docommand##1%
{\increment\MMLcounter
\expanded{\setupTABLE[column][\MMLcounter][#2=\XMLval{mmp:mtable}{#2:##1}\empty]}}%
- \expanded{\processseparatedlist[\XMLpar{mtable}{#1}\empty]}[ ]\docommando}
+ \expanded{\processseparatedlist[\XMLpar{mtable}{#1}\empty]}[ ]\docommand}
{}}
\def\MMLpTABLEsplitter#1#2%
{\doifXMLparelse{mtable}{#1}
{\newcounter\MMLcounter
- \def\docommando##1%
+ \def\docommand##1%
{\increment\MMLcounter
\expanded{\setupTABLE[column][\MMLcounter][#2=##1]}}%
- \expanded{\processseparatedlist[\XMLpar{mtable}{#1}\empty]}[ ]\docommando}
+ \expanded{\processseparatedlist[\XMLpar{mtable}{#1}\empty]}[ ]\docommand}
{}}
\def\MMLpTABLEmap#1#2%
@@ -2340,9 +2399,9 @@
% watch the extra {}'s
\ifdone
\ifodd\scratchcounter
- ^{\getXMLstackdata\recurselevel}{}
- \else
_{\getXMLstackdata\recurselevel}
+ \else
+ ^{\getXMLstackdata\recurselevel}{}
\fi
\else
\doif{\getXMLstackname\recurselevel}{mprescripts}{\donetrue{}}
@@ -2489,6 +2548,72 @@
\fi
\stopsetups
+\def\xflushXMLstackwith#1#2#3#4% num bgroup egroup whatever
+ {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+ {#2\relax
+ \ifnum\recurselevel>#1\relax#4\fi
+ \getXMLstackdata\recurselevel
+ #3}}
+
+\def\xflushXMLstackfrom#1#2#3%
+ {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+ {#2\getXMLstackdata\recurselevel#3}}
+
+% <apply><divide/>
+% <apply><minus/>
+% <apply><minus/><ci>b</ci></apply>
+% <apply><minus/><ci>b</ci></apply>
+% <apply><root/> <ci>a</ci></apply>
+% </apply>
+% <apply><minus/>
+% <apply><minus/><ci>b</ci><ci>b</ci></apply>
+% <apply><minus/><ci>b</ci></apply>
+% <apply><root/> <ci>a</ci></apply>
+% </apply>
+% </apply>
+
+\startsetups mmc:minus
+ \doif \@@MMLsignreduction \v!yes {
+ \setMMLcreset{fn,\MMLcfunctionlist}
+ }
+ \ifcase\XMLstacklevel
+ \or
+ % self
+ \or
+ -\getXMLstackdata\plustwo
+ \else
+ \dostepwiserecurse\plustwo\XMLstacklevel\plusone {
+ \begingroup
+ \doifelse {\getXMLstackname\recurselevel} {apply} {
+ \ifnum\recurselevel=\plustwo
+ \begingroup
+ \dodoifelseMMCfunctioninapply \recurselevel {minus} {
+ \ifnum\XMLstacklevel>\plustwo
+ \endgroup
+ \else
+ \endgroup
+ \MMLcreset
+ \fi
+ } {
+ \endgroup
+ }
+ \else
+ \doifelseMMCfunctioninapply \recurselevel {\MMLcfunctionlist,\MMLcconstructlist} {
+ \MMLcreset
+ } {
+ }
+ \fi
+ } {
+ }
+ \getXMLstackdata\recurselevel
+ \ifnum\recurselevel<\XMLstacklevel\relax
+ -
+ \fi
+ \endgroup
+ }
+ \fi
+\stopsetups
+
\stopmoduletestsection
\stopmodule
diff --git a/Master/texmf-dist/tex/context/base/x-newmmo.tex b/Master/texmf-dist/tex/context/base/x-newmmo.tex
index 2becfb30a80..5e05faae906 100644
--- a/Master/texmf-dist/tex/context/base/x-newmmo.tex
+++ b/Master/texmf-dist/tex/context/base/x-newmmo.tex
@@ -48,7 +48,7 @@
%D
%D \typebuffer \processXMLbuffer
-\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#diffquot
+\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\string#diffquot
\MMLcreset
\frac {
\Delta\getXMLstackdata\plustwo
@@ -97,7 +97,7 @@
%D
%D \typebuffer \processXMLbuffer
-\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#difference
+\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\string#difference
\MMLcreset
\Delta\getXMLstackdata\plustwo
\stopsetups
@@ -114,7 +114,7 @@
%D
%D \typebuffer \processXMLbuffer
-\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#diff
+\startsetups mmc:csymbol:http://www.openmath.org/cd/mathadore\string#diff
\MMLcreset
\frac {
\mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plustwo
diff --git a/Master/texmf-dist/tex/context/base/x-om2cml.xsl b/Master/texmf-dist/tex/context/base/x-om2cml.xsl
index acd95db2c10..60888c10d7c 100644
--- a/Master/texmf-dist/tex/context/base/x-om2cml.xsl
+++ b/Master/texmf-dist/tex/context/base/x-om2cml.xsl
@@ -408,16 +408,16 @@
<xsl:template match="om:OMA[om:OMS[@cd='interval1']]">
<interval>
<xsl:choose>
- <xsl:when test="om:OMS[1]/@name='interval_oo'">
+ <xsl:when test="om:OMS[1]/@name='interval_oo'">
<xsl:attribute name='closure'>open</xsl:attribute>
</xsl:when>
- <xsl:when test="om:OMS[1]/@name='interval_cc'">
+ <xsl:when test="om:OMS[1]/@name='interval_cc'">
<xsl:attribute name='closure'>closed</xsl:attribute>
</xsl:when>
- <xsl:when test="om:OMS[1]/@name='interval_oc'">
+ <xsl:when test="om:OMS[1]/@name='interval_oc'">
<xsl:attribute name='closure'>open-closed</xsl:attribute>
</xsl:when>
- <xsl:when test="om:OMS[1]/@name='interval_co'">
+ <xsl:when test="om:OMS[1]/@name='interval_co'">
<xsl:attribute name='closure'>closed-open</xsl:attribute>
</xsl:when>
</xsl:choose>
@@ -1247,12 +1247,29 @@
</annotation>
</xsl:template>
- <xsl:template match="om:OMS[@cd='math4all' and @name]">
+ <xsl:template match="om:OMS[(@cd='math4all' or @cd='mathadore' or @cd='m4all') and @name]">
<csymbol>
<xsl:attribute name="definitionURL">
- <xsl:value-of select="concat(concat(concat('http://www.openmath.org/cd/',@cd),'#'),@name)"/>
+ <xsl:value-of select="concat(concat('http://www.openmath.org/cd/mathadore','#'),@name)"/>
</xsl:attribute>
</csymbol>
</xsl:template>
+<!--
+ <xsl:template match="om:OMS[@cd='mathadore' and @name]">
+ <csymbol>
+ <xsl:attribute name="definitionURL">
+ <xsl:value-of select="concat(concat(@cd,'#'),@name)"/>
+ </xsl:attribute>
+ </csymbol>
+ </xsl:template>
+-->
+
+ <xsl:template match="om:OMA[om:OMS[@cd='combinat1' and @name='binomial']]">
+ <matrix>
+ <matrixrow><xsl:apply-templates select="*[2]"/></matrixrow>
+ <matrixrow><xsl:apply-templates select="*[3]"/></matrixrow>
+ </matrix>
+ </xsl:template>
+
</xsl:stylesheet>
diff --git a/Master/texmf-dist/tex/context/base/x-openmath.xsl b/Master/texmf-dist/tex/context/base/x-openmath.xsl
index e91b83e51c6..ffb40493951 100644
--- a/Master/texmf-dist/tex/context/base/x-openmath.xsl
+++ b/Master/texmf-dist/tex/context/base/x-openmath.xsl
@@ -6,7 +6,7 @@
<!-- newline, temp hack, latest texexec handles it okay -->
- <xsl:template match ="processing-instruction()"><xsl:copy/><xsl:text>
+ <xsl:template match="processing-instruction()"><xsl:copy/><xsl:text>
</xsl:text></xsl:template>
<!-- xsl:template match="*"><xsl:copy/></xsl:template -->
@@ -20,7 +20,7 @@
</xsl:template>
-->
- <xsl:template match = "node()|@*" >
+ <xsl:template match="node()|@*" >
<xsl:copy>
<xsl:apply-templates select = "node()|@*" />
</xsl:copy>
diff --git a/Master/texmf-dist/tex/context/base/x-res-01.tex b/Master/texmf-dist/tex/context/base/x-res-01.tex
index e989d7090c1..83f747f838e 100644
--- a/Master/texmf-dist/tex/context/base/x-res-01.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-01.tex
@@ -257,8 +257,8 @@
[\XMLflush{rl:file}]
[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}%
[GridPg]%
- \freezedimenmacro\naturalfigurewidth \let\FigWid\naturalfigurewidth
- \freezedimenmacro\naturalfigureheight\let\FigHei\naturalfigureheight
+ \let\FigWid\figurenaturalwidth
+ \let\FigHei\figurenaturalheight
\advance\hsize by -150pt
\hskip10pt
\advance\hsize by -10pt
diff --git a/Master/texmf-dist/tex/context/base/x-res-04.tex b/Master/texmf-dist/tex/context/base/x-res-04.tex
index 066404afd25..83998a4c42e 100644
--- a/Master/texmf-dist/tex/context/base/x-res-04.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-04.tex
@@ -158,8 +158,10 @@
{\bgroup}
{\XMLflush{rl:figure}
\doglobal\increment\figurefilepage
+ %\doshowfigurestate{base : comparing \askedlabel\space with \XMLflush{rl:label}}%
\doif\askedlabel{\XMLflush{rl:label}}
- {\ifnum\figurebasemode=\plusone % load used ones
+ {\doshowfigurestate{base label : found \askedlabel}%
+ \ifnum\figurebasemode=\plusone % load used ones
\figbase@savedata\askedlabel\figurefilepage
\fi
\doglobal\saveXMLdata{rl:l:manipulation}{rl:manipulation}%
@@ -189,7 +191,8 @@
\def\askedlabel{#2}%
\doifelseXMLelement{rl:rl:\askedlabel}
{\enableXMLelements\flushXMLelement{rl:rl:\askedlabel}}
- {\processcommacommand[\figurepathlist]\dogetfigurefilename}%
+ {\doshowfigurestate{base path : \figurepathlist}%
+ \processcommacommand[\figurepathlist]\dogetfigurefilename}%
\stopXMLmapping
\stopnointerference}
@@ -204,8 +207,11 @@
\globalletempty\figurefileoriginal
\globalletempty\figurefilefile
\xdef\figurefilebasepath{#1}%
- \assignfullfilename{#1}\figurefilebase\to\filename
- \expanded{\processXMLfilegrouped{\filename.xml}}%
+ \assignfullfilename{#1}{\figurefilebase.xml}\to\filename
+ \doiffileelse\filename
+ {\doshowfigurestate{base file : \filename}%
+ \processXMLfilegrouped\filename}
+ \donothing
\ifx\figurefilename\empty \else
\global\let\figurefilebase\figurefilebase
\fi
@@ -227,36 +233,71 @@
\def\resetfigurefilebase
{\the\figurebaseresets}
-\let\normalcalculateexternalfigure\calculateexternalfigure
-
-\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
- {\resetfigurefilebase
- \ifx\figurebaselist\empty
- \normalcalculateexternalfigure
- [#1][#2][#3][#4][#5][#6]%
- \else
- \def\docommando##1%
- {\getfigurefilename{##1}{#3}%
- \ifx\figurefilename\empty\else
- \gdef\figurefilelabel{#3}%
- \quitcommalist
- \fi}%
- \processcommacommand[\figurebaselist]\docommando
- \ifx\figurefilename\empty
- \stripspaces\from#3\to\figurefilename % to be sure
- \normalcalculateexternalfigure
- [#1][#2][\figurefilename][#4][#5][#6]%
- \else
- \doiffileelse{\figurefilebase.pdf}
- {\let\figurepathlist\figurefilebasepath
- \normalcalculateexternalfigure
- [#1][#2][\figurefilebase.pdf]%
- [\c!page=\figurefilepage,#4][#5][#6]}
- {\@EA\stripspaces\@EA\from\figurefilename\to\figurefilename
- \normalcalculateexternalfigure
- [#1][#2][\figurefilename][#4][#5][#6]}%
- \fi
- \fi}
+\ifx\doshowfigurestate\undefined \let\doshowfigurestate\gobbleoneargument \fi
+
+\ifx\doanalyzefiguredimensionsfromfile\undefined
+
+ % will become obsolete once the new core-fig is used
+
+ \let\normalcalculateexternalfigure\calculateexternalfigure
+
+ \def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+ {\resetfigurefilebase
+ \ifx\figurebaselist\empty
+ \normalcalculateexternalfigure[#1][#2][#3][#4][#5][#6]%
+ \else
+ \def\docommand##1%
+ {\doshowfigurestate{base : check #3 in ##1}%
+ \getfigurefilename{##1}{#3}%
+ \ifx\figurefilename\empty\else\quitcommalist\fi}%
+ \processcommacommand[\figurebaselist]\docommand
+ \ifx\figurefilename\empty
+ \stripspaces\from#3\to\figurefilename % to be sure
+ \normalcalculateexternalfigure[#1][#2][\figurefilename][#4][#5][#6]%
+ \else
+ \doiffileelse{\figurefilebase.pdf}
+ {\let\figurepathlist\figurefilebasepath
+ \normalcalculateexternalfigure
+ [#1][#2][\figurefilebase.pdf]%
+ [\c!page=\figurefilepage,#4][#5][#6]}
+ {\@EA\stripspaces\@EA\from\figurefilename\to\figurefilename
+ \normalcalculateexternalfigure[#1][#2][\figurefilename][#4][#5][#6]}%
+ \fi
+ \fi}
+
+\else
+
+ % todo: use different internal names, \figurebasepage and such
+
+ \def\doanalyzefiguredimensionsfromfile
+ {\ifcase\figurestatus \ifx\figurebaselist\empty \else
+ \resetfigurefilebase
+ \doshowfigurestate{base list : \figurebaselist}%
+ \processcommacommand[\figurebaselist]\dodoanalyzefiguredimensionsfromfile
+ \ifx\figurefilename\empty
+ \doshowfigurestate{base warning : no matching name found}%
+ \else
+ \doiffileelse{\figurefilebase.pdf}
+ {\doshowfigurestate{base file : \figurefilebase.pdf}%
+ \doshowfigurestate{base page : \figurefilepage}%
+ \let\figurepathlist\figurefilebasepath
+ \analyzefigurefilename{\figurefilebase.pdf}\wantedfigurelabel
+ \let\wantedfigurepage\figurefilepage}
+ {\doshowfigurestate{base missing : \figurefilebase.pdf}}
+ \fi
+ \ifcase\figurestatus
+ \analyzefigurefilename\expandedfigurename\wantedfigurelabel
+ \fi
+ \fi \fi}
+
+ \def\dodoanalyzefiguredimensionsfromfile#1%
+ {\doshowfigurestate{base check : \wantedfigurename\space in #1}%
+ \getfigurefilename{#1}\wantedfigurename
+ \ifx\figurefilename\empty\else
+ \quitcommalist
+ \fi}
+
+\fi
% management
diff --git a/Master/texmf-dist/tex/context/base/x-res-08.tex b/Master/texmf-dist/tex/context/base/x-res-08.tex
index e7388516646..548933123b8 100644
--- a/Master/texmf-dist/tex/context/base/x-res-08.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-08.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D TODO: make rlxtools callable from texexec (class), speeds up things.
+
%D Experimental module!
%D
%D \starttyping
@@ -52,16 +54,19 @@
\let\figurefileprefix \empty
\def\XMLfeedbackresource#1#2%
- {\convertcommand\currentresourcecomment\to\currentresourcecomment
+ {\begingroup
+ \convertcommand\currentresourcecomment\to\currentresourcecomment
+ \doifnothing\figurefilefile{\edef\figurefilefile{\figurefilename.\figurefiletype}}%
\immediate\write\XMLrllog
{\writtenXMLelement{\XMLrlprefix usage}%
- {\writtenXMLelement{\XMLrlprefix type}{#2}%
- \writtenXMLelement{\XMLrlprefix state}{#1}%
+ {\writtenXMLelement{\XMLrlprefix type}{#2}% 'figure' not the type in \extenalfigure
+ \writtenXMLelement{\XMLrlprefix state}{#1}% 'missing' 'found' etc
\ifx\figurefilelabel\empty
\ifx\figurelabel\s!dummy \else % otherwise label equals filename
\writtenXMLelementcs{\XMLrlprefix label}\figurelabel
\fi
- \writtenXMLelementcs{\XMLrlprefix file}\figurefilename
+ \writtenXMLelementcs{\XMLrlprefix file}\figurefilefile % complete name
+ \writtenXMLelementcs{\XMLrlprefix name}\figurefilename % no suffix
\writtenXMLelementcs{\XMLrlprefix suffix}\figurefiletype
\else
% \figurefilelabel is set in x-res-04 and since
@@ -84,10 +89,11 @@
\ifconditional\externalfigureflush
\writtenXMLelementcs{\XMLrlprefix width}\figurewidth
\writtenXMLelementcs{\XMLrlprefix height}\figureheight
- \fi}}}
+ \fi}}%
+ \endgroup}
\def\XMLfeedbackexternalfigure
- {\externalfigureflush\doifmodeelse{*\v!figure}%
+ {\doifmodeelse{*\v!figure}%
{\XMLfeedbackresource{found}}%
{\XMLfeedbackresource{\ifconditional\externalfigureflush missing\else registered\fi}}%
{figure}}
@@ -96,15 +102,23 @@
[rl:manipulate]
[file=rlxtools.rlx]
-\startsetups[rl:manipulate]
-
-% \immediatewriteutilitycommand{\writestatus{system}{we force multiple runs at \normaltime}}
-
- \doiflocfileelse{\jobname.rlx}
- {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}}
- {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}}
-
-\stopsetups
+% \startsetups[rl:manipulate]
+% \doiflocfileelse{\jobname.rlx}
+% {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}}
+% {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}}
+% \stopsetups
+%
+% no longer need for \setups[rl:manipulate]
+
+\ifx\nofconversionfigures\undefined \chardef\nofconversionfigures\plusone \fi
+
+\appendtoks
+ \ifcase\nofconversionfigures\else
+ \doiflocfileelse{\jobname.rlx}
+ {\installprogram{texmfstart rlxtools --manipulate kpse:\jobname.rlx \jobname.rlg}}
+ {\installprogram{texmfstart rlxtools --manipulate kpse:\getvariabledefault{rl:manipulate}{file}{rlxtools.rlx} \jobname.rlg}}%
+ \fi
+\to \everylastshipout
\appendtoks \openXMLresourcelog \to \everystarttext
\appendtoks \closeXMLresourcelog \to \everystoptext
diff --git a/Master/texmf-dist/tex/context/base/x-res-12.tex b/Master/texmf-dist/tex/context/base/x-res-12.tex
new file mode 100644
index 00000000000..c4bc4386f60
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-res-12.tex
@@ -0,0 +1,53 @@
+%D \module
+%D [ file=x-fig-12,
+%D version=2005.05.05,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Resource Checking,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This module implements the dimension checking using \RLXTOOLS.
+
+\unprotect
+
+\chardef\figurerlxmode\plusone % rlx permitted
+
+\startXMLmapping[rli]
+ \defineXMLprocess[rl:identify]
+ \defineXMLsavecontent[rl:width] {\!!zeropoint}
+ \defineXMLsavecontent[rl:height]{\!!zeropoint}
+\stopXMLmapping
+
+\def\doanalyzefiguredimensionsrlx
+ {\ifcase\figurestatus \ifcase\figurerlxmode \else
+ \doifnotfile{\wantedfigurefullname.rli}
+ {% let's try runtime running first
+ \doshowfiguremessage6\wantedfigurefullname
+ \executesystemcommand{texmfstart rlxtools --identify \wantedfigurefullname}}%
+ \doifnotfile{\wantedfigurefullname.rli}
+ {% we assume that runtime running failed
+ \doshowfiguremessage6\wantedfigurefullname
+ \installprogram{texmfstart rlxtools --identify \wantedfigurefullname}}%
+ \doiffile{\wantedfigurefullname.rli}
+ {\global\let\analyzedfigurewidth \!!zeropoint
+ \global\let\analyzedfigureheight\!!zeropoint
+ \startnointerference % groups
+ \startXMLmapping[rli]%
+ \startXMLignore
+ \processXMLfile{\wantedfigurefullname.rli}%
+ \xdef\analyzedfigurewidth {\the\dimexpr\XMLflush{rl:width} \relax}% turn whatever into pt
+ \xdef\analyzedfigureheight{\the\dimexpr\XMLflush{rl:height}\relax}% turn whatever into pt
+ \stopXMLignore
+ \stopXMLmapping
+ \stopnointerference
+ \setanalyzedfiguredimensions\!!ten}%
+ \fi\fi}
+
+\let\doanalyzefiguredimensionsexternal\doanalyzefiguredimensionsrlx
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-res-20.tex b/Master/texmf-dist/tex/context/base/x-res-20.tex
new file mode 100644
index 00000000000..e81927c217a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-res-20.tex
@@ -0,0 +1,231 @@
+%D \module
+%D [ file=x-res-20,
+%D version=2006.08.20,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Figure Lists,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D For the beginning we have used \TEXUTIL\ to hels us deal with
+%D graphics whose dimensions could not be determines and|/|or to
+%D provide placeholder info for graphics that were not available.
+%D Much of this functionality is now moved to \RLXTOOLS\ and
+%D therefore it makes sense to reimplement the code that deals with
+%D producing an overview of grapghics as well. At the same time we
+%D move some \TEX\ code from \TEXEXEC\ to here.
+%D
+%D Because the show commands are not used in real documents, but
+%D only for special purposed, it does not harm that this
+%D functionality is now part of a module. We no longer use the
+%D parsing code in \TEXUTIL, but rely on \IMAGEMAGICK's
+%D identify functionility.
+%D
+%D At the end of the file we kept the old code from \type {core-fig}.
+
+\unprotect
+
+\startXMLmapping[rlx:list]
+
+ \defineXMLprocess
+ [rl:identification]
+
+ \defineXMLenvironment
+ [rl:identify] [name=]
+ {\bgroup\ignorespaces}
+ {\removeunwantedspaces\doRLhandlegraphic\egroup}
+
+ \defineXMLsave[rl:size]
+ \defineXMLsave[rl:path]
+ \defineXMLsave[rl:width]
+ \defineXMLsave[rl:height]
+
+\stopXMLmapping
+
+\def\showexternalfigures
+ {\dosingleempty\doshowexternalfigures}
+
+\let\doRLhandlegraphic\relax
+\let\doRLstartgraphics\relax
+\let\doRLstopgraphics \relax
+
+\let\RLfigurewidth \empty
+\let\RLfigureheight\empty
+\let\RLfiguresize \empty
+\let\RLfigurefile \empty
+
+\def\doRLpresetgraphic
+ {\edef\RLfigurewidth {\the\dimexpr \XMLflush{rl:width}\relax}%
+ \edef\RLfigureheight{\the\dimexpr \XMLflush{rl:height}\relax}%
+ \edef\RLfiguresize {\the\numexpr0\XMLflush{rl:size}\relax}%
+ \edef\RLfigurefile {\XMLpar{rl:identify}{name}{unknown}}}
+
+\def\doshowexternalfigures[#1]%
+ {\bgroup
+ \dontcomplain
+ \setupcolors[\c!state=\v!start]% to prevent mps color conversion
+ \getparameters[\??ex][\c!file=rlxtools.rli,\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]%
+ \getvalue{\strippedcsname\doRLhandlegraphic\@@exalternative}%
+ \startXMLmapping[rlx:list]%
+ \startXMLignore
+ \doRLstartgraphics
+ \processXMLfilegrouped{\@@exfile}% \readjobfile\@@exfile\donothing\donothing
+ \doRLstopgraphics
+ \stopXMLignore
+ \stopXMLmapping
+ \egroup}
+
+\def\doRLhandlegraphica
+ {\def\doRLhandlegraphic
+ {\doRLpresetgraphic
+ \getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][]
+ {}
+ {\hbox
+ {\externalfigure[\RLfigurefile][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize]%
+ \quad
+ \framed[\c!width=\figurewidth,\c!height=\figureheight]{}%
+ \quad}}%
+ {\hbox{\tt\tfa\setstrut\strut\expanded{\asciistr{\RLfigurefile}}}}%
+ \blank
+ \tfx
+ \starttabulate[|l|l|]
+ \NC width \EQ \RLfigurewidth \NC \NR
+ \NC height \EQ \RLfigureheight \NC \NR
+ \NC size \EQ \RLfiguresize \NC \NR
+ \stoptabulate
+ \getvalue{\e!stop\v!figure\e!text}}}
+
+\def\doRLhandlegraphicb
+ {\def\doRLhandlegraphic
+ {\dontleavehmode
+ \vbox
+ {\doRLpresetgraphic
+ \hsize\dimexpr.2\hsize-.8em\relax
+ \cbox{\externalfigure[\RLfigurefile][\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize]}%
+ \vskip.5\lineheight
+ \midaligned{\tttf\RLfigurefile}}%
+ \vadjust{\vskip.2\lineheight}%
+ \quad\allowbreak}}
+
+\def\doRLhandlegraphicc
+ {\def\doRLhandlegraphic
+ {\doRLpresetgraphic
+ \pagefigure[\RLfigurefile]}}
+
+\def\doRLhandlegraphicd % this one builds a dimension file for metapost/metafun
+ {\def\doRLstartgraphics
+ {\immediate\openout\scratchwrite=mpfigs.mp\relax
+ \immediate\write\scratchwrite{\letterpercent\space graphic dimension file for metapost/metafun}}%
+ \def\doRLstopgraphics
+ {\immediate\closeout\scratchwrite}%
+ \def\doRLhandlegraphic
+ {\doRLpresetgraphic
+ \immediate\write\scratchwrite{registerfigure("\RLfigurefile",\RLfigurewidth,\RLfigureheight);}}}
+
+% \showexternalfigures[alternative=b]
+
+\protect \endinput
+
+%D Old code:
+
+\def\doshowexternalfigures[#1]%
+ {\bgroup
+ \setupcolors[\c!state=\v!start]% to prevent mps color conversion
+ \getparameters[\??ex][\c!alternative=a,\c!offset=\!!zeropoint,\c!size=,#1]%
+ \getvalue{\strippedcsname\showexternalfigure\@@exalternative}%
+ \egroup}
+
+\def\showexternalfigures
+ {\dosingleempty\doshowexternalfigures}
+
+\def\showexternalfigurea
+ {\bgroup
+ \dontcomplain
+ \def\presetfigure[##1][##2]%
+ {\getvalue{\e!start\v!figure\e!text}[\v!left,\v!none][]
+ {}
+ {\hbox
+ {\externalfigure[##1][\c!frame=\v!on,\c!width=6cm,\c!size=\@@exsize][##2]%
+ \tfskip
+ \framed[\c!width=\figurewidth,\c!height=\figureheight]{}}}%
+ {\tt\tfa\expanded{\asciistr{##1}}}%
+ \blank
+ \tfx
+ \def\docommand####1%
+ {\beforesplitstring####1\at=\to\asciia
+ \aftersplitstring ####1\at=\to\asciib
+ \convertcommand\asciib\to\asciib
+ \doifsomething\asciib
+ {\hsmash{\hbox to .75em{\asciia\hss}: \asciib}\endgraf}}%
+ \processcommalist[##2]\docommand
+ \strut
+ \endgraf
+ \getvalue{\e!stop\v!figure\e!text}}%
+ \pushendofline
+ \readjobfile\@@exfile\donothing\donothing
+ \popendofline
+ \egroup}
+
+\def\showexternalfigureb % instelbaar maken
+ {\bgroup
+ \def\total{5}%
+ \globalletempty\allfigures
+ \doglobal\newcounter\figurecounter
+ \dontcomplain
+ \def\docommand##1{##1&}%
+ \def\figurecaptions%
+ {\crcr
+ \noalign{\nobreak\vskip.5em}%
+ \@EA\globalprocesscommalist\@EA[\allfigures]\docommand
+ \globalletempty\allfigures
+ \crcr
+ \noalign{\vskip1em\goodbreak}}%
+ \def\presetfigure[##1][##2]%
+ {\vbox
+ {\divide\hsize \total
+ \advance\hsize -1em
+ \externalfigure
+ [##1]
+ [\c!frame=\v!on,\c!factor=\v!max,\c!width=\hsize,\c!size=\@@exsize][##2]}%
+ \doglobal\addtocommalist{##1}\allfigures
+ %\getvalue{\s!figurepreset}%
+ \doglobal\increment\figurecounter
+ \ifnum\figurecounter=\total
+ \doglobal\newcounter\figurecounter
+ \def\next{\figurecaptions}%
+ \else
+ \def\next{&}%
+ \fi
+ \next}%
+ \pushendofline
+ \tabskip\zeropoint \!!plus 1fill
+ \halign to \hsize
+ {&\hss##\hss\cr\readjobfile\@@exfile\donothing\donothing\crcr
+ \figurecaptions}
+ \popendofline
+ \egroup}
+
+\def\showexternalfigurec
+ {\bgroup
+ \def\presetfigure[##1][##2]{\expanded{\pagefigure[##1][\c!size=\@@exsize]}}% else loop
+ \pushendofline
+ \readjobfile\@@exfile\donothing\donothing
+ \popendofline
+ \egroup}
+
+\def\showexternalfigured % to be documented; this one builds a dimension file for
+ {\bgroup % metapost/metafun
+ \immediate\openout\scratchwrite=mpfigs.mp
+ \def\presetfigure[##1][##2]%
+ {\getfiguredimensionsonly[##1]% \pagefigure[##1]%
+ \immediate\write\scratchwrite
+ {registerfigure("##1",\figurewidth,\figureheight);}}
+ \pushendofline
+ \readjobfile\@@exfile\donothing\donothing
+ \popendofline
+ \immediate\closeout\scratchwrite
+ \egroup}
diff --git a/Master/texmf-dist/tex/context/base/x-sch-00.tex b/Master/texmf-dist/tex/context/base/x-sch-00.tex
index 97b266d5e28..379d19cf2f8 100644
--- a/Master/texmf-dist/tex/context/base/x-sch-00.tex
+++ b/Master/texmf-dist/tex/context/base/x-sch-00.tex
@@ -8,14 +8,14 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D Schema support was implemented right after euro\TeX\ 2001,
%D when Tobias Burnus send me a schema for the XML figure
%D base. Since it happened that I needed schemata for other
%D projects too, I wrote this mapper. Thanks to Tobias for
-%D testing it.
+%D testing it.
\newcounter\XSDprefix
\newif\ifXDScomposite
@@ -54,10 +54,10 @@
\pagereference[xsd:\XSDprefix:\XSDtemp]%
\fi
\doXSDtemp},
- type=>{\doifinstringelse{xsd:}{\XSDtemp}
+ type=>{\doifinstringelse{xsd:}{\XSDtemp}
{\doXSDtemp}
{\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}},
- ref=>{\doifinstringelse{xsd:}{\XSDtemp}
+ ref=>{\doifinstringelse{xsd:}{\XSDtemp}
{\doXSDtemp}
{\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}},
unknown=>\doXSDtemp]}%
@@ -65,8 +65,8 @@
\egroup}
\def\doXSDkeyvals#1#2#3%
- {\def\docommando##1{\doXSDkeyval{#1}{##1}{#2}{##1}}%
- \processcommalist[#3]\docommando}
+ {\def\docommand##1{\doXSDkeyval{#1}{##1}{#2}{##1}}%
+ \processcommalist[#3]\docommand}
\def\dodoXSDbanner#1%
{\framed
@@ -77,7 +77,7 @@
\def\doXSDtitle#1#2#3%
{\edef\XSDtemp{\XMLpar{#2}{#3}{}}%
\dodoXSDbanner
- {{\bf\ignorespaces#1\unskip}%
+ {{\bf\ignorespaces#1\unskip}%
\doifsomething{\XSDtemp}
{:\space\ignorespaces\XSDtemp\unskip
\pagereference[xsd:\XSDprefix:\XSDtemp]}}}
@@ -113,7 +113,7 @@
\defineframedtext [XSDcapsule] [backgroundcolor=xsd:2]
\defineframedtext [XSDsequence] [backgroundcolor=xsd:3]
-\def\XDSstructures% handy for external settings
+\def\XDSstructures% handy for external settings
{XSDannotation,
XSDcomplexType,XSDsimpleType,XSDelement,XSDattribute,
XSDcomplexContent,XSDsimpleContent,XSDattributeGroup,
@@ -129,29 +129,29 @@
before=\ifinframed\else\blank\fi,
after=\ifinframed\else\blank\fi,
depthcorrection=off,
- rulethickness=1pt,
+ rulethickness=1pt,
strut=no]
\definesymbol[xsd][{\blackrule[width=4em]}]
\def\placeXSDlegenda
{\startbaselinecorrection
- \starttabulate[|l|l|]
- \HL
- \NC \bf color \NC \bf meaning \NC \NR
- \HL
- \NC \color[xsd:1]{\symbol[xsd]} \NC complexContent \unskip\quad
- simpleContent \unskip\quad
- attributeGroup \NC \NR
- \NC \color[xsd:2]{\symbol[xsd]} \NC capsule \NC \NR
- \NC \color[xsd:3]{\symbol[xsd]} \NC sequence \NC \NR
- \HL
- \NC \color[xsd:5]{\symbol[xsd]} \NC element \NC \NR
- \NC \color[xsd:6]{\symbol[xsd]} \NC attribute \NC \NR
- \NC \color[xsd:7]{\symbol[xsd]} \NC simpleType \NC \NR
- \NC \color[xsd:8]{\symbol[xsd]} \NC complexType \NC \NR
- \HL
- \stoptabulate
+ \starttabulate[|l|l|]
+ \HL
+ \NC \bf color \NC \bf meaning \NC \NR
+ \HL
+ \NC \color[xsd:1]{\symbol[xsd]} \NC complexContent \unskip\quad
+ simpleContent \unskip\quad
+ attributeGroup \NC \NR
+ \NC \color[xsd:2]{\symbol[xsd]} \NC capsule \NC \NR
+ \NC \color[xsd:3]{\symbol[xsd]} \NC sequence \NC \NR
+ \HL
+ \NC \color[xsd:5]{\symbol[xsd]} \NC element \NC \NR
+ \NC \color[xsd:6]{\symbol[xsd]} \NC attribute \NC \NR
+ \NC \color[xsd:7]{\symbol[xsd]} \NC simpleType \NC \NR
+ \NC \color[xsd:8]{\symbol[xsd]} \NC complexType \NC \NR
+ \HL
+ \stoptabulate
\stopbaselinecorrection}
\defineXMLenvironment [xsd:all] [id=]
@@ -168,7 +168,7 @@
{\stopXSDannotation
\stopXSDcapsule}
-\defineXMLignore [xsd:appInfo]
+\defineXMLignore [xsd:appInfo]
\defineXMLenvironment [xsd:attribute]
[id=,name=,ref=,type=,form=,use=,value=]
@@ -374,9 +374,9 @@
[id=,schemaLocation=]
[id,schemaLocation]
-\defineXSDfacet
- [notation]
- [id=,name=,public=,system=]
+\defineXSDfacet
+ [notation]
+ [id=,name=,public=,system=]
[id,name,public,system]
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-xml-11.tex b/Master/texmf-dist/tex/context/base/x-xml-11.tex
index 81fbac5b4c5..c1b185b559f 100644
--- a/Master/texmf-dist/tex/context/base/x-xml-11.tex
+++ b/Master/texmf-dist/tex/context/base/x-xml-11.tex
@@ -57,14 +57,15 @@
\defineXMLpickup
[entities][n=0]
{\expanded{\SomeElement{\XMLop{n}}{Entities}}
- \starttabulate[|l|p|]}
+ \starttabulate[|l|l|l|]}
{\stoptabulate}
-\defineXMLcommand
+\defineXMLcommand % ugly hack (make macro of it)
[entity][name=,n=0]
{\startexpanded
\noexpand \NC \XMLop{name}
\noexpand \NC \XMLop{n}
+ \noexpand \NC \noexpand\doXMLentity\XMLop{name};
\noexpand \NC
\noexpand \NR
\stopexpanded}
diff --git a/Master/texmf-dist/tex/context/base/xtag-cml.tex b/Master/texmf-dist/tex/context/base/xtag-cml.tex
index 493d9eff340..203218ceb22 100644
--- a/Master/texmf-dist/tex/context/base/xtag-cml.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-cml.tex
@@ -1,5 +1,7 @@
% see mathml, == \defineXMLdirective [mathml] \setupMMLappearance
+% will be rewritten avoiding the mapper
+
\unprotect
\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
@@ -66,8 +68,9 @@
\newcounter\nofCMLatoms
\getXMLarguments{cml-m}{n="0" #1}%
\doifnotXMLzero{cml-m}{n}\firstofoneargument
- \ignorespaces\processXMLRchild{atom,ion,bond/,%
- singlebond/,doublebond/,triplebond/}{#2}\unskip
+ \ignorespaces
+ \processXMLRchild{atom,ion,bond/,singlebond/,doublebond/,triplebond/}{#2}%
+ \unskip
\egroup}%
\ignorespaces}
@@ -81,13 +84,15 @@
\getXMLarguments{cml-i}{n="0" charge="0" #1}%
\doifnotXMLzero{cml-i}{n}\firstofoneargument
\doifelse\@@CMLionalternative\v!b
- {[\ignorespaces\processXMLRchild{atom,bond/,%
- singlebond/,doublebond/,triplebond/}{#2}\unskip]%
+ {[\ignorespaces
+ \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}%
+ \unskip]%
\high{\doifnotXMLzero{cml-i}{charge}\CMLscript}}
{\countXMLRchild{atom}{\ignorespaces#2\unskip}%
\let\nofCMLatoms\nofXMLRchildren
- \ignorespaces\processXMLRchild{atom,bond/,%
- singlebond/,doublebond/,triplebond/}{#2}\unskip}%
+ \ignorespaces
+ \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}%
+ \unskip}%
\egroup}%
\ignorespaces}
@@ -174,7 +179,7 @@
{\def\CMLtopcaption{##2}%
\let\doCMLcaption\gobbletwoarguments}}
-\def\resetCMLcaption%
+\def\resetCMLcaption
{\let\CMLtopcaption\empty
\let\CMLbotcaption\empty
\let\doCMLcaption\dodoCMLcaption}
diff --git a/Master/texmf-dist/tex/context/base/xtag-ext.tex b/Master/texmf-dist/tex/context/base/xtag-ext.tex
index f20cc05a0e4..26dd70f2981 100644
--- a/Master/texmf-dist/tex/context/base/xtag-ext.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-ext.tex
@@ -36,8 +36,6 @@
%D When a \type {[+]} is specified, the mappings will
%D nest.
-\let\normal@@XMLelement\@@XMLelement
-
\def\resetXMLmapping
{\let\@@XMLelement\normal@@XMLelement
\let\@@XMLmapping\empty}
diff --git a/Master/texmf-dist/tex/context/base/xtag-ini.tex b/Master/texmf-dist/tex/context/base/xtag-ini.tex
index 7579898faa1..d7e01afd7d0 100644
--- a/Master/texmf-dist/tex/context/base/xtag-ini.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-ini.tex
@@ -16,9 +16,7 @@
%D Beware: don't rely on \longempty things, since this may
%D change!
-%D To be sure:
-
-\newif\ifprocessingXML
+% \newif\ifprocessingXML
\beginTEX
\writestatus{XML}{sorry, XML is only supported in (pdf)etex}
@@ -26,15 +24,10 @@
\endinput
\endTEX
-% to be moved
-
-\ifx\globalscratchtoks \undefined \newtoks \globalscratchtoks \fi
-\ifx\globalscratchdimen\undefined \newdimen\globalscratchdimen \fi
-
% tzt nog eens child grabber maken; mooier in mathml
%D This module is highly optimized for speed, which sometimes
-%D reads to rather unreadable code. Sorry for this.
+%D leads to rather unreadable code. Sorry for this.
\beginETEX XML
@@ -205,6 +198,8 @@
\fi
+\let\normal@@XMLelement\@@XMLelement % we may overload this one later inside a group
+
\newtoks\XMLtoks
\newtoks\XMLresetlist
@@ -244,152 +239,237 @@
% part of this should move to a low level module
-\bgroup
-\catcode`\*=\@@comment
-\catcode`\.=\@@escape
-.catcode`.B=.@@begingroup
-.catcode`.E=.@@endgroup
-.catcode`.P=.@@parameter
-
-.catcode`.&=.@@active * .xdef.letterampersand B.string&E
-.catcode`.<=.@@active * .xdef.letterless B.string<E
- * .xdef.lettermore B.string>E
-.catcode`.#=.@@active * .xdef.letterhash B.string#E
-.catcode`.$=.@@active * .xdef.letterdollar B.string$E
-.catcode`.%=.@@active * .xdef.letterpercent B.string%E
-.catcode`.\=.@@active * .xdef.letterbackslash B.string\E
-.catcode`.^=.@@active * .xdef.letterhat B.string^E
-.catcode`._=.@@active * .xdef.letterunderscore B.string_E
-.catcode`.{=.@@active * .xdef.letterbgroup B.string{E
-.catcode`.}=.@@active * .xdef.letteregroup B.string}E
-.catcode`.|=.@@active * .xdef.letterbar B.string|E
-.catcode`.~=.@@active * .xdef.lettertilde B.string~E
-
-.gdef.enableXMLexpansion
- B.def<B.doXMLelementE.let&=.doXMLentityE
-
-.gdef.disableXMLexpansion
- B.unexpanded.def<B.doXMLelementE.let&=.doXMLentityE
-
-* internally the # becomes two #'s (before expanding, during
-* the parsing stage) which is why we let the first # gobble
-* the second one
-*
-* since this only takes place when reading arguments, as in
-* \startXMLdata ... cum, suis, we can take place of it
-* there; this is needed because reading from file goes wrong
-* (eating up argument)
-
-.unexpanded.gdef.enableXML
- B.catcode`.!=.@@other
- .catcode`.?=.@@other
- .catcode`.:=.@@other * active in french
- .catcode`.;=.@@other * active in french
- .catcode`.&=.@@active
- .catcode`.<=.@@active
- .catcode`.>=.@@other
- .catcode`."=.@@other
- .catcode`./=.@@other
- .catcode`.'=.@@other
- .catcode`.~=.@@other
- .catcode`.#=.@@other
- .let &=.doXMLentity
- .unexpanded.def<B.doXMLelementE*
- .ifcase.XMLtokensreduction
- .entitleXMLescapetokens
- .or
- .reduceXMLescapetokens
- .else
- .ignoreXMLescapetokens
- .fi
- .processingXMLtrue
- .the.everyenableXML
- E
-
-.gdef.activateXMLescapetokens
- B.catcode`.$=.@@active
- .catcode`.%=.@@active
- .catcode`.\=.@@active
- .catcode`.^=.@@active
- .catcode`._=.@@active
- .catcode`.{=.@@active
- .catcode`.}=.@@active
- .catcode`.|=.@@active
- E
-
-* .gdef.entitleXMLescapetokens
-* B.activateXMLescapetokens
-* .def#B&tex-hash;E*
-* .def$B&tex-dollar;E*
-* .def%B&tex-percent;E*
-* .def\B&tex-backslash;E*
-* .def^B&tex-hat;E*
-* .def_B&tex-underscore;E*
-* .def{B&tex-leftbrace;E*
-* .def}B&tex-rightbrace;E*
-* .def|B&tex-bar;E*
-* E
-
-.xdef.entitleXMLescapetokens
- B.noexpand.activateXMLescapetokens
- .noexpand.def.noexpand#B.noexpand&.string#035;E*
- .noexpand.def.noexpand$B.noexpand&.string#036;E*
- .noexpand.def.noexpand%B.noexpand&.string#037;E*
- .noexpand.def.noexpand\B.noexpand&.string#092;E*
- .noexpand.def.noexpand^B.noexpand&.string#094;E*
- .noexpand.def.noexpand_B.noexpand&.string#095;E*
- .noexpand.def.noexpand{B.noexpand&.string#123;E*
- .noexpand.def.noexpand}B.noexpand&.string#125;E*
- .noexpand.def.noexpand|B.noexpand&.string#124;E*
- E
-
-.gdef.reduceXMLescapetokens
- B.activateXMLescapetokens
- .def#B.string#E*
- .def$B.string$E*
- .def%B.string%E*
- .def\B.string\E*
- .def^B.string^E*
- .def_B.string_E*
- .def{B.string{E*
- .def}B.string}E*
- .def|B.string|E*
- E
-
-.gdef.ignoreXMLescapetokens
- B.catcode`.$=.@@other
- .catcode`.%=.@@other
- .catcode`.\=.@@other
- .catcode`.^=.@@other
- .catcode`._=.@@other
- .catcode`.{=.@@other
- .catcode`.}=.@@other
- .catcode`.|=.@@other
- E
-
-* The following macro can be invokes when reading from
-* an auxiliary file.
-
-.unexpanded.gdef.enableXMLelements
- B.catcode60=.@@active * .catcode`.<=.@@active
- .catcode62=.@@other * .catcode`.>=.@@other
- .unexpanded.def<B.doXMLelementE*
- .processingXMLtrue
- E
-
-.unexpanded.gdef.disableXMLelements
- B.catcode60=.@@active * .catcode`.<=.@@active
- .catcode62=.@@other * .catcode`.>=.@@other
- .let<.relax * new
- .processingXMLfalse
- E
-
-.global.let<.relax * new
-.global.let&.relax * new
-
-.egroup
-
-\def\disableXML{\setnormalcatcodes\processingXMLfalse}
+% we predefine some macros, just to satisfy the dep parser
+
+\let\enableXMLexpansion \relax
+\let\disableXMLexpansion \relax
+\let\enableXML \relax
+\let\activateXMLescapetokens\relax
+\let\entitleXMLescapetokens \relax
+\let\reduceXMLescapetokens \relax
+\let\ignoreXMLescapetokens \relax
+\let\enableXMLelements \relax
+\let\disableXMLelements \relax
+
+% \bgroup
+% \catcode`\*=\@@comment
+% \catcode`\.=\@@escape
+% .catcode`.B=.@@begingroup
+% .catcode`.E=.@@endgroup
+% .catcode`.P=.@@parameter
+%
+% .catcode`.&=.@@active
+% .catcode`.<=.@@active
+%
+% .catcode`.#=.@@active
+% .catcode`.$=.@@active
+% .catcode`.%=.@@active
+% .catcode`.\=.@@active
+% .catcode`.^=.@@active
+% .catcode`._=.@@active
+% .catcode`.{=.@@active
+% .catcode`.}=.@@active
+% .catcode`.|=.@@active
+% .catcode`.~=.@@active
+%
+% .gdef.enableXMLexpansion
+% B.def<B.doXMLelementE.let&=.doXMLentityE
+%
+% .gdef.disableXMLexpansion
+% B.unexpanded.def<B.doXMLelementE.let&=.doXMLentityE
+%
+% * internally the # becomes two #'s (before expanding, during
+% * the parsing stage) which is why we let the first # gobble
+% * the second one
+% *
+% * since this only takes place when reading arguments, as in
+% * \startXMLdata ... cum, suis, we can take place of it
+% * there; this is needed because reading from file goes wrong
+% * (eating up argument)
+%
+% .unexpanded.gdef.enableXML
+% B.catcode`.!=.@@other
+% .catcode`.?=.@@other
+% .catcode`.:=.@@other * active in french
+% .catcode`.;=.@@other * active in french
+% .catcode`.&=.@@active
+% .catcode`.<=.@@active
+% .catcode`.>=.@@other
+% .catcode`."=.@@other
+% .catcode`./=.@@other
+% .catcode`.'=.@@other
+% .catcode`.~=.@@other
+% .catcode`.#=.@@other
+% .let &=.doXMLentity
+% .unexpanded.def<B.doXMLelementE*
+% .ifcase.XMLtokensreduction
+% .entitleXMLescapetokens
+% .or
+% .reduceXMLescapetokens
+% .else
+% .ignoreXMLescapetokens
+% .fi
+% .processingXMLtrue
+% .the.everyenableXML
+% E
+%
+% .gdef.activateXMLescapetokens
+% B.catcode`.$=.@@active
+% .catcode`.%=.@@active
+% .catcode`.\=.@@active
+% .catcode`.^=.@@active
+% .catcode`._=.@@active
+% .catcode`.{=.@@active
+% .catcode`.}=.@@active
+% .catcode`.|=.@@active
+% E
+%
+% .xdef.entitleXMLescapetokens
+% B.noexpand.activateXMLescapetokens
+% .noexpand.def.noexpand#B.noexpand&.string#035;E*
+% .noexpand.def.noexpand$B.noexpand&.string#036;E*
+% .noexpand.def.noexpand%B.noexpand&.string#037;E*
+% .noexpand.def.noexpand\B.noexpand&.string#092;E*
+% .noexpand.def.noexpand^B.noexpand&.string#094;E*
+% .noexpand.def.noexpand_B.noexpand&.string#095;E*
+% .noexpand.def.noexpand{B.noexpand&.string#123;E*
+% .noexpand.def.noexpand}B.noexpand&.string#125;E*
+% .noexpand.def.noexpand|B.noexpand&.string#124;E*
+% E
+%
+% .gdef.reduceXMLescapetokens
+% B.activateXMLescapetokens
+% .def#B.string#E*
+% .def$B.string$E*
+% .def%B.string%E*
+% .def\B.string\E*
+% .def^B.string^E*
+% .def_B.string_E*
+% .def{B.string{E*
+% .def}B.string}E*
+% .def|B.string|E*
+% E
+%
+% .gdef.ignoreXMLescapetokens
+% B.catcode`.$=.@@other
+% .catcode`.%=.@@other
+% .catcode`.\=.@@other
+% .catcode`.^=.@@other
+% .catcode`._=.@@other
+% .catcode`.{=.@@other
+% .catcode`.}=.@@other
+% .catcode`.|=.@@other
+% E
+%
+% * The following macro can be invokes when reading from
+% * an auxiliary file.
+%
+% .unexpanded.gdef.enableXMLelements
+% B.catcode60=.@@active * .catcode`.<=.@@active
+% .catcode62=.@@other * .catcode`.>=.@@other
+% .unexpanded.def<B.doXMLelementE*
+% .processingXMLtrue
+% E
+%
+% .unexpanded.gdef.disableXMLelements
+% B.catcode60=.@@active * .catcode`.<=.@@active
+% .catcode62=.@@other * .catcode`.>=.@@other
+% .let<.relax * new
+% .processingXMLfalse
+% E
+%
+% .global.let<.relax * new
+% .global.let&.relax * new
+%
+% .egroup
+%
+% \def\disableXML
+% {\setnormalcatcodes\processingXMLfalse}
+
+\letcatcodecommand\xmlcatcodesn `\& \doXMLentity
+\letcatcodecommand\xmlcatcodesn `\< \doXMLelement
+\letcatcodecommand\xmlcatcodese `\& \doXMLentity
+\letcatcodecommand\xmlcatcodese `\< \doXMLelement
+\letcatcodecommand\xmlcatcodesr `\& \doXMLentity
+\letcatcodecommand\xmlcatcodesr `\< \doXMLelement
+
+\letcatcodecommand\xmlcatcodesr `\# \letterhash
+\letcatcodecommand\xmlcatcodesr `\$ \letterdollar
+\letcatcodecommand\xmlcatcodesr `\% \letterpercent
+\letcatcodecommand\xmlcatcodesr `\\ \letterbackslash
+\letcatcodecommand\xmlcatcodesr `\^ \letterhat
+\letcatcodecommand\xmlcatcodesr `\_ \letterunderscore
+\letcatcodecommand\xmlcatcodesr `\{ \letterleftbrace
+\letcatcodecommand\xmlcatcodesr `\} \letterrightbrace
+\letcatcodecommand\xmlcatcodesr `\| \letterbar
+
+\bgroup \catcode`\&=13
+
+\xdef\entityhash {&\string#035;}
+\xdef\entitydollar {&\string#036;}
+\xdef\entitypercent {&\string#037;}
+\xdef\entitybackslash {&\string#092;}
+\xdef\entityhat {&\string#094;}
+\xdef\entityunderscore{&\string#095;}
+\xdef\entityleftbrace {&\string#123;}
+\xdef\entityrightbrace{&\string#125;}
+\xdef\entitybar {&\string#124;}
+
+\egroup
+
+\letcatcodecommand\xmlcatcodese `\# \entityhash
+\letcatcodecommand\xmlcatcodese `\$ \entitydollar
+\letcatcodecommand\xmlcatcodese `\% \entitypercent
+\letcatcodecommand\xmlcatcodese `\\ \entitybackslash
+\letcatcodecommand\xmlcatcodese `\^ \entityhat
+\letcatcodecommand\xmlcatcodese `\_ \entityunderscore
+\letcatcodecommand\xmlcatcodese `\{ \entityleftbrace
+\letcatcodecommand\xmlcatcodese `\} \entityrightbrace
+\letcatcodecommand\xmlcatcodese `\| \entitybar
+
+% we speed things up by explicitly setting the active char's < &
+
+\bgroup \catcode`\<=13 \catcode`\&=13
+
+\gdef\enableXML
+ {\ifcase\XMLtokensreduction
+ \setcatcodetable\xmlcatcodese \or
+ \setcatcodetable\xmlcatcodesr \else
+ \setcatcodetable\xmlcatcodesn
+ \fi
+ \let&\doXMLentity
+ \unexpanded\def<{\doXMLelement}%
+ \processingXMLtrue
+ \the\everyenableXML}
+
+\gdef\disableXML
+ {\setcatcodetable\ctxcatcodes % maybe \texcatcodes
+ \processingXMLfalse}
+
+\gdef\enableXMLexpansion
+ {\def<{\doXMLelement}%
+ \let&\doXMLentity}
+
+\gdef\disableXMLexpansion
+ {\unexpanded\def<{\doXMLelement}%
+ \let&\doXMLentity}
+
+\unexpanded\gdef\enableXMLelements
+ {\catcode60=\@@active
+ \catcode62=\@@other
+ \unexpanded\def<{\doXMLelement}%
+ \processingXMLtrue}
+
+\unexpanded\gdef\disableXMLelements
+ {\catcode60=\@@active
+ \catcode62=\@@other
+ \let<\relax
+ \processingXMLfalse}
+
+\global\let<\relax
+\global\let&\relax
+
+\egroup
%D An element can be singular or paired. A singular element is
%D called an empty element. The following definitions are
@@ -1419,24 +1499,10 @@
% maybe some day global handling here as well
\fi}
-% \def\dosetXMLattributeC#1%
-% {\ifx\@@XMLspac\originalXMLnamespace
-% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname{#1}%
-% \else
-% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLspac:\@@XMLname\endcsname{#1}%
-% \fi}
-
\def\dosetXMLattributeC
{\@EA\def\csname\@@XMLvariable:\@@XMLclass\ifx\@@XMLspac
\originalXMLnamespace\else:\@@XMLspac\fi:\@@XMLname\endcsname}
-% \def\dosetXMLattributeD#1%
-% {\ifx\@@XMLspac\originalXMLnamespace
-% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\currentXMLnamespace:\@@XMLname\endcsname{#1}%
-% \else
-% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLspac:\@@XMLname\endcsname{#1}%
-% \fi}
-
\def\dosetXMLattributeD
{\@EA\def\csname\@@XMLvariable:\@@XMLclass:\ifx\@@XMLspac
\originalXMLnamespace\currentXMLnamespace\else\@@XMLspac\fi:\@@XMLname\endcsname}
@@ -2009,7 +2075,7 @@
% \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}}
\long\def\setXMLarguments#1#2#3% element [tag] settings
- {\doifassignmentelse{#2}
+ {\doifassignmentelse{#2} % ROOM FOR OPTIMIZATION
{\letbeundefined{\@@XMLmap:#1}%
\long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}}
{\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name
@@ -2575,6 +2641,27 @@
\let\doifXMLparelse\doifXMLvarelse
\let\doifXMLpar \doifXMLvar
+%D Used in x-fo: I really need to document this!
+
+\bgroup \catcode`\<=\active
+
+% usage: \expanded{\rescanXMLatttributes{fo:table-cell}}
+
+\gdef\rescanXMLattributes #1{\noexpand\dogetXMLarguments{#1}\currentXMLarguments>}
+\gdef\parseXMLattributes #1#2{\dogetXMLarguments{#1}#2>}
+
+\egroup
+
+\def\defXMLattributestring#1#2#3#4%
+ {\ifcsname\@@XMLvariable:#2:#3\endcsname
+ \@EA\convertcommand\csname\@@XMLvariable:#2:#3\endcsname\to#1%
+ \else
+ \convertargument#4\to#1%
+ \fi}
+
+\def\XMLprocess#1%
+ {\begingroup\enableXML\XMLflush{#1}\endgroup}
+
\bgroup \catcode`<=\@@active
\long\gdef\ignoreuntilXMLelement#1<{<}
diff --git a/Master/texmf-dist/tex/context/base/xtag-map.tex b/Master/texmf-dist/tex/context/base/xtag-map.tex
index 6cd73442f57..28aabc4887f 100644
--- a/Master/texmf-dist/tex/context/base/xtag-map.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-map.tex
@@ -436,7 +436,7 @@
\let\parseXMLelement\remapXMLelement
\else
% here we need to get rid of the namespace; we also
- % have to preserve the leaqding / if present
+ % have to preserve the leading / if present
\@EA\long\@EA\def\@EA\parseXMLelement\@EA
##\@EA1\currentXMLnamespace:{\remapXMLelement##1}%
% ##2 removes leading spaces
@@ -456,10 +456,10 @@
\catcode`\^^M=\@@space
\catcode`\^^L=\@@space
\catcode`\^^Z=\@@space
-\pushmacro\unicodechar
-\let\unicodechar\relax
+ \pushmacro\unicodechar
+ \let\unicodechar\relax
\xdef\remappedXMLdata{#4\empty}%
-\popmacro\unicodechar
+ \popmacro\unicodechar
\let\par\endgraf
\popmacro\doXMLentity % needed ?
\disableXMLexpansion
diff --git a/Master/texmf-dist/tex/context/base/xtag-mml.tex b/Master/texmf-dist/tex/context/base/xtag-mml.tex
index f2279c4f57f..ce51bffb233 100644
--- a/Master/texmf-dist/tex/context/base/xtag-mml.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-mml.tex
@@ -444,13 +444,8 @@
\defineXMLentity [lparent] {\getXMLentity{lparenthesis}}
\defineXMLentity [rparent] {\getXMLentity{rparenthesis}}
-\bgroup
-\catcode`\{=12 \doglobal\convertargument{\to\mmllbrace
-\catcode`\}=12 \doglobal\convertargument}\to\mmlrbrace
-\egroup
-
-\@EA \defineXMLentity \@EA [\mmllbrace] {\getXMLentity{lbrace}}
-\@EA \defineXMLentity \@EA [\mmlrbrace] {\getXMLentity{rbrace}}
+\defineXMLentity [\letterleftbrace ] {\getXMLentity{lbrace}}
+\defineXMLentity [\letterrightbrace] {\getXMLentity{rbrace}}
\defineXMLentity [{[}] {\getXMLentity{lbracket}}
\defineXMLentity [{]}] {\getXMLentity{rbracket}}
diff --git a/Master/texmf-dist/tex/context/base/xtag-mmp.tex b/Master/texmf-dist/tex/context/base/xtag-mmp.tex
index b733644e5fe..3108191a0c8 100644
--- a/Master/texmf-dist/tex/context/base/xtag-mmp.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-mmp.tex
@@ -338,12 +338,12 @@
\def\MMLpTABLEmapper#1#2#3%
{\doifXMLparelse{mtable}{#1}
{\newcounter\MMLcounter
- \def\docommando##1%
+ \def\docommand##1%
{\increment\MMLcounter
\let\MMLpREMAP\doMMLpREMAP
\def\MMLsetting{##1}#3% remap list
\expanded{\setupTABLE[column][\MMLcounter][#2=\MMLsetting]}}%
- \expanded{\processseparatedlist[\XMLpar{mtable}{#1}{}][ ]\noexpand\docommando}}
+ \expanded{\processseparatedlist[\XMLpar{mtable}{#1}{}][ ]\noexpand\docommand}}
{}}
\def\MMLpTABLEmap#1#2#3%
diff --git a/Master/texmf-dist/tex/context/base/xtag-pre.tex b/Master/texmf-dist/tex/context/base/xtag-pre.tex
index da720bbc77c..5a1d7fa9718 100644
--- a/Master/texmf-dist/tex/context/base/xtag-pre.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-pre.tex
@@ -199,8 +199,8 @@
{#1} % {\externalfigure[#1]}
\def\dohandleXMLentityDEFINE#1 %#2 #3 #4 #5 #6>% name replacement
- {\def\docommando##1>{\expanded{\defineXMLentity[#1]{\the\scratchtoks}}}%
- \afterassignment\docommando\grabstring}
+ {\def\docommand##1>{\expanded{\defineXMLentity[#1]{\the\scratchtoks}}}%
+ \afterassignment\docommand\grabstring}
%D Such entities can be encapsulated in a \type {DOCTYPE}
%D element. Therefore we remove the outer level of document
diff --git a/Master/texmf-dist/tex/context/base/xtag-run.tex b/Master/texmf-dist/tex/context/base/xtag-run.tex
index face9f0b0b3..2691e8dff57 100644
--- a/Master/texmf-dist/tex/context/base/xtag-run.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-run.tex
@@ -169,8 +169,8 @@
\gdef\someXMLline{\par\@XMLlevel+\@XMLelement1\par\@XMLlevel-}
\gdef\setXMLshow#1#2#3[#4]%
- {\def\docommando##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}%
- \processcommalist[#4]\docommando}
+ {\def\docommand##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}%
+ \processcommalist[#4]\docommand}
\gdef\showXMLign[#1]%
{\setXMLshow\defineXMLignore \relax\relax[#1]%
@@ -200,8 +200,8 @@
{\setXMLshow\defineXMLsingular\someXMLword\relax[#1]}
\gdef\showXMLbreak[#1]%
- {\def\docommando##1{\setvalue{\@@XMLshow::##1}{\hskip\zeropoint}}%
- \processcommalist[#1]\docommando}
+ {\def\docommand##1{\setvalue{\@@XMLshow::##1}{\hskip\zeropoint}}%
+ \processcommalist[#1]\docommand}
\gdef\doautoshowXMLelement
{\ifcase\kindofXMLelement
diff --git a/Master/texmf-dist/tex/context/base/xtag-xsl.tex b/Master/texmf-dist/tex/context/base/xtag-xsl.tex
index 7981524d15d..3ad096c280a 100644
--- a/Master/texmf-dist/tex/context/base/xtag-xsl.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-xsl.tex
@@ -90,8 +90,8 @@
\let\doXSLTscript\donormalXSLTscript
\presetXSLTcharacters
\donefalse
- \def\docommando##1{\dodoapplyXSLTscript{##1}{\ifdone#3\else#2\fi}{#3}\donetrue}%
- \processcommalist[#1]\docommando
+ \def\docommand##1{\dodoapplyXSLTscript{##1}{\ifdone#3\else#2\fi}{#3}\donetrue}%
+ \processcommalist[#1]\docommand
\egroup
\else
\applyXSLTscript[#1][#2][#2]%
@@ -106,7 +106,7 @@
\doifundefined{\??xl#1}%
{\writestatus{XSLT}{unknown script #1}}
{\writestatus{XSLT}{convert #2 into #3 using #1}%
- \edef\par{\rawcharacter{10}}%
+ \edef\par{\outputnewlinechar}%
\edef\!!stringc{\getvalue{\??xl#1}}%
\immediate\openout\scratchwrite=\XSLTscriptfile.xsl
\immediate\write\scratchwrite{\!!stringc}%
diff --git a/Master/texmf-dist/tex/context/bib/bibl-apa-de.tex b/Master/texmf-dist/tex/context/bib/bibl-apa-de.tex
index 8ab1f48ff81..8f8be59fbbf 100644
--- a/Master/texmf-dist/tex/context/bib/bibl-apa-de.tex
+++ b/Master/texmf-dist/tex/context/bib/bibl-apa-de.tex
@@ -1,8 +1,6 @@
-% Test! Noch nicht übersetzt:
-% masters thesis
%D \module
-%D [ file=bibl-apa,
-%D version=2004.7.16,
+%D [ file=bibl-apa-de,
+%D version=2006.9.12,
%D title=APA bibliography style,
%D subtitle=Publications,
%D author={Taco Hoekwater},
@@ -340,7 +338,7 @@
\insertauthors{}{ }{}%
\insertpubyear{(}{). }{}%
\inserttitle{\bgroup }{\egroup \insertseries{ (}{)}{}. }{}%
- \insertbibtype{}{, }{Master's thesis, }%
+ \insertbibtype{}{, }{Masterarbeit, }%
\insertpublisher{}{. }{}%
\insertpages{}{S. }{}%
\insertnote{ }{.}{}%
diff --git a/Master/texmf-dist/tex/context/bib/t-bib.tex b/Master/texmf-dist/tex/context/bib/t-bib.tex
index 3c17a52b756..46bd82a94ec 100644
--- a/Master/texmf-dist/tex/context/bib/t-bib.tex
+++ b/Master/texmf-dist/tex/context/bib/t-bib.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-bib,
-%D version=2006.08.08,
+%D version=2006.11.05,
%D title=\CONTEXT\ Publication Module,
%D subtitle=Publications,
%D author=Taco Hoekwater,
@@ -93,6 +93,19 @@
%D \item the constants \type{sorttype}, \type{compress} and
%D \type{autohang} have moved to the core (8/8/2006)
%D \item bibtex is now registered as a program to be run by texexec (8/8/2006)
+%D \item fix a bug in \type{\setupcite[authoretallimit=1]} (9/8/2006)
+%D \item fix a bug inside citations that prevented lastpubsep from ever being
+%D used due to a volatile \type{\commalistsize} (25/8/2006).
+%D \item added the possibility of \type{\placepublications[option=continue]}
+%D (6/9/2006)
+%D \item Mojca translated Master's Thesis to Masterarbeit (bibl-apa-de.tex)
+%D (12/9/2006)
+%D \item Added \type{\setuppublicationlist[maybeyear=off]} by request from
+%D Thomas Schmitz (15/9/2006)
+%D \item Removed some spurious spaces pointed out by willi egger (19/9/2006)
+%D \item Add configuration of bibtex executable name (4/11/2006)
+%D \item Fix numbering=short and numbering=bib (spotted by Matthias Wächter) (4/11/2006)
+%D \item third attempt to get a correct release (5/11/2006)
%D \stopitemize
%D
%D \subject{WISHLIST}
@@ -281,7 +294,7 @@
\def\dosetupbibtex[#1]%
{\let\@@pbdatabase\empty
\let\@@pbsort \empty
- \getparameters[\??pb][#1]
+ \getparameters[\??pb][#1]%
\expanded{\processaction[\@@pbsort]}
[ \v!no=>\def\bibstyle{cont-no},
\v!author=>\def\bibstyle{cont-au},
@@ -291,6 +304,8 @@
\s!unknown=>\def\bibstyle{cont-no}]%
\ifx\@@pbdatabase\empty\else \writeauxfile \fi}
+\dosetupbibtex[bibtex=bibtex]
+
%D \macros{writeauxfile}
%D
%D Unfortunately, \BIBTEX\ is not the best configurable program
@@ -319,7 +334,7 @@
\write \scratchwrite {\string\bibdata{\@@pbdatabase}}%
\closeout\scratchwrite
\showmessage\m!bib{3}{}%
- \installprogram{bibtex \jobname}}}
+ \expanded{\installprogram{\@@pbbibtex\space\jobname}}}}
%D \macros{ifsortbycite,iftypesetall,ifautohang,ifbibcitecompress}
%D
@@ -910,18 +925,45 @@
\fi\fi
\edef\samplewidth{\the\wd\scratchbox}%
\setuplist[pubs][\c!width=\samplewidth,\c!distance=0pt]%
- \def\@@pblimitednumber##1{\hbox to \samplewidth{\@@pbnumbercommand{##1}}}%
+ \ifx\@@pbnumbering\v!short
+ \def\@@pblimitednumber##1{\hbox to \samplewidth
+ {\@@pbnumbercommand{\getvalue{pbds-\@@pbk}}}}%
+ \else \ifx \@@pbnumbering\v!bib
+ \def\@@pblimitednumber##1{\hbox to \samplewidth
+ {\@@pbnumbercommand{\getvalue{pbdn-\@@pbk}}}}%
+ \else
+ \def\@@pblimitednumber##1{\hbox to \samplewidth{\@@pbnumbercommand{##1}}}%
+ \fi \fi
\else
+ \ifx\@@pbnumbering\v!short
\doifemptyelse
{\getvalue{\??li pubs\c!width}}
- {\def\@@pblimitednumber##1{\hbox{\@@pbnumbercommand{##1}}}}%
- {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}{\@@pbnumbercommand{##1}}}}%
+ {\def\@@pblimitednumber##1{\hbox
+ {\@@pbnumbercommand{\getvalue{pbds-\@@pbk}}}}}%
+ {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}%
+ {\@@pbnumbercommand{\getvalue{pbds-\@@pbk}}}}}%
+ \else \ifx \@@pbnumbering\v!bib
+ \doifemptyelse
+ {\getvalue{\??li pubs\c!width}}
+ {\def\@@pblimitednumber##1{\hbox
+ {\@@pbnumbercommand{\getvalue{pbdn-\@@pbk}}}}}%
+ {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}%
+ {\@@pbnumbercommand{\getvalue{pbdn-\@@pbk}}}}}%
+ \else
+ \doifemptyelse
+ {\getvalue{\??li pubs\c!width}}
+ {\def\@@pblimitednumber##1{\hbox{\@@pbnumbercommand{##1}}}}%
+ {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}{\@@pbnumbercommand{##1}}}}%
+ \fi
+ \fi
\fi
\ifx\@@pbnumbering\v!no
- \setuplist[pubs][\c!numbercommand=,\c!symbol=\v!none,\c!textcommand=\outdented]
+ \setuplist[pubs][\c!numbercommand=,\c!symbol=\v!none,\c!textcommand=\outdented]%
\else
\setuplist[pubs][\c!numbercommand=\@@pblimitednumber]%
\fi
+ \doifelsevalue
+ {\??pv datamaybeyear}{\v!off}{\def\maybeyear##1{}}{\def\maybeyear##1{##1}}%
\forgetall % bugfix 2005/03/18
}
@@ -962,12 +1004,15 @@
\def\doplacepublications[#1]%
{%\getparameters[\??pv data][#1]
\begingroup
- \setuplist[pubs][\c!criterium=\v!previous,#1]
+ \setuplist[pubs][\c!criterium=\v!previous,#1]%
\dodoplacepublications }%
\def\dodoplacepublications%
{\initializepubslist
- \global\let\bibcounter\!!zerocount
+ \doifelsevalue
+ {\??li pubs\c!option}{\v!continue}%
+ {}%
+ {\global\let\bibcounter\!!zerocount }%
\inpublisttrue
\typesetpubslist
\inpublistfalse
@@ -979,14 +1024,22 @@
\unexpanded\def\typesetapublication#1%
{\doifsomething{#1}{\doglobal\increment\bibcounter
- \dodolistelement{pubs}{}{\bibcounter}%
- {\expanded{\reference[\bibrefprefix#1]{\bibcounter}}%
- \strut \dotypesetapublication{#1}\strut }{}{}}}
+ \bgroup
+ \makepbkvalue{#1}%
+ \ifgridsnapping
+ \snaptogrid\vbox{\dodolistelement{pubs}{}{\bibcounter}%
+ {\expanded{\reference[\bibrefprefix#1]{\bibcounter}}%
+ \strut \dotypesetapublication{#1}\strut }{}{}}%
+ \else
+ \dodolistelement{pubs}{}{\bibcounter}%
+ {\expanded{\reference[\bibrefprefix#1]{\bibcounter}}%
+ \strut \dotypesetapublication{#1}\strut }{}{}%
+ \fi
+ \egroup }}
\def\dotypesetapublication#1%
{\bgroup
\def\@@currentalternative{data}%
- \makepbkvalue{#1}%
\processcommacommand[\bibcommandlist,crossref]\clearbibitem
\processcommalist [artauthor,author,editor]\clearbibitemtwo
\processcommacommand[\bibcommandlist]\bibitemdefs
@@ -1223,6 +1276,7 @@
\def\dobibauthoryear
{\scratchcounter\zerocount
\getcommacommandsize[\thebibauthors]%
+ \edef\authorcount{\commalistsize}%
\@EA\processcommalist\@EA[\thebibauthors]\dodobibauthoryear}
\def\dodobibauthoryear#1%
@@ -1233,7 +1287,7 @@
\setcurrentbibauthor{#1}%
\ifnum\scratchcounter=\plusone
\ixfirstcommand
- \else\ifnum \scratchcounter=\commalistsize\relax
+ \else\ifnum \scratchcounter=\authorcount\relax
\ixlastcommand
\else
\ixsecondcommand
@@ -1254,12 +1308,20 @@
\fi }
+%D This discovery of authoretallimit is not the best one,
+%D but it will do for now.
+
\def\docurrentbibauthor#1,#2%
{\doifemptyelse{#2}
{\def\currentbibauthor{#1\bibalternative{otherstext}}}
- {\edef\currentbibauthor{#1%
- \ifcase0\bibalternative{authoretallimit}\relax\or
- \bibalternative{otherstext}\else \bibalternative{andtext}#2\fi}}}
+ {\@EA
+ \ifx\csname \??pv\@@currentalternative authoretallimit\endcsname\relax
+ \edef\currentbibauthor{#1\bibalternative{andtext}#2}%
+ \else
+ \edef\currentbibauthor{#1%
+ \ifcase0\bibalternative{authoretallimit}\relax\or
+ \bibalternative{otherstext}\else\bibalternative{andtext}#2\fi}%
+ \fi}}
%D This is not the one Hans made for me, because I need a global
%D edef, and the \type{\robustdoifinsetelse} doesn't listen to
@@ -1701,7 +1763,7 @@
%D \type{\citeasnoun}.
\def\bibauthornumref[#1]%
- {\getcommalistsize[#1]
+ {\getcommalistsize[#1]%
\global\bibitemcounter\commalistsize
\firstreftrue
\processcommalist[#1]\dobibauthornumref }
diff --git a/Master/texmf-dist/tex/context/config/cont-usr.tex b/Master/texmf-dist/tex/context/config/cont-usr.tex
index 67a3f4d37fa..ee0627836c1 100644
--- a/Master/texmf-dist/tex/context/config/cont-usr.tex
+++ b/Master/texmf-dist/tex/context/config/cont-usr.tex
@@ -91,7 +91,9 @@
%D In some languages, compound characters, like \type {"e}
%D are used to get accented and non latin characters.
- \useencoding[fde] % german
+% Per 21/9/2006 one needs to explicitly enable this.
+
+% \useencoding[fde] % german
% \useencoding[ffr] % french
% \useencoding[fro] % romanian
% \useencoding[fpl] % polish
diff --git a/Master/texmf-dist/tex/context/interface/cont-cz.xml b/Master/texmf-dist/tex/context/interface/cont-cz.xml
index 50e15bb31b0..8ec1415b9b5 100644
--- a/Master/texmf-dist/tex/context/interface/cont-cz.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-cz.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="datum"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="cislostranky"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="datum"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="cislostranky"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="marginalie"/>
+ <cd:constant type="hrana"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="vrsek"/>
+ <cd:constant type="zahlavi"/>
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="upati"/>
+ <cd:constant type="spodek"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="vrsek"/>
<cd:constant type="nastred"/>
<cd:constant type="spodek"/>
+ <cd:constant type="drzet"/>
</cd:parameter>
<cd:parameter name="volba">
<cd:constant type="zadny"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="foregroundstyle">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="tloustkalinky">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="hrana"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="hrana"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="hrana"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="hrana"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="hrana"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="settextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definujznaceni"/>
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="ukazmrizku"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="reset"/>
+ <cd:constant type="vrsek"/>
+ <cd:constant type="spodek"/>
+ <cd:constant type="zadny"/>
+ <cd:constant type="vse"/>
+ <cd:constant type="radky"/>
+ <cd:constant type="ramecek"/>
+ <cd:constant type="nonumber"/>
+ <cd:constant type="vpravo"/>
+ <cd:constant type="vlevo"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="vysoko"/>
<cd:constant type="nizko"/>
<cd:constant type="nastred"/>
+ <cd:constant type="vlevo"/>
+ <cd:constant type="nastred"/>
+ <cd:constant type="vpravo"/>
+ <cd:constant type="lefthanging"/>
+ <cd:constant type="righthanging"/>
+ <cd:constant type="levyokraj"/>
+ <cd:constant type="pravyokraj"/>
+ <cd:constant type="innermargin"/>
+ <cd:constant type="outermargin"/>
</cd:parameter>
<cd:parameter name="sirka">
<cd:constant type="prizpusobive"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="ano"/>
<cd:constant type="ne"/>
</cd:parameter>
+ <cd:parameter name="zarovnani">
+ <cd:constant type="flushleft"/>
+ <cd:constant type="flushright"/>
+ <cd:constant type="nastred"/>
+ <cd:constant type="center"/>
+ </cd:parameter>
<cd:parameter name="levyokraj">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="otoceno"/>
<cd:constant type="dvoustranny"/>
<cd:constant type="negativ"/>
+ <cd:constant type="pozadi"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/cont-de.xml b/Master/texmf-dist/tex/context/interface/cont-de.xml
index 21221582c7a..2268f5418ee 100644
--- a/Master/texmf-dist/tex/context/interface/cont-de.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-de.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="datum"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="seitennummer"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="datum"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="seitennummer"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="marginalie"/>
+ <cd:constant type="kante"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="oben"/>
+ <cd:constant type="kopfzeile"/>
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="fusszeile"/>
+ <cd:constant type="unten"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="oben"/>
<cd:constant type="mittig"/>
<cd:constant type="unten"/>
+ <cd:constant type="behalte"/>
</cd:parameter>
<cd:parameter name="option">
<cd:constant type="kein"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="foregroundstyle">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="liniendicke">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="kante"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="kante"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="kante"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="kante"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marginalie"/>
- <cd:constant type="kante"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="settext"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definierebeschriftung"/>
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="zeigegitter"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="zuruecksetzten"/>
+ <cd:constant type="oben"/>
+ <cd:constant type="unten"/>
+ <cd:constant type="kein"/>
+ <cd:constant type="alles"/>
+ <cd:constant type="zeilen"/>
+ <cd:constant type="rahmen"/>
+ <cd:constant type="nonumber"/>
+ <cd:constant type="rechts"/>
+ <cd:constant type="links"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="hoch"/>
<cd:constant type="tief"/>
<cd:constant type="mittig"/>
+ <cd:constant type="links"/>
+ <cd:constant type="mittig"/>
+ <cd:constant type="rechts"/>
+ <cd:constant type="lefthanging"/>
+ <cd:constant type="righthanging"/>
+ <cd:constant type="linkerrand"/>
+ <cd:constant type="rechterrand"/>
+ <cd:constant type="innermargin"/>
+ <cd:constant type="outermargin"/>
</cd:parameter>
<cd:parameter name="breite">
<cd:constant type="passend"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="ja"/>
<cd:constant type="nein"/>
</cd:parameter>
+ <cd:parameter name="ausrichtung">
+ <cd:constant type="flushleft"/>
+ <cd:constant type="flushright"/>
+ <cd:constant type="mittig"/>
+ <cd:constant type="center"/>
+ </cd:parameter>
<cd:parameter name="linkerrand">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="gedreht"/>
<cd:constant type="doppelseitig"/>
<cd:constant type="negativ"/>
+ <cd:constant type="hintergrund"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/cont-en.xml b/Master/texmf-dist/tex/context/interface/cont-en.xml
index b44992b8fa8..45ddc571830 100644
--- a/Master/texmf-dist/tex/context/interface/cont-en.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-en.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="date"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="pagenumber"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="date"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="pagenumber"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="margin"/>
+ <cd:constant type="edge"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="top"/>
+ <cd:constant type="header"/>
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="footer"/>
+ <cd:constant type="bottom"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="top"/>
<cd:constant type="middle"/>
<cd:constant type="bottom"/>
+ <cd:constant type="keep"/>
</cd:parameter>
<cd:parameter name="option">
<cd:constant type="none"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="foregroundstyle">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="rulethickness">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margin"/>
- <cd:constant type="edge"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margin"/>
- <cd:constant type="edge"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margin"/>
- <cd:constant type="edge"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margin"/>
- <cd:constant type="edge"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margin"/>
- <cd:constant type="edge"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="settextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definemarking"/>
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="showgrid"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="reset"/>
+ <cd:constant type="top"/>
+ <cd:constant type="bottom"/>
+ <cd:constant type="none"/>
+ <cd:constant type="all"/>
+ <cd:constant type="lines"/>
+ <cd:constant type="frame"/>
+ <cd:constant type="nonumber"/>
+ <cd:constant type="right"/>
+ <cd:constant type="left"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="high"/>
<cd:constant type="low"/>
<cd:constant type="middle"/>
+ <cd:constant type="left"/>
+ <cd:constant type="middle"/>
+ <cd:constant type="right"/>
+ <cd:constant type="lefthanging"/>
+ <cd:constant type="righthanging"/>
+ <cd:constant type="leftmargin"/>
+ <cd:constant type="rightmargin"/>
+ <cd:constant type="innermargin"/>
+ <cd:constant type="outermargin"/>
</cd:parameter>
<cd:parameter name="width">
<cd:constant type="fit"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="yes"/>
<cd:constant type="no"/>
</cd:parameter>
+ <cd:parameter name="align">
+ <cd:constant type="flushleft"/>
+ <cd:constant type="flushright"/>
+ <cd:constant type="middle"/>
+ <cd:constant type="center"/>
+ </cd:parameter>
<cd:parameter name="leftmargin">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="rotated"/>
<cd:constant type="doublesided"/>
<cd:constant type="negative"/>
+ <cd:constant type="background"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/cont-fr.xml b/Master/texmf-dist/tex/context/interface/cont-fr.xml
index 4cacc10a502..04c9b4692e3 100644
--- a/Master/texmf-dist/tex/context/interface/cont-fr.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-fr.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="date"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="numeropage"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="date"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="numeropage"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="texte" default="yes"/>
+ <cd:constant type="marge"/>
+ <cd:constant type="bord"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="sup"/>
+ <cd:constant type="entete"/>
+ <cd:constant type="texte" default="yes"/>
+ <cd:constant type="pdp"/>
+ <cd:constant type="inf"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="sup"/>
<cd:constant type="milieu"/>
<cd:constant type="inf"/>
+ <cd:constant type="maintient"/>
</cd:parameter>
<cd:parameter name="option">
<cd:constant type="rien"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="stylepremierplan">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="epaisseurligne">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="bord"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="bord"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="bord"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="bord"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="bord"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="settext"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definitmarquage"/>
@@ -3636,7 +3686,7 @@
<cd:parameter name="inf">
<cd:constant type="cd:dimension"/>
</cd:parameter>
- <cd:parameter name="brodgauche">
+ <cd:parameter name="bordgauche">
<cd:constant type="cd:dimension"/>
</cd:parameter>
<cd:parameter name="borddroit">
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="montregrille"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="raz"/>
+ <cd:constant type="sup"/>
+ <cd:constant type="inf"/>
+ <cd:constant type="rien"/>
+ <cd:constant type="tout"/>
+ <cd:constant type="lignes"/>
+ <cd:constant type="cadre"/>
+ <cd:constant type="sansnumero"/>
+ <cd:constant type="droite"/>
+ <cd:constant type="gauche"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="haut"/>
<cd:constant type="bas"/>
<cd:constant type="milieu"/>
+ <cd:constant type="gauche"/>
+ <cd:constant type="milieu"/>
+ <cd:constant type="droite"/>
+ <cd:constant type="lefthanging"/>
+ <cd:constant type="righthanging"/>
+ <cd:constant type="margegauche"/>
+ <cd:constant type="margedroite"/>
+ <cd:constant type="margeinterieure"/>
+ <cd:constant type="margeexterieure"/>
</cd:parameter>
<cd:parameter name="largeur">
<cd:constant type="adapte"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="oui"/>
<cd:constant type="non"/>
</cd:parameter>
+ <cd:parameter name="alignement">
+ <cd:constant type="flushleft"/>
+ <cd:constant type="flushright"/>
+ <cd:constant type="milieu"/>
+ <cd:constant type="center"/>
+ </cd:parameter>
<cd:parameter name="margegauche">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="tourne"/>
<cd:constant type="rectoverso"/>
<cd:constant type="negatif"/>
+ <cd:constant type="arriereplan"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/cont-it.xml b/Master/texmf-dist/tex/context/interface/cont-it.xml
index d69165d5234..25a2c03566a 100644
--- a/Master/texmf-dist/tex/context/interface/cont-it.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-it.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="data"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="numeropagina"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="data"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="numeropagina"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="testo" default="yes"/>
+ <cd:constant type="margine"/>
+ <cd:constant type="bordo"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="cima"/>
+ <cd:constant type="intestazione"/>
+ <cd:constant type="testo" default="yes"/>
+ <cd:constant type="piedipagina"/>
+ <cd:constant type="fondo"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="cima"/>
<cd:constant type="centro"/>
<cd:constant type="fondo"/>
+ <cd:constant type="mantieni"/>
</cd:parameter>
<cd:parameter name="opzione">
<cd:constant type="nessuno"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="foregroundstyle">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="spessorelinea">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordo"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordo"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordo"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordo"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordo"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="settext"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definiscimarcatura"/>
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="mostragriglia"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="reimposta"/>
+ <cd:constant type="cima"/>
+ <cd:constant type="fondo"/>
+ <cd:constant type="nessuno"/>
+ <cd:constant type="tutti"/>
+ <cd:constant type="righe"/>
+ <cd:constant type="cornice"/>
+ <cd:constant type="nonumber"/>
+ <cd:constant type="destra"/>
+ <cd:constant type="sinistra"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="alto"/>
<cd:constant type="basso"/>
<cd:constant type="centro"/>
+ <cd:constant type="sinistra"/>
+ <cd:constant type="centro"/>
+ <cd:constant type="destra"/>
+ <cd:constant type="lefthanging"/>
+ <cd:constant type="righthanging"/>
+ <cd:constant type="marginesinistro"/>
+ <cd:constant type="marginedestro"/>
+ <cd:constant type="margineinterno"/>
+ <cd:constant type="margineesterno"/>
</cd:parameter>
<cd:parameter name="ampiezza">
<cd:constant type="adatta"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="si"/>
<cd:constant type="no"/>
</cd:parameter>
+ <cd:parameter name="allinea">
+ <cd:constant type="flushleft"/>
+ <cd:constant type="flushright"/>
+ <cd:constant type="centro"/>
+ <cd:constant type="center"/>
+ </cd:parameter>
<cd:parameter name="marginesinistro">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="ruotato"/>
<cd:constant type="doppiafaccia"/>
<cd:constant type="negativo"/>
+ <cd:constant type="sfondo"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/cont-nl.xml b/Master/texmf-dist/tex/context/interface/cont-nl.xml
index b75ad033b92..e8e3f067bd5 100644
--- a/Master/texmf-dist/tex/context/interface/cont-nl.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-nl.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="datum"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="paginanummer"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="datum"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="paginanummer"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="tekst" default="yes"/>
+ <cd:constant type="marge"/>
+ <cd:constant type="rand"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="boven"/>
+ <cd:constant type="hoofd"/>
+ <cd:constant type="tekst" default="yes"/>
+ <cd:constant type="voet"/>
+ <cd:constant type="onder"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="boven"/>
<cd:constant type="midden"/>
<cd:constant type="onder"/>
+ <cd:constant type="handhaaf"/>
</cd:parameter>
<cd:parameter name="optie">
<cd:constant type="geen"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="voorgrondletter">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="lijndikte">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="rand"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="rand"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="rand"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="rand"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="marge"/>
- <cd:constant type="rand"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="steltekstinhoudin"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definieermarkering"/>
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="toongrid"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="reset"/>
+ <cd:constant type="boven"/>
+ <cd:constant type="onder"/>
+ <cd:constant type="geen"/>
+ <cd:constant type="alles"/>
+ <cd:constant type="regels"/>
+ <cd:constant type="kader"/>
+ <cd:constant type="geennummer"/>
+ <cd:constant type="rechts"/>
+ <cd:constant type="links"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="hoog"/>
<cd:constant type="laag"/>
<cd:constant type="midden"/>
+ <cd:constant type="links"/>
+ <cd:constant type="midden"/>
+ <cd:constant type="rechts"/>
+ <cd:constant type="linkshangend"/>
+ <cd:constant type="rechtshangend"/>
+ <cd:constant type="linkermarge"/>
+ <cd:constant type="rechtermarge"/>
+ <cd:constant type="binnenmarge"/>
+ <cd:constant type="buitenmarge"/>
</cd:parameter>
<cd:parameter name="breedte">
<cd:constant type="passend"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="ja"/>
<cd:constant type="nee"/>
</cd:parameter>
+ <cd:parameter name="uitlijnen">
+ <cd:constant type="lijnlinks"/>
+ <cd:constant type="lijnrechts"/>
+ <cd:constant type="midden"/>
+ <cd:constant type="centreer"/>
+ </cd:parameter>
<cd:parameter name="linkermarge">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="geroteerd"/>
<cd:constant type="dubbelzijdig"/>
<cd:constant type="negatief"/>
+ <cd:constant type="achtergrond"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/cont-ro.xml b/Master/texmf-dist/tex/context/interface/cont-ro.xml
index 9d2eae7fdb9..e8df14520bb 100644
--- a/Master/texmf-dist/tex/context/interface/cont-ro.xml
+++ b/Master/texmf-dist/tex/context/interface/cont-ro.xml
@@ -59,22 +59,36 @@
</cd:define>
<cd:define name="language">
- <cd:constant type="nl"/>
- <cd:constant type="fr"/>
- <cd:constant type="en"/>
- <cd:constant type="uk"/>
- <cd:constant type="de"/>
- <cd:constant type="es"/>
- <cd:constant type="cz"/>
- <cd:constant type=".."/>
+ <cd:constant type="nl"/>
+ <cd:constant type="fr"/>
+ <cd:constant type="en"/>
+ <cd:constant type="uk"/>
+ <cd:constant type="de"/>
+ <cd:constant type="es"/>
+ <cd:constant type="cz"/>
+ <cd:constant type=".."/>
</cd:define>
<cd:define name="texts">
- <cd:constant type="cd:text"/>
- <cd:constant type="cd:section"/>
- <cd:constant type="data"/>
- <cd:constant type="cd:mark"/>
- <cd:constant type="numarpagina"/>
+ <cd:constant type="cd:text"/>
+ <cd:constant type="cd:section"/>
+ <cd:constant type="data"/>
+ <cd:constant type="cd:mark"/>
+ <cd:constant type="numarpagina"/>
+</cd:define>
+
+<cd:define name="layout-h">
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="margine"/>
+ <cd:constant type="bordura"/>
+</cd:define>
+
+<cd:define name="layout-v">
+ <cd:constant type="sus"/>
+ <cd:constant type="antet"/>
+ <cd:constant type="text" default="yes"/>
+ <cd:constant type="subsol"/>
+ <cd:constant type="subsol"/>
</cd:define>
<cd:command name="installlanguage" file="lang-ini.tex">
@@ -1626,6 +1640,7 @@
<cd:constant type="sus"/>
<cd:constant type="centru"/>
<cd:constant type="subsol"/>
+ <cd:constant type="mentine"/>
</cd:parameter>
<cd:parameter name="optiune">
<cd:constant type="niciunul"/>
@@ -1731,6 +1746,9 @@
<cd:parameter name="foregroundstyle">
<cd:resolve name="style"/>
</cd:parameter>
+ <cd:parameter name="grosimerigla">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
</cd:assignments>
</cd:arguments>
</cd:command>
@@ -3390,9 +3408,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordura"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3409,9 +3425,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordura"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3428,9 +3442,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordura"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3447,9 +3459,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordura"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3466,9 +3476,7 @@
</cd:sequence>
<cd:arguments>
<cd:keywords optional="yes">
- <cd:constant type="cd:text" default="yes"/>
- <cd:constant type="margine"/>
- <cd:constant type="bordura"/>
+ <cd:resolve name="layout-h"/>
</cd:keywords>
<cd:keywords>
<cd:resolve name="texts"/>
@@ -3479,6 +3487,48 @@
</cd:arguments>
</cd:command>
+<cd:command name="settextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="settextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:resolve name="texts"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
+<cd:command name="resettextcontent" file="page-txt.tex">
+ <cd:sequence>
+ <cd:string value="resettextcontent"/>
+ </cd:sequence>
+ <cd:arguments>
+ <cd:keywords>
+ <cd:resolve name="layout-v"/>
+ </cd:keywords>
+ <cd:keywords>
+ <cd:resolve name="layout-h"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant name="lefttext"/>
+ <cd:constant name="middletext"/>
+ <cd:constant name="righttext"/>
+ </cd:keywords>
+ </cd:arguments>
+</cd:command>
+
<cd:command name="definemarking" file="core-mar.tex">
<cd:sequence>
<cd:string value="definestemarcaje"/>
@@ -3774,6 +3824,21 @@
<cd:sequence>
<cd:string value="afiseazagrid"/>
</cd:sequence>
+ <cd:arguments>
+ <cd:keywords optional="yes" list="yes">
+ <cd:constant type="reset"/>
+ <cd:constant type="sus"/>
+ <cd:constant type="subsol"/>
+ <cd:constant type="niciunul"/>
+ <cd:constant type="tot"/>
+ <cd:constant type="linii"/>
+ <cd:constant type="incadrat"/>
+ <cd:constant type="nonumber"/>
+ <cd:constant type="dreapta"/>
+ <cd:constant type="stanga"/>
+ </cd:keywords>
+ <cd:content/>
+ </cd:arguments>
</cd:command>
<cd:command name="placeongrid" file="core-grd.tex">
@@ -4106,6 +4171,15 @@
<cd:constant type="inalt"/>
<cd:constant type="jos"/>
<cd:constant type="centru"/>
+ <cd:constant type="stanga"/>
+ <cd:constant type="centru"/>
+ <cd:constant type="dreapta"/>
+ <cd:constant type="lefthanging"/>
+ <cd:constant type="righthanging"/>
+ <cd:constant type="marginestanga"/>
+ <cd:constant type="marginedreapta"/>
+ <cd:constant type="innermargin"/>
+ <cd:constant type="outermargin"/>
</cd:parameter>
<cd:parameter name="latime">
<cd:constant type="ajustat"/>
@@ -5034,6 +5108,12 @@
<cd:constant type="da"/>
<cd:constant type="nu"/>
</cd:parameter>
+ <cd:parameter name="aliniere">
+ <cd:constant type="flushleft"/>
+ <cd:constant type="flushright"/>
+ <cd:constant type="centru"/>
+ <cd:constant type="center"/>
+ </cd:parameter>
<cd:parameter name="marginestanga">
<cd:constant type="cd:dimension"/>
</cd:parameter>
@@ -5471,6 +5551,7 @@
<cd:constant type="rotat"/>
<cd:constant type="douafete"/>
<cd:constant type="negativ"/>
+ <cd:constant type="fundal"/>
<cd:constant type="90"/>
<cd:constant type="180"/>
<cd:constant type="270"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-cz.xml b/Master/texmf-dist/tex/context/interface/keys-cz.xml
index 13b363f09ae..2ff97c87612 100644
--- a/Master/texmf-dist/tex/context/interface/keys-cz.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-cz.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="cz" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="jedna"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="flushleft"/>
<cd:variable name="flushright" value="flushright"/>
<cd:variable name="center" value="center"/>
+ <cd:variable name="flushouter" value="flushouter"/>
+ <cd:variable name="flushinner" value="flushinner"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="rovnice"/>
+ <cd:variable name="subformula" value="subrovnice"/>
<cd:variable name="formulae" value="rovnice"/>
<cd:variable name="figure" value="obrazek"/>
<cd:variable name="figures" value="obrazky"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="vlevo"/>
<cd:variable name="local" value="lokalne"/>
<cd:variable name="new" value="novy"/>
+ <cd:variable name="old" value="old"/>
<cd:variable name="MONTH" value="MESIC"/>
<cd:variable name="month" value="mesic"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="polozka"/>
<cd:variable name="marking" value="znaceni"/>
<cd:variable name="margin" value="marginalie"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="vycet"/>
<cd:variable name="description" value="popis"/>
+ <cd:variable name="lefthanging" value="lefthanging"/>
+ <cd:variable name="righthanging" value="righthanging"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="subpagenumber"/>
<cd:command name="setuptext" value="nastavtext"/>
<cd:command name="setuptexttexts" value="nastavtexttexty"/>
+ <cd:command name="settextcontent" value="settextcontent"/>
+ <cd:command name="resettext" value="resettextcontent"/>
<cd:command name="definetext" value="definujtext"/>
<cd:command name="pagenumber" value="cislostrany"/>
<cd:command name="completepagenumber" value="completepagenumber"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-de.xml b/Master/texmf-dist/tex/context/interface/keys-de.xml
index 598bf64fb9b..fb1e35eaf7f 100644
--- a/Master/texmf-dist/tex/context/interface/keys-de.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-de.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="de" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="eins"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="flushleft"/>
<cd:variable name="flushright" value="flushright"/>
<cd:variable name="center" value="center"/>
+ <cd:variable name="flushouter" value="flushouter"/>
+ <cd:variable name="flushinner" value="flushinner"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="formel"/>
+ <cd:variable name="subformula" value="subformel"/>
<cd:variable name="formulae" value="formeln"/>
<cd:variable name="figure" value="abbildung"/>
<cd:variable name="figures" value="abbildungen"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="links"/>
<cd:variable name="local" value="lokal"/>
<cd:variable name="new" value="neu"/>
+ <cd:variable name="old" value="old"/>
<cd:variable name="MONTH" value="MONAT"/>
<cd:variable name="month" value="monat"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="pos"/>
<cd:variable name="marking" value="beschriftung"/>
<cd:variable name="margin" value="marginalie"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="nummerierung"/>
<cd:variable name="description" value="beschreibung"/>
+ <cd:variable name="lefthanging" value="lefthanging"/>
+ <cd:variable name="righthanging" value="righthanging"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="subpagenumber"/>
<cd:command name="setuptext" value="stelletextein"/>
<cd:command name="setuptexttexts" value="stelletexttexteein"/>
+ <cd:command name="settextcontent" value="settext"/>
+ <cd:command name="resettext" value="resettextcontent"/>
<cd:command name="definetext" value="definieretext"/>
<cd:command name="pagenumber" value="seitenummer"/>
<cd:command name="completepagenumber" value="completepagenumber"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-en.xml b/Master/texmf-dist/tex/context/interface/keys-en.xml
index 5fc33fb5ab2..f515dffa8a8 100644
--- a/Master/texmf-dist/tex/context/interface/keys-en.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-en.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="en" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="one"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="flushleft"/>
<cd:variable name="flushright" value="flushright"/>
<cd:variable name="center" value="center"/>
+ <cd:variable name="flushouter" value="flushouter"/>
+ <cd:variable name="flushinner" value="flushinner"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="formula"/>
+ <cd:variable name="subformula" value="subformula"/>
<cd:variable name="formulae" value="formulae"/>
<cd:variable name="figure" value="figure"/>
<cd:variable name="figures" value="figures"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="left"/>
<cd:variable name="local" value="local"/>
<cd:variable name="new" value="new"/>
+ <cd:variable name="old" value="old"/>
<cd:variable name="MONTH" value="MONTH"/>
<cd:variable name="month" value="month"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="item"/>
<cd:variable name="marking" value="marking"/>
<cd:variable name="margin" value="margin"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="enumeration"/>
<cd:variable name="description" value="description"/>
+ <cd:variable name="lefthanging" value="lefthanging"/>
+ <cd:variable name="righthanging" value="righthanging"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="subpagenumber"/>
<cd:command name="setuptext" value="setuptext"/>
<cd:command name="setuptexttexts" value="setuptexttexts"/>
+ <cd:command name="settextcontent" value="settextcontent"/>
+ <cd:command name="resettext" value="resettextcontent"/>
<cd:command name="definetext" value="definetext"/>
<cd:command name="pagenumber" value="pagenumber"/>
<cd:command name="completepagenumber" value="completepagenumber"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-fr.xml b/Master/texmf-dist/tex/context/interface/keys-fr.xml
index 4fa12b0a5fb..0c332407ac7 100644
--- a/Master/texmf-dist/tex/context/interface/keys-fr.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-fr.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="fr" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="un"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="flushleft"/>
<cd:variable name="flushright" value="flushright"/>
<cd:variable name="center" value="center"/>
+ <cd:variable name="flushouter" value="flushouter"/>
+ <cd:variable name="flushinner" value="flushinner"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="formule"/>
+ <cd:variable name="subformula" value="subformule"/>
<cd:variable name="formulae" value="formules"/>
<cd:variable name="figure" value="figure"/>
<cd:variable name="figures" value="figures"/>
@@ -281,7 +284,7 @@
<cd:constant name="leftmargin" value="margegauche"/>
<cd:constant name="leftmargindistance" value="distancemargegauche"/>
<cd:constant name="leftoffset" value="decalagegauche"/>
- <cd:constant name="leftedge" value="brodgauche"/>
+ <cd:constant name="leftedge" value="bordgauche"/>
<cd:constant name="leftedgedistance" value="distancebordgauche"/>
<cd:constant name="lefttext" value="textegauche"/>
<cd:constant name="left" value="gauche"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="gauche"/>
<cd:variable name="local" value="local"/>
<cd:variable name="new" value="nouveau"/>
+ <cd:variable name="old" value="old"/>
<cd:variable name="MONTH" value="MOIS"/>
<cd:variable name="month" value="mois"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="element"/>
<cd:variable name="marking" value="marquage"/>
<cd:variable name="margin" value="marge"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="enumeration"/>
<cd:variable name="description" value="description"/>
+ <cd:variable name="lefthanging" value="lefthanging"/>
+ <cd:variable name="righthanging" value="righthanging"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="sousnumeropage"/>
<cd:command name="setuptext" value="regletexte"/>
<cd:command name="setuptexttexts" value="regletextestexte"/>
+ <cd:command name="settextcontent" value="settext"/>
+ <cd:command name="resettext" value="resettextcontent"/>
<cd:command name="definetext" value="definittexte"/>
<cd:command name="pagenumber" value="numeropage"/>
<cd:command name="completepagenumber" value="completenumeropage"/>
@@ -1568,7 +1577,7 @@
<cd:command name="leftmargindistance" value="distancemargegauche"/>
<cd:command name="rightmargindistance" value="distancemargedroite"/>
<cd:command name="edgewidth" value="largeurbord"/>
- <cd:command name="leftedgewidth" value="largeurbrodgauche"/>
+ <cd:command name="leftedgewidth" value="largeurbordgauche"/>
<cd:command name="rightedgewidth" value="largeurborddroit"/>
<cd:command name="edgedistance" value="distancebord"/>
<cd:command name="leftedgedistance" value="distancebordgauche"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-it.xml b/Master/texmf-dist/tex/context/interface/keys-it.xml
index e659a0df724..6091fe8ee95 100644
--- a/Master/texmf-dist/tex/context/interface/keys-it.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-it.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="it" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="uno"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="flushleft"/>
<cd:variable name="flushright" value="flushright"/>
<cd:variable name="center" value="center"/>
+ <cd:variable name="flushouter" value="flushouter"/>
+ <cd:variable name="flushinner" value="flushinner"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="formula"/>
+ <cd:variable name="subformula" value="subformula"/>
<cd:variable name="formulae" value="formule"/>
<cd:variable name="figure" value="figura"/>
<cd:variable name="figures" value="figure"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="sinistra"/>
<cd:variable name="local" value="locale"/>
<cd:variable name="new" value="nuovo"/>
+ <cd:variable name="old" value="old"/>
<cd:variable name="MONTH" value="MESE"/>
<cd:variable name="month" value="mese"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="elemento"/>
<cd:variable name="marking" value="marcatura"/>
<cd:variable name="margin" value="margine"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="enumerazione"/>
<cd:variable name="description" value="descrizione"/>
+ <cd:variable name="lefthanging" value="lefthanging"/>
+ <cd:variable name="righthanging" value="righthanging"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="subpagenumber"/>
<cd:command name="setuptext" value="impostatesto"/>
<cd:command name="setuptexttexts" value="impostatestotesti"/>
+ <cd:command name="settextcontent" value="settext"/>
+ <cd:command name="resettext" value="resettextcontent"/>
<cd:command name="definetext" value="definiscitesto"/>
<cd:command name="pagenumber" value="numeropagina"/>
<cd:command name="completepagenumber" value="numeropaginacompleto"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-nl.xml b/Master/texmf-dist/tex/context/interface/keys-nl.xml
index 71c954ec3a4..7f238cdf6f0 100644
--- a/Master/texmf-dist/tex/context/interface/keys-nl.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-nl.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="nl" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="een"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="lijnlinks"/>
<cd:variable name="flushright" value="lijnrechts"/>
<cd:variable name="center" value="centreer"/>
+ <cd:variable name="flushouter" value="lijnbuiten"/>
+ <cd:variable name="flushinner" value="lijnbinnen"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="formule"/>
+ <cd:variable name="subformula" value="subformule"/>
<cd:variable name="formulae" value="formules"/>
<cd:variable name="figure" value="figuur"/>
<cd:variable name="figures" value="figuren"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="links"/>
<cd:variable name="local" value="lokaal"/>
<cd:variable name="new" value="nieuw"/>
+ <cd:variable name="old" value="oud"/>
<cd:variable name="MONTH" value="MAAND"/>
<cd:variable name="month" value="maand"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="som"/>
<cd:variable name="marking" value="markering"/>
<cd:variable name="margin" value="marge"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="doornummering"/>
<cd:variable name="description" value="doordefinitie"/>
+ <cd:variable name="lefthanging" value="linkshangend"/>
+ <cd:variable name="righthanging" value="rechtshangend"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="subpaginanummer"/>
<cd:command name="setuptext" value="steltekstin"/>
<cd:command name="setuptexttexts" value="stelteksttekstenin"/>
+ <cd:command name="settextcontent" value="steltekstinhoudin"/>
+ <cd:command name="resettext" value="resettekstinhoud"/>
<cd:command name="definetext" value="definieertekst"/>
<cd:command name="pagenumber" value="paginanummer"/>
<cd:command name="completepagenumber" value="volledigepaginanummer"/>
diff --git a/Master/texmf-dist/tex/context/interface/keys-ro.xml b/Master/texmf-dist/tex/context/interface/keys-ro.xml
index 159e06014ce..80a061a1708 100644
--- a/Master/texmf-dist/tex/context/interface/keys-ro.xml
+++ b/Master/texmf-dist/tex/context/interface/keys-ro.xml
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.08.08 21:51">
+<cd:interface xmlns:cd="http://www.pragma-ade.com/commands" name="context" language="ro" version="2006.11.17 19:52">
<cd:variables>
<cd:variable name="one" value="unu"/>
@@ -87,6 +87,8 @@
<cd:variable name="flushleft" value="flushleft"/>
<cd:variable name="flushright" value="flushright"/>
<cd:variable name="center" value="center"/>
+ <cd:variable name="flushouter" value="flushouter"/>
+ <cd:variable name="flushinner" value="flushinner"/>
</cd:variables>
<cd:variables>
@@ -96,6 +98,7 @@
<cd:variables>
<cd:variable name="formula" value="formula"/>
+ <cd:variable name="subformula" value="subformula"/>
<cd:variable name="formulae" value="formule"/>
<cd:variable name="figure" value="figura"/>
<cd:variable name="figures" value="figure"/>
@@ -627,9 +630,11 @@
<cd:variable name="left" value="stanga"/>
<cd:variable name="local" value="local"/>
<cd:variable name="new" value="nou"/>
+ <cd:variable name="old" value="old"/>
<cd:variable name="MONTH" value="LUNA"/>
<cd:variable name="month" value="luna"/>
<cd:variable name="mar" value="mar"/>
+ <cd:variable name="item" value="element"/>
<cd:variable name="marking" value="marcaje"/>
<cd:variable name="margin" value="margine"/>
<cd:variable name="max" value="max"/>
@@ -784,6 +789,8 @@
<cd:variable name="xml" value="xml"/>
<cd:variable name="enumeration" value="enumerare"/>
<cd:variable name="description" value="descriere"/>
+ <cd:variable name="lefthanging" value="lefthanging"/>
+ <cd:variable name="righthanging" value="righthanging"/>
</cd:variables>
<cd:constants>
@@ -1192,6 +1199,8 @@
<cd:command name="subpagenumber" value="subpagenumber"/>
<cd:command name="setuptext" value="seteazatext"/>
<cd:command name="setuptexttexts" value="seteazatextetext"/>
+ <cd:command name="settextcontent" value="settextcontent"/>
+ <cd:command name="resettext" value="resettextcontent"/>
<cd:command name="definetext" value="definestetext"/>
<cd:command name="pagenumber" value="numarpagina"/>
<cd:command name="completepagenumber" value="completeazanumarpagina"/>
diff --git a/Master/texmf-dist/tex/context/interface/t-bib.xml b/Master/texmf-dist/tex/context/interface/t-bib.xml
index dc7bd38f43a..d22933d3aa9 100644
--- a/Master/texmf-dist/tex/context/interface/t-bib.xml
+++ b/Master/texmf-dist/tex/context/interface/t-bib.xml
@@ -76,6 +76,10 @@
<cd:parameter name="title">
<cd:constant type="cd:command"/>
</cd:parameter>
+ <cd:parameter name="maybeyear">
+ <cd:constant type="off"/>
+ <cd:constant type="on" default="yes"/>
+ </cd:parameter>
<cd:parameter name="criterium">
<cd:constant type="cd:section"/>
<cd:constant type="local"/>
@@ -254,6 +258,9 @@
</cd:sequence>
<cd:arguments>
<cd:assignments list="yes">
+ <cd:parameter name="bibtex">
+ <cd:constant type="cd:text"/>
+ </cd:parameter>
<cd:parameter name="database">
<cd:constant type="cd:file"/>
</cd:parameter>
diff --git a/Master/texmf-dist/tex/generic/context/m-metapo.tex b/Master/texmf-dist/tex/generic/context/m-metapo.tex
index a71c9191006..8680f69c6b2 100644
--- a/Master/texmf-dist/tex/generic/context/m-metapo.tex
+++ b/Master/texmf-dist/tex/generic/context/m-metapo.tex
@@ -1,71 +1,71 @@
%D \module
%D [ file=m-metapo,
%D version=1999.03.26,
-%D title=\LATEX\ Modules,
+%D title=\LATEX\ Modules,
%D subtitle=\METAPOST\ Inclusion,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ distribution and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D We quit when \CONTEXT\ is found and use some deep down
+%D We quit when \CONTEXT\ is found and use some deep down
%D macro to trigger this:
-\ifx\undefined\dodoplaceexternalfigure \else \expandafter \endinput \fi
+\ifx\undefined\dodoplaceexternalfigure \else \expandafter \endinput \fi
-%D \macros
+%D \macros
%D {includeMPgraphics}
%D
%D This rather small \LATEX\ module is dedicated to David
%D Arnold. It takes care of including the fonts used in
%D \METAPOST\ graphics in the file. This hack is needed when
%D one uses another \DVI\ driver than \DVIPS. This module
-%D falls back on the generic \CONTEXT\ support module:
+%D falls back on the generic \CONTEXT\ support module:
-\ifx\undefined\includeMPfonts \input supp-mps.tex \relax \fi
+\ifx\undefined\includeMPfonts \input supp-mps.tex \relax \fi
%D Instead of using \type {\includegraphics}, one should use its
-%D little brother \type {\includeMPgraphics}. This macro takes
-%D the same arguments.
+%D little brother \type {\includeMPgraphics}. This macro takes
+%D the same arguments.
\def\includeMPgraphics#1#%
{\leavevmode\vbox\bgroup\hbox\bgroup
\def\includeMPgraphics##1%
{\includeMPfonts{##1}%
- \includegraphics#1{##1}%
+ \includegraphics#1{##1}%
\egroup\egroup}%
\includeMPgraphics}
-%D An example of using this module is given below:
-%D
+%D An example of using this module is given below:
+%D
%D \starttyping
%D \documentclass[10pt]{article}
-%D
+%D
%D \usepackage{graphicx}
%D \usepackage{m-metapo}
-%D
+%D
%D \begin{document}
%D \includeMPgraphics{somefile.1}
%D \includeMPgraphics[angle=90]{somefile.2}
%D \end{document}
%D \stoptyping
%D
-%D This module needs \type {supp-mps} and \type {supp-mis},
+%D This module needs \type {supp-mps} and \type {supp-mis},
%D that both are present in the \CONTEXT\ path.
%D
-%D Please do not forget to say \type {prologues:=2} at the
+%D Please do not forget to say \type {prologues:=1} at the
%D top of the metapost file!
-%D
-%D For non \LATEX\ (and \CONTEXT) users we provide an
-%D alternative inclusion macro. This one has no optional
-%D arguments.
+%D
+%D For non \LATEX\ (and \CONTEXT) users we provide an
+%D alternative inclusion macro. This one has no optional
+%D arguments.
\ifx\includegraphics\undefined
- \ifx\undefined\dogetEPSboundingbox \input supp-eps.tex \relax \fi
+ \ifx\undefined\dogetEPSboundingbox \input supp-eps.tex \relax \fi
\def\includeMPgraphics#1%
{\hbox\bgroup
@@ -86,4 +86,4 @@
\fi
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/generic/context/mptopdf.tex b/Master/texmf-dist/tex/generic/context/mptopdf.tex
index 97f2890a645..84a8aa380b8 100644
--- a/Master/texmf-dist/tex/generic/context/mptopdf.tex
+++ b/Master/texmf-dist/tex/generic/context/mptopdf.tex
@@ -2,103 +2,104 @@
%D [ file=mptopdf,
%D version=2000.03.27,
%D title=\METAPOST,
-%D subtitle=conversion to \PDF,
+%D subtitle=conversion to \PDF,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D The file \type {mptopdf} provides a quick way to convert
-%D \METAPOST\ files to \PDF\ using a slightly stripped down
-%D plain \TEX, \PDFTEX, and a few \CONTEXT\ modules.
+%D The file \type {mptopdf} provides a quick way to convert
+%D \METAPOST\ files to \PDF\ using a slightly stripped down
+%D plain \TEX, \PDFTEX, and a few \CONTEXT\ modules.
%D
%D First generate a format, which in \WEBC\ looks like:
%D
-%D \starttyping
-%D pdftex --ini mptopdf
-%D \stoptyping
+%D \starttyping
+%D pdftex --ini mptopdf
+%D \stoptyping
%D
-%D or:
+%D or:
%D
-%D \starttyping
-%D texexec --make --tex=pdftex --format=mptopdf --alone
-%D \stoptyping
+%D \starttyping
+%D texexec --make --tex=pdftex --format=mptopdf --alone
+%D \stoptyping
%D
-%D Since this conversion only works with \PDFTEX\ or \PDFETEX,
-%D the session is aborted when another \TEX\ is used. When
-%D finished, the resulting \type {fmt} file should be moved to
-%D the right location.
+%D Since this conversion only works with \PDFTEX\ or \PDFETEX,
+%D the session is aborted when another \TEX\ is used. When
+%D finished, the resulting \type {fmt} file should be moved to
+%D the right location.
%D
-%D The conversion itself is accomplished by:
+%D The conversion itself is accomplished by:
+%D
+%D \starttyping
+%D pdftex &mptopdf \relax filename.number
+%D \stoptyping
%D
-%D \starttyping
-%D pdftex &mptopdf \relax filename.number
-%D \stoptyping
-%D
%D The \type {\relax} is needed since we don't want to process
%D the file directly. Instead we pick up the filename using
%D \type {\everypar}. Since this file is still the first one
%D we load, although delayed, the jobname is as we expect. So,
%D at least in \WEBC, the result of the conversion comes
%D available in the file \type {filename.pdf}. This conversion
-%D process is roughly compatible with:
+%D process is roughly compatible with:
%D
-%D \starttyping
+%D \starttyping
%D texexec --pdf --fig=c --result=filename filename.number
-%D \stoptyping
+%D \stoptyping
%D
-%D This uses \CONTEXT, and is therefore slower. Therefore,
-%D we provide a small \PERL\ script that does a faster job,
-%D using the minimal format. Given that a format is
-%D generated, one can say:
+%D This uses \CONTEXT, and is therefore slower. Therefore,
+%D we provide a small \PERL\ script that does a faster job,
+%D using the minimal format. Given that a format is
+%D generated, one can say:
%D
-%D \starttyping
-%D mptopdf somefile
+%D \starttyping
+%D mptopdf somefile
%D mptopdf somefile.123
-%D mptopdf mp*.*
-%D \stoptyping
-%D
-%D The results are copied into files named \type
-%D {somefile-number}. This mechanism will also be available
+%D mptopdf mp*.*
+%D \stoptyping
+%D
+%D The results are copied into files named \type
+%D {somefile-number}. This mechanism will also be available
%D in a next release of \TEXUTIL.
-%D The \TEX\ implementation is rather simple, since we use some
+%D The \TEX\ implementation is rather simple, since we use some
%D generic \CONTEXT\ modules. Because we need a few register
-%D allocation macros, we preload plain \TEX. We don't load
-%D fonts yet.
+%D allocation macros, we preload plain \TEX. We don't load
+%D fonts yet.
\input syst-tex
-%D We check for the usage of \PDFTEX, and quit if another
-%D \TEX\ is used.
+%D We check for the usage of \PDFTEX, and quit if another
+%D \TEX\ is used.
-\ifx\pdfoutput\undefined
- \message{Sorry, you should use pdf(e)TeX instead.}
- \expandafter \endinput
+\ifx\pdfoutput\undefined
+ \message{Sorry, you should use pdf(e)TeX instead.}
+ \expandafter \endinput
\fi
-%D The conversion to \PDF\ is carried out by macros, that
-%D are collected in the file:
+%D The conversion to \PDF\ is carried out by macros, that
+%D are collected in the file:
-\input supp-pdf
+\input supp-mis
+\input supp-pdf
\input supp-mpe \MPcmykcolorstrue \MPspotcolorstrue
-%D We use no output routine.
+%D We use no output routine.
-\output{}
+\output{}
-%D Since we need to calculate and set the bounding box,
+%D Since we need to calculate and set the bounding box,
%D we definitely don't want to indent paragraphs.
-\parindent=0pt
+\parindent=0pt
%D We use \type {\everypar} to pick up the filename and
-%D process the \METAPOST\ graphic.
+%D process the \METAPOST\ graphic.
-\everypar{\processMPfile}
+\everypar{\processMPfile}
%D The main macro shows a few \PDFTEX\ primitives. The main
%D work is done by the macro \type {\convertMPtoPDF} which is
@@ -107,39 +108,39 @@
%D learn a few (\PDF) tricks. Apart from some path
%D transformations, which are needed since \PDF\ has a
%D different vision on paths, the graphic is positioned in
-%D such a way that accuracy in \PDF\ xforms is guaranteed.
+%D such a way that accuracy in \PDF\ xforms is guaranteed.
\def\processMPfile#1 %
- {\pdfoutput=1
+ {\pdfoutput=1
\pdfcompresslevel=9
\chardef\makeMPintoPDFobject=1
\hsize=100in
\vsize=\hsize
- \hoffset=-1in
+ \hoffset=-1in
\voffset=\hoffset
\topskip=0pt
\setbox0=\vbox{\convertMPtoPDF{#1}{1}{1}}%
- \ifdim\wd0<1in \message{[warning: width<1in]}\fi
- \ifdim\ht0<1in \message{[warning: height<1in]}\fi
- \pdfpageheight=\ht0
- \pdfpagewidth=\wd0
+ \ifdim\wd0<1in \message{[warning: the width is less than 1in]}\fi
+ \ifdim\ht0<1in \message{[warning: the height is less than 1in]}\fi
+ \pdfpageheight=\ht0
+ \pdfpagewidth=\wd0
\box0
\bye}
-%D The \type {\chardef} forces the converter to build a so
+%D The \type {\chardef} forces the converter to build a so
%D called xform object. This is needed in case the graphic
-%D uses special trickery, like shading.
+%D uses special trickery, like shading.
-%D Since \ACROBAT\ has troubles with figures smaller than
-%D 1~inch, we issue a warning. When embedding graphics in
-%D documents, a size less that 1~inch does not harm. In
-%D order to overload runtime directives in the \PDFTEX\
-%D configuration file, we set the offsets and output method
+%D Since \ACROBAT\ has troubles with figures smaller than
+%D 1~inch, we issue a warning. When embedding graphics in
+%D documents, a size less that 1~inch does not harm. In
+%D order to overload runtime directives in the \PDFTEX\
+%D configuration file, we set the offsets and output method
%D in the macro.
-%D
+%D
%D The resulting \PDF\ file is about as efficient as such a
%D self contained file can be. However, if needed, this \PDF\
-%D file can be converted to \EPS\ using for instance the
-%D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT.
+%D file can be converted to \EPS\ using for instance the
+%D \PDFTOPS\ program (in \WEBC) or \GHOSTSCRIPT.
\dump