From d0fbd0050d9085f815b642d138c3ef571b64b76a Mon Sep 17 00:00:00 2001 From: Marius Date: Mon, 31 Jan 2011 00:29:42 +0200 Subject: beta 2011.01.24 23:51 --- tex/context/base/buff-imp-default.lua | 42 + tex/context/base/buff-imp-default.mkiv | 43 + tex/context/base/buff-imp-escaped.lua | 14 + tex/context/base/buff-imp-escaped.mkiv | 18 + tex/context/base/buff-imp-lua.lua | 208 ++ tex/context/base/buff-imp-lua.mkiv | 69 + tex/context/base/buff-imp-mp.lua | 176 ++ tex/context/base/buff-imp-mp.mkiv | 76 + tex/context/base/buff-imp-nested.lua | 80 + tex/context/base/buff-imp-nested.mkiv | 21 + tex/context/base/buff-imp-parsed-xml.lua | 101 + tex/context/base/buff-imp-parsed-xml.mkiv | 70 + tex/context/base/buff-imp-tex.lua | 130 ++ tex/context/base/buff-imp-tex.mkiv | 51 + tex/context/base/buff-imp-xml.lua | 133 ++ tex/context/base/buff-imp-xml.mkiv | 71 + tex/context/base/buff-ver.lua | 6 +- tex/context/base/colo-ema.mkii | 590 ++++++ tex/context/base/colo-ema.tex | 590 ------ tex/context/base/colo-hex.mkii | 125 ++ tex/context/base/colo-imp-ema.mkiv | 590 ++++++ tex/context/base/colo-imp-rgb.mkiv | 530 +++++ tex/context/base/colo-imp-run.mkiv | 257 +++ tex/context/base/colo-imp-x11.mkiv | 677 ++++++ tex/context/base/colo-imp-xwi.mkiv | 142 ++ tex/context/base/colo-ini.lua | 16 + tex/context/base/colo-ini.mkii | 6 +- tex/context/base/colo-ini.mkiv | 27 +- tex/context/base/colo-rgb.mkii | 530 +++++ tex/context/base/colo-rgb.tex | 530 ----- tex/context/base/colo-run.mkii | 257 +++ tex/context/base/colo-run.tex | 257 --- tex/context/base/colo-x11.mkii | 677 ++++++ tex/context/base/colo-x11.tex | 677 ------ tex/context/base/colo-xwi.mkii | 142 ++ tex/context/base/colo-xwi.tex | 142 -- tex/context/base/cont-cs.mkii | 26 + tex/context/base/cont-cs.mkiv | 22 + tex/context/base/cont-cs.tex | 37 - tex/context/base/cont-de.mkii | 26 + tex/context/base/cont-de.mkiv | 22 + tex/context/base/cont-de.tex | 42 - tex/context/base/cont-en.mkii | 28 + tex/context/base/cont-en.mkiv | 22 + tex/context/base/cont-en.tex | 44 - tex/context/base/cont-fr.mkii | 28 + tex/context/base/cont-fr.mkiv | 22 + tex/context/base/cont-fr.tex | 40 - tex/context/base/cont-gb.mkii | 28 + tex/context/base/cont-gb.mkiv | 22 + tex/context/base/cont-gb.tex | 40 - tex/context/base/cont-it.mkii | 28 + tex/context/base/cont-it.mkiv | 22 + tex/context/base/cont-it.tex | 39 - tex/context/base/cont-log.mkii | 304 +++ tex/context/base/cont-log.mkiv | 249 +++ tex/context/base/cont-log.tex | 304 --- tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/cont-nl.mkii | 28 + tex/context/base/cont-nl.mkiv | 22 + tex/context/base/cont-nl.tex | 40 - tex/context/base/cont-pe.mkiv | 22 + tex/context/base/cont-pe.tex | 43 - tex/context/base/cont-ro.mkii | 28 + tex/context/base/cont-ro.mkiv | 22 + tex/context/base/cont-ro.tex | 36 - tex/context/base/context.mkii | 44 +- tex/context/base/context.mkiv | 53 +- tex/context/base/context.tex | 225 -- tex/context/base/core-fil.mkii | 2 +- tex/context/base/core-fil.mkiv | 2 +- tex/context/base/enco-ini.mkii | 10 +- tex/context/base/font-ini.mkii | 22 +- tex/context/base/font-ini.mkiv | 22 +- tex/context/base/java-ans.mkii | 28 + tex/context/base/java-ans.tex | 28 - tex/context/base/java-exa.mkii | 395 ++++ tex/context/base/java-exa.tex | 395 ---- tex/context/base/java-fil.mkii | 48 + tex/context/base/java-fil.tex | 48 - tex/context/base/java-fld.mkii | 475 +++++ tex/context/base/java-fld.tex | 475 ----- tex/context/base/java-imp-ans.mkiv | 28 + tex/context/base/java-imp-exa.mkiv | 395 ++++ tex/context/base/java-imp-fil.mkiv | 48 + tex/context/base/java-imp-fld.mkiv | 475 +++++ tex/context/base/java-imp-stp.mkiv | 121 ++ tex/context/base/java-ini.lua | 138 -- tex/context/base/java-ini.mkii | 32 +- tex/context/base/java-ini.mkiv | 162 -- tex/context/base/java-stp.mkii | 121 ++ tex/context/base/java-stp.tex | 121 -- tex/context/base/lang-alt.mkiv | 63 - tex/context/base/lang-ana.mkiv | 24 - tex/context/base/lang-ara.mkiv | 63 - tex/context/base/lang-art.mkiv | 26 - tex/context/base/lang-bal.mkiv | 44 - tex/context/base/lang-cel.mkiv | 26 - tex/context/base/lang-cjk.mkiv | 48 - tex/context/base/lang-cyr.mkiv | 60 - tex/context/base/lang-def.mkiv | 715 +++++++ tex/context/base/lang-ger.mkiv | 259 --- tex/context/base/lang-grk.mkiv | 48 - tex/context/base/lang-ind.mkiv | 26 - tex/context/base/lang-ini.mkii | 2 +- tex/context/base/lang-ita.mkiv | 157 -- tex/context/base/lang-sla.mkiv | 179 -- tex/context/base/lang-txt.lua | 3 +- tex/context/base/lang-ura.mkiv | 63 - tex/context/base/lang-vn.mkiv | 43 - tex/context/base/lpdf-wid.lua | 2 +- tex/context/base/luat-fmt.lua | 8 +- tex/context/base/math-ini.mkii | 4 +- tex/context/base/meta-clp.mkii | 164 ++ tex/context/base/meta-clp.tex | 164 -- tex/context/base/meta-dum.mkii | 123 ++ tex/context/base/meta-dum.tex | 123 -- tex/context/base/meta-fig.mkiv | 1 + tex/context/base/meta-imp-clp.mkiv | 164 ++ tex/context/base/meta-imp-dum.mkiv | 123 ++ tex/context/base/meta-imp-mis.mkiv | 54 + tex/context/base/meta-imp-nav.mkiv | 65 + tex/context/base/meta-imp-pre.mkiv | 68 + tex/context/base/meta-imp-txt.mkiv | 304 +++ tex/context/base/meta-ini.lua | 24 + tex/context/base/meta-ini.mkii | 6 +- tex/context/base/meta-ini.mkiv | 13 +- tex/context/base/meta-mis.mkii | 54 + tex/context/base/meta-mis.tex | 54 - tex/context/base/meta-nav.mkii | 65 + tex/context/base/meta-nav.tex | 65 - tex/context/base/meta-pre.mkii | 68 + tex/context/base/meta-pre.tex | 68 - tex/context/base/meta-txt.mkii | 304 +++ tex/context/base/meta-txt.tex | 304 --- tex/context/base/metatex.tex | 12 +- tex/context/base/page-app.mkiv | 7 +- tex/context/base/page-lay.mkii | 10 +- tex/context/base/page-lay.mkiv | 10 +- tex/context/base/s-inf-01.mkiv | 78 +- tex/context/base/scrn-int.mkiv | 11 +- tex/context/base/supp-fil.lua | 33 +- tex/context/base/symb-ini.mkii | 2 +- tex/context/base/symb-ini.mkiv | 2 +- tex/context/base/syst-ini.mkii | 923 ++++++++ tex/context/base/syst-ini.mkiv | 925 ++++++++ tex/context/base/syst-ini.tex | 923 -------- tex/context/base/type-ini.lua | 33 + tex/context/base/type-ini.mkii | 2 +- tex/context/base/type-ini.mkiv | 19 +- tex/context/base/type-set.mkiv | 12 +- tex/context/base/unic-ini.mkii | 4 +- tex/context/base/v-default.lua | 42 - tex/context/base/v-default.mkiv | 43 - tex/context/base/v-escaped.lua | 14 - tex/context/base/v-escaped.mkiv | 18 - tex/context/base/v-lua.lua | 208 -- tex/context/base/v-lua.mkiv | 69 - tex/context/base/v-mp.lua | 176 -- tex/context/base/v-mp.mkiv | 76 - tex/context/base/v-nested.lua | 80 - tex/context/base/v-nested.mkiv | 21 - tex/context/base/v-parsed-xml.lua | 101 - tex/context/base/v-parsed-xml.mkiv | 70 - tex/context/base/v-tex.lua | 130 -- tex/context/base/v-tex.mkiv | 51 - tex/context/base/v-xml.lua | 133 -- tex/context/base/v-xml.mkiv | 71 - tex/context/base/x-fo.mkii | 2 - tex/context/base/x-res-01.mkiv | 695 +++--- tex/context/base/x-res-50.mkiv | 4 +- tex/context/base/x-set-01.mkii | 79 + tex/context/base/x-set-01.tex | 79 - tex/context/base/x-set-02.mkii | 30 + tex/context/base/x-set-02.tex | 30 - tex/context/base/x-set-11.mkii | 266 ++- tex/context/base/x-set-11.mkiv | 266 ++- tex/context/base/x-set-12.mkii | 258 +++ tex/context/base/x-set-12.mkiv | 258 +++ tex/context/base/x-set-12.tex | 258 --- tex/context/base/x-set-99.tex | 283 --- tex/context/base/x-xtag.mkiv | 14 +- tex/context/base/xtag-cml.mkii | 228 ++ tex/context/base/xtag-cml.tex | 228 -- tex/context/base/xtag-ent.mkii | 117 ++ tex/context/base/xtag-ent.tex | 117 -- tex/context/base/xtag-exp.mkii | 88 + tex/context/base/xtag-exp.tex | 88 - tex/context/base/xtag-ext.mkii | 439 ++++ tex/context/base/xtag-ext.tex | 439 ---- tex/context/base/xtag-hyp.mkii | 69 + tex/context/base/xtag-hyp.tex | 69 - tex/context/base/xtag-ini.mkii | 3023 +++++++++++++++++++++++++++ tex/context/base/xtag-ini.tex | 3019 -------------------------- tex/context/base/xtag-map.mkii | 746 +++++++ tex/context/base/xtag-map.tex | 746 ------- tex/context/base/xtag-mea.mkii | 152 ++ tex/context/base/xtag-mea.tex | 152 -- tex/context/base/xtag-meb.mkii | 124 ++ tex/context/base/xtag-meb.tex | 124 -- tex/context/base/xtag-mec.mkii | 28 + tex/context/base/xtag-mec.tex | 28 - tex/context/base/xtag-meh.mkii | 166 ++ tex/context/base/xtag-meh.tex | 166 -- tex/context/base/xtag-men.mkii | 98 + tex/context/base/xtag-men.tex | 98 - tex/context/base/xtag-meo.mkii | 58 + tex/context/base/xtag-meo.tex | 58 - tex/context/base/xtag-mer.mkii | 185 ++ tex/context/base/xtag-mer.tex | 185 -- tex/context/base/xtag-mmc.mkii | 1265 +++++++++++ tex/context/base/xtag-mmc.tex | 1265 ----------- tex/context/base/xtag-mml.mkii | 515 +++++ tex/context/base/xtag-mml.tex | 515 ----- tex/context/base/xtag-mmp.mkii | 553 +++++ tex/context/base/xtag-mmp.tex | 553 ----- tex/context/base/xtag-mxa.mkii | 101 + tex/context/base/xtag-mxa.tex | 101 - tex/context/base/xtag-mxb.mkii | 55 + tex/context/base/xtag-mxb.tex | 55 - tex/context/base/xtag-mxc.mkii | 10 + tex/context/base/xtag-mxc.tex | 10 - tex/context/base/xtag-mxh.mkii | 67 + tex/context/base/xtag-mxh.tex | 67 - tex/context/base/xtag-mxn.mkii | 84 + tex/context/base/xtag-mxn.tex | 84 - tex/context/base/xtag-mxo.mkii | 14 + tex/context/base/xtag-mxo.tex | 14 - tex/context/base/xtag-mxr.mkii | 112 + tex/context/base/xtag-mxr.tex | 112 - tex/context/base/xtag-pml.mkii | 85 + tex/context/base/xtag-pml.tex | 85 - tex/context/base/xtag-pmu.mkii | 188 ++ tex/context/base/xtag-pmu.tex | 188 -- tex/context/base/xtag-pre.mkii | 435 ++++ tex/context/base/xtag-pre.tex | 435 ---- tex/context/base/xtag-prs.mkii | 42 + tex/context/base/xtag-prs.tex | 42 - tex/context/base/xtag-raw.mkii | 37 + tex/context/base/xtag-raw.tex | 37 - tex/context/base/xtag-rng.mkii | 28 + tex/context/base/xtag-rng.tex | 28 - tex/context/base/xtag-run.mkii | 319 +++ tex/context/base/xtag-run.tex | 319 --- tex/context/base/xtag-stk.mkii | 230 ++ tex/context/base/xtag-stk.tex | 230 -- tex/context/base/xtag-utf.mkii | 21 + tex/context/base/xtag-utf.tex | 21 - tex/context/base/xtag-xsd.mkii | 28 + tex/context/base/xtag-xsd.tex | 28 - tex/context/base/xtag-xsl.mkii | 224 ++ tex/context/base/xtag-xsl.tex | 224 -- tex/generic/context/luatex-fonts-merged.lua | 2 +- 254 files changed, 24792 insertions(+), 19770 deletions(-) create mode 100644 tex/context/base/buff-imp-default.lua create mode 100644 tex/context/base/buff-imp-default.mkiv create mode 100644 tex/context/base/buff-imp-escaped.lua create mode 100644 tex/context/base/buff-imp-escaped.mkiv create mode 100644 tex/context/base/buff-imp-lua.lua create mode 100644 tex/context/base/buff-imp-lua.mkiv create mode 100644 tex/context/base/buff-imp-mp.lua create mode 100644 tex/context/base/buff-imp-mp.mkiv create mode 100644 tex/context/base/buff-imp-nested.lua create mode 100644 tex/context/base/buff-imp-nested.mkiv create mode 100644 tex/context/base/buff-imp-parsed-xml.lua create mode 100644 tex/context/base/buff-imp-parsed-xml.mkiv create mode 100644 tex/context/base/buff-imp-tex.lua create mode 100644 tex/context/base/buff-imp-tex.mkiv create mode 100644 tex/context/base/buff-imp-xml.lua create mode 100644 tex/context/base/buff-imp-xml.mkiv create mode 100644 tex/context/base/colo-ema.mkii delete mode 100644 tex/context/base/colo-ema.tex create mode 100644 tex/context/base/colo-hex.mkii create mode 100644 tex/context/base/colo-imp-ema.mkiv create mode 100644 tex/context/base/colo-imp-rgb.mkiv create mode 100644 tex/context/base/colo-imp-run.mkiv create mode 100644 tex/context/base/colo-imp-x11.mkiv create mode 100644 tex/context/base/colo-imp-xwi.mkiv create mode 100644 tex/context/base/colo-rgb.mkii delete mode 100644 tex/context/base/colo-rgb.tex create mode 100644 tex/context/base/colo-run.mkii delete mode 100644 tex/context/base/colo-run.tex create mode 100644 tex/context/base/colo-x11.mkii delete mode 100644 tex/context/base/colo-x11.tex create mode 100644 tex/context/base/colo-xwi.mkii delete mode 100644 tex/context/base/colo-xwi.tex create mode 100644 tex/context/base/cont-cs.mkii create mode 100644 tex/context/base/cont-cs.mkiv delete mode 100644 tex/context/base/cont-cs.tex create mode 100644 tex/context/base/cont-de.mkii create mode 100644 tex/context/base/cont-de.mkiv delete mode 100644 tex/context/base/cont-de.tex create mode 100644 tex/context/base/cont-en.mkii create mode 100644 tex/context/base/cont-en.mkiv delete mode 100644 tex/context/base/cont-en.tex create mode 100644 tex/context/base/cont-fr.mkii create mode 100644 tex/context/base/cont-fr.mkiv delete mode 100644 tex/context/base/cont-fr.tex create mode 100644 tex/context/base/cont-gb.mkii create mode 100644 tex/context/base/cont-gb.mkiv delete mode 100644 tex/context/base/cont-gb.tex create mode 100644 tex/context/base/cont-it.mkii create mode 100644 tex/context/base/cont-it.mkiv delete mode 100644 tex/context/base/cont-it.tex create mode 100644 tex/context/base/cont-log.mkii create mode 100644 tex/context/base/cont-log.mkiv delete mode 100644 tex/context/base/cont-log.tex create mode 100644 tex/context/base/cont-nl.mkii create mode 100644 tex/context/base/cont-nl.mkiv delete mode 100644 tex/context/base/cont-nl.tex create mode 100644 tex/context/base/cont-pe.mkiv delete mode 100644 tex/context/base/cont-pe.tex create mode 100644 tex/context/base/cont-ro.mkii create mode 100644 tex/context/base/cont-ro.mkiv delete mode 100644 tex/context/base/cont-ro.tex delete mode 100644 tex/context/base/context.tex create mode 100644 tex/context/base/java-ans.mkii delete mode 100644 tex/context/base/java-ans.tex create mode 100644 tex/context/base/java-exa.mkii delete mode 100644 tex/context/base/java-exa.tex create mode 100644 tex/context/base/java-fil.mkii delete mode 100644 tex/context/base/java-fil.tex create mode 100644 tex/context/base/java-fld.mkii delete mode 100644 tex/context/base/java-fld.tex create mode 100644 tex/context/base/java-imp-ans.mkiv create mode 100644 tex/context/base/java-imp-exa.mkiv create mode 100644 tex/context/base/java-imp-fil.mkiv create mode 100644 tex/context/base/java-imp-fld.mkiv create mode 100644 tex/context/base/java-imp-stp.mkiv delete mode 100644 tex/context/base/java-ini.lua delete mode 100644 tex/context/base/java-ini.mkiv create mode 100644 tex/context/base/java-stp.mkii delete mode 100644 tex/context/base/java-stp.tex delete mode 100644 tex/context/base/lang-alt.mkiv delete mode 100644 tex/context/base/lang-ana.mkiv delete mode 100644 tex/context/base/lang-ara.mkiv delete mode 100644 tex/context/base/lang-art.mkiv delete mode 100644 tex/context/base/lang-bal.mkiv delete mode 100644 tex/context/base/lang-cel.mkiv delete mode 100644 tex/context/base/lang-cjk.mkiv delete mode 100644 tex/context/base/lang-cyr.mkiv create mode 100644 tex/context/base/lang-def.mkiv delete mode 100644 tex/context/base/lang-ger.mkiv delete mode 100644 tex/context/base/lang-grk.mkiv delete mode 100644 tex/context/base/lang-ind.mkiv delete mode 100644 tex/context/base/lang-ita.mkiv delete mode 100644 tex/context/base/lang-sla.mkiv delete mode 100644 tex/context/base/lang-ura.mkiv delete mode 100644 tex/context/base/lang-vn.mkiv create mode 100644 tex/context/base/meta-clp.mkii delete mode 100644 tex/context/base/meta-clp.tex create mode 100644 tex/context/base/meta-dum.mkii delete mode 100644 tex/context/base/meta-dum.tex create mode 100644 tex/context/base/meta-imp-clp.mkiv create mode 100644 tex/context/base/meta-imp-dum.mkiv create mode 100644 tex/context/base/meta-imp-mis.mkiv create mode 100644 tex/context/base/meta-imp-nav.mkiv create mode 100644 tex/context/base/meta-imp-pre.mkiv create mode 100644 tex/context/base/meta-imp-txt.mkiv create mode 100644 tex/context/base/meta-ini.lua create mode 100644 tex/context/base/meta-mis.mkii delete mode 100644 tex/context/base/meta-mis.tex create mode 100644 tex/context/base/meta-nav.mkii delete mode 100644 tex/context/base/meta-nav.tex create mode 100644 tex/context/base/meta-pre.mkii delete mode 100644 tex/context/base/meta-pre.tex create mode 100644 tex/context/base/meta-txt.mkii delete mode 100644 tex/context/base/meta-txt.tex create mode 100644 tex/context/base/syst-ini.mkii create mode 100644 tex/context/base/syst-ini.mkiv delete mode 100644 tex/context/base/syst-ini.tex create mode 100644 tex/context/base/type-ini.lua delete mode 100644 tex/context/base/v-default.lua delete mode 100644 tex/context/base/v-default.mkiv delete mode 100644 tex/context/base/v-escaped.lua delete mode 100644 tex/context/base/v-escaped.mkiv delete mode 100644 tex/context/base/v-lua.lua delete mode 100644 tex/context/base/v-lua.mkiv delete mode 100644 tex/context/base/v-mp.lua delete mode 100644 tex/context/base/v-mp.mkiv delete mode 100644 tex/context/base/v-nested.lua delete mode 100644 tex/context/base/v-nested.mkiv delete mode 100644 tex/context/base/v-parsed-xml.lua delete mode 100644 tex/context/base/v-parsed-xml.mkiv delete mode 100644 tex/context/base/v-tex.lua delete mode 100644 tex/context/base/v-tex.mkiv delete mode 100644 tex/context/base/v-xml.lua delete mode 100644 tex/context/base/v-xml.mkiv create mode 100644 tex/context/base/x-set-01.mkii delete mode 100644 tex/context/base/x-set-01.tex create mode 100644 tex/context/base/x-set-02.mkii delete mode 100644 tex/context/base/x-set-02.tex create mode 100644 tex/context/base/x-set-12.mkii create mode 100644 tex/context/base/x-set-12.mkiv delete mode 100644 tex/context/base/x-set-12.tex delete mode 100644 tex/context/base/x-set-99.tex create mode 100644 tex/context/base/xtag-cml.mkii delete mode 100644 tex/context/base/xtag-cml.tex create mode 100644 tex/context/base/xtag-ent.mkii delete mode 100644 tex/context/base/xtag-ent.tex create mode 100644 tex/context/base/xtag-exp.mkii delete mode 100644 tex/context/base/xtag-exp.tex create mode 100644 tex/context/base/xtag-ext.mkii delete mode 100644 tex/context/base/xtag-ext.tex create mode 100644 tex/context/base/xtag-hyp.mkii delete mode 100644 tex/context/base/xtag-hyp.tex create mode 100644 tex/context/base/xtag-ini.mkii delete mode 100644 tex/context/base/xtag-ini.tex create mode 100644 tex/context/base/xtag-map.mkii delete mode 100644 tex/context/base/xtag-map.tex create mode 100644 tex/context/base/xtag-mea.mkii delete mode 100644 tex/context/base/xtag-mea.tex create mode 100644 tex/context/base/xtag-meb.mkii delete mode 100644 tex/context/base/xtag-meb.tex create mode 100644 tex/context/base/xtag-mec.mkii delete mode 100644 tex/context/base/xtag-mec.tex create mode 100644 tex/context/base/xtag-meh.mkii delete mode 100644 tex/context/base/xtag-meh.tex create mode 100644 tex/context/base/xtag-men.mkii delete mode 100644 tex/context/base/xtag-men.tex create mode 100644 tex/context/base/xtag-meo.mkii delete mode 100644 tex/context/base/xtag-meo.tex create mode 100644 tex/context/base/xtag-mer.mkii delete mode 100644 tex/context/base/xtag-mer.tex create mode 100644 tex/context/base/xtag-mmc.mkii delete mode 100644 tex/context/base/xtag-mmc.tex create mode 100644 tex/context/base/xtag-mml.mkii delete mode 100644 tex/context/base/xtag-mml.tex create mode 100644 tex/context/base/xtag-mmp.mkii delete mode 100644 tex/context/base/xtag-mmp.tex create mode 100644 tex/context/base/xtag-mxa.mkii delete mode 100644 tex/context/base/xtag-mxa.tex create mode 100644 tex/context/base/xtag-mxb.mkii delete mode 100644 tex/context/base/xtag-mxb.tex create mode 100644 tex/context/base/xtag-mxc.mkii delete mode 100644 tex/context/base/xtag-mxc.tex create mode 100644 tex/context/base/xtag-mxh.mkii delete mode 100644 tex/context/base/xtag-mxh.tex create mode 100644 tex/context/base/xtag-mxn.mkii delete mode 100644 tex/context/base/xtag-mxn.tex create mode 100644 tex/context/base/xtag-mxo.mkii delete mode 100644 tex/context/base/xtag-mxo.tex create mode 100644 tex/context/base/xtag-mxr.mkii delete mode 100644 tex/context/base/xtag-mxr.tex create mode 100644 tex/context/base/xtag-pml.mkii delete mode 100644 tex/context/base/xtag-pml.tex create mode 100644 tex/context/base/xtag-pmu.mkii delete mode 100644 tex/context/base/xtag-pmu.tex create mode 100644 tex/context/base/xtag-pre.mkii delete mode 100644 tex/context/base/xtag-pre.tex create mode 100644 tex/context/base/xtag-prs.mkii delete mode 100644 tex/context/base/xtag-prs.tex create mode 100644 tex/context/base/xtag-raw.mkii delete mode 100644 tex/context/base/xtag-raw.tex create mode 100644 tex/context/base/xtag-rng.mkii delete mode 100644 tex/context/base/xtag-rng.tex create mode 100644 tex/context/base/xtag-run.mkii delete mode 100644 tex/context/base/xtag-run.tex create mode 100644 tex/context/base/xtag-stk.mkii delete mode 100644 tex/context/base/xtag-stk.tex create mode 100644 tex/context/base/xtag-utf.mkii delete mode 100644 tex/context/base/xtag-utf.tex create mode 100644 tex/context/base/xtag-xsd.mkii delete mode 100644 tex/context/base/xtag-xsd.tex create mode 100644 tex/context/base/xtag-xsl.mkii delete mode 100644 tex/context/base/xtag-xsl.tex (limited to 'tex') diff --git a/tex/context/base/buff-imp-default.lua b/tex/context/base/buff-imp-default.lua new file mode 100644 index 000000000..2e3707442 --- /dev/null +++ b/tex/context/base/buff-imp-default.lua @@ -0,0 +1,42 @@ +if not modules then modules = { } end modules ['v-default'] = { + version = 1.001, + comment = "companion to v-default.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local patterns, P, V = lpeg.patterns, lpeg.P, lpeg.V +local makepattern = visualizers.makepattern + +local handler = visualizers.newhandler() + +local grammar = { "visualizer", + + -- basic + + signal = makepattern(handler,"signal", visualizers.signalpattern), + emptyline = makepattern(handler,"emptyline",patterns.emptyline), + beginline = makepattern(handler,"beginline",patterns.beginline), + newline = makepattern(handler,"newline", patterns.newline), + space = makepattern(handler,"space", patterns.space), + default = makepattern(handler,"default", patterns.utf8char), + content = makepattern(handler,"default", patterns.somecontent), -- not too efficient + + -- handy + + -- line = V("newline") * V("emptyline")^0 * V("beginline"), + line = V("newline") * V("emptyline")^0 * V("beginline") + V("emptyline") + V("newline"), + whitespace = (V("space") + V("line"))^1, + optionalwhitespace = (V("space") + V("line"))^0, + + -- used + + pattern = V("line") + V("space") + V("signal") + V("content"), + visualizer = V("pattern")^1 + +} + +local parser = P(grammar) + +visualizers.register("default", { parser = parser, handler = handler, grammar = grammar }) diff --git a/tex/context/base/buff-imp-default.mkiv b/tex/context/base/buff-imp-default.mkiv new file mode 100644 index 000000000..f9a821f0f --- /dev/null +++ b/tex/context/base/buff-imp-default.mkiv @@ -0,0 +1,43 @@ +%D \module +%D [ file=v-default, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=Default, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-default.lua}{1.001} + +\unprotect + +\definestartstop + [DefaultSnippet] + [\c!before=\blank, + \c!after=\blank, + \c!style=\tt] + +% Name +% NamePrimitive +% NamePlain +% NameMetafun +% Group +% Boundary +% Special +% Comment +% Constructor +% Key +% Entity +% String +% Equal +% Cdata +% Instruction + +% Value +% Quote + +\protect \endinput diff --git a/tex/context/base/buff-imp-escaped.lua b/tex/context/base/buff-imp-escaped.lua new file mode 100644 index 000000000..060f48ea3 --- /dev/null +++ b/tex/context/base/buff-imp-escaped.lua @@ -0,0 +1,14 @@ +if not modules then modules = { } end modules ['v-escaped'] = { + version = 1.001, + comment = "companion to v-escaped.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +visualizers.registerescapepattern("/BTEX/ETEX","/BTEX","/ETEX") + +visualizers.register("escaped", { + parser = visualizers.escapepatterns["/BTEX/ETEX"], + handler = visualizers.newhandler(), +}) diff --git a/tex/context/base/buff-imp-escaped.mkiv b/tex/context/base/buff-imp-escaped.mkiv new file mode 100644 index 000000000..780d0b518 --- /dev/null +++ b/tex/context/base/buff-imp-escaped.mkiv @@ -0,0 +1,18 @@ +%D \module +%D [ file=v-escaped, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=Escaped, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-escaped.lua}{1.001} + +\unprotect + +\protect \endinput diff --git a/tex/context/base/buff-imp-lua.lua b/tex/context/base/buff-imp-lua.lua new file mode 100644 index 000000000..abe8de211 --- /dev/null +++ b/tex/context/base/buff-imp-lua.lua @@ -0,0 +1,208 @@ +if not modules then modules = { } end modules ['v-lua'] = { + version = 1.001, + comment = "companion to v-lua.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- borrowed from scite +-- +-- depricated: +-- +-- gcinfo unpack getfenv setfenv loadlib +-- table.maxn table.getn table.setn +-- math.log10 math.mod math.modf math.fmod + +local format, tohash = string.format, table.tohash +local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns +local C, Cs, Cg, Cb, Cmt, Carg = lpeg.C, lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.Cmt, lpeg.Carg + +local core = tohash { + "and", "break", "do", "else", "elseif", "end", "false", "for", "function", + "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", + "true", "until", "while" +} + +local base = tohash { + "assert", "collectgarbage", "dofile", "error", "loadfile", + "loadstring", "print", "rawget", "rawset", "require", "tonumber", + "tostring", "type", "_G", "getmetatable", "ipairs", "next", "pairs", + "pcall", "rawequal", "setmetatable", "xpcall", "module", "select", +} + +local libraries = { + coroutine = tohash { + "create", "resume", "status", "wrap", "yield", "running", + }, + package = tohash{ + "cpath", "loaded", "loadlib", "path", "config", "preload", "seeall", + }, + io = tohash{ + "close", "flush", "input", "lines", "open", "output", "read", "tmpfile", + "type", "write", "stdin", "stdout", "stderr", "popen", + }, + math = tohash{ + "abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "deg", "exp", + "floor ", "ldexp", "log", "max", "min", "pi", "pow", "rad", "random", + "randomseed", "sin", "sqrt", "tan", "cosh", "sinh", "tanh", "huge", + }, + string = tohash{ + "byte", "char", "dump", "find", "len", "lower", "rep", "sub", "upper", + "format", "gfind", "gsub", "gmatch", "match", "reverse", + }, + table = tohash{ + "concat", "foreach", "foreachi", "sort", "insert", "remove", "pack", + "unpack", + }, + os = tohash{ + "clock", "date", "difftime", "execute", "exit", "getenv", "remove", + "rename", "setlocale", "time", "tmpname", + }, + lpeg = tohash{ + "print", "match", "locale", "type", "version", "setmaxstack", + "P", "R", "S", "C", "V", "Cs", "Ct", "Cs", "Cp", "Carg", + "Cg", "Cb", "Cmt", "Cf", "B", + }, + -- bit + -- debug +} + +local context = context +local verbatim = context.verbatim +local makepattern = visualizers.makepattern + +local LuaSnippet = context.LuaSnippet +local startLuaSnippet = context.startLuaSnippet +local stopLuaSnippet = context.stopLuaSnippet + +local LuaSnippetBoundary = verbatim.LuaSnippetBoundary +local LuaSnippetQuote = verbatim.LuaSnippetQuote +local LuaSnippetString = verbatim.LuaSnippetString +local LuaSnippetSpecial = verbatim.LuaSnippetSpecial +local LuaSnippetComment = verbatim.LuaSnippetComment +local LuaSnippetNameCore = verbatim.LuaSnippetNameCore +local LuaSnippetNameBase = verbatim.LuaSnippetNameBase +local LuaSnippetNameLibraries = verbatim.LuaSnippetNameLibraries +local LuaSnippetName = verbatim.LuaSnippetName + +local namespace + +local function visualizename_a(s) + if core[s] then + namespace = nil + LuaSnippetNameCore(s) + elseif base[s] then + namespace = nil + LuaSnippetNameBase(s) + else + namespace = libraries[s] + if namespace then + LuaSnippetNameLibraries(s) + else + LuaSnippetName(s) + end + end +end + +local function visualizename_b(s) + if namespace and namespace[s] then + namespace = nil + LuaSnippetNameLibraries(s) + else + LuaSnippetName(s) + end +end + +local function visualizename_c(s) + LuaSnippetName(s) +end + +local handler = visualizers.newhandler { + startinline = function() LuaSnippet(false,"{") end, + stopinline = function() context("}") end, + startdisplay = function() startLuaSnippet() end, + stopdisplay = function() stopLuaSnippet() end , + boundary = function(s) LuaSnippetBoundary(s) end, + special = function(s) LuaSnippetSpecial(s) end, + comment = function(s) LuaSnippetComment(s) end, + quote = function(s) LuaSnippetQuote(s) end, + string = function(s) LuaSnippetString(s) end, + period = function(s) verbatim(s) end, + name_a = visualizename_a, + name_b = visualizename_b, + name_c = visualizename_c, +} + +local comment = P("--") +local name = (patterns.letter + patterns.underscore) + * (patterns.letter + patterns.underscore + patterns.digit)^0 +local boundary = S('()[]{}') +local special = S("-+/*^%=#") + P("..") + +-- The following longstring parser is taken from Roberto's documentation +-- that can be found at http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html. + +local equals = P("=")^0 +local open = P("[") * Cg(equals, "init") * P("[") * P("\n")^-1 -- maybe better: patterns.newline^-1 +local close = P("]") * C(equals) * P("]") +local closeeq = Cmt(close * Cb("init"), function(s,i,a,b) return a == b end) +local longstring = open * Cs((P(1) - closeeq)^0) * close * Carg(1) + +local function long(content,equals,settings) + handler.boundary(format("[%s[",equals or "")) + visualizers.write(content,settings) -- unhandled + handler.boundary(format("]%s]",equals or "")) +end + +local grammar = visualizers.newgrammar("default", { "visualizer", + sstring = + makepattern(handler,"quote",patterns.dquote) + * (V("whitespace") + makepattern(handler,"string",1-patterns.dquote))^0 -- patterns.nodquote + * makepattern(handler,"quote",patterns.dquote), + dstring = + makepattern(handler,"quote",patterns.squote) + * (V("whitespace") + makepattern(handler,"string",1-patterns.squote))^0 -- patterns.nosquote + * makepattern(handler,"quote",patterns.squote), + longstring = + longstring / long, + comment = + makepattern(handler,"comment",comment) + * (V("space") + V("content"))^0, + longcomment = + makepattern(handler,"comment",comment) + * longstring / long, + name = + makepattern(handler,"name_a",name) + * ( V("optionalwhitespace") + * makepattern(handler,"default",patterns.period) + * V("optionalwhitespace") + * makepattern(handler,"name_b",name) + )^-1 + * ( V("optionalwhitespace") + * makepattern(handler,"default",patterns.period) + * V("optionalwhitespace") + * makepattern(handler,"name_c",name) + )^0, + + pattern = + V("longcomment") + + V("comment") + + V("longstring") + + V("dstring") + + V("sstring") + + V("name") + + makepattern(handler,"boundary",boundary) + + makepattern(handler,"special",special) + + + V("space") + + V("line") + + V("default"), + + visualizer = + V("pattern")^1 +} ) + +local parser = P(grammar) + +visualizers.register("lua", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/buff-imp-lua.mkiv b/tex/context/base/buff-imp-lua.mkiv new file mode 100644 index 000000000..4ed04f169 --- /dev/null +++ b/tex/context/base/buff-imp-lua.mkiv @@ -0,0 +1,69 @@ +%D \module +%D [ file=v-lua, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=\LUA, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-lua.lua}{1.001} + +\unprotect + +\definestartstop + [LuaSnippet] + [DefaultSnippet] + +\definestartstop + [LuaSnippetName] + [\c!color=, + \c!style=boldface] + +\definestartstop + [LuaSnippetNameCore] + [\c!color=darkgreen, + \c!style=boldface] + +\definestartstop + [LuaSnippetNameBase] + [\c!color=darkgreen, + \c!style=boldface] + +\definestartstop + [LuaSnippetNameLibraries] + [\c!color=darkgreen, + \c!style=boldface] + +\definestartstop + [LuaSnippetBoundary] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [LuaSnippetString] + [LuaSnippet] + +\definestartstop + [LuaSnippetQuote] + [LuaSnippetBoundary] + +\definestartstop + [LuaSnippetSpecial] + [\c!color=darkred, + \c!style=boldface] + +\definestartstop + [LuaSnippetComment] + [\c!color=darkyellow, + \c!style=boldface] + +\definetyping + [LUA] + [\c!option=lua] + +\protect \endinput diff --git a/tex/context/base/buff-imp-mp.lua b/tex/context/base/buff-imp-mp.lua new file mode 100644 index 000000000..7c356a5c8 --- /dev/null +++ b/tex/context/base/buff-imp-mp.lua @@ -0,0 +1,176 @@ +if not modules then modules = { } end modules ['v-mp'] = { + version = 1.001, + comment = "companion to v-mp.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns + +local primitives = table.tohash { + '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', 'mpprocset', + 'false', 'nullpicture', 'pencircle', 'true', + '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', + 'addto', 'clip', 'input', 'interim', 'let', 'newinternal', 'save', 'setbounds', + 'shipout', 'show', 'showdependencies', 'showtoken', 'showvariable', + 'special', + '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', 'forever', 'exitif', + 'forsuffixes', 'downto', 'upto', 'step', 'until', + 'charlist', 'extensible', 'fontdimen', 'headerbyte', 'kern', 'ligtable', + 'boundarychar', 'chardp', 'charext', 'charht', 'charic', 'charwd', 'designsize', + 'fontmaking', 'charexists', + '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', + 'extra_beginfig', 'extra_endfig', 'mpxbreak', + 'end', 'btex', 'etex', 'verbatimtex' +} + +local plain = table.tohash { + 'ahangle', 'ahlength', 'bboxmargin', 'defaultpen', 'defaultscale', + 'labeloffset', 'background', 'currentpen', 'currentpicture', 'cuttings', + 'defaultfont', 'extra_beginfig', 'extra_endfig', + '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', + 'abs', 'bbox', 'ceiling', 'center', 'cutafter', 'cutbefore', 'dir', + 'directionpoint', 'div', 'dotprod', 'intersectionpoint', 'inverse', 'mod', 'lft', + 'round', 'rt', 'unitvector', 'whatever', + 'cutdraw', 'draw', 'drawarrow', 'drawdblarrow', 'fill', 'filldraw', 'drawdot', + 'loggingall', 'pickup', 'tracingall', 'tracingnone', 'undraw', 'unfill', + 'unfilldraw', + 'buildcycle', 'dashpattern', 'decr', 'dotlabel', 'dotlabels', 'drawoptions', + 'incr', 'label', 'labels', 'max', 'min', 'thelabel', 'z', + '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' +} + +local metafun = table.tohash { + 'unitcircle', 'fulldiamond', 'unitdiamond', + 'halfcircle', 'quartercircle', + 'llcircle', 'lrcircle', 'urcircle', 'ulcircle', + 'tcircle', 'bcircle', 'lcircle', 'rcircle', + 'lltriangle', 'lrtriangle', 'urtriangle', 'ultriangle', + 'smoothed', 'cornered', 'superellipsed', 'randomized', 'squeezed', + 'punked', 'curved', 'unspiked', 'simplified', 'blownup', 'stretched', + 'paralled', 'enlonged', 'shortened', + 'enlarged', 'leftenlarged', 'topenlarged', 'rightenlarged', 'bottomenlarged', + 'llenlarged', 'lrenlarged', 'urenlarged', 'ulenlarged', + 'llmoved', 'lrmoved', 'urmoved', 'ulmoved', + 'boundingbox', 'innerboundingbox', 'outerboundingbox', + 'bottomboundary', 'leftboundary', 'topboundary', 'rightboundary', + 'xsized', 'ysized', 'xysized', + 'cmyk', 'transparent', 'withshade', 'spotcolor', + 'drawfill', 'undrawfill', + 'inverted', 'uncolored', 'softened', 'grayed', + 'textext', 'graphictext', + 'loadfigure', 'externalfigure' +} + +local context = context +local verbatim = context.verbatim +local makepattern = visualizers.makepattern + +local MetapostSnippet = context.MetapostSnippet +local startMetapostSnippet = context.startMetapostSnippet +local stopMetapostSnippet = context.stopMetapostSnippet + +local MetapostSnippetConstructor = verbatim.MetapostSnippetConstructor +local MetapostSnippetBoundary = verbatim.MetapostSnippetBoundary +local MetapostSnippetSpecial = verbatim.MetapostSnippetSpecial +local MetapostSnippetComment = verbatim.MetapostSnippetComment +local MetapostSnippetNamePrimitive = verbatim.MetapostSnippetNamePrimitive +local MetapostSnippetNamePlain = verbatim.MetapostSnippetNamePlain +local MetapostSnippetNameMetafun = verbatim.MetapostSnippetNameMetafun +local MetapostSnippetName = verbatim.MetapostSnippetName + +local function visualizename(s) + if primitives[s] then + MetapostSnippetNamePrimitive(s) + elseif plain[s] then + MetapostSnippetNamePlain(s) + elseif metafun[s] then + MetapostSnippetNameMetafun(s) + else + MetapostSnippetName(s) + end +end + +local handler = visualizers.newhandler { + startinline = function() MetapostSnippet(false,"{") end, + stopinline = function() context("}") end, + startdisplay = function() startMetapostSnippet() end, + stopdisplay = function() stopMetapostSnippet() end , + constructor = function(s) MetapostSnippetConstructor(s) end, + boundary = function(s) MetapostSnippetBoundary(s) end, + special = function(s) MetapostSnippetSpecial(s) end, + comment = function(s) MetapostSnippetComment(s) end, + string = function(s) MetapostSnippetString(s) end, + quote = function(s) MetapostSnippetQuote(s) end, + name = visualizename, +} + +local comment = S("%") +local name = (patterns.letter + S("_"))^1 +local constructor = S("$@#") +local boundary = S('()[]:=<>;"') +local special = S("-+/*|`!?^&%.,") + +local grammar = visualizers.newgrammar("default", { "visualizer", + + comment = makepattern(handler,"comment",comment) + * (V("space") + V("content"))^0, + dstring = makepattern(handler,"quote",patterns.dquote) + * makepattern(handler,"string",patterns.nodquote) + * makepattern(handler,"quote",patterns.dquote), + name = makepattern(handler,"name",name), + constructor = makepattern(handler,"constructor",constructor), + boundary = makepattern(handler,"boundary",boundary), + special = makepattern(handler,"special",special), + + pattern = + V("comment") + V("dstring") + V("name") + V("constructor") + V("boundary") + V("special") + + V("newline") * V("emptyline")^0 * V("beginline") + + V("space") + + V("default"), + + visualizer = + V("pattern")^1 + +} ) + +local parser = P(grammar) + +visualizers.register("mp", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/buff-imp-mp.mkiv b/tex/context/base/buff-imp-mp.mkiv new file mode 100644 index 000000000..30eb23f8b --- /dev/null +++ b/tex/context/base/buff-imp-mp.mkiv @@ -0,0 +1,76 @@ +%D \module +%D [ file=v-mp, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=\METAPOST, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-mp.lua}{1.001} + +\unprotect + +\definestartstop + [MetapostSnippet] + [DefaultSnippet] + +\definestartstop + [MetapostSnippetName] + [\c!color=darkgreen, + \c!style=boldface] + +\definestartstop + [MetapostSnippetNamePrimitive] + [\c!color=darkgreen, + \c!style=swapface] + +\definestartstop + [MetapostSnippetNamePlain] + [\c!color=darkblue, + \c!color=darkgreen, + \c!style=swapface] + +\definestartstop + [MetapostSnippetNameMetafun] + [\c!color=darkred, + \c!color=darkgreen, + \c!style=swapface] + +\definestartstop + [MetapostSnippetConstructor] + [\c!color=darkred, + \c!style=boldface] + +\definestartstop + [MetapostSnippetBoundary] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [MetapostSnippetQuote] + [MetapostSnippetBoundary] + +\definestartstop + [MetapostSnippetSpecial] + [\c!color=darkyellow, + \c!style=boldface] + +\definestartstop + [MetapostSnippetString] + [MetapostSnippet] + +\definestartstop + [MetapostSnippetComment] + [\c!color=darkyellow, + \c!style=boldface] + +\definetyping + [MP] + [\c!option=mp] + +\protect \endinput diff --git a/tex/context/base/buff-imp-nested.lua b/tex/context/base/buff-imp-nested.lua new file mode 100644 index 000000000..e37e1bb58 --- /dev/null +++ b/tex/context/base/buff-imp-nested.lua @@ -0,0 +1,80 @@ +if not modules then modules = { } end modules ['v-nested'] = { + version = 1.001, + comment = "companion to v-nested.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local lpegmatch, patterns = lpeg.match, lpeg.patterns +local P, V, Carg = lpeg.P, lpeg.V, lpeg.Carg + +local context = context +local verbatim = context.verbatim +local variables = interfaces.variables + +local makepattern = visualizers.makepattern +local getvisualizer = visualizers.getvisualizer + +local nested = nil + +local donestedtypingstart = context.donestedtypingstart +local donestedtypingstop = context.donestedtypingstop + +local v_none = variables.none +local v_slanted = variables.slanted + +local handler = visualizers.newhandler { + initialize = function(settings) + local option = settings and settings.option + if not option or option == "" then + nested = nil + elseif option == v_slanted then + nested = nil + elseif option == v_none then + nested = nil + else + nested = getvisualizer(option,"direct") + end + end, + open = function() + donestedtypingstart() + end, + close = function() + donestedtypingstop() + end, + content = function(s) + if nested then + nested(s) + else + verbatim(s) + end + end, +} + +local open = P("<<") +local close = P(">>") +local rest = (1 - open - close - patterns.space - patterns.newline)^1 + +local grammar = visualizers.newgrammar("default", { + + initialize = patterns.beginofstring * Carg(1) / handler.initialize, + + open = makepattern(handler,"open",open), + close = makepattern(handler,"close",close), + rest = makepattern(handler,"content",rest), + + nested = V("open") * (V("pattern")^0) * V("close"), + pattern = V("line") + V("space") + V("nested") + V("rest"), + + visualizer = V("initialize") * (V("pattern")^1) + +} ) + +local parser = P(grammar) + +visualizers.register("nested", { parser = parser, handler = handler, grammar = grammar } ) + +-- lpeg.match(parser,[[<>tf<>tf>>]]) context.par() +-- lpeg.match(parser,[[<>sl>>tf>>]]) context.par() +-- lpeg.match(parser,[[sl<>tf>>sl]]) context.par() diff --git a/tex/context/base/buff-imp-nested.mkiv b/tex/context/base/buff-imp-nested.mkiv new file mode 100644 index 000000000..e1d582d81 --- /dev/null +++ b/tex/context/base/buff-imp-nested.mkiv @@ -0,0 +1,21 @@ +%D \module +%D [ file=v-nested, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=Nested, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-nested.lua}{1.001} + +\unprotect + +\unexpanded\def\donestedtypingstart{\bgroup\swaptypeface{}} +\unexpanded\def\donestedtypingstop {\egroup{}} + +\protect \endinput diff --git a/tex/context/base/buff-imp-parsed-xml.lua b/tex/context/base/buff-imp-parsed-xml.lua new file mode 100644 index 000000000..530060b57 --- /dev/null +++ b/tex/context/base/buff-imp-parsed-xml.lua @@ -0,0 +1,101 @@ +if not modules then modules = { } end modules ['v-parsed-xml'] = { + version = 1.001, + comment = "companion to v-parsed-xml.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format = string.format + +local context = context +local verbatim = context.verbatim + +local write = visualizers.write +local writespace = visualizers.writespace +local writeargument = visualizers.writeargument + +local ParsedXmlSnippetKey = context.ParsedXmlSnippetKey +local ParsedXmlSnippetValue = context.ParsedXmlSnippetValue + +local ParsedXmlSnippetElement = verbatim.ParsedXmlSnippetElement +local ParsedXmlSnippetInstruction = verbatim.ParsedXmlSnippetInstruction +local ParsedXmlSnippetComment = verbatim.ParsedXmlSnippetComment +local ParsedXmlSnippetCdata = verbatim.ParsedXmlSnippetCdata +local ParsedXmlSnippetDoctype = verbatim.ParsedXmlSnippetDoctype + +local startParsedXmlSnippet = context.startParsedXmlSnippet +local stopParsedXmlSnippet = context.stopParsedXmlSnippet + +local parsedxmlhandler = xml.newhandlers { -- todo: treat spaces and tabs + name = "parsedxml", + handle = function(...) + print("error:",...) -- we need a handler as fallback, even if not used + end, + functions = { + ["@el@"] = function(e,handler) + local at = e.at + if at and next(at) then + ParsedXmlSnippetElement(format("<%s",e.tg)) + for k, v in next, at do + writespace() + ParsedXmlSnippetKey() + writeargument(k) + verbatim("=") + ParsedXmlSnippetValue() + writeargument(format("%q",k)) + end + ParsedXmlSnippetElement(">") + else + ParsedXmlSnippetElement(format("<%s>",e.tg)) + end + handler.serialize(e.dt,handler) + ParsedXmlSnippetElement(format("",e.tg)) + end, + ["@pi@"] = function(e,handler) + ParsedXmlSnippetInstruction("") + end , + ["@cm@"] = function(e,handler) + ParsedXmlSnippetComment("") + end, + ["@cd@"] = function(e,handler) + ParsedXmlSnippetCdata("") + end, + ["@dt@"] = function(e,handler) + ParsedXmlSnippetDoctype("") + end, + ["@tx@"] = function(s,handler) + write(s) + end, + } +} + +local function parsedxml(root,pattern) + if root then + if pattern then + root = xml.filter(root,pattern) + end + if root then + context.startParsedXmlSnippet() + xml.serialize(root,parsedxmlhandler) + context.stopParsedXmlSnippet() + end + end +end + +local function parser(str,settings) + parsedxml(xml.convert(str),settings and settings.pattern) +end + +visualizers.parsedxml = parsedxml -- for use at the lua end (maybe namespace needed) + +visualizers.register("parsed-xml", { parser = parser } ) + diff --git a/tex/context/base/buff-imp-parsed-xml.mkiv b/tex/context/base/buff-imp-parsed-xml.mkiv new file mode 100644 index 000000000..b99328be7 --- /dev/null +++ b/tex/context/base/buff-imp-parsed-xml.mkiv @@ -0,0 +1,70 @@ +%D \module +%D [ file=v-parsed-xml, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=Parsed \XML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% todo: color specific elements + +\registerctxluafile{v-parsed-xml.lua}{1.001} + +\unprotect + +\definestartstop + [ParsedXmlSnippet] + [%\c!before=\blank, + %\c!after=\blank, + \c!style=\tt] + +\definestartstop + [ParsedXmlSnippetDocType] + [\c!style=boldface, + \c!color=darkgreen] + +\definestartstop + [ParsedXmlSnippetElement] + [\c!style=boldface, + \c!color=darkblue] + +\definestartstop + [ParsedXmlSnippetInstruction] + [\c!style=boldface, + \c!color=darkgreen] + +\definestartstop + [ParsedXmlSnippetCdata] + [\c!style=boldface, + \c!color=darkgreen] + +\definestartstop + [ParsedXmlSnippetComment] + [\c!style=boldface, + \c!color=darkgreen] + +\definestartstop + [ParsedXmlSnippetKey] + [\c!style=boldface, + \c!color=darkred] + +% \definestartstop +% [ParsedXmlSnippetQuote] +% [\c!style=, +% \c!color=] + +\definestartstop + [ParsedXmlSnippetValue] + [\c!style=, + \c!color=] + +\definetyping + [PARSEDXML] + [option=parsed-xml] + +\protect \endinput diff --git a/tex/context/base/buff-imp-tex.lua b/tex/context/base/buff-imp-tex.lua new file mode 100644 index 000000000..1973017f3 --- /dev/null +++ b/tex/context/base/buff-imp-tex.lua @@ -0,0 +1,130 @@ +if not modules then modules = { } end modules ['v-tex'] = { + version = 1.001, + comment = "companion to v-tex.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns + +local context = context +local verbatim = context.verbatim +local makepattern = visualizers.makepattern +local makenested = visualizers.makenested +local getvisualizer = visualizers.getvisualizer + +local TexSnippet = context.TexSnippet +local startTexSnippet = context.startTexSnippet +local stopTexSnippet = context.stopTexSnippet + +local TexSnippetName = verbatim.TexSnippetName +local TexSnippetGroup = verbatim.TexSnippetGroup +local TexSnippetBoundary = verbatim.TexSnippetBoundary +local TexSnippetSpecial = verbatim.TexSnippetSpecial +local TexSnippetComment = verbatim.TexSnippetComment + +local handler = visualizers.newhandler { + startinline = function() TexSnippet(false,"{") end, + stopinline = function() context("}") end, + startdisplay = function() startTexSnippet() end, + stopdisplay = function() stopTexSnippet() end , + name = function(s) TexSnippetName(s) end, + group = function(s) TexSnippetGroup(s) end, + boundary = function(s) TexSnippetBoundary(s) end, + special = function(s) TexSnippetSpecial(s) end, + comment = function(s) TexSnippetComment(s) end, +} + +-- todo: unicode letters in control sequences (slow as we need to test the nature) + +local comment = S("%") +local name = P("\\") * (patterns.letter + S("@!?"))^1 +local escape = P("\\") * (patterns.anything - patterns.newline)^-1 -- else we get \n +local group = S("${}") +local boundary = S('[]()<>#="') +local special = S("/^_-&+'`|") + +local p_comment = makepattern(handler,"comment",comment) + * (V("space") + V("content"))^0 +local p_name = makepattern(handler,"name",name) +local p_escape = makepattern(handler,"name",escape) +local p_group = makepattern(handler,"group",group) +local p_boundary = makepattern(handler,"boundary",boundary) +local p_special = makepattern(handler,"special",special) +local p_somespace = V("newline") * V("emptyline")^0 * V("beginline") + + V("space") + +--~ local pattern = visualizers.pattern + +local grammar = visualizers.newgrammar("default", { "visualizer", + + comment = p_comment, + name = p_name, + escape = p_escape, + group = p_group, + boundary = p_boundary, + special = p_special, + somespace = p_somespace, + + pattern = V("comment") + + V("name") + V("escape") + V("group") + V("boundary") + V("special") + + V("newline") * V("emptyline")^0 * V("beginline") + + V("space") + + V("default"), + + visualizer = V("pattern")^1 + +} ) + +local parser = P(grammar) + +visualizers.register("tex", { parser = parser, handler = handler, grammar = grammar } ) + +local function makecommand(handler,how,start,left,right) + local c, l, r, f = P(start), P(left), P(right), how + local n = ( P { l * ((1 - (l + r)) + V(1))^0 * r } + P(1-r) )^0 + if type(how) == "string" then + f = function(s) getvisualizer(how,"direct")(s) end + end + return makepattern(handler,"name",c) + * V("somespace")^0 + * makepattern(handler,"group",l) + * (n/f) + * makepattern(handler,"group",r) +end + +local grammar = visualizers.newgrammar("default", { "visualizer", + + comment = p_comment, + name = p_name, + escape = p_escape, + group = p_group, + boundary = p_boundary, + special = p_special, + somespace = p_somespace, + + mpcode = makenested(handler,"mp","\\startMPcode","\\stopMPcode") + + makenested(handler,"mp","\\startMPgraphic","\\stopMPgraphic") + + makenested(handler,"mp","\\startuseMPgraphic","\\stopuseMPgraphic") + + makenested(handler,"mp","\\startreusableMPgraphic","\\stopreusableMPgraphic") + + makenested(handler,"mp","\\startuniqueMPgraphic","\\stopuniqueMPgraphic") + + makenested(handler,"mp","\\startMPpage","\\stopMPpage"), + + luacode = makenested (handler,"lua","\\startluacode","\\stopluacode") + + makecommand(handler,"lua","\\ctxlua","{","}"), + + pattern = V("comment") + + V("mpcode") + V("luacode") + + V("name") + V("escape") + V("group") + V("boundary") + V("special") + + V("newline") * V("emptyline")^0 * V("beginline") + + V("space") + + V("default"), + + visualizer = V("pattern")^1 + +} ) + +local parser = P(grammar) + +visualizers.register("context", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/buff-imp-tex.mkiv b/tex/context/base/buff-imp-tex.mkiv new file mode 100644 index 000000000..5cd5753bb --- /dev/null +++ b/tex/context/base/buff-imp-tex.mkiv @@ -0,0 +1,51 @@ +%D \module +%D [ file=v-tex, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=\TEX, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-tex.lua}{1.001} + +\unprotect + +\definestartstop + [TexSnippet] + [DefaultSnippet] + +\definestartstop + [TexSnippetName] + [\c!color=darkgreen, + \c!style=boldface] + +\definestartstop + [TexSnippetGroup] + [\c!color=darkred, + \c!style=boldface] + +\definestartstop + [TexSnippetBoundary] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [TexSnippetSpecial] + [\c!color=darkyellow, + \c!style=boldface] + +\definestartstop + [TexSnippetComment] + [\c!color=darkyellow, + \c!style=boldface] + +\definetyping + [TEX] + [\c!option=tex] + +\protect \endinput diff --git a/tex/context/base/buff-imp-xml.lua b/tex/context/base/buff-imp-xml.lua new file mode 100644 index 000000000..bf6945e26 --- /dev/null +++ b/tex/context/base/buff-imp-xml.lua @@ -0,0 +1,133 @@ +if not modules then modules = { } end modules ['v-xml'] = { + version = 1.001, + comment = "companion to v-xml.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns + +local context = context +local verbatim = context.verbatim +local makepattern = visualizers.makepattern + +local XmlSnippet = context.XmlSnippet +local startXmlSnippet = context.startXmlSnippet +local stopXmlSnippet = context.stopXmlSnippet + +local XmlSnippetName = verbatim.XmlSnippetName +local XmlSnippetKey = verbatim.XmlSnippetKey +local XmlSnippetBoundary = verbatim.XmlSnippetBoundary +local XmlSnippetString = verbatim.XmlSnippetString +local XmlSnippetEqual = verbatim.XmlSnippetEqual +local XmlSnippetEntity = verbatim.XmlSnippetEntity +local XmlSnippetComment = verbatim.XmlSnippetComment +local XmlSnippetCdata = verbatim.XmlSnippetCdata + +local handler = visualizers.newhandler { + startinline = function() XmlSnippet(false,"{") end, + stopinline = function() context("}") end, + startdisplay = function() startXmlSnippet() end, + stopdisplay = function() stopXmlSnippet () end, + name = function(s) XmlSnippetName(s) end, + key = function(s) XmlSnippetKey(s) end, + boundary = function(s) XmlSnippetBoundary(s) end, + string = function(s) XmlSnippetString(s) end, + equal = function(s) XmlSnippetEqual(s) end, + entity = function(s) XmlSnippetEntity(s) end, + comment = function(s) XmlSnippetComment(s) end, + cdata = function(s) XmlSnippetCdata(s) end, +} + +local comment = P("--") +local name = (patterns.letter + patterns.digit + S('_-.'))^1 +local entity = P("&") * (1-P(";"))^1 * P(";") +local openbegin = P("<") +local openend = P("") + P(">") +local closeend = P(">") +local opencomment = P("") +local openinstruction = P("") +local opencdata = P("") + +local grammar = visualizers.newgrammar("default", { "visualizer", + sstring = + makepattern(handler,"string",patterns.dquote) + * (V("whitespace") + makepattern(handler,"default",1-patterns.dquote))^0 + * makepattern(handler,"string",patterns.dquote), + dstring = + makepattern(handler,"string",patterns.squote) + * (V("whitespace") + makepattern(handler,"default",1-patterns.squote))^0 + * makepattern(handler,"string",patterns.squote), + entity = + makepattern(handler,"entity",entity), + name = + makepattern(handler,"name",name) + * ( + makepattern(handler,"default",patterns.colon) + * makepattern(handler,"name",name) + )^0, + key = + makepattern(handler,"key",name) + * ( + makepattern(handler,"default",patterns.colon) + * makepattern(handler,"key",name) + )^0, + attributes = ( + V("optionalwhitespace") + * V("key") + * V("optionalwhitespace") + * makepattern(handler,"equal",patterns.equal) + * V("optionalwhitespace") + * (V("dstring") + V("sstring")) + * V("optionalwhitespace") + )^0, + open = + makepattern(handler,"boundary",openbegin) + * V("name") + * V("optionalwhitespace") + * V("attributes") + * makepattern(handler,"boundary",closebegin), + close = + makepattern(handler,"boundary",openend) + * V("name") + * V("optionalwhitespace") + * makepattern(handler,"boundary",closeend), + comment = + makepattern(handler,"boundary",opencomment) + * (V("whitespace") + makepattern(handler,"comment",(1-closecomment)))^0 -- slow + * makepattern(handler,"boundary",closecomment), + cdata = + makepattern(handler,"boundary",opencdata) + * (V("whitespace") + makepattern(handler,"comment",(1-closecdata)))^0 -- slow + * makepattern(handler,"boundary",closecdata), + instruction = + makepattern(handler,"boundary",openinstruction) + * V("name") + * V("optionalwhitespace") + * V("attributes") + * V("optionalwhitespace") + * makepattern(handler,"boundary",closeinstruction), + + pattern = + V("comment") + + V("instruction") + + V("cdata") + + V("close") + + V("open") + + V("entity") + + V("space") + + V("line") + + V("default"), + + visualizer = + V("pattern")^1 +} ) + +local parser = P(grammar) + +visualizers.register("xml", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/buff-imp-xml.mkiv b/tex/context/base/buff-imp-xml.mkiv new file mode 100644 index 000000000..3cc9244f2 --- /dev/null +++ b/tex/context/base/buff-imp-xml.mkiv @@ -0,0 +1,71 @@ +%D \module +%D [ file=v-xml, +%D version=2010.10.19, +%D title=\CONTEXT\ Visualizer Macros, +%D subtitle=\XML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright=PRAGMA-ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\registerctxluafile{v-xml.lua}{1.001} + +\unprotect + +\definestartstop + [XmlSnippet] + [DefaultSnippet] + +\definestartstop + [XmlSnippetName] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [XmlSnippetKey] + [\c!color=darkgreen, + \c!style=boldface] + +\definestartstop + [XmlSnippetBoundary] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [XmlSnippetEntity] + [\c!color=darkred, + \c!style=boldface] + +\definestartstop + [XmlSnippetString] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [XmlSnippetEqual] + [\c!color=darkblue, + \c!style=boldface] + +\definestartstop + [XmlSnippetComment] + [\c!color=darkyellow, + \c!style=boldface] + +\definestartstop + [XmlSnippetCdata] + [\c!color=darkyellow, + \c!style=boldface] + +\definestartstop + [XmlSnippetInstruction] + [\c!color=darkyellow, + \c!style=boldface] + +\definetyping + [XML] + [\c!option=xml] + +\protect \endinput diff --git a/tex/context/base/buff-ver.lua b/tex/context/base/buff-ver.lua index 91bf1c6a0..9c7f6e371 100644 --- a/tex/context/base/buff-ver.lua +++ b/tex/context/base/buff-ver.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['buff-ver'] = { license = "see context related readme files" } --- The default visualizers have reserved names starting with v-*. Users are +-- The default visualizers have reserved names starting with buff-imp-*. Users are -- supposed to use different names for their own variants. local type, next, rawset, rawget, setmetatable, getmetatable = type, next, rawset, rawget, setmetatable, getmetatable @@ -224,8 +224,8 @@ function visualizers.load(name) name = lower(name) if rawget(specifications,name) == nil then name = lower(name) - local texname = findfile(format("v-%s.mkiv",name)) - local luaname = findfile(format("v-%s.lua" ,name)) + local texname = findfile(format("buff-imp-%s.mkiv",name)) + local luaname = findfile(format("buff-imp-%s.lua" ,name)) if texname == "" or luaname == "" then -- assume a user specific file luaname = findfile(addsuffix(name,"mkiv")) diff --git a/tex/context/base/colo-ema.mkii b/tex/context/base/colo-ema.mkii new file mode 100644 index 000000000..e5e90b235 --- /dev/null +++ b/tex/context/base/colo-ema.mkii @@ -0,0 +1,590 @@ +%D \module +%D [ file=colo-ema, +%D version=2003.03.20, +%D title=\CONTEXT\ Color Macros, +%D subtitle=Emacs Colors, +%D author=Peter Rolf, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% author : Peter Rolf +% last change : 17 march 2003 +% origin : /emacs/etc/rgb.txt +% +% USAGE: +% +% - select emacs menu: Edit -> Text Properties -> Display +% Colors, if you don't know what I'm talking about +% - copy this file to your /texmf/tex/context/user directory +% and add "\input colo-emacs" to your tex-file +% +% IMPORTANT NOTES: +% +% - all color names are written as ONE word in lowercase +% letters (no redundancy as in rgb.txt) so if you want to +% use the color "Light Sky Blue"/"light sky blue" it's new +% name is lightskyblue +% - the grayX values [X=0..100] can only be used with \color +% [grayX] +% - use it at your own risk :) +% +% HINT: +% +% I only include this file (\showcolor [ema]) until I've +% found the colors I want. Copy and paste the color +% definitions to a seperate file, to decrease compilation +% time (540 color definitions). + +\definecolor [snow] [r=1,g=.980392,b=.980392] +\definecolor [ghostwhite] [r=.972549,g=.972549,b=1] +\definecolor [whitesmoke] [s=.960784] +\definecolor [gainsboro] [s=.862745] +\definecolor [floralwhite] [r=1,g=.980392,b=.941176] +\definecolor [oldlace] [r=.992157,g=.960784,b=.901961] +\definecolor [linen] [r=.980392,g=.941176,b=.901961] +\definecolor [antiquewhite] [r=.980392,g=.921569,b=.843137] +\definecolor [papayawhip] [r=1,g=.937255,b=.835294] +\definecolor [blanchedalmond] [r=1,g=.921569,b=.803922] +\definecolor [bisque] [r=1,g=.894118,b=.768627] +\definecolor [peachpuff] [r=1,g=.854902,b=.72549] +\definecolor [navajowhite] [r=1,g=.870588,b=.678431] +\definecolor [moccasin] [r=1,g=.894118,b=.709804] +\definecolor [cornsilk] [r=1,g=.972549,b=.862745] +\definecolor [ivory] [r=1,g=1,b=.941176] +\definecolor [lemonchiffon] [r=1,g=.980392,b=.803922] +\definecolor [seashell] [r=1,g=.960784,b=.933333] +\definecolor [honeydew] [r=.941176,g=1,b=.941176] +\definecolor [mintcream] [r=.960784,g=1,b=.980392] +\definecolor [azure] [r=.941176,g=1,b=1] +\definecolor [aliceblue] [r=.941176,g=.972549,b=1] +\definecolor [lavender] [r=.901961,g=.901961,b=.980392] +\definecolor [lavenderblush] [r=1,g=.941176,b=.960784] +\definecolor [mistyrose] [r=1,g=.894118,b=.882353] +%definecolor[white] [s=1] +%definecolor[black] [s=0] +\definecolor [darkslategray] [r=.184314,g=.309804,b=.309804] +\definecolor [dimgray] [s=.411765] +\definecolor [slategray] [r=.439216,g=.501961,b=.564706] +\definecolor [lightslategray] [r=.466667,g=.533333,b=.6] +\definecolor [gray] [s=.745098] +\definecolor [lightgray] [s=.827451] +\definecolor [midnightblue] [r=.098039,g=.098039,b=.439216] +\definecolor [navy] [b=.501961] +\definecolor [navyblue] [navy] +\definecolor [cornflowerblue] [r=.392157,g=.584314,b=.929412] +\definecolor [darkslateblue] [r=.282353,g=.239216,b=.545098] +\definecolor [slateblue] [r=.415686,g=.352941,b=.803922] +\definecolor [mediumslateblue] [r=.482353,g=.407843,b=.933333] +\definecolor [lightslateblue] [r=.517647,g=.439216,b=1] +\definecolor [mediumblue] [b=.803922] +\definecolor [royalblue] [r=.254902,g=.411765,b=.882353] +%definecolor[blue] [b=1] +\definecolor [dodgerblue] [r=.117647,g=.564706,b=1] +\definecolor [deepskyblue] [g=.74902,b=1] +\definecolor [skyblue] [r=.529412,g=.807843,b=.921569] +\definecolor [lightskyblue] [r=.529412,g=.807843,b=.980392] +\definecolor [steelblue] [r=.27451,g=.509804,b=.705882] +\definecolor [lightsteelblue] [r=.690196,g=.768627,b=.870588] +\definecolor [lightblue] [r=.678431,g=.847059,b=.901961] +\definecolor [powderblue] [r=.690196,g=.878431,b=.901961] +\definecolor [paleturquoise] [r=.686275,g=.933333,b=.933333] +\definecolor [darkturquoise] [g=.807843,b=.819608] +\definecolor [mediumturquoise] [r=.282353,g=.819608,b=.8] +\definecolor [turquoise] [r=.25098,g=.878431,b=.815686] +%definecolor[cyan] [g=1,b=1] +\definecolor [lightcyan] [r=.878431,g=1,b=1] +\definecolor [cadetblue] [r=.372549,g=.619608,b=.627451] +\definecolor [mediumaquamarine] [r=.4,g=.803922,b=.666667] +\definecolor [aquamarine] [r=.498039,g=1,b=.831373] +\definecolor [darkgreen] [g=.392157] +\definecolor [darkolivegreen] [r=.333333,g=.419608,b=.184314] +\definecolor [darkseagreen] [r=.560784,g=.737255,b=.560784] +\definecolor [seagreen] [r=.180392,g=.545098,b=.341176] +\definecolor [mediumseagreen] [r=.235294,g=.701961,b=.443137] +\definecolor [lightseagreen] [r=.12549,g=.698039,b=.666667] +\definecolor [palegreen] [r=.596078,g=.984314,b=.596078] +\definecolor [springgreen] [g=1,b=.498039] +\definecolor [lawngreen] [r=.486275,g=.988235] +%definecolor[green] [g=1] +\definecolor [chartreuse] [r=.498039,g=1] +\definecolor [mediumspringgreen] [g=.980392,b=.603922] +\definecolor [greenyellow] [r=.678431,g=1,b=.184314] +\definecolor [limegreen] [r=.196078,g=.803922,b=.196078] +\definecolor [yellowgreen] [r=.603922,g=.803922,b=.196078] +\definecolor [forestgreen] [r=.133333,g=.545098,b=.133333] +\definecolor [olivedrab] [r=.419608,g=.556863,b=.137255] +\definecolor [darkkhaki] [r=.741176,g=.717647,b=.419608] +\definecolor [khaki] [r=.941176,g=.901961,b=.54902] +\definecolor [palegoldenrod] [r=.933333,g=.909804,b=.666667] +\definecolor [lightgoldenrodyellow] [r=.980392,g=.980392,b=.823529] +\definecolor [lightyellow] [r=1,g=1,b=.878431] +%definecolor[yellow] [r=1,g=1] +\definecolor [gold] [r=1,g=.843137] +\definecolor [lightgoldenrod] [r=.933333,g=.866667,b=.509804] +\definecolor [goldenrod] [r=.854902,g=.647059,b=.12549] +\definecolor [darkgoldenrod] [r=.721569,g=.52549,b=.043137] +\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784] +\definecolor [indianred] [r=.803922,g=.360784,b=.360784] +\definecolor [saddlebrown] [r=.545098,g=.270588,b=.07451] +\definecolor [sienna] [r=.627451,g=.321569,b=.176471] +\definecolor [peru] [r=.803922,g=.521569,b=.247059] +\definecolor [burlywood] [r=.870588,g=.721569,b=.529412] +\definecolor [beige] [r=.960784,g=.960784,b=.862745] +\definecolor [wheat] [r=.960784,g=.870588,b=.701961] +\definecolor [sandybrown] [r=.956863,g=.643137,b=.376471] +\definecolor [tan] [r=.823529,g=.705882,b=.54902] +\definecolor [chocolate] [r=.823529,g=.411765,b=.117647] +\definecolor [firebrick] [r=.698039,g=.133333,b=.133333] +\definecolor [brown] [r=.647059,g=.164706,b=.164706] +\definecolor [darksalmon] [r=.913725,g=.588235,b=.478431] +\definecolor [salmon] [r=.980392,g=.501961,b=.447059] +\definecolor [lightsalmon] [r=1,g=.627451,b=.478431] +\definecolor [orange] [r=1,g=.647059] +\definecolor [darkorange] [r=1,g=.54902] +\definecolor [coral] [r=1,g=.498039,b=.313725] +\definecolor [lightcoral] [r=.941176,g=.501961,b=.501961] +\definecolor [tomato] [r=1,g=.388235,b=.278431] +\definecolor [orangered] [r=1,g=.270588] +%definecolor[red] [r=1] +\definecolor [hotpink] [r=1,g=.411765,b=.705882] +\definecolor [deeppink] [r=1,g=.078431,b=.576471] +\definecolor [pink] [r=1,g=.752941,b=.796078] +\definecolor [lightpink] [r=1,g=.713725,b=.756863] +\definecolor [palevioletred] [r=.858824,g=.439216,b=.576471] +\definecolor [maroon] [r=.690196,g=.188235,b=.376471] +\definecolor [mediumvioletred] [r=.780392,g=.082353,b=.521569] +\definecolor [violetred] [r=.815686,g=.12549,b=.564706] +%definecolor[magenta] [r=1,b=1] +\definecolor [violet] [r=.933333,g=.509804,b=.933333] +\definecolor [plum] [r=.866667,g=.627451,b=.866667] +\definecolor [orchid] [r=.854902,g=.439216,b=.839216] +\definecolor [mediumorchid] [r=.729412,g=.333333,b=.827451] +\definecolor [darkorchid] [r=.6,g=.196078,b=.8] +\definecolor [darkviolet] [r=.580392,b=.827451] +\definecolor [blueviolet] [r=.541176,g=.168627,b=.886275] +\definecolor [purple] [r=.627451,g=.12549,b=.941176] +\definecolor [mediumpurple] [r=.576471,g=.439216,b=.858824] +\definecolor [thistle] [r=.847059,g=.74902,b=.847059] +\definecolor [snow1] [r=1,g=.980392,b=.980392] +\definecolor [snow2] [r=.933333,g=.913725,b=.913725] +\definecolor [snow3] [r=.803922,g=.788235,b=.788235] +\definecolor [snow4] [r=.545098,g=.537255,b=.537255] +\definecolor [seashell1] [r=1,g=.960784,b=.933333] +\definecolor [seashell2] [r=.933333,g=.898039,b=.870588] +\definecolor [seashell3] [r=.803922,g=.772549,b=.74902] +\definecolor [seashell4] [r=.545098,g=.52549,b=.509804] +\definecolor [antiquewhite1] [r=1,g=.937255,b=.858824] +\definecolor [antiquewhite2] [r=.933333,g=.87451,b=.8] +\definecolor [antiquewhite3] [r=.803922,g=.752941,b=.690196] +\definecolor [antiquewhite4] [r=.545098,g=.513725,b=.470588] +\definecolor [bisque1] [r=1,g=.894118,b=.768627] +\definecolor [bisque2] [r=.933333,g=.835294,b=.717647] +\definecolor [bisque3] [r=.803922,g=.717647,b=.619608] +\definecolor [bisque4] [r=.545098,g=.490196,b=.419608] +\definecolor [peachpuff1] [r=1,g=.854902,b=.72549] +\definecolor [peachpuff2] [r=.933333,g=.796078,b=.678431] +\definecolor [peachpuff3] [r=.803922,g=.686275,b=.584314] +\definecolor [peachpuff4] [r=.545098,g=.466667,b=.396078] +\definecolor [navajowhite1] [r=1,g=.870588,b=.678431] +\definecolor [navajowhite2] [r=.933333,g=.811765,b=.631373] +\definecolor [navajowhite3] [r=.803922,g=.701961,b=.545098] +\definecolor [navajowhite4] [r=.545098,g=.47451,b=.368627] +\definecolor [lemonchiffon1] [r=1,g=.980392,b=.803922] +\definecolor [lemonchiffon2] [r=.933333,g=.913725,b=.74902] +\definecolor [lemonchiffon3] [r=.803922,g=.788235,b=.647059] +\definecolor [lemonchiffon4] [r=.545098,g=.537255,b=.439216] +\definecolor [cornsilk1] [r=1,g=.972549,b=.862745] +\definecolor [cornsilk2] [r=.933333,g=.909804,b=.803922] +\definecolor [cornsilk3] [r=.803922,g=.784314,b=.694118] +\definecolor [cornsilk4] [r=.545098,g=.533333,b=.470588] +\definecolor [ivory1] [r=1,g=1,b=.941176] +\definecolor [ivory2] [r=.933333,g=.933333,b=.878431] +\definecolor [ivory3] [r=.803922,g=.803922,b=.756863] +\definecolor [ivory4] [r=.545098,g=.545098,b=.513725] +\definecolor [honeydew1] [r=.941176,g=1,b=.941176] +\definecolor [honeydew2] [r=.878431,g=.933333,b=.878431] +\definecolor [honeydew3] [r=.756863,g=.803922,b=.756863] +\definecolor [honeydew4] [r=.513725,g=.545098,b=.513725] +\definecolor [lavenderblush1] [r=1,g=.941176,b=.960784] +\definecolor [lavenderblush2] [r=.933333,g=.878431,b=.898039] +\definecolor [lavenderblush3] [r=.803922,g=.756863,b=.772549] +\definecolor [lavenderblush4] [r=.545098,g=.513725,b=.52549] +\definecolor [mistyrose1] [r=1,g=.894118,b=.882353] +\definecolor [mistyrose2] [r=.933333,g=.835294,b=.823529] +\definecolor [mistyrose3] [r=.803922,g=.717647,b=.709804] +\definecolor [mistyrose4] [r=.545098,g=.490196,b=.482353] +\definecolor [azure1] [r=.941176,g=1,b=1] +\definecolor [azure2] [r=.878431,g=.933333,b=.933333] +\definecolor [azure3] [r=.756863,g=.803922,b=.803922] +\definecolor [azure4] [r=.513725,g=.545098,b=.545098] +\definecolor [slateblue1] [r=.513725,g=.435294,b=1] +\definecolor [slateblue2] [r=.478431,g=.403922,b=.933333] +\definecolor [slateblue3] [r=.411765,g=.34902,b=.803922] +\definecolor [slateblue4] [r=.278431,g=.235294,b=.545098] +\definecolor [royalblue1] [r=.282353,g=.462745,b=1] +\definecolor [royalblue2] [r=.262745,g=.431373,b=.933333] +\definecolor [royalblue3] [r=.227451,g=.372549,b=.803922] +\definecolor [royalblue4] [r=.152941,g=.25098,b=.545098] +\definecolor [blue1] [blue] +\definecolor [blue2] [b=.933333] +\definecolor [blue3] [b=.803922] +\definecolor [blue4] [b=.545098] +\definecolor [dodgerblue1] [r=.117647,g=.564706,b=1] +\definecolor [dodgerblue2] [r=.109804,g=.52549,b=.933333] +\definecolor [dodgerblue3] [r=.094118,g=.454902,b=.803922] +\definecolor [dodgerblue4] [r=.062745,g=.305882,b=.545098] +\definecolor [steelblue1] [r=.388235,g=.721569,b=1] +\definecolor [steelblue2] [r=.360784,g=.67451,b=.933333] +\definecolor [steelblue3] [r=.309804,g=.580392,b=.803922] +\definecolor [steelblue4] [r=.211765,g=.392157,b=.545098] +\definecolor [deepskyblue1] [g=.74902,b=1] +\definecolor [deepskyblue2] [g=.698039,b=.933333] +\definecolor [deepskyblue3] [g=.603922,b=.803922] +\definecolor [deepskyblue4] [g=.407843,b=.545098] +\definecolor [skyblue1] [r=.529412,g=.807843,b=1] +\definecolor [skyblue2] [r=.494118,g=.752941,b=.933333] +\definecolor [skyblue3] [r=.423529,g=.65098,b=.803922] +\definecolor [skyblue4] [r=.290196,g=.439216,b=.545098] +\definecolor [lightskyblue1] [r=.690196,g=.886275,b=1] +\definecolor [lightskyblue2] [r=.643137,g=.827451,b=.933333] +\definecolor [lightskyblue3] [r=.552941,g=.713725,b=.803922] +\definecolor [lightskyblue4] [r=.376471,g=.482353,b=.545098] +\definecolor [slategray1] [r=.776471,g=.886275,b=1] +\definecolor [slategray2] [r=.72549,g=.827451,b=.933333] +\definecolor [slategray3] [r=.623529,g=.713725,b=.803922] +\definecolor [slategray4] [r=.423529,g=.482353,b=.545098] +\definecolor [lightsteelblue1] [r=.792157,g=.882353,b=1] +\definecolor [lightsteelblue2] [r=.737255,g=.823529,b=.933333] +\definecolor [lightsteelblue3] [r=.635294,g=.709804,b=.803922] +\definecolor [lightsteelblue4] [r=.431373,g=.482353,b=.545098] +\definecolor [lightblue1] [r=.74902,g=.937255,b=1] +\definecolor [lightblue2] [r=.698039,g=.87451,b=.933333] +\definecolor [lightblue3] [r=.603922,g=.752941,b=.803922] +\definecolor [lightblue4] [r=.407843,g=.513725,b=.545098] +\definecolor [lightcyan1] [r=.878431,g=1,b=1] +\definecolor [lightcyan2] [r=.819608,g=.933333,b=.933333] +\definecolor [lightcyan3] [r=.705882,g=.803922,b=.803922] +\definecolor [lightcyan4] [r=.478431,g=.545098,b=.545098] +\definecolor [paleturquoise1] [r=.733333,g=1,b=1] +\definecolor [paleturquoise2] [r=.682353,g=.933333,b=.933333] +\definecolor [paleturquoise3] [r=.588235,g=.803922,b=.803922] +\definecolor [paleturquoise4] [r=.4,g=.545098,b=.545098] +\definecolor [cadetblue1] [r=.596078,g=.960784,b=1] +\definecolor [cadetblue2] [r=.556863,g=.898039,b=.933333] +\definecolor [cadetblue3] [r=.478431,g=.772549,b=.803922] +\definecolor [cadetblue4] [r=.32549,g=.52549,b=.545098] +\definecolor [turquoise1] [g=.960784,b=1] +\definecolor [turquoise2] [g=.898039,b=.933333] +\definecolor [turquoise3] [g=.772549,b=.803922] +\definecolor [turquoise4] [g=.52549,b=.545098] +\definecolor [cyan1] [cyan] +\definecolor [cyan2] [g=.933333,b=.933333] +\definecolor [cyan3] [g=.803922,b=.803922] +\definecolor [cyan4] [g=.545098,b=.545098] +\definecolor [darkslategray1] [r=.592157,g=1,b=1] +\definecolor [darkslategray2] [r=.552941,g=.933333,b=.933333] +\definecolor [darkslategray3] [r=.47451,g=.803922,b=.803922] +\definecolor [darkslategray4] [r=.321569,g=.545098,b=.545098] +\definecolor [aquamarine1] [r=.498039,g=1,b=.831373] +\definecolor [aquamarine2] [r=.462745,g=.933333,b=.776471] +\definecolor [aquamarine3] [r=.4,g=.803922,b=.666667] +\definecolor [aquamarine4] [r=.270588,g=.545098,b=.454902] +\definecolor [darkseagreen1] [r=.756863,g=1,b=.756863] +\definecolor [darkseagreen2] [r=.705882,g=.933333,b=.705882] +\definecolor [darkseagreen3] [r=.607843,g=.803922,b=.607843] +\definecolor [darkseagreen4] [r=.411765,g=.545098,b=.411765] +\definecolor [seagreen1] [r=.329412,g=1,b=.623529] +\definecolor [seagreen2] [r=.305882,g=.933333,b=.580392] +\definecolor [seagreen3] [r=.262745,g=.803922,b=.501961] +\definecolor [seagreen4] [r=.180392,g=.545098,b=.341176] +\definecolor [palegreen1] [r=.603922,g=1,b=.603922] +\definecolor [palegreen2] [r=.564706,g=.933333,b=.564706] +\definecolor [palegreen3] [r=.486275,g=.803922,b=.486275] +\definecolor [palegreen4] [r=.329412,g=.545098,b=.329412] +\definecolor [springgreen1] [g=1,b=.498039] +\definecolor [springgreen2] [g=.933333,b=.462745] +\definecolor [springgreen3] [g=.803922,b=.4] +\definecolor [springgreen4] [g=.545098,b=.270588] +\definecolor [green1] [green] +\definecolor [green2] [g=.933333] +\definecolor [green3] [g=.803922] +\definecolor [green4] [g=.545098] +\definecolor [chartreuse1] [r=.498039,g=1] +\definecolor [chartreuse2] [r=.462745,g=.933333] +\definecolor [chartreuse3] [r=.4,g=.803922] +\definecolor [chartreuse4] [r=.270588,g=.545098] +\definecolor [olivedrab1] [r=.752941,g=1,b=.243137] +\definecolor [olivedrab2] [r=.701961,g=.933333,b=.227451] +\definecolor [olivedrab3] [r=.603922,g=.803922,b=.196078] +\definecolor [olivedrab4] [r=.411765,g=.545098,b=.133333] +\definecolor [darkolivegreen1] [r=.792157,g=1,b=.439216] +\definecolor [darkolivegreen2] [r=.737255,g=.933333,b=.407843] +\definecolor [darkolivegreen3] [r=.635294,g=.803922,b=.352941] +\definecolor [darkolivegreen4] [r=.431373,g=.545098,b=.239216] +\definecolor [khaki1] [r=1,g=.964706,b=.560784] +\definecolor [khaki2] [r=.933333,g=.901961,b=.521569] +\definecolor [khaki3] [r=.803922,g=.776471,b=.45098] +\definecolor [khaki4] [r=.545098,g=.52549,b=.305882] +\definecolor [lightgoldenrod1] [r=1,g=.92549,b=.545098] +\definecolor [lightgoldenrod2] [r=.933333,g=.862745,b=.509804] +\definecolor [lightgoldenrod3] [r=.803922,g=.745098,b=.439216] +\definecolor [lightgoldenrod4] [r=.545098,g=.505882,b=.298039] +\definecolor [lightyellow1] [r=1,g=1,b=.878431] +\definecolor [lightyellow2] [r=.933333,g=.933333,b=.819608] +\definecolor [lightyellow3] [r=.803922,g=.803922,b=.705882] +\definecolor [lightyellow4] [r=.545098,g=.545098,b=.478431] +\definecolor [yellow1] [yellow] +\definecolor [yellow2] [r=.933333,g=.933333] +\definecolor [yellow3] [r=.803922,g=.803922] +\definecolor [yellow4] [r=.545098,g=.545098] +\definecolor [gold1] [r=1,g=.843137] +\definecolor [gold2] [r=.933333,g=.788235] +\definecolor [gold3] [r=.803922,g=.678431] +\definecolor [gold4] [r=.545098,g=.458824] +\definecolor [goldenrod1] [r=1,g=.756863,b=.145098] +\definecolor [goldenrod2] [r=.933333,g=.705882,b=.133333] +\definecolor [goldenrod3] [r=.803922,g=.607843,b=.113725] +\definecolor [goldenrod4] [r=.545098,g=.411765,b=.078431] +\definecolor [darkgoldenrod1] [r=1,g=.72549,b=.058824] +\definecolor [darkgoldenrod2] [r=.933333,g=.678431,b=.054902] +\definecolor [darkgoldenrod3] [r=.803922,g=.584314,b=.047059] +\definecolor [darkgoldenrod4] [r=.545098,g=.396078,b=.031373] +\definecolor [rosybrown1] [r=1,g=.756863,b=.756863] +\definecolor [rosybrown2] [r=.933333,g=.705882,b=.705882] +\definecolor [rosybrown3] [r=.803922,g=.607843,b=.607843] +\definecolor [rosybrown4] [r=.545098,g=.411765,b=.411765] +\definecolor [indianred1] [r=1,g=.415686,b=.415686] +\definecolor [indianred2] [r=.933333,g=.388235,b=.388235] +\definecolor [indianred3] [r=.803922,g=.333333,b=.333333] +\definecolor [indianred4] [r=.545098,g=.227451,b=.227451] +\definecolor [sienna1] [r=1,g=.509804,b=.278431] +\definecolor [sienna2] [r=.933333,g=.47451,b=.258824] +\definecolor [sienna3] [r=.803922,g=.407843,b=.223529] +\definecolor [sienna4] [r=.545098,g=.278431,b=.14902] +\definecolor [burlywood1] [r=1,g=.827451,b=.607843] +\definecolor [burlywood2] [r=.933333,g=.772549,b=.568627] +\definecolor [burlywood3] [r=.803922,g=.666667,b=.490196] +\definecolor [burlywood4] [r=.545098,g=.45098,b=.333333] +\definecolor [wheat1] [r=1,g=.905882,b=.729412] +\definecolor [wheat2] [r=.933333,g=.847059,b=.682353] +\definecolor [wheat3] [r=.803922,g=.729412,b=.588235] +\definecolor [wheat4] [r=.545098,g=.494118,b=.4] +\definecolor [tan1] [r=1,g=.647059,b=.309804] +\definecolor [tan2] [r=.933333,g=.603922,b=.286275] +\definecolor [tan3] [r=.803922,g=.521569,b=.247059] +\definecolor [tan4] [r=.545098,g=.352941,b=.168627] +\definecolor [chocolate1] [r=1,g=.498039,b=.141176] +\definecolor [chocolate2] [r=.933333,g=.462745,b=.129412] +\definecolor [chocolate3] [r=.803922,g=.4,b=.113725] +\definecolor [chocolate4] [r=.545098,g=.270588,b=.07451] +\definecolor [firebrick1] [r=1,g=.188235,b=.188235] +\definecolor [firebrick2] [r=.933333,g=.172549,b=.172549] +\definecolor [firebrick3] [r=.803922,g=.14902,b=.14902] +\definecolor [firebrick4] [r=.545098,g=.101961,b=.101961] +\definecolor [brown1] [r=1,g=.25098,b=.25098] +\definecolor [brown2] [r=.933333,g=.231373,b=.231373] +\definecolor [brown3] [r=.803922,g=.2,b=.2] +\definecolor [brown4] [r=.545098,g=.137255,b=.137255] +\definecolor [salmon1] [r=1,g=.54902,b=.411765] +\definecolor [salmon2] [r=.933333,g=.509804,b=.384314] +\definecolor [salmon3] [r=.803922,g=.439216,b=.329412] +\definecolor [salmon4] [r=.545098,g=.298039,b=.223529] +\definecolor [lightsalmon1] [r=1,g=.627451,b=.478431] +\definecolor [lightsalmon2] [r=.933333,g=.584314,b=.447059] +\definecolor [lightsalmon3] [r=.803922,g=.505882,b=.384314] +\definecolor [lightsalmon4] [r=.545098,g=.341176,b=.258824] +\definecolor [orange1] [r=1,g=.647059] +\definecolor [orange2] [r=.933333,g=.603922] +\definecolor [orange3] [r=.803922,g=.521569] +\definecolor [orange4] [r=.545098,g=.352941] +\definecolor [darkorange1] [r=1,g=.498039] +\definecolor [darkorange2] [r=.933333,g=.462745] +\definecolor [darkorange3] [r=.803922,g=.4] +\definecolor [darkorange4] [r=.545098,g=.270588] +\definecolor [coral1] [r=1,g=.447059,b=.337255] +\definecolor [coral2] [r=.933333,g=.415686,b=.313725] +\definecolor [coral3] [r=.803922,g=.356863,b=.270588] +\definecolor [coral4] [r=.545098,g=.243137,b=.184314] +\definecolor [tomato1] [r=1,g=.388235,b=.278431] +\definecolor [tomato2] [r=.933333,g=.360784,b=.258824] +\definecolor [tomato3] [r=.803922,g=.309804,b=.223529] +\definecolor [tomato4] [r=.545098,g=.211765,b=.14902] +\definecolor [orangered1] [r=1,g=.270588] +\definecolor [orangered2] [r=.933333,g=.25098] +\definecolor [orangered3] [r=.803922,g=.215686] +\definecolor [orangered4] [r=.545098,g=.145098] +\definecolor [red1] [red] +\definecolor [red2] [r=.933333] +\definecolor [red3] [r=.803922] +\definecolor [red4] [r=.545098] +\definecolor [deeppink1] [r=1,g=.078431,b=.576471] +\definecolor [deeppink2] [r=.933333,g=.070588,b=.537255] +\definecolor [deeppink3] [r=.803922,g=.062745,b=.462745] +\definecolor [deeppink4] [r=.545098,g=.039216,b=.313725] +\definecolor [hotpink1] [r=1,g=.431373,b=.705882] +\definecolor [hotpink2] [r=.933333,g=.415686,b=.654902] +\definecolor [hotpink3] [r=.803922,g=.376471,b=.564706] +\definecolor [hotpink4] [r=.545098,g=.227451,b=.384314] +\definecolor [pink1] [r=1,g=.709804,b=.772549] +\definecolor [pink2] [r=.933333,g=.662745,b=.721569] +\definecolor [pink3] [r=.803922,g=.568627,b=.619608] +\definecolor [pink4] [r=.545098,g=.388235,b=.423529] +\definecolor [lightpink1] [r=1,g=.682353,b=.72549] +\definecolor [lightpink2] [r=.933333,g=.635294,b=.678431] +\definecolor [lightpink3] [r=.803922,g=.54902,b=.584314] +\definecolor [lightpink4] [r=.545098,g=.372549,b=.396078] +\definecolor [palevioletred1] [r=1,g=.509804,b=.670588] +\definecolor [palevioletred2] [r=.933333,g=.47451,b=.623529] +\definecolor [palevioletred3] [r=.803922,g=.407843,b=.537255] +\definecolor [palevioletred4] [r=.545098,g=.278431,b=.364706] +\definecolor [maroon1] [r=1,g=.203922,b=.701961] +\definecolor [maroon2] [r=.933333,g=.188235,b=.654902] +\definecolor [maroon3] [r=.803922,g=.160784,b=.564706] +\definecolor [maroon4] [r=.545098,g=.109804,b=.384314] +\definecolor [violetred1] [r=1,g=.243137,b=.588235] +\definecolor [violetred2] [r=.933333,g=.227451,b=.54902] +\definecolor [violetred3] [r=.803922,g=.196078,b=.470588] +\definecolor [violetred4] [r=.545098,g=.133333,b=.321569] +\definecolor [magenta1] [magenta] +\definecolor [magenta2] [r=.933333,b=.933333] +\definecolor [magenta3] [r=.803922,b=.803922] +\definecolor [magenta4] [r=.545098,b=.545098] +\definecolor [orchid1] [r=1,g=.513725,b=.980392] +\definecolor [orchid2] [r=.933333,g=.478431,b=.913725] +\definecolor [orchid3] [r=.803922,g=.411765,b=.788235] +\definecolor [orchid4] [r=.545098,g=.278431,b=.537255] +\definecolor [plum1] [r=1,g=.733333,b=1] +\definecolor [plum2] [r=.933333,g=.682353,b=.933333] +\definecolor [plum3] [r=.803922,g=.588235,b=.803922] +\definecolor [plum4] [r=.545098,g=.4,b=.545098] +\definecolor [mediumorchid1] [r=.878431,g=.4,b=1] +\definecolor [mediumorchid2] [r=.819608,g=.372549,b=.933333] +\definecolor [mediumorchid3] [r=.705882,g=.321569,b=.803922] +\definecolor [mediumorchid4] [r=.478431,g=.215686,b=.545098] +\definecolor [darkorchid1] [r=.74902,g=.243137,b=1] +\definecolor [darkorchid2] [r=.698039,g=.227451,b=.933333] +\definecolor [darkorchid3] [r=.603922,g=.196078,b=.803922] +\definecolor [darkorchid4] [r=.407843,g=.133333,b=.545098] +\definecolor [purple1] [r=.607843,g=.188235,b=1] +\definecolor [purple2] [r=.568627,g=.172549,b=.933333] +\definecolor [purple3] [r=.490196,g=.14902,b=.803922] +\definecolor [purple4] [r=.333333,g=.101961,b=.545098] +\definecolor [mediumpurple1] [r=.670588,g=.509804,b=1] +\definecolor [mediumpurple2] [r=.623529,g=.47451,b=.933333] +\definecolor [mediumpurple3] [r=.537255,g=.407843,b=.803922] +\definecolor [mediumpurple4] [r=.364706,g=.278431,b=.545098] +\definecolor [thistle1] [r=1,g=.882353,b=1] +\definecolor [thistle2] [r=.933333,g=.823529,b=.933333] +\definecolor [thistle3] [r=.803922,g=.709804,b=.803922] +\definecolor [thistle4] [r=.545098,g=.482353,b=.545098] +\definecolor [gray0] [black] +\definecolor [gray1] [s=.01] +\definecolor [gray2] [s=.02] +\definecolor [gray3] [s=.03] +\definecolor [gray4] [s=.04] +\definecolor [gray5] [s=.05] +\definecolor [gray6] [s=.06] +\definecolor [gray7] [s=.07] +\definecolor [gray8] [s=.08] +\definecolor [gray9] [s=.09] +\definecolor [gray10] [s=.1] +\definecolor [gray11] [s=.11] +\definecolor [gray12] [s=.12] +\definecolor [gray13] [s=.13] +\definecolor [gray14] [s=.14] +\definecolor [gray15] [s=.15] +\definecolor [gray16] [s=.16] +\definecolor [gray17] [s=.17] +\definecolor [gray18] [s=.18] +\definecolor [gray19] [s=.19] +\definecolor [gray20] [s=.2] +\definecolor [gray21] [s=.21] +\definecolor [gray22] [s=.22] +\definecolor [gray23] [s=.23] +\definecolor [gray24] [s=.24] +\definecolor [gray25] [s=.25] +\definecolor [gray26] [s=.26] +\definecolor [gray27] [s=.27] +\definecolor [gray28] [s=.28] +\definecolor [gray29] [s=.29] +\definecolor [gray30] [s=.3] +\definecolor [gray31] [s=.31] +\definecolor [gray32] [s=.32] +\definecolor [gray33] [s=.33] +\definecolor [gray34] [s=.34] +\definecolor [gray35] [s=.35] +\definecolor [gray36] [s=.36] +\definecolor [gray37] [s=.37] +\definecolor [gray38] [s=.38] +\definecolor [gray39] [s=.39] +\definecolor [gray40] [s=.4] +\definecolor [gray41] [s=.41] +\definecolor [gray42] [s=.42] +\definecolor [gray43] [s=.43] +\definecolor [gray44] [s=.44] +\definecolor [gray45] [s=.45] +\definecolor [gray46] [s=.46] +\definecolor [gray47] [s=.47] +\definecolor [gray48] [s=.48] +\definecolor [gray49] [s=.49] +\definecolor [gray50] [s=.5] +\definecolor [gray51] [s=.51] +\definecolor [gray52] [s=.52] +\definecolor [gray53] [s=.53] +\definecolor [gray54] [s=.54] +\definecolor [gray55] [s=.55] +\definecolor [gray56] [s=.56] +\definecolor [gray57] [s=.57] +\definecolor [gray58] [s=.58] +\definecolor [gray59] [s=.59] +\definecolor [gray60] [s=.6] +\definecolor [gray61] [s=.61] +\definecolor [gray62] [s=.62] +\definecolor [gray63] [s=.63] +\definecolor [gray64] [s=.64] +\definecolor [gray65] [s=.65] +\definecolor [gray66] [s=.66] +\definecolor [gray67] [s=.67] +\definecolor [gray68] [s=.68] +\definecolor [gray69] [s=.69] +\definecolor [gray70] [s=.7] +\definecolor [gray71] [s=.71] +\definecolor [gray72] [s=.72] +\definecolor [gray73] [s=.73] +\definecolor [gray74] [s=.74] +\definecolor [gray75] [s=.75] +\definecolor [gray76] [s=.76] +\definecolor [gray77] [s=.77] +\definecolor [gray78] [s=.78] +\definecolor [gray79] [s=.79] +\definecolor [gray80] [s=.8] +\definecolor [gray81] [s=.81] +\definecolor [gray82] [s=.82] +\definecolor [gray83] [s=.83] +\definecolor [gray84] [s=.84] +\definecolor [gray85] [s=.85] +\definecolor [gray86] [s=.86] +\definecolor [gray87] [s=.87] +\definecolor [gray88] [s=.88] +\definecolor [gray89] [s=.89] +\definecolor [gray90] [s=.9] +\definecolor [gray91] [s=.91] +\definecolor [gray92] [s=.92] +\definecolor [gray93] [s=.93] +\definecolor [gray94] [s=.94] +\definecolor [gray95] [s=.95] +\definecolor [gray96] [s=.96] +\definecolor [gray97] [s=.97] +\definecolor [gray98] [s=.98] +\definecolor [gray99] [s=.99] +\definecolor [gray100] [white] +\definecolor [darkgray] [s=.662745] +\definecolor [darkblue] [b=.545098] +\definecolor [darkcyan] [g=.545098,b=.545098] +\definecolor [darkmagenta] [r=.545098,b=.545098] +\definecolor [darkred] [r=.545098] +\definecolor [lightgreen] [r=.564706,g=.933333,b=.564706] diff --git a/tex/context/base/colo-ema.tex b/tex/context/base/colo-ema.tex deleted file mode 100644 index e5e90b235..000000000 --- a/tex/context/base/colo-ema.tex +++ /dev/null @@ -1,590 +0,0 @@ -%D \module -%D [ file=colo-ema, -%D version=2003.03.20, -%D title=\CONTEXT\ Color Macros, -%D subtitle=Emacs Colors, -%D author=Peter Rolf, -%D date=\currentdate, -%D copyright=PRAGMA ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% author : Peter Rolf -% last change : 17 march 2003 -% origin : /emacs/etc/rgb.txt -% -% USAGE: -% -% - select emacs menu: Edit -> Text Properties -> Display -% Colors, if you don't know what I'm talking about -% - copy this file to your /texmf/tex/context/user directory -% and add "\input colo-emacs" to your tex-file -% -% IMPORTANT NOTES: -% -% - all color names are written as ONE word in lowercase -% letters (no redundancy as in rgb.txt) so if you want to -% use the color "Light Sky Blue"/"light sky blue" it's new -% name is lightskyblue -% - the grayX values [X=0..100] can only be used with \color -% [grayX] -% - use it at your own risk :) -% -% HINT: -% -% I only include this file (\showcolor [ema]) until I've -% found the colors I want. Copy and paste the color -% definitions to a seperate file, to decrease compilation -% time (540 color definitions). - -\definecolor [snow] [r=1,g=.980392,b=.980392] -\definecolor [ghostwhite] [r=.972549,g=.972549,b=1] -\definecolor [whitesmoke] [s=.960784] -\definecolor [gainsboro] [s=.862745] -\definecolor [floralwhite] [r=1,g=.980392,b=.941176] -\definecolor [oldlace] [r=.992157,g=.960784,b=.901961] -\definecolor [linen] [r=.980392,g=.941176,b=.901961] -\definecolor [antiquewhite] [r=.980392,g=.921569,b=.843137] -\definecolor [papayawhip] [r=1,g=.937255,b=.835294] -\definecolor [blanchedalmond] [r=1,g=.921569,b=.803922] -\definecolor [bisque] [r=1,g=.894118,b=.768627] -\definecolor [peachpuff] [r=1,g=.854902,b=.72549] -\definecolor [navajowhite] [r=1,g=.870588,b=.678431] -\definecolor [moccasin] [r=1,g=.894118,b=.709804] -\definecolor [cornsilk] [r=1,g=.972549,b=.862745] -\definecolor [ivory] [r=1,g=1,b=.941176] -\definecolor [lemonchiffon] [r=1,g=.980392,b=.803922] -\definecolor [seashell] [r=1,g=.960784,b=.933333] -\definecolor [honeydew] [r=.941176,g=1,b=.941176] -\definecolor [mintcream] [r=.960784,g=1,b=.980392] -\definecolor [azure] [r=.941176,g=1,b=1] -\definecolor [aliceblue] [r=.941176,g=.972549,b=1] -\definecolor [lavender] [r=.901961,g=.901961,b=.980392] -\definecolor [lavenderblush] [r=1,g=.941176,b=.960784] -\definecolor [mistyrose] [r=1,g=.894118,b=.882353] -%definecolor[white] [s=1] -%definecolor[black] [s=0] -\definecolor [darkslategray] [r=.184314,g=.309804,b=.309804] -\definecolor [dimgray] [s=.411765] -\definecolor [slategray] [r=.439216,g=.501961,b=.564706] -\definecolor [lightslategray] [r=.466667,g=.533333,b=.6] -\definecolor [gray] [s=.745098] -\definecolor [lightgray] [s=.827451] -\definecolor [midnightblue] [r=.098039,g=.098039,b=.439216] -\definecolor [navy] [b=.501961] -\definecolor [navyblue] [navy] -\definecolor [cornflowerblue] [r=.392157,g=.584314,b=.929412] -\definecolor [darkslateblue] [r=.282353,g=.239216,b=.545098] -\definecolor [slateblue] [r=.415686,g=.352941,b=.803922] -\definecolor [mediumslateblue] [r=.482353,g=.407843,b=.933333] -\definecolor [lightslateblue] [r=.517647,g=.439216,b=1] -\definecolor [mediumblue] [b=.803922] -\definecolor [royalblue] [r=.254902,g=.411765,b=.882353] -%definecolor[blue] [b=1] -\definecolor [dodgerblue] [r=.117647,g=.564706,b=1] -\definecolor [deepskyblue] [g=.74902,b=1] -\definecolor [skyblue] [r=.529412,g=.807843,b=.921569] -\definecolor [lightskyblue] [r=.529412,g=.807843,b=.980392] -\definecolor [steelblue] [r=.27451,g=.509804,b=.705882] -\definecolor [lightsteelblue] [r=.690196,g=.768627,b=.870588] -\definecolor [lightblue] [r=.678431,g=.847059,b=.901961] -\definecolor [powderblue] [r=.690196,g=.878431,b=.901961] -\definecolor [paleturquoise] [r=.686275,g=.933333,b=.933333] -\definecolor [darkturquoise] [g=.807843,b=.819608] -\definecolor [mediumturquoise] [r=.282353,g=.819608,b=.8] -\definecolor [turquoise] [r=.25098,g=.878431,b=.815686] -%definecolor[cyan] [g=1,b=1] -\definecolor [lightcyan] [r=.878431,g=1,b=1] -\definecolor [cadetblue] [r=.372549,g=.619608,b=.627451] -\definecolor [mediumaquamarine] [r=.4,g=.803922,b=.666667] -\definecolor [aquamarine] [r=.498039,g=1,b=.831373] -\definecolor [darkgreen] [g=.392157] -\definecolor [darkolivegreen] [r=.333333,g=.419608,b=.184314] -\definecolor [darkseagreen] [r=.560784,g=.737255,b=.560784] -\definecolor [seagreen] [r=.180392,g=.545098,b=.341176] -\definecolor [mediumseagreen] [r=.235294,g=.701961,b=.443137] -\definecolor [lightseagreen] [r=.12549,g=.698039,b=.666667] -\definecolor [palegreen] [r=.596078,g=.984314,b=.596078] -\definecolor [springgreen] [g=1,b=.498039] -\definecolor [lawngreen] [r=.486275,g=.988235] -%definecolor[green] [g=1] -\definecolor [chartreuse] [r=.498039,g=1] -\definecolor [mediumspringgreen] [g=.980392,b=.603922] -\definecolor [greenyellow] [r=.678431,g=1,b=.184314] -\definecolor [limegreen] [r=.196078,g=.803922,b=.196078] -\definecolor [yellowgreen] [r=.603922,g=.803922,b=.196078] -\definecolor [forestgreen] [r=.133333,g=.545098,b=.133333] -\definecolor [olivedrab] [r=.419608,g=.556863,b=.137255] -\definecolor [darkkhaki] [r=.741176,g=.717647,b=.419608] -\definecolor [khaki] [r=.941176,g=.901961,b=.54902] -\definecolor [palegoldenrod] [r=.933333,g=.909804,b=.666667] -\definecolor [lightgoldenrodyellow] [r=.980392,g=.980392,b=.823529] -\definecolor [lightyellow] [r=1,g=1,b=.878431] -%definecolor[yellow] [r=1,g=1] -\definecolor [gold] [r=1,g=.843137] -\definecolor [lightgoldenrod] [r=.933333,g=.866667,b=.509804] -\definecolor [goldenrod] [r=.854902,g=.647059,b=.12549] -\definecolor [darkgoldenrod] [r=.721569,g=.52549,b=.043137] -\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784] -\definecolor [indianred] [r=.803922,g=.360784,b=.360784] -\definecolor [saddlebrown] [r=.545098,g=.270588,b=.07451] -\definecolor [sienna] [r=.627451,g=.321569,b=.176471] -\definecolor [peru] [r=.803922,g=.521569,b=.247059] -\definecolor [burlywood] [r=.870588,g=.721569,b=.529412] -\definecolor [beige] [r=.960784,g=.960784,b=.862745] -\definecolor [wheat] [r=.960784,g=.870588,b=.701961] -\definecolor [sandybrown] [r=.956863,g=.643137,b=.376471] -\definecolor [tan] [r=.823529,g=.705882,b=.54902] -\definecolor [chocolate] [r=.823529,g=.411765,b=.117647] -\definecolor [firebrick] [r=.698039,g=.133333,b=.133333] -\definecolor [brown] [r=.647059,g=.164706,b=.164706] -\definecolor [darksalmon] [r=.913725,g=.588235,b=.478431] -\definecolor [salmon] [r=.980392,g=.501961,b=.447059] -\definecolor [lightsalmon] [r=1,g=.627451,b=.478431] -\definecolor [orange] [r=1,g=.647059] -\definecolor [darkorange] [r=1,g=.54902] -\definecolor [coral] [r=1,g=.498039,b=.313725] -\definecolor [lightcoral] [r=.941176,g=.501961,b=.501961] -\definecolor [tomato] [r=1,g=.388235,b=.278431] -\definecolor [orangered] [r=1,g=.270588] -%definecolor[red] [r=1] -\definecolor [hotpink] [r=1,g=.411765,b=.705882] -\definecolor [deeppink] [r=1,g=.078431,b=.576471] -\definecolor [pink] [r=1,g=.752941,b=.796078] -\definecolor [lightpink] [r=1,g=.713725,b=.756863] -\definecolor [palevioletred] [r=.858824,g=.439216,b=.576471] -\definecolor [maroon] [r=.690196,g=.188235,b=.376471] -\definecolor [mediumvioletred] [r=.780392,g=.082353,b=.521569] -\definecolor [violetred] [r=.815686,g=.12549,b=.564706] -%definecolor[magenta] [r=1,b=1] -\definecolor [violet] [r=.933333,g=.509804,b=.933333] -\definecolor [plum] [r=.866667,g=.627451,b=.866667] -\definecolor [orchid] [r=.854902,g=.439216,b=.839216] -\definecolor [mediumorchid] [r=.729412,g=.333333,b=.827451] -\definecolor [darkorchid] [r=.6,g=.196078,b=.8] -\definecolor [darkviolet] [r=.580392,b=.827451] -\definecolor [blueviolet] [r=.541176,g=.168627,b=.886275] -\definecolor [purple] [r=.627451,g=.12549,b=.941176] -\definecolor [mediumpurple] [r=.576471,g=.439216,b=.858824] -\definecolor [thistle] [r=.847059,g=.74902,b=.847059] -\definecolor [snow1] [r=1,g=.980392,b=.980392] -\definecolor [snow2] [r=.933333,g=.913725,b=.913725] -\definecolor [snow3] [r=.803922,g=.788235,b=.788235] -\definecolor [snow4] [r=.545098,g=.537255,b=.537255] -\definecolor [seashell1] [r=1,g=.960784,b=.933333] -\definecolor [seashell2] [r=.933333,g=.898039,b=.870588] -\definecolor [seashell3] [r=.803922,g=.772549,b=.74902] -\definecolor [seashell4] [r=.545098,g=.52549,b=.509804] -\definecolor [antiquewhite1] [r=1,g=.937255,b=.858824] -\definecolor [antiquewhite2] [r=.933333,g=.87451,b=.8] -\definecolor [antiquewhite3] [r=.803922,g=.752941,b=.690196] -\definecolor [antiquewhite4] [r=.545098,g=.513725,b=.470588] -\definecolor [bisque1] [r=1,g=.894118,b=.768627] -\definecolor [bisque2] [r=.933333,g=.835294,b=.717647] -\definecolor [bisque3] [r=.803922,g=.717647,b=.619608] -\definecolor [bisque4] [r=.545098,g=.490196,b=.419608] -\definecolor [peachpuff1] [r=1,g=.854902,b=.72549] -\definecolor [peachpuff2] [r=.933333,g=.796078,b=.678431] -\definecolor [peachpuff3] [r=.803922,g=.686275,b=.584314] -\definecolor [peachpuff4] [r=.545098,g=.466667,b=.396078] -\definecolor [navajowhite1] [r=1,g=.870588,b=.678431] -\definecolor [navajowhite2] [r=.933333,g=.811765,b=.631373] -\definecolor [navajowhite3] [r=.803922,g=.701961,b=.545098] -\definecolor [navajowhite4] [r=.545098,g=.47451,b=.368627] -\definecolor [lemonchiffon1] [r=1,g=.980392,b=.803922] -\definecolor [lemonchiffon2] [r=.933333,g=.913725,b=.74902] -\definecolor [lemonchiffon3] [r=.803922,g=.788235,b=.647059] -\definecolor [lemonchiffon4] [r=.545098,g=.537255,b=.439216] -\definecolor [cornsilk1] [r=1,g=.972549,b=.862745] -\definecolor [cornsilk2] [r=.933333,g=.909804,b=.803922] -\definecolor [cornsilk3] [r=.803922,g=.784314,b=.694118] -\definecolor [cornsilk4] [r=.545098,g=.533333,b=.470588] -\definecolor [ivory1] [r=1,g=1,b=.941176] -\definecolor [ivory2] [r=.933333,g=.933333,b=.878431] -\definecolor [ivory3] [r=.803922,g=.803922,b=.756863] -\definecolor [ivory4] [r=.545098,g=.545098,b=.513725] -\definecolor [honeydew1] [r=.941176,g=1,b=.941176] -\definecolor [honeydew2] [r=.878431,g=.933333,b=.878431] -\definecolor [honeydew3] [r=.756863,g=.803922,b=.756863] -\definecolor [honeydew4] [r=.513725,g=.545098,b=.513725] -\definecolor [lavenderblush1] [r=1,g=.941176,b=.960784] -\definecolor [lavenderblush2] [r=.933333,g=.878431,b=.898039] -\definecolor [lavenderblush3] [r=.803922,g=.756863,b=.772549] -\definecolor [lavenderblush4] [r=.545098,g=.513725,b=.52549] -\definecolor [mistyrose1] [r=1,g=.894118,b=.882353] -\definecolor [mistyrose2] [r=.933333,g=.835294,b=.823529] -\definecolor [mistyrose3] [r=.803922,g=.717647,b=.709804] -\definecolor [mistyrose4] [r=.545098,g=.490196,b=.482353] -\definecolor [azure1] [r=.941176,g=1,b=1] -\definecolor [azure2] [r=.878431,g=.933333,b=.933333] -\definecolor [azure3] [r=.756863,g=.803922,b=.803922] -\definecolor [azure4] [r=.513725,g=.545098,b=.545098] -\definecolor [slateblue1] [r=.513725,g=.435294,b=1] -\definecolor [slateblue2] [r=.478431,g=.403922,b=.933333] -\definecolor [slateblue3] [r=.411765,g=.34902,b=.803922] -\definecolor [slateblue4] [r=.278431,g=.235294,b=.545098] -\definecolor [royalblue1] [r=.282353,g=.462745,b=1] -\definecolor [royalblue2] [r=.262745,g=.431373,b=.933333] -\definecolor [royalblue3] [r=.227451,g=.372549,b=.803922] -\definecolor [royalblue4] [r=.152941,g=.25098,b=.545098] -\definecolor [blue1] [blue] -\definecolor [blue2] [b=.933333] -\definecolor [blue3] [b=.803922] -\definecolor [blue4] [b=.545098] -\definecolor [dodgerblue1] [r=.117647,g=.564706,b=1] -\definecolor [dodgerblue2] [r=.109804,g=.52549,b=.933333] -\definecolor [dodgerblue3] [r=.094118,g=.454902,b=.803922] -\definecolor [dodgerblue4] [r=.062745,g=.305882,b=.545098] -\definecolor [steelblue1] [r=.388235,g=.721569,b=1] -\definecolor [steelblue2] [r=.360784,g=.67451,b=.933333] -\definecolor [steelblue3] [r=.309804,g=.580392,b=.803922] -\definecolor [steelblue4] [r=.211765,g=.392157,b=.545098] -\definecolor [deepskyblue1] [g=.74902,b=1] -\definecolor [deepskyblue2] [g=.698039,b=.933333] -\definecolor [deepskyblue3] [g=.603922,b=.803922] -\definecolor [deepskyblue4] [g=.407843,b=.545098] -\definecolor [skyblue1] [r=.529412,g=.807843,b=1] -\definecolor [skyblue2] [r=.494118,g=.752941,b=.933333] -\definecolor [skyblue3] [r=.423529,g=.65098,b=.803922] -\definecolor [skyblue4] [r=.290196,g=.439216,b=.545098] -\definecolor [lightskyblue1] [r=.690196,g=.886275,b=1] -\definecolor [lightskyblue2] [r=.643137,g=.827451,b=.933333] -\definecolor [lightskyblue3] [r=.552941,g=.713725,b=.803922] -\definecolor [lightskyblue4] [r=.376471,g=.482353,b=.545098] -\definecolor [slategray1] [r=.776471,g=.886275,b=1] -\definecolor [slategray2] [r=.72549,g=.827451,b=.933333] -\definecolor [slategray3] [r=.623529,g=.713725,b=.803922] -\definecolor [slategray4] [r=.423529,g=.482353,b=.545098] -\definecolor [lightsteelblue1] [r=.792157,g=.882353,b=1] -\definecolor [lightsteelblue2] [r=.737255,g=.823529,b=.933333] -\definecolor [lightsteelblue3] [r=.635294,g=.709804,b=.803922] -\definecolor [lightsteelblue4] [r=.431373,g=.482353,b=.545098] -\definecolor [lightblue1] [r=.74902,g=.937255,b=1] -\definecolor [lightblue2] [r=.698039,g=.87451,b=.933333] -\definecolor [lightblue3] [r=.603922,g=.752941,b=.803922] -\definecolor [lightblue4] [r=.407843,g=.513725,b=.545098] -\definecolor [lightcyan1] [r=.878431,g=1,b=1] -\definecolor [lightcyan2] [r=.819608,g=.933333,b=.933333] -\definecolor [lightcyan3] [r=.705882,g=.803922,b=.803922] -\definecolor [lightcyan4] [r=.478431,g=.545098,b=.545098] -\definecolor [paleturquoise1] [r=.733333,g=1,b=1] -\definecolor [paleturquoise2] [r=.682353,g=.933333,b=.933333] -\definecolor [paleturquoise3] [r=.588235,g=.803922,b=.803922] -\definecolor [paleturquoise4] [r=.4,g=.545098,b=.545098] -\definecolor [cadetblue1] [r=.596078,g=.960784,b=1] -\definecolor [cadetblue2] [r=.556863,g=.898039,b=.933333] -\definecolor [cadetblue3] [r=.478431,g=.772549,b=.803922] -\definecolor [cadetblue4] [r=.32549,g=.52549,b=.545098] -\definecolor [turquoise1] [g=.960784,b=1] -\definecolor [turquoise2] [g=.898039,b=.933333] -\definecolor [turquoise3] [g=.772549,b=.803922] -\definecolor [turquoise4] [g=.52549,b=.545098] -\definecolor [cyan1] [cyan] -\definecolor [cyan2] [g=.933333,b=.933333] -\definecolor [cyan3] [g=.803922,b=.803922] -\definecolor [cyan4] [g=.545098,b=.545098] -\definecolor [darkslategray1] [r=.592157,g=1,b=1] -\definecolor [darkslategray2] [r=.552941,g=.933333,b=.933333] -\definecolor [darkslategray3] [r=.47451,g=.803922,b=.803922] -\definecolor [darkslategray4] [r=.321569,g=.545098,b=.545098] -\definecolor [aquamarine1] [r=.498039,g=1,b=.831373] -\definecolor [aquamarine2] [r=.462745,g=.933333,b=.776471] -\definecolor [aquamarine3] [r=.4,g=.803922,b=.666667] -\definecolor [aquamarine4] [r=.270588,g=.545098,b=.454902] -\definecolor [darkseagreen1] [r=.756863,g=1,b=.756863] -\definecolor [darkseagreen2] [r=.705882,g=.933333,b=.705882] -\definecolor [darkseagreen3] [r=.607843,g=.803922,b=.607843] -\definecolor [darkseagreen4] [r=.411765,g=.545098,b=.411765] -\definecolor [seagreen1] [r=.329412,g=1,b=.623529] -\definecolor [seagreen2] [r=.305882,g=.933333,b=.580392] -\definecolor [seagreen3] [r=.262745,g=.803922,b=.501961] -\definecolor [seagreen4] [r=.180392,g=.545098,b=.341176] -\definecolor [palegreen1] [r=.603922,g=1,b=.603922] -\definecolor [palegreen2] [r=.564706,g=.933333,b=.564706] -\definecolor [palegreen3] [r=.486275,g=.803922,b=.486275] -\definecolor [palegreen4] [r=.329412,g=.545098,b=.329412] -\definecolor [springgreen1] [g=1,b=.498039] -\definecolor [springgreen2] [g=.933333,b=.462745] -\definecolor [springgreen3] [g=.803922,b=.4] -\definecolor [springgreen4] [g=.545098,b=.270588] -\definecolor [green1] [green] -\definecolor [green2] [g=.933333] -\definecolor [green3] [g=.803922] -\definecolor [green4] [g=.545098] -\definecolor [chartreuse1] [r=.498039,g=1] -\definecolor [chartreuse2] [r=.462745,g=.933333] -\definecolor [chartreuse3] [r=.4,g=.803922] -\definecolor [chartreuse4] [r=.270588,g=.545098] -\definecolor [olivedrab1] [r=.752941,g=1,b=.243137] -\definecolor [olivedrab2] [r=.701961,g=.933333,b=.227451] -\definecolor [olivedrab3] [r=.603922,g=.803922,b=.196078] -\definecolor [olivedrab4] [r=.411765,g=.545098,b=.133333] -\definecolor [darkolivegreen1] [r=.792157,g=1,b=.439216] -\definecolor [darkolivegreen2] [r=.737255,g=.933333,b=.407843] -\definecolor [darkolivegreen3] [r=.635294,g=.803922,b=.352941] -\definecolor [darkolivegreen4] [r=.431373,g=.545098,b=.239216] -\definecolor [khaki1] [r=1,g=.964706,b=.560784] -\definecolor [khaki2] [r=.933333,g=.901961,b=.521569] -\definecolor [khaki3] [r=.803922,g=.776471,b=.45098] -\definecolor [khaki4] [r=.545098,g=.52549,b=.305882] -\definecolor [lightgoldenrod1] [r=1,g=.92549,b=.545098] -\definecolor [lightgoldenrod2] [r=.933333,g=.862745,b=.509804] -\definecolor [lightgoldenrod3] [r=.803922,g=.745098,b=.439216] -\definecolor [lightgoldenrod4] [r=.545098,g=.505882,b=.298039] -\definecolor [lightyellow1] [r=1,g=1,b=.878431] -\definecolor [lightyellow2] [r=.933333,g=.933333,b=.819608] -\definecolor [lightyellow3] [r=.803922,g=.803922,b=.705882] -\definecolor [lightyellow4] [r=.545098,g=.545098,b=.478431] -\definecolor [yellow1] [yellow] -\definecolor [yellow2] [r=.933333,g=.933333] -\definecolor [yellow3] [r=.803922,g=.803922] -\definecolor [yellow4] [r=.545098,g=.545098] -\definecolor [gold1] [r=1,g=.843137] -\definecolor [gold2] [r=.933333,g=.788235] -\definecolor [gold3] [r=.803922,g=.678431] -\definecolor [gold4] [r=.545098,g=.458824] -\definecolor [goldenrod1] [r=1,g=.756863,b=.145098] -\definecolor [goldenrod2] [r=.933333,g=.705882,b=.133333] -\definecolor [goldenrod3] [r=.803922,g=.607843,b=.113725] -\definecolor [goldenrod4] [r=.545098,g=.411765,b=.078431] -\definecolor [darkgoldenrod1] [r=1,g=.72549,b=.058824] -\definecolor [darkgoldenrod2] [r=.933333,g=.678431,b=.054902] -\definecolor [darkgoldenrod3] [r=.803922,g=.584314,b=.047059] -\definecolor [darkgoldenrod4] [r=.545098,g=.396078,b=.031373] -\definecolor [rosybrown1] [r=1,g=.756863,b=.756863] -\definecolor [rosybrown2] [r=.933333,g=.705882,b=.705882] -\definecolor [rosybrown3] [r=.803922,g=.607843,b=.607843] -\definecolor [rosybrown4] [r=.545098,g=.411765,b=.411765] -\definecolor [indianred1] [r=1,g=.415686,b=.415686] -\definecolor [indianred2] [r=.933333,g=.388235,b=.388235] -\definecolor [indianred3] [r=.803922,g=.333333,b=.333333] -\definecolor [indianred4] [r=.545098,g=.227451,b=.227451] -\definecolor [sienna1] [r=1,g=.509804,b=.278431] -\definecolor [sienna2] [r=.933333,g=.47451,b=.258824] -\definecolor [sienna3] [r=.803922,g=.407843,b=.223529] -\definecolor [sienna4] [r=.545098,g=.278431,b=.14902] -\definecolor [burlywood1] [r=1,g=.827451,b=.607843] -\definecolor [burlywood2] [r=.933333,g=.772549,b=.568627] -\definecolor [burlywood3] [r=.803922,g=.666667,b=.490196] -\definecolor [burlywood4] [r=.545098,g=.45098,b=.333333] -\definecolor [wheat1] [r=1,g=.905882,b=.729412] -\definecolor [wheat2] [r=.933333,g=.847059,b=.682353] -\definecolor [wheat3] [r=.803922,g=.729412,b=.588235] -\definecolor [wheat4] [r=.545098,g=.494118,b=.4] -\definecolor [tan1] [r=1,g=.647059,b=.309804] -\definecolor [tan2] [r=.933333,g=.603922,b=.286275] -\definecolor [tan3] [r=.803922,g=.521569,b=.247059] -\definecolor [tan4] [r=.545098,g=.352941,b=.168627] -\definecolor [chocolate1] [r=1,g=.498039,b=.141176] -\definecolor [chocolate2] [r=.933333,g=.462745,b=.129412] -\definecolor [chocolate3] [r=.803922,g=.4,b=.113725] -\definecolor [chocolate4] [r=.545098,g=.270588,b=.07451] -\definecolor [firebrick1] [r=1,g=.188235,b=.188235] -\definecolor [firebrick2] [r=.933333,g=.172549,b=.172549] -\definecolor [firebrick3] [r=.803922,g=.14902,b=.14902] -\definecolor [firebrick4] [r=.545098,g=.101961,b=.101961] -\definecolor [brown1] [r=1,g=.25098,b=.25098] -\definecolor [brown2] [r=.933333,g=.231373,b=.231373] -\definecolor [brown3] [r=.803922,g=.2,b=.2] -\definecolor [brown4] [r=.545098,g=.137255,b=.137255] -\definecolor [salmon1] [r=1,g=.54902,b=.411765] -\definecolor [salmon2] [r=.933333,g=.509804,b=.384314] -\definecolor [salmon3] [r=.803922,g=.439216,b=.329412] -\definecolor [salmon4] [r=.545098,g=.298039,b=.223529] -\definecolor [lightsalmon1] [r=1,g=.627451,b=.478431] -\definecolor [lightsalmon2] [r=.933333,g=.584314,b=.447059] -\definecolor [lightsalmon3] [r=.803922,g=.505882,b=.384314] -\definecolor [lightsalmon4] [r=.545098,g=.341176,b=.258824] -\definecolor [orange1] [r=1,g=.647059] -\definecolor [orange2] [r=.933333,g=.603922] -\definecolor [orange3] [r=.803922,g=.521569] -\definecolor [orange4] [r=.545098,g=.352941] -\definecolor [darkorange1] [r=1,g=.498039] -\definecolor [darkorange2] [r=.933333,g=.462745] -\definecolor [darkorange3] [r=.803922,g=.4] -\definecolor [darkorange4] [r=.545098,g=.270588] -\definecolor [coral1] [r=1,g=.447059,b=.337255] -\definecolor [coral2] [r=.933333,g=.415686,b=.313725] -\definecolor [coral3] [r=.803922,g=.356863,b=.270588] -\definecolor [coral4] [r=.545098,g=.243137,b=.184314] -\definecolor [tomato1] [r=1,g=.388235,b=.278431] -\definecolor [tomato2] [r=.933333,g=.360784,b=.258824] -\definecolor [tomato3] [r=.803922,g=.309804,b=.223529] -\definecolor [tomato4] [r=.545098,g=.211765,b=.14902] -\definecolor [orangered1] [r=1,g=.270588] -\definecolor [orangered2] [r=.933333,g=.25098] -\definecolor [orangered3] [r=.803922,g=.215686] -\definecolor [orangered4] [r=.545098,g=.145098] -\definecolor [red1] [red] -\definecolor [red2] [r=.933333] -\definecolor [red3] [r=.803922] -\definecolor [red4] [r=.545098] -\definecolor [deeppink1] [r=1,g=.078431,b=.576471] -\definecolor [deeppink2] [r=.933333,g=.070588,b=.537255] -\definecolor [deeppink3] [r=.803922,g=.062745,b=.462745] -\definecolor [deeppink4] [r=.545098,g=.039216,b=.313725] -\definecolor [hotpink1] [r=1,g=.431373,b=.705882] -\definecolor [hotpink2] [r=.933333,g=.415686,b=.654902] -\definecolor [hotpink3] [r=.803922,g=.376471,b=.564706] -\definecolor [hotpink4] [r=.545098,g=.227451,b=.384314] -\definecolor [pink1] [r=1,g=.709804,b=.772549] -\definecolor [pink2] [r=.933333,g=.662745,b=.721569] -\definecolor [pink3] [r=.803922,g=.568627,b=.619608] -\definecolor [pink4] [r=.545098,g=.388235,b=.423529] -\definecolor [lightpink1] [r=1,g=.682353,b=.72549] -\definecolor [lightpink2] [r=.933333,g=.635294,b=.678431] -\definecolor [lightpink3] [r=.803922,g=.54902,b=.584314] -\definecolor [lightpink4] [r=.545098,g=.372549,b=.396078] -\definecolor [palevioletred1] [r=1,g=.509804,b=.670588] -\definecolor [palevioletred2] [r=.933333,g=.47451,b=.623529] -\definecolor [palevioletred3] [r=.803922,g=.407843,b=.537255] -\definecolor [palevioletred4] [r=.545098,g=.278431,b=.364706] -\definecolor [maroon1] [r=1,g=.203922,b=.701961] -\definecolor [maroon2] [r=.933333,g=.188235,b=.654902] -\definecolor [maroon3] [r=.803922,g=.160784,b=.564706] -\definecolor [maroon4] [r=.545098,g=.109804,b=.384314] -\definecolor [violetred1] [r=1,g=.243137,b=.588235] -\definecolor [violetred2] [r=.933333,g=.227451,b=.54902] -\definecolor [violetred3] [r=.803922,g=.196078,b=.470588] -\definecolor [violetred4] [r=.545098,g=.133333,b=.321569] -\definecolor [magenta1] [magenta] -\definecolor [magenta2] [r=.933333,b=.933333] -\definecolor [magenta3] [r=.803922,b=.803922] -\definecolor [magenta4] [r=.545098,b=.545098] -\definecolor [orchid1] [r=1,g=.513725,b=.980392] -\definecolor [orchid2] [r=.933333,g=.478431,b=.913725] -\definecolor [orchid3] [r=.803922,g=.411765,b=.788235] -\definecolor [orchid4] [r=.545098,g=.278431,b=.537255] -\definecolor [plum1] [r=1,g=.733333,b=1] -\definecolor [plum2] [r=.933333,g=.682353,b=.933333] -\definecolor [plum3] [r=.803922,g=.588235,b=.803922] -\definecolor [plum4] [r=.545098,g=.4,b=.545098] -\definecolor [mediumorchid1] [r=.878431,g=.4,b=1] -\definecolor [mediumorchid2] [r=.819608,g=.372549,b=.933333] -\definecolor [mediumorchid3] [r=.705882,g=.321569,b=.803922] -\definecolor [mediumorchid4] [r=.478431,g=.215686,b=.545098] -\definecolor [darkorchid1] [r=.74902,g=.243137,b=1] -\definecolor [darkorchid2] [r=.698039,g=.227451,b=.933333] -\definecolor [darkorchid3] [r=.603922,g=.196078,b=.803922] -\definecolor [darkorchid4] [r=.407843,g=.133333,b=.545098] -\definecolor [purple1] [r=.607843,g=.188235,b=1] -\definecolor [purple2] [r=.568627,g=.172549,b=.933333] -\definecolor [purple3] [r=.490196,g=.14902,b=.803922] -\definecolor [purple4] [r=.333333,g=.101961,b=.545098] -\definecolor [mediumpurple1] [r=.670588,g=.509804,b=1] -\definecolor [mediumpurple2] [r=.623529,g=.47451,b=.933333] -\definecolor [mediumpurple3] [r=.537255,g=.407843,b=.803922] -\definecolor [mediumpurple4] [r=.364706,g=.278431,b=.545098] -\definecolor [thistle1] [r=1,g=.882353,b=1] -\definecolor [thistle2] [r=.933333,g=.823529,b=.933333] -\definecolor [thistle3] [r=.803922,g=.709804,b=.803922] -\definecolor [thistle4] [r=.545098,g=.482353,b=.545098] -\definecolor [gray0] [black] -\definecolor [gray1] [s=.01] -\definecolor [gray2] [s=.02] -\definecolor [gray3] [s=.03] -\definecolor [gray4] [s=.04] -\definecolor [gray5] [s=.05] -\definecolor [gray6] [s=.06] -\definecolor [gray7] [s=.07] -\definecolor [gray8] [s=.08] -\definecolor [gray9] [s=.09] -\definecolor [gray10] [s=.1] -\definecolor [gray11] [s=.11] -\definecolor [gray12] [s=.12] -\definecolor [gray13] [s=.13] -\definecolor [gray14] [s=.14] -\definecolor [gray15] [s=.15] -\definecolor [gray16] [s=.16] -\definecolor [gray17] [s=.17] -\definecolor [gray18] [s=.18] -\definecolor [gray19] [s=.19] -\definecolor [gray20] [s=.2] -\definecolor [gray21] [s=.21] -\definecolor [gray22] [s=.22] -\definecolor [gray23] [s=.23] -\definecolor [gray24] [s=.24] -\definecolor [gray25] [s=.25] -\definecolor [gray26] [s=.26] -\definecolor [gray27] [s=.27] -\definecolor [gray28] [s=.28] -\definecolor [gray29] [s=.29] -\definecolor [gray30] [s=.3] -\definecolor [gray31] [s=.31] -\definecolor [gray32] [s=.32] -\definecolor [gray33] [s=.33] -\definecolor [gray34] [s=.34] -\definecolor [gray35] [s=.35] -\definecolor [gray36] [s=.36] -\definecolor [gray37] [s=.37] -\definecolor [gray38] [s=.38] -\definecolor [gray39] [s=.39] -\definecolor [gray40] [s=.4] -\definecolor [gray41] [s=.41] -\definecolor [gray42] [s=.42] -\definecolor [gray43] [s=.43] -\definecolor [gray44] [s=.44] -\definecolor [gray45] [s=.45] -\definecolor [gray46] [s=.46] -\definecolor [gray47] [s=.47] -\definecolor [gray48] [s=.48] -\definecolor [gray49] [s=.49] -\definecolor [gray50] [s=.5] -\definecolor [gray51] [s=.51] -\definecolor [gray52] [s=.52] -\definecolor [gray53] [s=.53] -\definecolor [gray54] [s=.54] -\definecolor [gray55] [s=.55] -\definecolor [gray56] [s=.56] -\definecolor [gray57] [s=.57] -\definecolor [gray58] [s=.58] -\definecolor [gray59] [s=.59] -\definecolor [gray60] [s=.6] -\definecolor [gray61] [s=.61] -\definecolor [gray62] [s=.62] -\definecolor [gray63] [s=.63] -\definecolor [gray64] [s=.64] -\definecolor [gray65] [s=.65] -\definecolor [gray66] [s=.66] -\definecolor [gray67] [s=.67] -\definecolor [gray68] [s=.68] -\definecolor [gray69] [s=.69] -\definecolor [gray70] [s=.7] -\definecolor [gray71] [s=.71] -\definecolor [gray72] [s=.72] -\definecolor [gray73] [s=.73] -\definecolor [gray74] [s=.74] -\definecolor [gray75] [s=.75] -\definecolor [gray76] [s=.76] -\definecolor [gray77] [s=.77] -\definecolor [gray78] [s=.78] -\definecolor [gray79] [s=.79] -\definecolor [gray80] [s=.8] -\definecolor [gray81] [s=.81] -\definecolor [gray82] [s=.82] -\definecolor [gray83] [s=.83] -\definecolor [gray84] [s=.84] -\definecolor [gray85] [s=.85] -\definecolor [gray86] [s=.86] -\definecolor [gray87] [s=.87] -\definecolor [gray88] [s=.88] -\definecolor [gray89] [s=.89] -\definecolor [gray90] [s=.9] -\definecolor [gray91] [s=.91] -\definecolor [gray92] [s=.92] -\definecolor [gray93] [s=.93] -\definecolor [gray94] [s=.94] -\definecolor [gray95] [s=.95] -\definecolor [gray96] [s=.96] -\definecolor [gray97] [s=.97] -\definecolor [gray98] [s=.98] -\definecolor [gray99] [s=.99] -\definecolor [gray100] [white] -\definecolor [darkgray] [s=.662745] -\definecolor [darkblue] [b=.545098] -\definecolor [darkcyan] [g=.545098,b=.545098] -\definecolor [darkmagenta] [r=.545098,b=.545098] -\definecolor [darkred] [r=.545098] -\definecolor [lightgreen] [r=.564706,g=.933333,b=.564706] diff --git a/tex/context/base/colo-hex.mkii b/tex/context/base/colo-hex.mkii new file mode 100644 index 000000000..db67f1841 --- /dev/null +++ b/tex/context/base/colo-hex.mkii @@ -0,0 +1,125 @@ +%D \module +%D [ file=colo-hex, +%D version=2004.06.23, +%D title=\CONTEXT\ Color Macros, +%D subtitle=Hex Colors, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\ifdefined \hexcolorprefix + \expandafter \endinput +\fi + +\writestatus{loading}{ConTeXt Color Macros / Hexadecimal} + +% \edef\testcolor{\string#FFC0C0} +% \edef\testcolor{\string#55} +% +% \setupcolors[state=start] +% +% \expanded{\definecolor[thehexcolor][\hexcolorspec\testcolor]} +% +% \checkhexcolor[\testcolor] +% +% \definecolor[thehexcolor][\testcolor] +% +% \starttext +% +% test \color[thehexcolor]{rood} +% test \color[red]{rood} +% test \color[\testcolor]{rood} +% +% \stoptext + +\unprotect + +% \definecolor[rgbtestcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227) +% \definecolor[hextestcolor] [h=E0DFE3] +% +% \startMPpage +% path p ; % example by Peter Rolf +% p := unitsquare xyscaled(5cm,5cm) ; +% fill (point 0 of p -- point 1 of p -- point 2 of p --cycle) withcolor \MPcolor{rgbtestcolor} ; % bottom right part of the square +% fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{hextestcolor} ; % top left part +% \stopMPpage + +\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr1pt/255\relax + +\chardef\hexcolorprefix=`# + +\def\hexcolorspec #1{\expandafter\dohexcolorspec #1\empty\empty\empty\empty\relax} +\def\hexcolorpattern#1{\expandafter\dohexcolorpattern#1\empty\empty\empty\empty\relax} + +\ifx\dohexstringtonumber\undefined \def\dohexstringtonumber{"} \fi + +\def\hexcolorcomponent#1#2% + {\ifnum\dohexstringtonumber#1#2=\zerocount0\else\ifnum\dohexstringtonumber#1#2=\plusone1\else + \expandafter\withoutpt\the\dimexpr\dohexstringtonumber#1#2\hexcolorfraction\relax + \fi\fi} + +\def\dohexcolorspec#1#2#3#4#5#6#7#8\relax + {\ifx#4\empty + s=\hexcolorcomponent#2#3% + \else + r=\hexcolorcomponent#2#3,g=\hexcolorcomponent#4#5,b=\hexcolorcomponent#6#7% + \fi} + +\def\dohexcolorpattern#1#2#3#4#5#6#7#8\relax + {0\ifx#4\empty + S:\hexcolorcomponent#2#3% + \else + R:\hexcolorcomponent#2#3:\hexcolorcomponent#4#5:\hexcolorcomponent#6#7% + \fi:0:0} + +\def\doifhexcolorelse#1% + {\expandafter\dodoifhexcolorelse#10\od} % 0 is a dirty trick to catch an empty #1 + +\def\dodoifhexcolorelse#1#2\od + {\ifnum`#1=\hexcolorprefix + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\docheckhexcolor#1% + {\doifhexcolorelse{#1}{\doifundefined{#1}{\setxvalue{\??cr#1}{\hexcolorpattern{#1}}}}\donothing} + +\def\checkhexcolor[#1]% + {\expanded{\docheckhexcolor{#1}}} + +\def\colorHpattern{\@EA\hexcolorpattern\@EA{\@EA*\@@cl@@h}} % * == dummy placeholder + +\let\dodododefinecolor\dododefinecolor % we will overload this one + +\def\dododefinecolor#1#2#3#4[#5][#6]% + {\doifhexcolorelse{#6} + {\setxvalue{\??cr#5}{\hexcolorpattern{#6}}} + {\dodododefinecolor#1#2#3#4[#5][#6]}} + +%D For Adam Lindsay and his XeTeX special driver: + +% because we intercept the zero condition, the .23pt in 1.23pt will disappear in the +% ifcase zero part branch + +\def\colorhexcomponent#1% + {\ifdim#1\points<.005\points + 00\else\lchexnumbers{\the\dimexpr255\dimexpr#1\points\relax+.5\points\relax}% + \fi} + +% the faster one + +\newdimen\hex@color@a \hex@color@a=.005pt +\newdimen\hex@color@b \hex@color@b=.5pt +\chardef \hex@color@c =255 + +\def\colorhexcomponent#1% + {\ifdim#1\points<\hex@color@a + 00\else\lchexnumbers{\the\dimexpr#1\points*\hex@color@c+\hex@color@b\relax}% + \fi} + +\protect \endinput diff --git a/tex/context/base/colo-imp-ema.mkiv b/tex/context/base/colo-imp-ema.mkiv new file mode 100644 index 000000000..e5e90b235 --- /dev/null +++ b/tex/context/base/colo-imp-ema.mkiv @@ -0,0 +1,590 @@ +%D \module +%D [ file=colo-ema, +%D version=2003.03.20, +%D title=\CONTEXT\ Color Macros, +%D subtitle=Emacs Colors, +%D author=Peter Rolf, +%D date=\currentdate, +%D copyright=PRAGMA ADE] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% author : Peter Rolf +% last change : 17 march 2003 +% origin : /emacs/etc/rgb.txt +% +% USAGE: +% +% - select emacs menu: Edit -> Text Properties -> Display +% Colors, if you don't know what I'm talking about +% - copy this file to your /texmf/tex/context/user directory +% and add "\input colo-emacs" to your tex-file +% +% IMPORTANT NOTES: +% +% - all color names are written as ONE word in lowercase +% letters (no redundancy as in rgb.txt) so if you want to +% use the color "Light Sky Blue"/"light sky blue" it's new +% name is lightskyblue +% - the grayX values [X=0..100] can only be used with \color +% [grayX] +% - use it at your own risk :) +% +% HINT: +% +% I only include this file (\showcolor [ema]) until I've +% found the colors I want. Copy and paste the color +% definitions to a seperate file, to decrease compilation +% time (540 color definitions). + +\definecolor [snow] [r=1,g=.980392,b=.980392] +\definecolor [ghostwhite] [r=.972549,g=.972549,b=1] +\definecolor [whitesmoke] [s=.960784] +\definecolor [gainsboro] [s=.862745] +\definecolor [floralwhite] [r=1,g=.980392,b=.941176] +\definecolor [oldlace] [r=.992157,g=.960784,b=.901961] +\definecolor [linen] [r=.980392,g=.941176,b=.901961] +\definecolor [antiquewhite] [r=.980392,g=.921569,b=.843137] +\definecolor [papayawhip] [r=1,g=.937255,b=.835294] +\definecolor [blanchedalmond] [r=1,g=.921569,b=.803922] +\definecolor [bisque] [r=1,g=.894118,b=.768627] +\definecolor [peachpuff] [r=1,g=.854902,b=.72549] +\definecolor [navajowhite] [r=1,g=.870588,b=.678431] +\definecolor [moccasin] [r=1,g=.894118,b=.709804] +\definecolor [cornsilk] [r=1,g=.972549,b=.862745] +\definecolor [ivory] [r=1,g=1,b=.941176] +\definecolor [lemonchiffon] [r=1,g=.980392,b=.803922] +\definecolor [seashell] [r=1,g=.960784,b=.933333] +\definecolor [honeydew] [r=.941176,g=1,b=.941176] +\definecolor [mintcream] [r=.960784,g=1,b=.980392] +\definecolor [azure] [r=.941176,g=1,b=1] +\definecolor [aliceblue] [r=.941176,g=.972549,b=1] +\definecolor [lavender] [r=.901961,g=.901961,b=.980392] +\definecolor [lavenderblush] [r=1,g=.941176,b=.960784] +\definecolor [mistyrose] [r=1,g=.894118,b=.882353] +%definecolor[white] [s=1] +%definecolor[black] [s=0] +\definecolor [darkslategray] [r=.184314,g=.309804,b=.309804] +\definecolor [dimgray] [s=.411765] +\definecolor [slategray] [r=.439216,g=.501961,b=.564706] +\definecolor [lightslategray] [r=.466667,g=.533333,b=.6] +\definecolor [gray] [s=.745098] +\definecolor [lightgray] [s=.827451] +\definecolor [midnightblue] [r=.098039,g=.098039,b=.439216] +\definecolor [navy] [b=.501961] +\definecolor [navyblue] [navy] +\definecolor [cornflowerblue] [r=.392157,g=.584314,b=.929412] +\definecolor [darkslateblue] [r=.282353,g=.239216,b=.545098] +\definecolor [slateblue] [r=.415686,g=.352941,b=.803922] +\definecolor [mediumslateblue] [r=.482353,g=.407843,b=.933333] +\definecolor [lightslateblue] [r=.517647,g=.439216,b=1] +\definecolor [mediumblue] [b=.803922] +\definecolor [royalblue] [r=.254902,g=.411765,b=.882353] +%definecolor[blue] [b=1] +\definecolor [dodgerblue] [r=.117647,g=.564706,b=1] +\definecolor [deepskyblue] [g=.74902,b=1] +\definecolor [skyblue] [r=.529412,g=.807843,b=.921569] +\definecolor [lightskyblue] [r=.529412,g=.807843,b=.980392] +\definecolor [steelblue] [r=.27451,g=.509804,b=.705882] +\definecolor [lightsteelblue] [r=.690196,g=.768627,b=.870588] +\definecolor [lightblue] [r=.678431,g=.847059,b=.901961] +\definecolor [powderblue] [r=.690196,g=.878431,b=.901961] +\definecolor [paleturquoise] [r=.686275,g=.933333,b=.933333] +\definecolor [darkturquoise] [g=.807843,b=.819608] +\definecolor [mediumturquoise] [r=.282353,g=.819608,b=.8] +\definecolor [turquoise] [r=.25098,g=.878431,b=.815686] +%definecolor[cyan] [g=1,b=1] +\definecolor [lightcyan] [r=.878431,g=1,b=1] +\definecolor [cadetblue] [r=.372549,g=.619608,b=.627451] +\definecolor [mediumaquamarine] [r=.4,g=.803922,b=.666667] +\definecolor [aquamarine] [r=.498039,g=1,b=.831373] +\definecolor [darkgreen] [g=.392157] +\definecolor [darkolivegreen] [r=.333333,g=.419608,b=.184314] +\definecolor [darkseagreen] [r=.560784,g=.737255,b=.560784] +\definecolor [seagreen] [r=.180392,g=.545098,b=.341176] +\definecolor [mediumseagreen] [r=.235294,g=.701961,b=.443137] +\definecolor [lightseagreen] [r=.12549,g=.698039,b=.666667] +\definecolor [palegreen] [r=.596078,g=.984314,b=.596078] +\definecolor [springgreen] [g=1,b=.498039] +\definecolor [lawngreen] [r=.486275,g=.988235] +%definecolor[green] [g=1] +\definecolor [chartreuse] [r=.498039,g=1] +\definecolor [mediumspringgreen] [g=.980392,b=.603922] +\definecolor [greenyellow] [r=.678431,g=1,b=.184314] +\definecolor [limegreen] [r=.196078,g=.803922,b=.196078] +\definecolor [yellowgreen] [r=.603922,g=.803922,b=.196078] +\definecolor [forestgreen] [r=.133333,g=.545098,b=.133333] +\definecolor [olivedrab] [r=.419608,g=.556863,b=.137255] +\definecolor [darkkhaki] [r=.741176,g=.717647,b=.419608] +\definecolor [khaki] [r=.941176,g=.901961,b=.54902] +\definecolor [palegoldenrod] [r=.933333,g=.909804,b=.666667] +\definecolor [lightgoldenrodyellow] [r=.980392,g=.980392,b=.823529] +\definecolor [lightyellow] [r=1,g=1,b=.878431] +%definecolor[yellow] [r=1,g=1] +\definecolor [gold] [r=1,g=.843137] +\definecolor [lightgoldenrod] [r=.933333,g=.866667,b=.509804] +\definecolor [goldenrod] [r=.854902,g=.647059,b=.12549] +\definecolor [darkgoldenrod] [r=.721569,g=.52549,b=.043137] +\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784] +\definecolor [indianred] [r=.803922,g=.360784,b=.360784] +\definecolor [saddlebrown] [r=.545098,g=.270588,b=.07451] +\definecolor [sienna] [r=.627451,g=.321569,b=.176471] +\definecolor [peru] [r=.803922,g=.521569,b=.247059] +\definecolor [burlywood] [r=.870588,g=.721569,b=.529412] +\definecolor [beige] [r=.960784,g=.960784,b=.862745] +\definecolor [wheat] [r=.960784,g=.870588,b=.701961] +\definecolor [sandybrown] [r=.956863,g=.643137,b=.376471] +\definecolor [tan] [r=.823529,g=.705882,b=.54902] +\definecolor [chocolate] [r=.823529,g=.411765,b=.117647] +\definecolor [firebrick] [r=.698039,g=.133333,b=.133333] +\definecolor [brown] [r=.647059,g=.164706,b=.164706] +\definecolor [darksalmon] [r=.913725,g=.588235,b=.478431] +\definecolor [salmon] [r=.980392,g=.501961,b=.447059] +\definecolor [lightsalmon] [r=1,g=.627451,b=.478431] +\definecolor [orange] [r=1,g=.647059] +\definecolor [darkorange] [r=1,g=.54902] +\definecolor [coral] [r=1,g=.498039,b=.313725] +\definecolor [lightcoral] [r=.941176,g=.501961,b=.501961] +\definecolor [tomato] [r=1,g=.388235,b=.278431] +\definecolor [orangered] [r=1,g=.270588] +%definecolor[red] [r=1] +\definecolor [hotpink] [r=1,g=.411765,b=.705882] +\definecolor [deeppink] [r=1,g=.078431,b=.576471] +\definecolor [pink] [r=1,g=.752941,b=.796078] +\definecolor [lightpink] [r=1,g=.713725,b=.756863] +\definecolor [palevioletred] [r=.858824,g=.439216,b=.576471] +\definecolor [maroon] [r=.690196,g=.188235,b=.376471] +\definecolor [mediumvioletred] [r=.780392,g=.082353,b=.521569] +\definecolor [violetred] [r=.815686,g=.12549,b=.564706] +%definecolor[magenta] [r=1,b=1] +\definecolor [violet] [r=.933333,g=.509804,b=.933333] +\definecolor [plum] [r=.866667,g=.627451,b=.866667] +\definecolor [orchid] [r=.854902,g=.439216,b=.839216] +\definecolor [mediumorchid] [r=.729412,g=.333333,b=.827451] +\definecolor [darkorchid] [r=.6,g=.196078,b=.8] +\definecolor [darkviolet] [r=.580392,b=.827451] +\definecolor [blueviolet] [r=.541176,g=.168627,b=.886275] +\definecolor [purple] [r=.627451,g=.12549,b=.941176] +\definecolor [mediumpurple] [r=.576471,g=.439216,b=.858824] +\definecolor [thistle] [r=.847059,g=.74902,b=.847059] +\definecolor [snow1] [r=1,g=.980392,b=.980392] +\definecolor [snow2] [r=.933333,g=.913725,b=.913725] +\definecolor [snow3] [r=.803922,g=.788235,b=.788235] +\definecolor [snow4] [r=.545098,g=.537255,b=.537255] +\definecolor [seashell1] [r=1,g=.960784,b=.933333] +\definecolor [seashell2] [r=.933333,g=.898039,b=.870588] +\definecolor [seashell3] [r=.803922,g=.772549,b=.74902] +\definecolor [seashell4] [r=.545098,g=.52549,b=.509804] +\definecolor [antiquewhite1] [r=1,g=.937255,b=.858824] +\definecolor [antiquewhite2] [r=.933333,g=.87451,b=.8] +\definecolor [antiquewhite3] [r=.803922,g=.752941,b=.690196] +\definecolor [antiquewhite4] [r=.545098,g=.513725,b=.470588] +\definecolor [bisque1] [r=1,g=.894118,b=.768627] +\definecolor [bisque2] [r=.933333,g=.835294,b=.717647] +\definecolor [bisque3] [r=.803922,g=.717647,b=.619608] +\definecolor [bisque4] [r=.545098,g=.490196,b=.419608] +\definecolor [peachpuff1] [r=1,g=.854902,b=.72549] +\definecolor [peachpuff2] [r=.933333,g=.796078,b=.678431] +\definecolor [peachpuff3] [r=.803922,g=.686275,b=.584314] +\definecolor [peachpuff4] [r=.545098,g=.466667,b=.396078] +\definecolor [navajowhite1] [r=1,g=.870588,b=.678431] +\definecolor [navajowhite2] [r=.933333,g=.811765,b=.631373] +\definecolor [navajowhite3] [r=.803922,g=.701961,b=.545098] +\definecolor [navajowhite4] [r=.545098,g=.47451,b=.368627] +\definecolor [lemonchiffon1] [r=1,g=.980392,b=.803922] +\definecolor [lemonchiffon2] [r=.933333,g=.913725,b=.74902] +\definecolor [lemonchiffon3] [r=.803922,g=.788235,b=.647059] +\definecolor [lemonchiffon4] [r=.545098,g=.537255,b=.439216] +\definecolor [cornsilk1] [r=1,g=.972549,b=.862745] +\definecolor [cornsilk2] [r=.933333,g=.909804,b=.803922] +\definecolor [cornsilk3] [r=.803922,g=.784314,b=.694118] +\definecolor [cornsilk4] [r=.545098,g=.533333,b=.470588] +\definecolor [ivory1] [r=1,g=1,b=.941176] +\definecolor [ivory2] [r=.933333,g=.933333,b=.878431] +\definecolor [ivory3] [r=.803922,g=.803922,b=.756863] +\definecolor [ivory4] [r=.545098,g=.545098,b=.513725] +\definecolor [honeydew1] [r=.941176,g=1,b=.941176] +\definecolor [honeydew2] [r=.878431,g=.933333,b=.878431] +\definecolor [honeydew3] [r=.756863,g=.803922,b=.756863] +\definecolor [honeydew4] [r=.513725,g=.545098,b=.513725] +\definecolor [lavenderblush1] [r=1,g=.941176,b=.960784] +\definecolor [lavenderblush2] [r=.933333,g=.878431,b=.898039] +\definecolor [lavenderblush3] [r=.803922,g=.756863,b=.772549] +\definecolor [lavenderblush4] [r=.545098,g=.513725,b=.52549] +\definecolor [mistyrose1] [r=1,g=.894118,b=.882353] +\definecolor [mistyrose2] [r=.933333,g=.835294,b=.823529] +\definecolor [mistyrose3] [r=.803922,g=.717647,b=.709804] +\definecolor [mistyrose4] [r=.545098,g=.490196,b=.482353] +\definecolor [azure1] [r=.941176,g=1,b=1] +\definecolor [azure2] [r=.878431,g=.933333,b=.933333] +\definecolor [azure3] [r=.756863,g=.803922,b=.803922] +\definecolor [azure4] [r=.513725,g=.545098,b=.545098] +\definecolor [slateblue1] [r=.513725,g=.435294,b=1] +\definecolor [slateblue2] [r=.478431,g=.403922,b=.933333] +\definecolor [slateblue3] [r=.411765,g=.34902,b=.803922] +\definecolor [slateblue4] [r=.278431,g=.235294,b=.545098] +\definecolor [royalblue1] [r=.282353,g=.462745,b=1] +\definecolor [royalblue2] [r=.262745,g=.431373,b=.933333] +\definecolor [royalblue3] [r=.227451,g=.372549,b=.803922] +\definecolor [royalblue4] [r=.152941,g=.25098,b=.545098] +\definecolor [blue1] [blue] +\definecolor [blue2] [b=.933333] +\definecolor [blue3] [b=.803922] +\definecolor [blue4] [b=.545098] +\definecolor [dodgerblue1] [r=.117647,g=.564706,b=1] +\definecolor [dodgerblue2] [r=.109804,g=.52549,b=.933333] +\definecolor [dodgerblue3] [r=.094118,g=.454902,b=.803922] +\definecolor [dodgerblue4] [r=.062745,g=.305882,b=.545098] +\definecolor [steelblue1] [r=.388235,g=.721569,b=1] +\definecolor [steelblue2] [r=.360784,g=.67451,b=.933333] +\definecolor [steelblue3] [r=.309804,g=.580392,b=.803922] +\definecolor [steelblue4] [r=.211765,g=.392157,b=.545098] +\definecolor [deepskyblue1] [g=.74902,b=1] +\definecolor [deepskyblue2] [g=.698039,b=.933333] +\definecolor [deepskyblue3] [g=.603922,b=.803922] +\definecolor [deepskyblue4] [g=.407843,b=.545098] +\definecolor [skyblue1] [r=.529412,g=.807843,b=1] +\definecolor [skyblue2] [r=.494118,g=.752941,b=.933333] +\definecolor [skyblue3] [r=.423529,g=.65098,b=.803922] +\definecolor [skyblue4] [r=.290196,g=.439216,b=.545098] +\definecolor [lightskyblue1] [r=.690196,g=.886275,b=1] +\definecolor [lightskyblue2] [r=.643137,g=.827451,b=.933333] +\definecolor [lightskyblue3] [r=.552941,g=.713725,b=.803922] +\definecolor [lightskyblue4] [r=.376471,g=.482353,b=.545098] +\definecolor [slategray1] [r=.776471,g=.886275,b=1] +\definecolor [slategray2] [r=.72549,g=.827451,b=.933333] +\definecolor [slategray3] [r=.623529,g=.713725,b=.803922] +\definecolor [slategray4] [r=.423529,g=.482353,b=.545098] +\definecolor [lightsteelblue1] [r=.792157,g=.882353,b=1] +\definecolor [lightsteelblue2] [r=.737255,g=.823529,b=.933333] +\definecolor [lightsteelblue3] [r=.635294,g=.709804,b=.803922] +\definecolor [lightsteelblue4] [r=.431373,g=.482353,b=.545098] +\definecolor [lightblue1] [r=.74902,g=.937255,b=1] +\definecolor [lightblue2] [r=.698039,g=.87451,b=.933333] +\definecolor [lightblue3] [r=.603922,g=.752941,b=.803922] +\definecolor [lightblue4] [r=.407843,g=.513725,b=.545098] +\definecolor [lightcyan1] [r=.878431,g=1,b=1] +\definecolor [lightcyan2] [r=.819608,g=.933333,b=.933333] +\definecolor [lightcyan3] [r=.705882,g=.803922,b=.803922] +\definecolor [lightcyan4] [r=.478431,g=.545098,b=.545098] +\definecolor [paleturquoise1] [r=.733333,g=1,b=1] +\definecolor [paleturquoise2] [r=.682353,g=.933333,b=.933333] +\definecolor [paleturquoise3] [r=.588235,g=.803922,b=.803922] +\definecolor [paleturquoise4] [r=.4,g=.545098,b=.545098] +\definecolor [cadetblue1] [r=.596078,g=.960784,b=1] +\definecolor [cadetblue2] [r=.556863,g=.898039,b=.933333] +\definecolor [cadetblue3] [r=.478431,g=.772549,b=.803922] +\definecolor [cadetblue4] [r=.32549,g=.52549,b=.545098] +\definecolor [turquoise1] [g=.960784,b=1] +\definecolor [turquoise2] [g=.898039,b=.933333] +\definecolor [turquoise3] [g=.772549,b=.803922] +\definecolor [turquoise4] [g=.52549,b=.545098] +\definecolor [cyan1] [cyan] +\definecolor [cyan2] [g=.933333,b=.933333] +\definecolor [cyan3] [g=.803922,b=.803922] +\definecolor [cyan4] [g=.545098,b=.545098] +\definecolor [darkslategray1] [r=.592157,g=1,b=1] +\definecolor [darkslategray2] [r=.552941,g=.933333,b=.933333] +\definecolor [darkslategray3] [r=.47451,g=.803922,b=.803922] +\definecolor [darkslategray4] [r=.321569,g=.545098,b=.545098] +\definecolor [aquamarine1] [r=.498039,g=1,b=.831373] +\definecolor [aquamarine2] [r=.462745,g=.933333,b=.776471] +\definecolor [aquamarine3] [r=.4,g=.803922,b=.666667] +\definecolor [aquamarine4] [r=.270588,g=.545098,b=.454902] +\definecolor [darkseagreen1] [r=.756863,g=1,b=.756863] +\definecolor [darkseagreen2] [r=.705882,g=.933333,b=.705882] +\definecolor [darkseagreen3] [r=.607843,g=.803922,b=.607843] +\definecolor [darkseagreen4] [r=.411765,g=.545098,b=.411765] +\definecolor [seagreen1] [r=.329412,g=1,b=.623529] +\definecolor [seagreen2] [r=.305882,g=.933333,b=.580392] +\definecolor [seagreen3] [r=.262745,g=.803922,b=.501961] +\definecolor [seagreen4] [r=.180392,g=.545098,b=.341176] +\definecolor [palegreen1] [r=.603922,g=1,b=.603922] +\definecolor [palegreen2] [r=.564706,g=.933333,b=.564706] +\definecolor [palegreen3] [r=.486275,g=.803922,b=.486275] +\definecolor [palegreen4] [r=.329412,g=.545098,b=.329412] +\definecolor [springgreen1] [g=1,b=.498039] +\definecolor [springgreen2] [g=.933333,b=.462745] +\definecolor [springgreen3] [g=.803922,b=.4] +\definecolor [springgreen4] [g=.545098,b=.270588] +\definecolor [green1] [green] +\definecolor [green2] [g=.933333] +\definecolor [green3] [g=.803922] +\definecolor [green4] [g=.545098] +\definecolor [chartreuse1] [r=.498039,g=1] +\definecolor [chartreuse2] [r=.462745,g=.933333] +\definecolor [chartreuse3] [r=.4,g=.803922] +\definecolor [chartreuse4] [r=.270588,g=.545098] +\definecolor [olivedrab1] [r=.752941,g=1,b=.243137] +\definecolor [olivedrab2] [r=.701961,g=.933333,b=.227451] +\definecolor [olivedrab3] [r=.603922,g=.803922,b=.196078] +\definecolor [olivedrab4] [r=.411765,g=.545098,b=.133333] +\definecolor [darkolivegreen1] [r=.792157,g=1,b=.439216] +\definecolor [darkolivegreen2] [r=.737255,g=.933333,b=.407843] +\definecolor [darkolivegreen3] [r=.635294,g=.803922,b=.352941] +\definecolor [darkolivegreen4] [r=.431373,g=.545098,b=.239216] +\definecolor [khaki1] [r=1,g=.964706,b=.560784] +\definecolor [khaki2] [r=.933333,g=.901961,b=.521569] +\definecolor [khaki3] [r=.803922,g=.776471,b=.45098] +\definecolor [khaki4] [r=.545098,g=.52549,b=.305882] +\definecolor [lightgoldenrod1] [r=1,g=.92549,b=.545098] +\definecolor [lightgoldenrod2] [r=.933333,g=.862745,b=.509804] +\definecolor [lightgoldenrod3] [r=.803922,g=.745098,b=.439216] +\definecolor [lightgoldenrod4] [r=.545098,g=.505882,b=.298039] +\definecolor [lightyellow1] [r=1,g=1,b=.878431] +\definecolor [lightyellow2] [r=.933333,g=.933333,b=.819608] +\definecolor [lightyellow3] [r=.803922,g=.803922,b=.705882] +\definecolor [lightyellow4] [r=.545098,g=.545098,b=.478431] +\definecolor [yellow1] [yellow] +\definecolor [yellow2] [r=.933333,g=.933333] +\definecolor [yellow3] [r=.803922,g=.803922] +\definecolor [yellow4] [r=.545098,g=.545098] +\definecolor [gold1] [r=1,g=.843137] +\definecolor [gold2] [r=.933333,g=.788235] +\definecolor [gold3] [r=.803922,g=.678431] +\definecolor [gold4] [r=.545098,g=.458824] +\definecolor [goldenrod1] [r=1,g=.756863,b=.145098] +\definecolor [goldenrod2] [r=.933333,g=.705882,b=.133333] +\definecolor [goldenrod3] [r=.803922,g=.607843,b=.113725] +\definecolor [goldenrod4] [r=.545098,g=.411765,b=.078431] +\definecolor [darkgoldenrod1] [r=1,g=.72549,b=.058824] +\definecolor [darkgoldenrod2] [r=.933333,g=.678431,b=.054902] +\definecolor [darkgoldenrod3] [r=.803922,g=.584314,b=.047059] +\definecolor [darkgoldenrod4] [r=.545098,g=.396078,b=.031373] +\definecolor [rosybrown1] [r=1,g=.756863,b=.756863] +\definecolor [rosybrown2] [r=.933333,g=.705882,b=.705882] +\definecolor [rosybrown3] [r=.803922,g=.607843,b=.607843] +\definecolor [rosybrown4] [r=.545098,g=.411765,b=.411765] +\definecolor [indianred1] [r=1,g=.415686,b=.415686] +\definecolor [indianred2] [r=.933333,g=.388235,b=.388235] +\definecolor [indianred3] [r=.803922,g=.333333,b=.333333] +\definecolor [indianred4] [r=.545098,g=.227451,b=.227451] +\definecolor [sienna1] [r=1,g=.509804,b=.278431] +\definecolor [sienna2] [r=.933333,g=.47451,b=.258824] +\definecolor [sienna3] [r=.803922,g=.407843,b=.223529] +\definecolor [sienna4] [r=.545098,g=.278431,b=.14902] +\definecolor [burlywood1] [r=1,g=.827451,b=.607843] +\definecolor [burlywood2] [r=.933333,g=.772549,b=.568627] +\definecolor [burlywood3] [r=.803922,g=.666667,b=.490196] +\definecolor [burlywood4] [r=.545098,g=.45098,b=.333333] +\definecolor [wheat1] [r=1,g=.905882,b=.729412] +\definecolor [wheat2] [r=.933333,g=.847059,b=.682353] +\definecolor [wheat3] [r=.803922,g=.729412,b=.588235] +\definecolor [wheat4] [r=.545098,g=.494118,b=.4] +\definecolor [tan1] [r=1,g=.647059,b=.309804] +\definecolor [tan2] [r=.933333,g=.603922,b=.286275] +\definecolor [tan3] [r=.803922,g=.521569,b=.247059] +\definecolor [tan4] [r=.545098,g=.352941,b=.168627] +\definecolor [chocolate1] [r=1,g=.498039,b=.141176] +\definecolor [chocolate2] [r=.933333,g=.462745,b=.129412] +\definecolor [chocolate3] [r=.803922,g=.4,b=.113725] +\definecolor [chocolate4] [r=.545098,g=.270588,b=.07451] +\definecolor [firebrick1] [r=1,g=.188235,b=.188235] +\definecolor [firebrick2] [r=.933333,g=.172549,b=.172549] +\definecolor [firebrick3] [r=.803922,g=.14902,b=.14902] +\definecolor [firebrick4] [r=.545098,g=.101961,b=.101961] +\definecolor [brown1] [r=1,g=.25098,b=.25098] +\definecolor [brown2] [r=.933333,g=.231373,b=.231373] +\definecolor [brown3] [r=.803922,g=.2,b=.2] +\definecolor [brown4] [r=.545098,g=.137255,b=.137255] +\definecolor [salmon1] [r=1,g=.54902,b=.411765] +\definecolor [salmon2] [r=.933333,g=.509804,b=.384314] +\definecolor [salmon3] [r=.803922,g=.439216,b=.329412] +\definecolor [salmon4] [r=.545098,g=.298039,b=.223529] +\definecolor [lightsalmon1] [r=1,g=.627451,b=.478431] +\definecolor [lightsalmon2] [r=.933333,g=.584314,b=.447059] +\definecolor [lightsalmon3] [r=.803922,g=.505882,b=.384314] +\definecolor [lightsalmon4] [r=.545098,g=.341176,b=.258824] +\definecolor [orange1] [r=1,g=.647059] +\definecolor [orange2] [r=.933333,g=.603922] +\definecolor [orange3] [r=.803922,g=.521569] +\definecolor [orange4] [r=.545098,g=.352941] +\definecolor [darkorange1] [r=1,g=.498039] +\definecolor [darkorange2] [r=.933333,g=.462745] +\definecolor [darkorange3] [r=.803922,g=.4] +\definecolor [darkorange4] [r=.545098,g=.270588] +\definecolor [coral1] [r=1,g=.447059,b=.337255] +\definecolor [coral2] [r=.933333,g=.415686,b=.313725] +\definecolor [coral3] [r=.803922,g=.356863,b=.270588] +\definecolor [coral4] [r=.545098,g=.243137,b=.184314] +\definecolor [tomato1] [r=1,g=.388235,b=.278431] +\definecolor [tomato2] [r=.933333,g=.360784,b=.258824] +\definecolor [tomato3] [r=.803922,g=.309804,b=.223529] +\definecolor [tomato4] [r=.545098,g=.211765,b=.14902] +\definecolor [orangered1] [r=1,g=.270588] +\definecolor [orangered2] [r=.933333,g=.25098] +\definecolor [orangered3] [r=.803922,g=.215686] +\definecolor [orangered4] [r=.545098,g=.145098] +\definecolor [red1] [red] +\definecolor [red2] [r=.933333] +\definecolor [red3] [r=.803922] +\definecolor [red4] [r=.545098] +\definecolor [deeppink1] [r=1,g=.078431,b=.576471] +\definecolor [deeppink2] [r=.933333,g=.070588,b=.537255] +\definecolor [deeppink3] [r=.803922,g=.062745,b=.462745] +\definecolor [deeppink4] [r=.545098,g=.039216,b=.313725] +\definecolor [hotpink1] [r=1,g=.431373,b=.705882] +\definecolor [hotpink2] [r=.933333,g=.415686,b=.654902] +\definecolor [hotpink3] [r=.803922,g=.376471,b=.564706] +\definecolor [hotpink4] [r=.545098,g=.227451,b=.384314] +\definecolor [pink1] [r=1,g=.709804,b=.772549] +\definecolor [pink2] [r=.933333,g=.662745,b=.721569] +\definecolor [pink3] [r=.803922,g=.568627,b=.619608] +\definecolor [pink4] [r=.545098,g=.388235,b=.423529] +\definecolor [lightpink1] [r=1,g=.682353,b=.72549] +\definecolor [lightpink2] [r=.933333,g=.635294,b=.678431] +\definecolor [lightpink3] [r=.803922,g=.54902,b=.584314] +\definecolor [lightpink4] [r=.545098,g=.372549,b=.396078] +\definecolor [palevioletred1] [r=1,g=.509804,b=.670588] +\definecolor [palevioletred2] [r=.933333,g=.47451,b=.623529] +\definecolor [palevioletred3] [r=.803922,g=.407843,b=.537255] +\definecolor [palevioletred4] [r=.545098,g=.278431,b=.364706] +\definecolor [maroon1] [r=1,g=.203922,b=.701961] +\definecolor [maroon2] [r=.933333,g=.188235,b=.654902] +\definecolor [maroon3] [r=.803922,g=.160784,b=.564706] +\definecolor [maroon4] [r=.545098,g=.109804,b=.384314] +\definecolor [violetred1] [r=1,g=.243137,b=.588235] +\definecolor [violetred2] [r=.933333,g=.227451,b=.54902] +\definecolor [violetred3] [r=.803922,g=.196078,b=.470588] +\definecolor [violetred4] [r=.545098,g=.133333,b=.321569] +\definecolor [magenta1] [magenta] +\definecolor [magenta2] [r=.933333,b=.933333] +\definecolor [magenta3] [r=.803922,b=.803922] +\definecolor [magenta4] [r=.545098,b=.545098] +\definecolor [orchid1] [r=1,g=.513725,b=.980392] +\definecolor [orchid2] [r=.933333,g=.478431,b=.913725] +\definecolor [orchid3] [r=.803922,g=.411765,b=.788235] +\definecolor [orchid4] [r=.545098,g=.278431,b=.537255] +\definecolor [plum1] [r=1,g=.733333,b=1] +\definecolor [plum2] [r=.933333,g=.682353,b=.933333] +\definecolor [plum3] [r=.803922,g=.588235,b=.803922] +\definecolor [plum4] [r=.545098,g=.4,b=.545098] +\definecolor [mediumorchid1] [r=.878431,g=.4,b=1] +\definecolor [mediumorchid2] [r=.819608,g=.372549,b=.933333] +\definecolor [mediumorchid3] [r=.705882,g=.321569,b=.803922] +\definecolor [mediumorchid4] [r=.478431,g=.215686,b=.545098] +\definecolor [darkorchid1] [r=.74902,g=.243137,b=1] +\definecolor [darkorchid2] [r=.698039,g=.227451,b=.933333] +\definecolor [darkorchid3] [r=.603922,g=.196078,b=.803922] +\definecolor [darkorchid4] [r=.407843,g=.133333,b=.545098] +\definecolor [purple1] [r=.607843,g=.188235,b=1] +\definecolor [purple2] [r=.568627,g=.172549,b=.933333] +\definecolor [purple3] [r=.490196,g=.14902,b=.803922] +\definecolor [purple4] [r=.333333,g=.101961,b=.545098] +\definecolor [mediumpurple1] [r=.670588,g=.509804,b=1] +\definecolor [mediumpurple2] [r=.623529,g=.47451,b=.933333] +\definecolor [mediumpurple3] [r=.537255,g=.407843,b=.803922] +\definecolor [mediumpurple4] [r=.364706,g=.278431,b=.545098] +\definecolor [thistle1] [r=1,g=.882353,b=1] +\definecolor [thistle2] [r=.933333,g=.823529,b=.933333] +\definecolor [thistle3] [r=.803922,g=.709804,b=.803922] +\definecolor [thistle4] [r=.545098,g=.482353,b=.545098] +\definecolor [gray0] [black] +\definecolor [gray1] [s=.01] +\definecolor [gray2] [s=.02] +\definecolor [gray3] [s=.03] +\definecolor [gray4] [s=.04] +\definecolor [gray5] [s=.05] +\definecolor [gray6] [s=.06] +\definecolor [gray7] [s=.07] +\definecolor [gray8] [s=.08] +\definecolor [gray9] [s=.09] +\definecolor [gray10] [s=.1] +\definecolor [gray11] [s=.11] +\definecolor [gray12] [s=.12] +\definecolor [gray13] [s=.13] +\definecolor [gray14] [s=.14] +\definecolor [gray15] [s=.15] +\definecolor [gray16] [s=.16] +\definecolor [gray17] [s=.17] +\definecolor [gray18] [s=.18] +\definecolor [gray19] [s=.19] +\definecolor [gray20] [s=.2] +\definecolor [gray21] [s=.21] +\definecolor [gray22] [s=.22] +\definecolor [gray23] [s=.23] +\definecolor [gray24] [s=.24] +\definecolor [gray25] [s=.25] +\definecolor [gray26] [s=.26] +\definecolor [gray27] [s=.27] +\definecolor [gray28] [s=.28] +\definecolor [gray29] [s=.29] +\definecolor [gray30] [s=.3] +\definecolor [gray31] [s=.31] +\definecolor [gray32] [s=.32] +\definecolor [gray33] [s=.33] +\definecolor [gray34] [s=.34] +\definecolor [gray35] [s=.35] +\definecolor [gray36] [s=.36] +\definecolor [gray37] [s=.37] +\definecolor [gray38] [s=.38] +\definecolor [gray39] [s=.39] +\definecolor [gray40] [s=.4] +\definecolor [gray41] [s=.41] +\definecolor [gray42] [s=.42] +\definecolor [gray43] [s=.43] +\definecolor [gray44] [s=.44] +\definecolor [gray45] [s=.45] +\definecolor [gray46] [s=.46] +\definecolor [gray47] [s=.47] +\definecolor [gray48] [s=.48] +\definecolor [gray49] [s=.49] +\definecolor [gray50] [s=.5] +\definecolor [gray51] [s=.51] +\definecolor [gray52] [s=.52] +\definecolor [gray53] [s=.53] +\definecolor [gray54] [s=.54] +\definecolor [gray55] [s=.55] +\definecolor [gray56] [s=.56] +\definecolor [gray57] [s=.57] +\definecolor [gray58] [s=.58] +\definecolor [gray59] [s=.59] +\definecolor [gray60] [s=.6] +\definecolor [gray61] [s=.61] +\definecolor [gray62] [s=.62] +\definecolor [gray63] [s=.63] +\definecolor [gray64] [s=.64] +\definecolor [gray65] [s=.65] +\definecolor [gray66] [s=.66] +\definecolor [gray67] [s=.67] +\definecolor [gray68] [s=.68] +\definecolor [gray69] [s=.69] +\definecolor [gray70] [s=.7] +\definecolor [gray71] [s=.71] +\definecolor [gray72] [s=.72] +\definecolor [gray73] [s=.73] +\definecolor [gray74] [s=.74] +\definecolor [gray75] [s=.75] +\definecolor [gray76] [s=.76] +\definecolor [gray77] [s=.77] +\definecolor [gray78] [s=.78] +\definecolor [gray79] [s=.79] +\definecolor [gray80] [s=.8] +\definecolor [gray81] [s=.81] +\definecolor [gray82] [s=.82] +\definecolor [gray83] [s=.83] +\definecolor [gray84] [s=.84] +\definecolor [gray85] [s=.85] +\definecolor [gray86] [s=.86] +\definecolor [gray87] [s=.87] +\definecolor [gray88] [s=.88] +\definecolor [gray89] [s=.89] +\definecolor [gray90] [s=.9] +\definecolor [gray91] [s=.91] +\definecolor [gray92] [s=.92] +\definecolor [gray93] [s=.93] +\definecolor [gray94] [s=.94] +\definecolor [gray95] [s=.95] +\definecolor [gray96] [s=.96] +\definecolor [gray97] [s=.97] +\definecolor [gray98] [s=.98] +\definecolor [gray99] [s=.99] +\definecolor [gray100] [white] +\definecolor [darkgray] [s=.662745] +\definecolor [darkblue] [b=.545098] +\definecolor [darkcyan] [g=.545098,b=.545098] +\definecolor [darkmagenta] [r=.545098,b=.545098] +\definecolor [darkred] [r=.545098] +\definecolor [lightgreen] [r=.564706,g=.933333,b=.564706] diff --git a/tex/context/base/colo-imp-rgb.mkiv b/tex/context/base/colo-imp-rgb.mkiv new file mode 100644 index 000000000..038e0ab0b --- /dev/null +++ b/tex/context/base/colo-imp-rgb.mkiv @@ -0,0 +1,530 @@ +%D \module +%D [ file=colo-rgb, +%D version=1995.01.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=RGB, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Just to give users a start we define some colors. While +%D switching fonts is as international as can be, thanks to the +%D mnemonics, naming colors is very interface dependant. To +%D support international setups, we define both english and +%D interface dependant colors. We use the color inheritance +%D mechanisms to implement the interface dependant ones. + +%D First we define some simple primary \cap{RGB} and \cap{CMYK} +%D colors. All colors are defined in \cap{RGB} color space. + +\definecolor [red] [r=1, g=0, b=0] +\definecolor [green] [r=0, g=1, b=0] +\definecolor [blue] [r=0, g=0, b=1] + +\definecolor [cyan] [r=0, g=1, b=1] +\definecolor [magenta] [r=1, g=0, b=1] +\definecolor [yellow] [r=1, g=1, b=0] + +\definecolor [white] [s=1] % [r=1, g=1, b=1] +\definecolor [black] [s=0] +\definecolor [gray] [s=.9] + +\definecolor [darkred] [r=.8, g=0, b=0] +\definecolor [middlered] [r=.9, g=0, b=0] +\definecolor [lightred] [r=1, g=0, b=0] + +\definecolor [darkgreen] [r=0, g=.6, b=0] +\definecolor [middlegreen] [r=0, g=.8, b=0] +\definecolor [lightgreen] [r=0, g=1, b=0] + +\definecolor [darkblue] [r=0, g=0, b=.8] +\definecolor [middleblue] [r=0, g=0, b=.9] +\definecolor [lightblue] [r=0, g=0, b=1] + +\definecolor [darkcyan] [r=.6, g=.8, b=.8] +\definecolor [middlecyan] [r=0, g=.8, b=.8] + +\definecolor [darkmagenta] [r=.8, g=.6, b=.8] +\definecolor [middlemagenta] [r=1, g=0, b=.6] + +\definecolor [darkyellow] [r=.8, g=.8, b=.6] +\definecolor [middleyellow] [r=1, g=1, b=.2] + +\definecolor [darkgray] [s=.5] +\definecolor [middlegray] [s=.7] +\definecolor [lightgray] [s=.9] + +%D These colors are mapped to interface dependant colornames. + +\startinterface dutch + + \definecolor [rood] [red] + \definecolor [groen] [green] + \definecolor [blauw] [blue] + + \definecolor [cyaan] [cyan] + \definecolor [magenta] [magenta] + \definecolor [geel] [yellow] + + \definecolor [wit] [white] + \definecolor [grijs] [gray] + \definecolor [zwart] [black] + + \definecolor [donkerrood] [darkred] + \definecolor [middelrood] [middlered] + \definecolor [lichtrood] [lightred] + + \definecolor [donkergroen] [darkgreen] + \definecolor [middelgroen] [middlegreen] + \definecolor [lichtgroen] [lightgreen] + + \definecolor [donkerblauw] [darkblue] + \definecolor [middelblauw] [middleblue] + \definecolor [lichtblauw] [lightblue] + + \definecolor [donkercyaan] [darkcyan] + \definecolor [middelcyaan] [middlecyan] + + \definecolor [donkermagenta] [darkmagenta] + \definecolor [middelmagenta] [middlemagenta] + + \definecolor [donkergeel] [darkyellow] + \definecolor [middelgeel] [middleyellow] + + \definecolor [donkergrijs] [darkgray] + \definecolor [middengrijs] [middlegray] + \definecolor [lichtgrijs] [lightgray] + +\stopinterface + +\startinterface german + + \definecolor [rot] [red] + \definecolor [gruen] [green] + \definecolor [blau] [blue] + + \definecolor [cyan] [cyan] + \definecolor [magenta] [magenta] + \definecolor [gelb] [yellow] + + \definecolor [weiss] [white] + \definecolor [grau] [gray] + \definecolor [schwarz] [black] + + \definecolor [dunkelrot] [darkred] + \definecolor [mittelrot] [middlered] + \definecolor [hellrot] [lightred] + + \definecolor [dunkelgruen] [darkgreen] + \definecolor [mittelgruen] [middlegreen] + \definecolor [hellgruen] [lightgreen] + + \definecolor [dunkelblau] [darkblue] + \definecolor [mittelblau] [middleblue] + \definecolor [hellblau] [lightblue] + + \definecolor [dunkelcyan] [darkcyan] + \definecolor [mittelcyan] [middlecyan] + + \definecolor [dunkelmagenta] [darkmagenta] + \definecolor [mittelmagenta] [middlemagenta] + + \definecolor [dunkelgelb] [darkyellow] + \definecolor [mittelgelb] [middleyellow] + + \definecolor [dunkelgrau] [darkgray] + \definecolor [mittelgrau] [middlegray] + \definecolor [hellgrau] [lightgray] + +\stopinterface + +\startinterface czech + + \definecolor [cervena] [red] + \definecolor [zelena] [green] + \definecolor [modra] [blue] + + \definecolor [azurova] [cyan] + \definecolor [fialova] [magenta] + \definecolor [zluta] [yellow] + + \definecolor [bila] [white] + \definecolor [cerna] [black] + + \definecolor [tmavecervena] [darkred] + \definecolor [strednecervena] [middlered] + \definecolor [svetlecervena] [lightred] + + \definecolor [tmavezelena] [darkgreen] + \definecolor [strednezelena] [middlegreen] + \definecolor [svetlezelena] [lightgreen] + + \definecolor [tmavemodra] [darkblue] + \definecolor [strednemodra] [middleblue] + \definecolor [svetlemodra] [lightblue] + + \definecolor [tmaveazurova] [darkcyan] + \definecolor [stredneazurova] [middlecyan] + + \definecolor [tmavefialova] [darkmagenta] + \definecolor [strednefialova] [middlemagenta] + + \definecolor [tmavezluta] [darkyellow] + \definecolor [strednezluta] [middleyellow] + + \definecolor [tmaveseda] [darkgray] + \definecolor [stredneseda] [middlegray] + \definecolor [svetleseda] [lightgray] + +\stopinterface + +\startinterface italian + + \definecolor [rosso] [red] + \definecolor [verde] [green] + \definecolor [blu] [blue] + + \definecolor [azzurro] [cyan] + \definecolor [turchino] [cyan] + \definecolor [ciano] [cyan] + \definecolor [cremisi] [magenta] + \definecolor [giallo] [yellow] + + \definecolor [bianco] [white] + \definecolor [grigio] [gray] + \definecolor [nero] [black] + + \definecolor [rossoscuro] [darkred] + \definecolor [rossomedio] [middlered] + \definecolor [rossochiaro] [lightred] + + \definecolor [verdescuro] [darkgreen] + \definecolor [verdemedio] [middlegreen] + \definecolor [verdechiaro] [lightgreen] + + \definecolor [bluscuro] [darkblue] + \definecolor [blumedio] [middleblue] + \definecolor [bluchiaro] [lightblue] + + \definecolor [azzurroscuro] [darkcyan] + \definecolor [azzurrochiaro] [middlecyan] + + \definecolor [cremisiscuro] [darkmagenta] + \definecolor [cremisichiaro] [middlemagenta] + + + \definecolor [gialloscuro] [darkyellow] + \definecolor [giallomedio] [middleyellow] + + \definecolor [grigioscuro] [darkgray] + \definecolor [grigiomedio] [middlegray] + \definecolor [grigiochiaro] [lightgray] + +\stopinterface + +\startinterface romanian + + \definecolor [rosu] [red] + \definecolor [verde] [green] + \definecolor [albastru] [blue] + + \definecolor [cian] [cyan] + \definecolor [magenta] [magenta] + \definecolor [galben] [yellow] + + \definecolor [alb] [white] + \definecolor [gri] [gray] + \definecolor [negru] [black] + + \definecolor [rosuinchis] [darkred] + \definecolor [rosumediu] [middlered] + \definecolor [rosudeschis] [lightred] + + \definecolor [verdeinchis] [darkgreen] + \definecolor [verdemediu] [middlegreen] + \definecolor [verdedeschis] [lightgreen] + + \definecolor [albastruinchis] [darkblue] + \definecolor [albastrumediu] [middleblue] + \definecolor [albastrudeschis] [lightblue] + + \definecolor [cianinchis] [darkcyan] + \definecolor [cianmediu] [middlecyan] + + \definecolor [magentainchis] [darkmagenta] + \definecolor [magentamediu] [middlemagenta] + + \definecolor [galbeninchis] [darkyellow] + \definecolor [galbenmediu] [middleyellow] + + \definecolor [griinchis] [darkgray] + \definecolor [grimediu] [middlegray] + \definecolor [grideschis] [lightgray] + +\stopinterface + +%D Like colors, we first define the english colorgroups. These +%D colorgroups are tuned for distinctive gray scale printing. + +% todo : more efficient and real gray + +\definecolorgroup + [gray] + [0.95:0.95:0.95, + 0.90:0.90:0.90, + 0.80:0.80:0.80, + 0.70:0.70:0.70, + 0.60:0.60:0.60, + 0.50:0.50:0.50, + 0.40:0.40:0.40, + 0.30:0.30:0.30, + 0.20:0.20:0.20, + 0.10:0.10:0.10, + 0.00:0.00:0.00] + +\definecolorgroup + [red] + [1.00:0.90:0.90, + 1.00:0.80:0.80, + 1.00:0.70:0.70, + 1.00:0.55:0.55, + 1.00:0.40:0.40, + 1.00:0.25:0.25, + 1.00:0.15:0.15, + 0.90:0.00:0.00] + +\definecolorgroup + [green] + [0.90:1.00:0.90, + 0.70:1.00:0.70, + 0.50:1.00:0.50, + 0.30:1.00:0.30, + 0.15:0.90:0.15, + 0.00:0.80:0.00, + 0.00:0.65:0.00, + 0.00:0.50:0.00] + +\definecolorgroup + [blue] + [0.90:0.95:1.00, + 0.80:0.90:1.00, + 0.55:0.85:1.00, + 0.30:0.80:1.00, + 0.15:0.75:1.00, + 0.00:0.70:1.00, + 0.00:0.55:1.00, + 0.00:0.40:1.00] + +\definecolorgroup + [cyan] + [0.80:1.00:1.00, + 0.60:1.00:1.00, + 0.30:1.00:1.00, + 0.00:0.95:0.95, + 0.00:0.85:0.85, + 0.00:0.75:0.75, + 0.00:0.60:0.60, + 0.00:0.50:0.50] + +\definecolorgroup + [magenta] + [1.00:0.90:1.00, + 1.00:0.80:1.00, + 1.00:0.65:1.00, + 1.00:0.50:1.00, + 1.00:0.35:1.00, + 1.00:0.15:1.00, + 0.90:0.05:0.90, + 0.80:0.00:0.80] + +\definecolorgroup + [yellow] + [1.00:1.00:0.70, + 1.00:1.00:0.00, + 1.00:0.85:0.05, + 1.00:0.70:0.00, + 1.00:0.55:0.00, + 0.95:0.40:0.00, + 0.80:0.30:0.00, + 0.60:0.30:0.00] + +\definecolorgroup + [red*] + [1.00:0.95:0.95, + 1.00:0.90:0.90, + 1.00:0.80:0.80, + 1.00:0.70:0.70, + 1.00:0.60:0.60, + 1.00:0.50:0.50, + 1.00:0.40:0.40, + 1.00:0.30:0.30] + +\definecolorgroup + [green*] + [0.95:1.00:0.95, + 0.90:1.00:0.90, + 0.80:1.00:0.80, + 0.70:1.00:0.70, + 0.60:1.00:0.60, + 0.50:1.00:0.50, + 0.40:1.00:0.40, + 0.30:1.00:0.30] + +\definecolorgroup + [blue*] + [0.95:0.95:1.00, + 0.90:0.90:1.00, + 0.80:0.80:1.00, + 0.70:0.70:1.00, + 0.60:0.60:1.00, + 0.50:0.50:1.00, + 0.40:0.40:1.00, + 0.30:0.30:1.00] + +\definecolorgroup + [yellow*] + [1.00:1.00:0.10, + 1.00:1.00:0.00, + 0.90:0.90:0.00, + 0.80:0.80:0.00, + 0.70:0.70:0.00, + 0.60:0.60:0.00, + 0.50:0.50:0.00, + 0.40:0.40:0.00] + +%D For the sake of implementing interface dependant color +%D groups we support colorgroup duplication. + +\startinterface dutch + \definecolorgroup [grijs] [gray] + \definecolorgroup [rood] [red] + \definecolorgroup [groen] [green] + \definecolorgroup [blauw] [blue] + \definecolorgroup [cyaan] [cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [geel] [yellow] + \definecolorgroup [rood*] [red*] + \definecolorgroup [groen*] [green*] + \definecolorgroup [blauw*] [blue*] + \definecolorgroup [geel*] [yellow*] +\stopinterface + +\startinterface german + \definecolorgroup [grau] [gray] + \definecolorgroup [rot] [red] + \definecolorgroup [gruen] [green] + \definecolorgroup [blau] [blue] + \definecolorgroup [cyan] [cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [gelb] [yellow] + \definecolorgroup [rot*] [red*] + \definecolorgroup [gruen*] [green*] + \definecolorgroup [blau*] [blue*] + \definecolorgroup [gelb*] [yellow*] +\stopinterface + +\startinterface czech + \definecolorgroup [seda] [gray] + \definecolorgroup [cervena] [red] + \definecolorgroup [zelena] [green] + \definecolorgroup [modra] [blue] + \definecolorgroup [azurova] [cyan] + \definecolorgroup [fialova] [magenta] + \definecolorgroup [zluta] [yellow] + \definecolorgroup [cervena*] [red*] + \definecolorgroup [zelena*] [green*] + \definecolorgroup [modra*] [blue*] + \definecolorgroup [zluta*] [yellow*] +\stopinterface + +\startinterface italian + \definecolorgroup [grigio] [gray] + \definecolorgroup [rosso] [red] + \definecolorgroup [verde] [green] + \definecolorgroup [blu] [blue] + \definecolorgroup [ciano] [cyan] + \definecolorgroup [azzurro] [cyan] + \definecolorgroup [turchino][cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [cremisi] [magenta] + \definecolorgroup [giallo] [yellow] + \definecolorgroup [rosso*] [red*] + \definecolorgroup [verde*] [green*] + \definecolorgroup [blu*] [blue*] + \definecolorgroup [giallo*] [yellow*] +\stopinterface + +%D The next set of color palets is quite language independant. +%D These palets are meant as examples. + +\definepalet + [alfa] + [ top=red:7, + bottom=green:6, + up=blue:5, + down=cyan:4, + strange=magenta:3, + charm=yellow:2] + +\definepalet + [beta] + [ top=red:7, + bottom=green:5, + up=blue:3, + down=cyan:6, + strange=magenta:2, + charm=yellow:1] + +\definepalet + [gamma] + [ top=red:2, + bottom=green:5, + up=blue:3, + down=cyan:6, + strange=magenta:7, + charm=yellow:4] + +\definepalet + [delta] + [ top=yellow*:5, + bottom=yellow*:3, + up=yellow*:2, + down=magenta:6, + strange=blue:4, + charm=blue:1] + +\definepalet + [epsilon] + [ top=cyan:7, + bottom=cyan:5, + up=blue:3, + down=yellow:6, + strange=yellow:4, + charm=yellow:2] + +\definepalet + [zeta] + [ top=red:6, + bottom=green:5, + up=blue:7, + down=cyan:4, + strange=magenta:3, + charm=yellow:2] + +%D The next four colors are used for typesetting verbatim \TEX\ +%D in color. + +\definecolor [texcolorone] [middlered] +\definecolor [texcolortwo] [middlegreen] +\definecolor [texcolorthree] [middleblue] +\definecolor [texcolorfour] [darkyellow] + +%D Bonus (needed for FO test): + +\definecolor [orange] [r=1,g=.5] + +\endinput diff --git a/tex/context/base/colo-imp-run.mkiv b/tex/context/base/colo-imp-run.mkiv new file mode 100644 index 000000000..d94ea9801 --- /dev/null +++ b/tex/context/base/colo-imp-run.mkiv @@ -0,0 +1,257 @@ +%D \module +%D [ file=colo-run, +%D version=1997.04.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=Runtime loaded commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +% temp hack (not do be documented) + +% \gdef\doformatcolorP#1:#2:#3:#4:#5:#6\od % was undefined in colo-ini +% {#1\colorformatseparator +% \dodoformatcolor{#2}\colorformatseparator +% \dodoformatcolor{#3}\colorformatseparator +% \dodoformatcolor{#4}\colorformatseparator} + +% \gdef\doformatgrayP#1:#2:#3:#4:#5:#6\od +% {todo} + +% so far + +\gdef\showpalet + {\dodoubleargument\doshowpalet} + +\gdef\doshowpalet[#1][#2]% + {\doifdefined{\??pa#1} + {\doifinsetelse\v!vertical{#2} + {\showverticalpalet[#1][#2]} + {\showhorizontalpalet[#1][#2]}}} + +\gdef\showverticalpalet[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet[#1] + \def\rule + {\vrule\!!width3em\!!height\strutht\!!depth\strutdp} + \tabskip\zeropoint + \def\doshowpalet##1% + {\doifinsetelse\v!number{#2}{##1\hskip.5em}{}& + \color[##1]{\rule}\graycolor[##1]{\rule}& + \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr} + \halign + {\hss##&\hss##\hss&##\cr + &\doifinset{\v!name}{#2}{\strut#1}&\cr% + \processpalet[#1]\doshowpalet\crcr}}} + +\gdef\showhorizontalpalet[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet[#1] + \tabskip\zeropoint + \!!widtha\zeropoint + \doifinset\v!number{#2} + {\def\doshowpalet##1% + {\setbox0\hbox{##1}% + \ifdim\!!widtha<\wd0\!!widtha\wd0\fi}% + \processpalet[#1]\doshowpalet}% + \advance\!!widtha 1em + \ifdim\!!widtha<5em + \!!widtha5em + \fi + \halign + {##&&\hbox to \!!widtha{\hss##\hss}\cr + \doifinset\v!number{#2} + {\def\doshowpalet##1{&\strut##1}% + \processpalet[#1]\doshowpalet}\cr + \doifinset\v!name{#2}{#1\hskip.5em}% + \def\doshowpalet##1% + {&\strut\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}% + \processpalet[#1]\doshowpalet\crcr + \noalign{\vskip-\strutdepth}% + \def\doshowpalet##1% + {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}% + \processpalet[#1]\doshowpalet\crcr + \doifinset\v!value{#2} + {\def\doshowpalet##1% + {&\vbox + {\hsize\!!widtha + \vskip.25ex + \everypar{\strut} + \veryraggedcenter + \let\colorformatseparator=\endgraf + \colorvalue{##1}}}% + \processpalet[#1]\doshowpalet}% + \crcr}}} + +\gdef\processpalet[#1]% + {\expanded{\globalprocesscommalist[\getvalue{\??pa#1}]}} + +\gdef\showcolorgroup + {\dodoubleargument\doshowcolorgroup} + +\gdef\doshowcolorgroup[#1][#2]% + {\doifcolor{#1:1} + {\doifinsetelse\v!vertical{#2} + {\showverticalcolorgroup[#1][#2]} + {\showhorizontalcolorgroup[#1][#2]}}} + +\gdef\showhorizontalcolorgroup[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet + \tabskip\zeropoint + \def\rule + {\vrule\!!width4em\!!height\strutht\!!depth\strutdp} + \def\colorformatseparator{\strut\cr} + \def\dodoshowgroup##1% + {\halign + {\hss####\hss\cr + \doifinset\v!number{#2}{\strut##1}\cr + \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr + \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr + \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}} + \def\doshowgroup##1% + {\doifcolor{#1:##1} + {\vbox{\dodoshowgroup{##1}}}}% + \hbox + {\doifinset\v!name{#2} + {\strut + \doifinsetelse\v!value{#2} + {\raise3\lineheight\hbox{#1\hskip.5em}} + {#1}% + \hskip.5em}% + \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4% + \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}} + +\gdef\showverticalcolorgroup[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet + \tabskip\zeropoint + \def\rule + {\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}% + \def\doshowgroup##1% + {\doifcolor{#1:##1} + {\doifinset\v!number{#2}{##1\hskip.5em}& + \color[#1:##1]{\rule}\graycolor[#1:##1]{\rule}& + \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}% + \halign + {\hss##&\hss##\hss&##\hss\cr + &\doifinset\v!name{#2}{\strut#1}&\crcr + \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4% + \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}} + +\gdef\showcolor + {\dosingleempty\doshowcolor} + +\gdef\doshowcolor[#1]% + {\bgroup + \iffirstargument + \let\colorlist\empty % not really used, only for colo-run + \let\colorstyle\empty + \settrue\collectcolorsinlist + \setupcolor[#1]% + \fi + \def\rule + {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}% + \def\docommand##1% + {\NC\graycolor[##1]{\rule}\NC\color[##1]{\rule}\NC\grayvalue{##1}\NC\colorvalue{##1}\NC##1\NC\NR}% + \starttabulate[|l|l|l|l|l|l|l|] + \expanded{\globalprocesscommalist[\colorlist]}\docommand + \stoptabulate + \egroup} + +\gdef\comparepalet + {\dosingleargument\docomparepalet} + +\gdef\docomparepalet[#1]% + {\doifdefined{\??pa#1} + {\hbox + {\dodocomparepalet\color[#1]% + \quad + \dodocomparepalet\graycolor[#1]}}} + +\gdef\dodocomparepalet#1[#2]% + {\localvbox + {\offinterlineskip + \setuppalet[#2] + \getcommacommandsize[\getvalue{\??pa#2}] + \!!widtha2em\relax + \hsize\commalistsize\!!widtha + \def\rule% + {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex} + \def\dododocomparepalet##1% + {\hbox + {\setbox0\hbox + {#1[##1]{\vrule\!!width\hsize\!!height3ex}}% + \wd0\zeropoint + \box0 + \hbox to \hsize + {\def\dododocomparepalet####1% + {\hbox to \!!widtha + {\hss#1[####1]{\rule}\hss}}% + \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}} + \endgraf} + \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}} + +\gdef\comparecolorgroup + {\dosingleargument\docomparecolorgroup} + +\gdef\docomparecolorgroup[#1]% + {\doifcolor{#1:1} + {\hbox + {\dodocomparecolorgroup\color[#1]% + \quad + \dodocomparecolorgroup\graycolor[#1]}}} + +\gdef\dodocomparecolorgroup#1[#2]% + {\localvbox + {\!!counta\zerocount + \dorecurse{15} + {\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}} + \!!widtha2em\relax + \hsize\!!counta\!!widtha + \def\rule + {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex} + \def\dododocomparecolorgroup##1% + {\hbox to \hsize + {\setbox0\hbox + {#1[#2:##1]{\vrule\!!width\hsize\!!height3ex}}% + \wd0\zeropoint + \box0 + \hbox to \hsize + {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\rule}\hss}}} + \endgraf} + \dorecurse\!!counta{\dododocomparecolorgroup\recurselevel}}} + +\gdef\dogetcolorcomponents#1% + {\doifelsenothing{#1} + {\appendtoks + \TB + \to \scratchtoks} + {\appendtoks + \NC\showcolorbar[#1]\NC#1\NC\transparencycomponents{#1}\NC\colorcomponents{#1}\NC \NR + \to \scratchtoks}} + +\gdef\showcolorbar[#1]% + {\backgroundline[#1]{\strut\enspace\color[white]{white}\enspace\color[black]{black}\enspace}} + +\gdef\showcolorcomponents[#1]% + {\begingroup + \scratchtoks{\TB}% + \processcommacommand[#1]\dogetcolorcomponents + \starttabulate[|lT|lT|lT|lT|] + \NC color \NC name \NC transparency \NC specification \NC\NR + \the\scratchtoks + \stoptabulate + \endgroup} + +\protect \endinput diff --git a/tex/context/base/colo-imp-x11.mkiv b/tex/context/base/colo-imp-x11.mkiv new file mode 100644 index 000000000..45d3aac62 --- /dev/null +++ b/tex/context/base/colo-imp-x11.mkiv @@ -0,0 +1,677 @@ +%D \module +%D [ file=colo-x11, +%D version=2009.11.13, +%D title=\CONTEXT\ Color Macros, +%D subtitle=X11, +%D author=Alan Braslau] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Standard X11 rgb colors (from \type {/usr/share/X11/rgb.txt}): + +\doifnotmode{mkiv} { + \input colo-hex.mkii +} + +\definecolor [snow] [h=fffafa] +\definecolor [ghostwhite] [h=f8f8ff] +\definecolor [whitesmoke] [s=0.96] +\definecolor [gainsboro] [s=0.86] +\definecolor [floralwhite] [h=fffaf0] +\definecolor [oldlace] [h=fdf5e6] +\definecolor [linen] [h=faf0e6] +\definecolor [antiquewhite] [h=faebd7] +\definecolor [papayawhip] [h=ffefd5] +\definecolor [blanchedalmond] [h=ffebcd] +\definecolor [bisque] [h=ffe4c4] +\definecolor [peachpuff] [h=ffdab9] +\definecolor [navajowhite] [h=ffdead] +\definecolor [moccasin] [h=ffe4b5] +\definecolor [cornsilk] [h=fff8dc] +\definecolor [ivory] [h=fffff0] +\definecolor [lemonchiffon] [h=fffacd] +\definecolor [seashell] [h=fff5ee] +\definecolor [honeydew] [h=f0fff0] +\definecolor [mintcream] [h=f5fffa] +\definecolor [azure] [h=f0ffff] +\definecolor [aliceblue] [h=f0f8ff] +\definecolor [lavender] [h=e6e6fa] +\definecolor [lavenderblush] [h=fff0f5] +\definecolor [mistyrose] [h=ffe4e1] +\definecolor [white] [s=1] +\definecolor [black] [s=0] +\definecolor [darkslategray] [h=2f4f4f] +\definecolor [darkslategrey] [darkslategray] +\definecolor [dimgray] [s=0.41] +\definecolor [dimgrey] [dimgray] +\definecolor [slategray] [h=708090] +\definecolor [slategrey] [slategray] +\definecolor [lightslategray] [h=778899] +\definecolor [lightslategrey] [lightslategray] +\definecolor [gray] [s=0.75] +\definecolor [grey] [gray] +\definecolor [lightgrey] [s=0.83] +\definecolor [lightgray] [lightgrey] +\definecolor [midnightblue] [h=191970] +\definecolor [navy] [h=000080] +\definecolor [navyblue] [navy] +\definecolor [cornflowerblue] [h=6495ed] +\definecolor [darkslateblue] [h=483d8b] +\definecolor [slateblue] [h=6a5acd] +\definecolor [mediumslateblue] [h=7b68ee] +\definecolor [lightslateblue] [h=8470ff] +\definecolor [mediumblue] [h=0000cd] +\definecolor [royalblue] [h=4169e1] +\definecolor [blue] [h=0000ff] +\definecolor [dodgerblue] [h=1e90ff] +\definecolor [deepskyblue] [h=00bfff] +\definecolor [skyblue] [h=87ceeb] +\definecolor [lightskyblue] [h=87cefa] +\definecolor [steelblue] [h=4682b4] +\definecolor [lightsteelblue] [h=b0c4de] +\definecolor [lightblue] [h=add8e6] +\definecolor [powderblue] [h=b0e0e6] +\definecolor [paleturquoise] [h=afeeee] +\definecolor [darkturquoise] [h=00ced1] +\definecolor [mediumturquoise] [h=48d1cc] +\definecolor [turquoise] [h=40e0d0] +\definecolor [cyan] [h=00ffff] +\definecolor [lightcyan] [h=e0ffff] +\definecolor [cadetblue] [h=5f9ea0] +\definecolor [mediumaquamarine] [h=66cdaa] +\definecolor [aquamarine] [h=7fffd4] +\definecolor [darkgreen] [h=006400] +\definecolor [darkolivegreen] [h=556b2f] +\definecolor [darkseagreen] [h=8fbc8f] +\definecolor [seagreen] [h=2e8b57] +\definecolor [mediumseagreen] [h=3cb371] +\definecolor [lightseagreen] [h=20b2aa] +\definecolor [palegreen] [h=98fb98] +\definecolor [springgreen] [h=00ff7f] +\definecolor [lawngreen] [h=7cfc00] +\definecolor [green] [h=00ff00] +\definecolor [chartreuse] [h=7fff00] +\definecolor [mediumspringgreen] [h=00fa9a] +\definecolor [greenyellow] [h=adff2f] +\definecolor [limegreen] [h=32cd32] +\definecolor [yellowgreen] [h=9acd32] +\definecolor [forestgreen] [h=228b22] +\definecolor [olivedrab] [h=6b8e23] +\definecolor [darkkhaki] [h=bdb76b] +\definecolor [khaki] [h=f0e68c] +\definecolor [palegoldenrod] [h=eee8aa] +\definecolor [lightgoldenrodyellow] [h=fafad2] +\definecolor [lightyellow] [h=ffffe0] +\definecolor [yellow] [h=ffff00] +\definecolor [gold] [h=ffd700] +\definecolor [lightgoldenrod] [h=eedd82] +\definecolor [goldenrod] [h=daa520] +\definecolor [darkgoldenrod] [h=b8860b] +\definecolor [rosybrown] [h=bc8f8f] +\definecolor [indianred] [h=cd5c5c] +\definecolor [saddlebrown] [h=8b4513] +\definecolor [sienna] [h=a0522d] +\definecolor [peru] [h=cd853f] +\definecolor [burlywood] [h=deb887] +\definecolor [beige] [h=f5f5dc] +\definecolor [wheat] [h=f5deb3] +\definecolor [sandybrown] [h=f4a460] +\definecolor [tan] [h=d2b48c] +\definecolor [chocolate] [h=d2691e] +\definecolor [firebrick] [h=b22222] +\definecolor [brown] [h=a52a2a] +\definecolor [darksalmon] [h=e9967a] +\definecolor [salmon] [h=fa8072] +\definecolor [lightsalmon] [h=ffa07a] +\definecolor [orange] [h=ffa500] +\definecolor [darkorange] [h=ff8c00] +\definecolor [coral] [h=ff7f50] +\definecolor [lightcoral] [h=f08080] +\definecolor [tomato] [h=ff6347] +\definecolor [orangered] [h=ff4500] +\definecolor [red] [h=ff0000] +\definecolor [hotpink] [h=ff69b4] +\definecolor [deeppink] [h=ff1493] +\definecolor [pink] [h=ffc0cb] +\definecolor [lightpink] [h=ffb6c1] +\definecolor [palevioletred] [h=db7093] +\definecolor [maroon] [h=b03060] +\definecolor [mediumvioletred] [h=c71585] +\definecolor [violetred] [h=d02090] +\definecolor [magenta] [h=ff00ff] +\definecolor [violet] [h=ee82ee] +\definecolor [plum] [h=dda0dd] +\definecolor [orchid] [h=da70d6] +\definecolor [mediumorchid] [h=ba55d3] +\definecolor [darkorchid] [h=9932cc] +\definecolor [darkviolet] [h=9400d3] +\definecolor [blueviolet] [h=8a2be2] +\definecolor [purple] [h=a020f0] +\definecolor [mediumpurple] [h=9370db] +\definecolor [thistle] [h=d8bfd8] +\definecolor [snow1] [h=fffafa] +\definecolor [snow2] [h=eee9e9] +\definecolor [snow3] [h=cdc9c9] +\definecolor [snow4] [h=8b8989] +\definecolor [seashell1] [h=fff5ee] +\definecolor [seashell2] [h=eee5de] +\definecolor [seashell3] [h=cdc5bf] +\definecolor [seashell4] [h=8b8682] +\definecolor [antiquewhite1] [h=ffefdb] +\definecolor [antiquewhite2] [h=eedfcc] +\definecolor [antiquewhite3] [h=cdc0b0] +\definecolor [antiquewhite4] [h=8b8378] +\definecolor [bisque1] [h=ffe4c4] +\definecolor [bisque2] [h=eed5b7] +\definecolor [bisque3] [h=cdb79e] +\definecolor [bisque4] [h=8b7d6b] +\definecolor [peachpuff1] [h=ffdab9] +\definecolor [peachpuff2] [h=eecbad] +\definecolor [peachpuff3] [h=cdaf95] +\definecolor [peachpuff4] [h=8b7765] +\definecolor [navajowhite1] [h=ffdead] +\definecolor [navajowhite2] [h=eecfa1] +\definecolor [navajowhite3] [h=cdb38b] +\definecolor [navajowhite4] [h=8b795e] +\definecolor [lemonchiffon1] [h=fffacd] +\definecolor [lemonchiffon2] [h=eee9bf] +\definecolor [lemonchiffon3] [h=cdc9a5] +\definecolor [lemonchiffon4] [h=8b8970] +\definecolor [cornsilk1] [h=fff8dc] +\definecolor [cornsilk2] [h=eee8cd] +\definecolor [cornsilk3] [h=cdc8b1] +\definecolor [cornsilk4] [h=8b8878] +\definecolor [ivory1] [h=fffff0] +\definecolor [ivory2] [h=eeeee0] +\definecolor [ivory3] [h=cdcdc1] +\definecolor [ivory4] [h=8b8b83] +\definecolor [honeydew1] [h=f0fff0] +\definecolor [honeydew2] [h=e0eee0] +\definecolor [honeydew3] [h=c1cdc1] +\definecolor [honeydew4] [h=838b83] +\definecolor [lavenderblush1] [h=fff0f5] +\definecolor [lavenderblush2] [h=eee0e5] +\definecolor [lavenderblush3] [h=cdc1c5] +\definecolor [lavenderblush4] [h=8b8386] +\definecolor [mistyrose1] [h=ffe4e1] +\definecolor [mistyrose2] [h=eed5d2] +\definecolor [mistyrose3] [h=cdb7b5] +\definecolor [mistyrose4] [h=8b7d7b] +\definecolor [azure1] [h=f0ffff] +\definecolor [azure2] [h=e0eeee] +\definecolor [azure3] [h=c1cdcd] +\definecolor [azure4] [h=838b8b] +\definecolor [slateblue1] [h=836fff] +\definecolor [slateblue2] [h=7a67ee] +\definecolor [slateblue3] [h=6959cd] +\definecolor [slateblue4] [h=473c8b] +\definecolor [royalblue1] [h=4876ff] +\definecolor [royalblue2] [h=436eee] +\definecolor [royalblue3] [h=3a5fcd] +\definecolor [royalblue4] [h=27408b] +\definecolor [blue1] [h=0000ff] +\definecolor [blue2] [h=0000ee] +\definecolor [blue3] [h=0000cd] +\definecolor [blue4] [h=00008b] +\definecolor [dodgerblue1] [h=1e90ff] +\definecolor [dodgerblue2] [h=1c86ee] +\definecolor [dodgerblue3] [h=1874cd] +\definecolor [dodgerblue4] [h=104e8b] +\definecolor [steelblue1] [h=63b8ff] +\definecolor [steelblue2] [h=5cacee] +\definecolor [steelblue3] [h=4f94cd] +\definecolor [steelblue4] [h=36648b] +\definecolor [deepskyblue1] [h=00bfff] +\definecolor [deepskyblue2] [h=00b2ee] +\definecolor [deepskyblue3] [h=009acd] +\definecolor [deepskyblue4] [h=00688b] +\definecolor [skyblue1] [h=87ceff] +\definecolor [skyblue2] [h=7ec0ee] +\definecolor [skyblue3] [h=6ca6cd] +\definecolor [skyblue4] [h=4a708b] +\definecolor [lightskyblue1] [h=b0e2ff] +\definecolor [lightskyblue2] [h=a4d3ee] +\definecolor [lightskyblue3] [h=8db6cd] +\definecolor [lightskyblue4] [h=607b8b] +\definecolor [slategray1] [h=c6e2ff] +\definecolor [slategray2] [h=b9d3ee] +\definecolor [slategray3] [h=9fb6cd] +\definecolor [slategray4] [h=6c7b8b] +\definecolor [lightsteelblue1] [h=cae1ff] +\definecolor [lightsteelblue2] [h=bcd2ee] +\definecolor [lightsteelblue3] [h=a2b5cd] +\definecolor [lightsteelblue4] [h=6e7b8b] +\definecolor [lightblue1] [h=bfefff] +\definecolor [lightblue2] [h=b2dfee] +\definecolor [lightblue3] [h=9ac0cd] +\definecolor [lightblue4] [h=68838b] +\definecolor [lightcyan1] [h=e0ffff] +\definecolor [lightcyan2] [h=d1eeee] +\definecolor [lightcyan3] [h=b4cdcd] +\definecolor [lightcyan4] [h=7a8b8b] +\definecolor [paleturquoise1] [h=bbffff] +\definecolor [paleturquoise2] [h=aeeeee] +\definecolor [paleturquoise3] [h=96cdcd] +\definecolor [paleturquoise4] [h=668b8b] +\definecolor [cadetblue1] [h=98f5ff] +\definecolor [cadetblue2] [h=8ee5ee] +\definecolor [cadetblue3] [h=7ac5cd] +\definecolor [cadetblue4] [h=53868b] +\definecolor [turquoise1] [h=00f5ff] +\definecolor [turquoise2] [h=00e5ee] +\definecolor [turquoise3] [h=00c5cd] +\definecolor [turquoise4] [h=00868b] +\definecolor [cyan1] [h=00ffff] +\definecolor [cyan2] [h=00eeee] +\definecolor [cyan3] [h=00cdcd] +\definecolor [cyan4] [h=008b8b] +\definecolor [darkslategray1] [h=97ffff] +\definecolor [darkslategray2] [h=8deeee] +\definecolor [darkslategray3] [h=79cdcd] +\definecolor [darkslategray4] [h=528b8b] +\definecolor [aquamarine1] [h=7fffd4] +\definecolor [aquamarine2] [h=76eec6] +\definecolor [aquamarine3] [h=66cdaa] +\definecolor [aquamarine4] [h=458b74] +\definecolor [darkseagreen1] [h=c1ffc1] +\definecolor [darkseagreen2] [h=b4eeb4] +\definecolor [darkseagreen3] [h=9bcd9b] +\definecolor [darkseagreen4] [h=698b69] +\definecolor [seagreen1] [h=54ff9f] +\definecolor [seagreen2] [h=4eee94] +\definecolor [seagreen3] [h=43cd80] +\definecolor [seagreen4] [h=2e8b57] +\definecolor [palegreen1] [h=9aff9a] +\definecolor [palegreen2] [h=90ee90] +\definecolor [palegreen3] [h=7ccd7c] +\definecolor [palegreen4] [h=548b54] +\definecolor [springgreen1] [h=00ff7f] +\definecolor [springgreen2] [h=00ee76] +\definecolor [springgreen3] [h=00cd66] +\definecolor [springgreen4] [h=008b45] +\definecolor [green1] [h=00ff00] +\definecolor [green2] [h=00ee00] +\definecolor [green3] [h=00cd00] +\definecolor [green4] [h=008b00] +\definecolor [chartreuse1] [h=7fff00] +\definecolor [chartreuse2] [h=76ee00] +\definecolor [chartreuse3] [h=66cd00] +\definecolor [chartreuse4] [h=458b00] +\definecolor [olivedrab1] [h=c0ff3e] +\definecolor [olivedrab2] [h=b3ee3a] +\definecolor [olivedrab3] [h=9acd32] +\definecolor [olivedrab4] [h=698b22] +\definecolor [darkolivegreen1] [h=caff70] +\definecolor [darkolivegreen2] [h=bcee68] +\definecolor [darkolivegreen3] [h=a2cd5a] +\definecolor [darkolivegreen4] [h=6e8b3d] +\definecolor [khaki1] [h=fff68f] +\definecolor [khaki2] [h=eee685] +\definecolor [khaki3] [h=cdc673] +\definecolor [khaki4] [h=8b864e] +\definecolor [lightgoldenrod1] [h=ffec8b] +\definecolor [lightgoldenrod2] [h=eedc82] +\definecolor [lightgoldenrod3] [h=cdbe70] +\definecolor [lightgoldenrod4] [h=8b814c] +\definecolor [lightyellow1] [h=ffffe0] +\definecolor [lightyellow2] [h=eeeed1] +\definecolor [lightyellow3] [h=cdcdb4] +\definecolor [lightyellow4] [h=8b8b7a] +\definecolor [yellow1] [h=ffff00] +\definecolor [yellow2] [h=eeee00] +\definecolor [yellow3] [h=cdcd00] +\definecolor [yellow4] [h=8b8b00] +\definecolor [gold1] [h=ffd700] +\definecolor [gold2] [h=eec900] +\definecolor [gold3] [h=cdad00] +\definecolor [gold4] [h=8b7500] +\definecolor [goldenrod1] [h=ffc125] +\definecolor [goldenrod2] [h=eeb422] +\definecolor [goldenrod3] [h=cd9b1d] +\definecolor [goldenrod4] [h=8b6914] +\definecolor [darkgoldenrod1] [h=ffb90f] +\definecolor [darkgoldenrod2] [h=eead0e] +\definecolor [darkgoldenrod3] [h=cd950c] +\definecolor [darkgoldenrod4] [h=8b6508] +\definecolor [rosybrown1] [h=ffc1c1] +\definecolor [rosybrown2] [h=eeb4b4] +\definecolor [rosybrown3] [h=cd9b9b] +\definecolor [rosybrown4] [h=8b6969] +\definecolor [indianred1] [h=ff6a6a] +\definecolor [indianred2] [h=ee6363] +\definecolor [indianred3] [h=cd5555] +\definecolor [indianred4] [h=8b3a3a] +\definecolor [sienna1] [h=ff8247] +\definecolor [sienna2] [h=ee7942] +\definecolor [sienna3] [h=cd6839] +\definecolor [sienna4] [h=8b4726] +\definecolor [burlywood1] [h=ffd39b] +\definecolor [burlywood2] [h=eec591] +\definecolor [burlywood3] [h=cdaa7d] +\definecolor [burlywood4] [h=8b7355] +\definecolor [wheat1] [h=ffe7ba] +\definecolor [wheat2] [h=eed8ae] +\definecolor [wheat3] [h=cdba96] +\definecolor [wheat4] [h=8b7e66] +\definecolor [tan1] [h=ffa54f] +\definecolor [tan2] [h=ee9a49] +\definecolor [tan3] [h=cd853f] +\definecolor [tan4] [h=8b5a2b] +\definecolor [chocolate1] [h=ff7f24] +\definecolor [chocolate2] [h=ee7621] +\definecolor [chocolate3] [h=cd661d] +\definecolor [chocolate4] [h=8b4513] +\definecolor [firebrick1] [h=ff3030] +\definecolor [firebrick2] [h=ee2c2c] +\definecolor [firebrick3] [h=cd2626] +\definecolor [firebrick4] [h=8b1a1a] +\definecolor [brown1] [h=ff4040] +\definecolor [brown2] [h=ee3b3b] +\definecolor [brown3] [h=cd3333] +\definecolor [brown4] [h=8b2323] +\definecolor [salmon1] [h=ff8c69] +\definecolor [salmon2] [h=ee8262] +\definecolor [salmon3] [h=cd7054] +\definecolor [salmon4] [h=8b4c39] +\definecolor [lightsalmon1] [h=ffa07a] +\definecolor [lightsalmon2] [h=ee9572] +\definecolor [lightsalmon3] [h=cd8162] +\definecolor [lightsalmon4] [h=8b5742] +\definecolor [orange1] [h=ffa500] +\definecolor [orange2] [h=ee9a00] +\definecolor [orange3] [h=cd8500] +\definecolor [orange4] [h=8b5a00] +\definecolor [darkorange1] [h=ff7f00] +\definecolor [darkorange2] [h=ee7600] +\definecolor [darkorange3] [h=cd6600] +\definecolor [darkorange4] [h=8b4500] +\definecolor [coral1] [h=ff7256] +\definecolor [coral2] [h=ee6a50] +\definecolor [coral3] [h=cd5b45] +\definecolor [coral4] [h=8b3e2f] +\definecolor [tomato1] [h=ff6347] +\definecolor [tomato2] [h=ee5c42] +\definecolor [tomato3] [h=cd4f39] +\definecolor [tomato4] [h=8b3626] +\definecolor [orangered1] [h=ff4500] +\definecolor [orangered2] [h=ee4000] +\definecolor [orangered3] [h=cd3700] +\definecolor [orangered4] [h=8b2500] +\definecolor [red1] [h=ff0000] +\definecolor [red2] [h=ee0000] +\definecolor [red3] [h=cd0000] +\definecolor [red4] [h=8b0000] +\definecolor [debianred] [h=d70751] +\definecolor [deeppink1] [h=ff1493] +\definecolor [deeppink2] [h=ee1289] +\definecolor [deeppink3] [h=cd1076] +\definecolor [deeppink4] [h=8b0a50] +\definecolor [hotpink1] [h=ff6eb4] +\definecolor [hotpink2] [h=ee6aa7] +\definecolor [hotpink3] [h=cd6090] +\definecolor [hotpink4] [h=8b3a62] +\definecolor [pink1] [h=ffb5c5] +\definecolor [pink2] [h=eea9b8] +\definecolor [pink3] [h=cd919e] +\definecolor [pink4] [h=8b636c] +\definecolor [lightpink1] [h=ffaeb9] +\definecolor [lightpink2] [h=eea2ad] +\definecolor [lightpink3] [h=cd8c95] +\definecolor [lightpink4] [h=8b5f65] +\definecolor [palevioletred1] [h=ff82ab] +\definecolor [palevioletred2] [h=ee799f] +\definecolor [palevioletred3] [h=cd6889] +\definecolor [palevioletred4] [h=8b475d] +\definecolor [maroon1] [h=ff34b3] +\definecolor [maroon2] [h=ee30a7] +\definecolor [maroon3] [h=cd2990] +\definecolor [maroon4] [h=8b1c62] +\definecolor [violetred1] [h=ff3e96] +\definecolor [violetred2] [h=ee3a8c] +\definecolor [violetred3] [h=cd3278] +\definecolor [violetred4] [h=8b2252] +\definecolor [magenta1] [h=ff00ff] +\definecolor [magenta2] [h=ee00ee] +\definecolor [magenta3] [h=cd00cd] +\definecolor [magenta4] [h=8b008b] +\definecolor [orchid1] [h=ff83fa] +\definecolor [orchid2] [h=ee7ae9] +\definecolor [orchid3] [h=cd69c9] +\definecolor [orchid4] [h=8b4789] +\definecolor [plum1] [h=ffbbff] +\definecolor [plum2] [h=eeaeee] +\definecolor [plum3] [h=cd96cd] +\definecolor [plum4] [h=8b668b] +\definecolor [mediumorchid1] [h=e066ff] +\definecolor [mediumorchid2] [h=d15fee] +\definecolor [mediumorchid3] [h=b452cd] +\definecolor [mediumorchid4] [h=7a378b] +\definecolor [darkorchid1] [h=bf3eff] +\definecolor [darkorchid2] [h=b23aee] +\definecolor [darkorchid3] [h=9a32cd] +\definecolor [darkorchid4] [h=68228b] +\definecolor [purple1] [h=9b30ff] +\definecolor [purple2] [h=912cee] +\definecolor [purple3] [h=7d26cd] +\definecolor [purple4] [h=551a8b] +\definecolor [mediumpurple1] [h=ab82ff] +\definecolor [mediumpurple2] [h=9f79ee] +\definecolor [mediumpurple3] [h=8968cd] +\definecolor [mediumpurple4] [h=5d478b] +\definecolor [thistle1] [h=ffe1ff] +\definecolor [thistle2] [h=eed2ee] +\definecolor [thistle3] [h=cdb5cd] +\definecolor [thistle4] [h=8b7b8b] +\definecolor [gray0] [s=0.00] +\definecolor [grey0] [gray0] +\definecolor [gray1] [s=0.01] +\definecolor [grey1] [gray1] +\definecolor [gray2] [s=0.02] +\definecolor [grey2] [gray2] +\definecolor [gray3] [s=0.03] +\definecolor [grey3] [gray3] +\definecolor [gray4] [s=0.04] +\definecolor [grey4] [gray4] +\definecolor [gray5] [s=0.05] +\definecolor [grey5] [gray5] +\definecolor [gray6] [s=0.06] +\definecolor [grey6] [gray6] +\definecolor [gray7] [s=0.07] +\definecolor [grey7] [gray7] +\definecolor [gray8] [s=0.08] +\definecolor [grey8] [gray8] +\definecolor [gray9] [s=0.09] +\definecolor [grey9] [gray9] +\definecolor [gray10] [s=0.10] +\definecolor [grey10] [gray10] +\definecolor [gray11] [s=0.11] +\definecolor [grey11] [gray11] +\definecolor [gray12] [s=0.12] +\definecolor [grey12] [gray12] +\definecolor [gray13] [s=0.13] +\definecolor [grey13] [gray13] +\definecolor [gray14] [s=0.14] +\definecolor [grey14] [gray14] +\definecolor [gray15] [s=0.15] +\definecolor [grey15] [gray15] +\definecolor [gray16] [s=0.16] +\definecolor [grey16] [gray16] +\definecolor [gray17] [s=0.17] +\definecolor [grey17] [gray17] +\definecolor [gray18] [s=0.18] +\definecolor [grey18] [gray18] +\definecolor [gray19] [s=0.19] +\definecolor [grey19] [gray19] +\definecolor [gray20] [s=0.20] +\definecolor [grey20] [gray20] +\definecolor [gray21] [s=0.21] +\definecolor [grey21] [gray21] +\definecolor [gray22] [s=0.22] +\definecolor [grey22] [gray22] +\definecolor [gray23] [s=0.23] +\definecolor [grey23] [gray23] +\definecolor [gray24] [s=0.24] +\definecolor [grey24] [gray24] +\definecolor [gray25] [s=0.25] +\definecolor [grey25] [gray25] +\definecolor [gray26] [s=0.26] +\definecolor [grey26] [gray26] +\definecolor [gray27] [s=0.27] +\definecolor [grey27] [gray27] +\definecolor [gray28] [s=0.28] +\definecolor [grey28] [gray28] +\definecolor [gray29] [s=0.29] +\definecolor [grey29] [gray29] +\definecolor [gray30] [s=0.30] +\definecolor [grey30] [gray30] +\definecolor [gray31] [s=0.31] +\definecolor [grey31] [gray31] +\definecolor [gray32] [s=0.32] +\definecolor [grey32] [gray32] +\definecolor [gray33] [s=0.33] +\definecolor [grey33] [gray33] +\definecolor [gray34] [s=0.34] +\definecolor [grey34] [gray34] +\definecolor [gray35] [s=0.35] +\definecolor [grey35] [gray35] +\definecolor [gray36] [s=0.36] +\definecolor [grey36] [gray36] +\definecolor [gray37] [s=0.37] +\definecolor [grey37] [gray37] +\definecolor [gray38] [s=0.38] +\definecolor [grey38] [gray38] +\definecolor [gray39] [s=0.39] +\definecolor [grey39] [gray39] +\definecolor [gray40] [s=0.40] +\definecolor [grey40] [gray40] +\definecolor [gray41] [s=0.41] +\definecolor [grey41] [gray41] +\definecolor [gray42] [s=0.42] +\definecolor [grey42] [gray42] +\definecolor [gray43] [s=0.43] +\definecolor [grey43] [gray43] +\definecolor [gray44] [s=0.44] +\definecolor [grey44] [gray44] +\definecolor [gray45] [s=0.45] +\definecolor [grey45] [gray45] +\definecolor [gray46] [s=0.46] +\definecolor [grey46] [gray46] +\definecolor [gray47] [s=0.47] +\definecolor [grey47] [gray47] +\definecolor [gray48] [s=0.48] +\definecolor [grey48] [gray48] +\definecolor [gray49] [s=0.49] +\definecolor [grey49] [gray49] +\definecolor [gray50] [s=0.50] +\definecolor [grey50] [gray50] +\definecolor [gray51] [s=0.51] +\definecolor [grey51] [gray51] +\definecolor [gray52] [s=0.52] +\definecolor [grey52] [gray52] +\definecolor [gray53] [s=0.53] +\definecolor [grey53] [gray53] +\definecolor [gray54] [s=0.54] +\definecolor [grey54] [gray54] +\definecolor [gray55] [s=0.55] +\definecolor [grey55] [gray55] +\definecolor [gray56] [s=0.56] +\definecolor [grey56] [gray56] +\definecolor [gray57] [s=0.57] +\definecolor [grey57] [gray57] +\definecolor [gray58] [s=0.58] +\definecolor [grey58] [gray58] +\definecolor [gray59] [s=0.59] +\definecolor [grey59] [gray59] +\definecolor [gray60] [s=0.60] +\definecolor [grey60] [gray60] +\definecolor [gray61] [s=0.61] +\definecolor [grey61] [gray61] +\definecolor [gray62] [s=0.62] +\definecolor [grey62] [gray62] +\definecolor [gray63] [s=0.63] +\definecolor [grey63] [gray63] +\definecolor [gray64] [s=0.64] +\definecolor [grey64] [gray64] +\definecolor [gray65] [s=0.65] +\definecolor [grey65] [gray65] +\definecolor [gray66] [s=0.66] +\definecolor [grey66] [gray66] +\definecolor [gray67] [s=0.67] +\definecolor [grey67] [gray67] +\definecolor [gray68] [s=0.68] +\definecolor [grey68] [gray68] +\definecolor [gray69] [s=0.69] +\definecolor [grey69] [gray69] +\definecolor [gray70] [s=0.70] +\definecolor [grey70] [gray70] +\definecolor [gray71] [s=0.71] +\definecolor [grey71] [gray71] +\definecolor [gray72] [s=0.72] +\definecolor [grey72] [gray72] +\definecolor [gray73] [s=0.73] +\definecolor [grey73] [gray73] +\definecolor [gray74] [s=0.74] +\definecolor [grey74] [gray74] +\definecolor [gray75] [s=0.75] +\definecolor [grey75] [gray75] +\definecolor [gray76] [s=0.76] +\definecolor [grey76] [gray76] +\definecolor [gray77] [s=0.77] +\definecolor [grey77] [gray77] +\definecolor [gray78] [s=0.78] +\definecolor [grey78] [gray78] +\definecolor [gray79] [s=0.79] +\definecolor [grey79] [gray79] +\definecolor [gray80] [s=0.80] +\definecolor [grey80] [gray80] +\definecolor [gray81] [s=0.81] +\definecolor [grey81] [gray81] +\definecolor [gray82] [s=0.82] +\definecolor [grey82] [gray82] +\definecolor [gray83] [s=0.83] +\definecolor [grey83] [gray83] +\definecolor [gray84] [s=0.84] +\definecolor [grey84] [gray84] +\definecolor [gray85] [s=0.85] +\definecolor [grey85] [gray85] +\definecolor [gray86] [s=0.86] +\definecolor [grey86] [gray86] +\definecolor [gray87] [s=0.87] +\definecolor [grey87] [gray87] +\definecolor [gray88] [s=0.88] +\definecolor [grey88] [gray88] +\definecolor [gray89] [s=0.89] +\definecolor [grey89] [gray89] +\definecolor [gray90] [s=0.90] +\definecolor [grey90] [gray90] +\definecolor [gray91] [s=0.91] +\definecolor [grey91] [gray91] +\definecolor [gray92] [s=0.92] +\definecolor [grey92] [gray92] +\definecolor [gray93] [s=0.93] +\definecolor [grey93] [gray93] +\definecolor [gray94] [s=0.94] +\definecolor [grey94] [gray94] +\definecolor [gray95] [s=0.95] +\definecolor [grey95] [gray95] +\definecolor [gray96] [s=0.96] +\definecolor [grey96] [gray96] +\definecolor [gray97] [s=0.97] +\definecolor [grey97] [gray97] +\definecolor [gray98] [s=0.98] +\definecolor [grey98] [gray98] +\definecolor [gray99] [s=0.99] +\definecolor [grey99] [gray99] +\definecolor [gray100] [s=1.00] +\definecolor [grey100] [gray100] +\definecolor [darkgrey] [s=0.66] +\definecolor [darkgray] [darkgrey] +\definecolor [darkblue] [h=00008b] +\definecolor [darkcyan] [h=008b8b] +\definecolor [darkmagenta] [h=8b008b] +\definecolor [darkred] [h=8b0000] +\definecolor [lightgreen] [h=90ee90] + +\endinput diff --git a/tex/context/base/colo-imp-xwi.mkiv b/tex/context/base/colo-imp-xwi.mkiv new file mode 100644 index 000000000..81e09d871 --- /dev/null +++ b/tex/context/base/colo-imp-xwi.mkiv @@ -0,0 +1,142 @@ +%D \module +%D [ file=colo-xwi, +%D version=1995.01.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=X Windows, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 I've forgotten where I got these definitions from, but maybe +%D they can be of use. + +\definecolor [aliceblue] [r=0.94,g=0.97,b=1.00] +\definecolor [antiquewhite] [r=0.98,g=0.92,b=0.84] +\definecolor [aquamarine] [r=0.50,g=1.00,b=0.83] +\definecolor [azure] [r=0.94,g=1.00,b=1.00] +\definecolor [beige] [r=0.96,g=0.96,b=0.86] +\definecolor [bisque] [r=1.00,g=0.89,b=0.77] +\definecolor [black] [s=0] % [r=0.00,g=0.00,b=0.00] +\definecolor [blanchedalmond] [r=1.00,g=0.92,b=0.80] +\definecolor [blue] [r=0.00,g=0.00,b=1.00] +\definecolor [blueviolet] [r=0.54,g=0.17,b=0.89] +\definecolor [brown] [r=0.65,g=0.16,b=0.16] +\definecolor [burlywood] [r=0.87,g=0.72,b=0.53] +\definecolor [cadetblue] [r=0.37,g=0.62,b=0.63] +\definecolor [chartreuse] [r=0.50,g=1.00,b=0.00] +\definecolor [chocolate] [r=0.82,g=0.41,b=0.12] +\definecolor [coral] [r=1.00,g=0.50,b=0.31] +\definecolor [cornflowerblue] [r=0.39,g=0.58,b=0.93] +\definecolor [cornsilk] [r=1.00,g=0.97,b=0.86] +\definecolor [cyan] [r=0.00,g=1.00,b=1.00] +\definecolor [darkgoldenrod] [r=0.72,g=0.53,b=0.04] +\definecolor [darkgreen] [r=0.00,g=0.39,b=0.00] +\definecolor [darkkhaki] [r=0.74,g=0.72,b=0.42] +\definecolor [darkolivegreen] [r=0.33,g=0.42,b=0.18] +\definecolor [darkorange] [r=1.00,g=0.55,b=0.00] +\definecolor [darkorchid] [r=0.60,g=0.20,b=0.80] +\definecolor [darksalmon] [r=0.91,g=0.59,b=0.48] +\definecolor [darkseagreen] [r=0.56,g=0.74,b=0.56] +\definecolor [darkslateblue] [r=0.28,g=0.24,b=0.55] +\definecolor [darkturquoise] [r=0.00,g=0.81,b=0.82] +\definecolor [darkviolet] [r=0.58,g=0.00,b=0.83] +\definecolor [deeppink] [r=1.00,g=0.08,b=0.58] +\definecolor [deepskyblue] [r=0.00,g=0.75,b=1.00] +\definecolor [dodgerblue] [r=0.12,g=0.56,b=1.00] +\definecolor [firebrick] [r=0.70,g=0.13,b=0.13] +\definecolor [floralwhite] [r=1.00,g=0.98,b=0.94] +\definecolor [forestgreen] [r=0.13,g=0.55,b=0.13] +\definecolor [gainsboro] [r=0.86,g=0.86,b=0.86] +\definecolor [ghostwhite] [r=0.97,g=0.97,b=1.00] +\definecolor [gold] [r=1.00,g=0.84,b=0.00] +\definecolor [goldenrod] [r=0.85,g=0.65,b=0.13] +\definecolor [green] [r=0.00,g=1.00,b=0.00] +\definecolor [greenyellow] [r=0.68,g=1.00,b=0.18] +\definecolor [honeydew] [r=0.94,g=1.00,b=0.94] +\definecolor [hotpink] [r=1.00,g=0.41,b=0.71] +\definecolor [indianred] [r=0.80,g=0.36,b=0.36] +\definecolor [ivory] [r=1.00,g=1.00,b=0.94] +\definecolor [khaki] [r=0.94,g=0.90,b=0.55] +\definecolor [lavender] [r=0.90,g=0.90,b=0.98] +\definecolor [lavenderblush] [r=1.00,g=0.94,b=0.96] +\definecolor [lawngreen] [r=0.49,g=0.99,b=0.00] +\definecolor [lemonchiffon] [r=1.00,g=0.98,b=0.80] +\definecolor [lightblue] [r=0.68,g=0.85,b=0.90] +\definecolor [lightcoral] [r=0.94,g=0.50,b=0.50] +\definecolor [lightcyan] [r=0.88,g=1.00,b=1.00] +\definecolor [lightgoldenrod] [r=0.93,g=0.87,b=0.51] +\definecolor [lightgoldenrodyellow] [r=0.98,g=0.98,b=0.82] +\definecolor [lightpink] [r=1.00,g=0.71,b=0.76] +\definecolor [lightsalmon] [r=1.00,g=0.63,b=0.48] +\definecolor [lightseagreen] [r=0.13,g=0.70,b=0.67] +\definecolor [lightskyblue] [r=0.53,g=0.81,b=0.98] +\definecolor [lightslateblue] [r=0.52,g=0.44,b=1.00] +\definecolor [lightsteelblue] [r=0.69,g=0.77,b=0.87] +\definecolor [lightyellow] [r=1.00,g=1.00,b=0.88] +\definecolor [limegreen] [r=0.20,g=0.80,b=0.20] +\definecolor [linen] [r=0.98,g=0.94,b=0.90] +\definecolor [magenta] [r=1.00,g=0.00,b=1.00] +\definecolor [maroon] [r=0.69,g=0.19,b=0.38] +\definecolor [mediumaquamarine] [r=0.40,g=0.80,b=0.67] +\definecolor [mediumblue] [r=0.00,g=0.00,b=0.80] +\definecolor [mediumorchid] [r=0.73,g=0.33,b=0.83] +\definecolor [mediumpurple] [r=0.58,g=0.44,b=0.86] +\definecolor [mediumseagreen] [r=0.24,g=0.70,b=0.44] +\definecolor [mediumslateblue] [r=0.48,g=0.41,b=0.93] +\definecolor [mediumspringgreen] [r=0.00,g=0.98,b=0.60] +\definecolor [mediumturquoise] [r=0.28,g=0.82,b=0.80] +\definecolor [mediumvioletred] [r=0.78,g=0.08,b=0.52] +\definecolor [midnightblue] [r=0.10,g=0.10,b=0.44] +\definecolor [mintcream] [r=0.96,g=1.00,b=0.98] +\definecolor [mistyrose] [r=1.00,g=0.89,b=0.88] +\definecolor [moccasin] [r=1.00,g=0.89,b=0.71] +\definecolor [navajowhite] [r=1.00,g=0.87,b=0.68] +\definecolor [navy] [r=0.00,g=0.00,b=0.50] +\definecolor [navyblue] [r=0.00,g=0.00,b=0.50] +\definecolor [oldlace] [r=0.99,g=0.96,b=0.90] +\definecolor [olivedrab] [r=0.42,g=0.56,b=0.14] +\definecolor [orange] [r=1.00,g=0.65,b=0.00] +\definecolor [orangered] [r=1.00,g=0.27,b=0.00] +\definecolor [orchid] [r=0.85,g=0.44,b=0.84] +\definecolor [palegoldenrod] [r=0.93,g=0.91,b=0.67] +\definecolor [palegreen] [r=0.60,g=0.98,b=0.60] +\definecolor [paleturquoise] [r=0.69,g=0.93,b=0.93] +\definecolor [palevioletred] [r=0.86,g=0.44,b=0.58] +\definecolor [papayawhip] [r=1.00,g=0.94,b=0.84] +\definecolor [peachpuff] [r=1.00,g=0.85,b=0.73] +\definecolor [peru] [r=0.80,g=0.52,b=0.25] +\definecolor [pink] [r=1.00,g=0.75,b=0.80] +\definecolor [plum] [r=0.87,g=0.63,b=0.87] +\definecolor [powderblue] [r=0.69,g=0.88,b=0.90] +\definecolor [purple] [r=0.63,g=0.13,b=0.94] +\definecolor [red ] [r=1.00,g=0.00,b=0.00] +\definecolor [rosybrown] [r=0.74,g=0.56,b=0.56] +\definecolor [royalblue] [r=0.25,g=0.41,b=0.88] +\definecolor [saddlebrown] [r=0.55,g=0.27,b=0.07] +\definecolor [salmon] [r=0.98,g=0.50,b=0.45] +\definecolor [sandybrown] [r=0.96,g=0.64,b=0.38] +\definecolor [seagreen] [r=0.18,g=0.55,b=0.34] +\definecolor [seashell] [r=1.00,g=0.96,b=0.93] +\definecolor [sienna] [r=0.63,g=0.32,b=0.18] +\definecolor [skyblue] [r=0.53,g=0.81,b=0.92] +\definecolor [slateblue] [r=0.42,g=0.35,b=0.80] +\definecolor [snow] [r=1.00,g=0.98,b=0.98] +\definecolor [springgreen] [r=0.00,g=1.00,b=0.50] +\definecolor [steelblue] [r=0.27,g=0.51,b=0.71] +\definecolor [tan ] [r=0.82,g=0.71,b=0.55] +\definecolor [thistle] [r=0.85,g=0.75,b=0.85] +\definecolor [tomato] [r=1.00,g=0.39,b=0.28] +\definecolor [turquoise] [r=0.25,g=0.88,b=0.82] +\definecolor [violet] [r=0.93,g=0.51,b=0.93] +\definecolor [violetred] [r=0.82,g=0.13,b=0.56] +\definecolor [wheat] [r=0.96,g=0.87,b=0.70] +\definecolor [white] [r=1.00,g=1.00,b=1.00] +\definecolor [whitesmoke] [s=0.96] % [r=0.96,g=0.96,b=0.96] +\definecolor [yellow] [r=1.00,g=1.00,b=0.00] +\definecolor [yellowgreen] [r=0.60,g=0.80,b=0.20] + +\endinput diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index b12e383c6..6f4c73336 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -590,6 +590,21 @@ function colors.defineintermediatecolor(name,fraction,c_one,c_two,a_one,a_two,sp end end +-- for the moment downward compatible + +local patterns = { "colo-imp-%s.mkiv", "colo-imp-%s.tex", "colo-%s.mkiv", "colo-%s.tex" } + +function colors.usecolors(name) + commands.uselibrary(name,patterns,function(name,foundname) + context.startreadingfile() + context.input(foundname) + context.showcolormessage("colors",4,name) + context.stopreadingfile() + end, function(name) + context.showcolormessage("colors",5,name) + end) +end + -- interface local setcolormodel = colors.setmodel @@ -632,3 +647,4 @@ function commands.doifdrawingblackelse() commands.doifelse(colors.isblack(gettexattribute(a_color))) end +commands.usecolors = colors.usecolors diff --git a/tex/context/base/colo-ini.mkii b/tex/context/base/colo-ini.mkii index 2d2a7bdaa..484a085fe 100644 --- a/tex/context/base/colo-ini.mkii +++ b/tex/context/base/colo-ini.mkii @@ -271,9 +271,11 @@ \def\dodosetupcolor#1% {\makeshortfilename[\truefilename{\f!colorprefix#1}]% \startreadingfile - \readsysfile\shortfilename + \readsysfile{\shortfilename.\mksuffix} {\showmessage\m!colors4\colorstyle} - {\showmessage\m!colors5\colorstyle}% + {\readsysfile{\shortfilename.tex} + {\showmessage\m!colors4\colorstyle} + {\showmessage\m!colors5\colorstyle}}% \stopreadingfile} \let\usecolors\setupcolor diff --git a/tex/context/base/colo-ini.mkiv b/tex/context/base/colo-ini.mkiv index 3b84634d2..3818ea37b 100644 --- a/tex/context/base/colo-ini.mkiv +++ b/tex/context/base/colo-ini.mkiv @@ -200,35 +200,18 @@ %D where \type{\f!colorprefix} is \unprotect {\tttf \f!colorprefix}. %D Loading such a file is done by \protect %D -%D \showsetup{setupcolor} +%D \showsetup{usecolors} %D %D Some default colors are specified in \type{colo-rgb.tex}, %D which is loaded into the format by: %D %D \starttyping -%D \setupcolor[rgb] +%D \usecolors[rgb] %D \stoptyping -\let\colorstyle\empty +\unexpanded\def\usecolors[#1]{\ctxlua{commands.usecolors(\!!bs#1\!!es)}} -\unexpanded\def\setupcolor - {\dosingleargument\dosetupcolor} - -\def\dosetupcolor[#1]% - {\doifnot{#1}\colorstyle - {\def\colorstyle{#1}% - \processcommalist[#1]\dodosetupcolor}} - -\def\dodosetupcolor#1% todo: mkii / mkiv - {\startreadingfile - \readsysfile{\truefilename{\f!colorprefix#1}} - {\showcolormessage\m!colors4\colorstyle} - {\showcolormessage\m!colors5\colorstyle}% - \stopreadingfile} - -\let\usecolors\setupcolor - -% check: \startcolormode +\let\setupcolor\usecolors %D \macros %D {definetransparency} @@ -298,7 +281,7 @@ \fi\fi \doifelse\@@clstate\v!stop {\incolorfalse\forcegrayMPcolorstrue}% - {\ifincolor\else\showcolormessage\m!colors1\colorstyle\fi\incolortrue\let\@@clstate\v!start}% + {\incolortrue\let\@@clstate\v!start}% \dosetupcolormodel \the\everysetupcolors} diff --git a/tex/context/base/colo-rgb.mkii b/tex/context/base/colo-rgb.mkii new file mode 100644 index 000000000..038e0ab0b --- /dev/null +++ b/tex/context/base/colo-rgb.mkii @@ -0,0 +1,530 @@ +%D \module +%D [ file=colo-rgb, +%D version=1995.01.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=RGB, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 Just to give users a start we define some colors. While +%D switching fonts is as international as can be, thanks to the +%D mnemonics, naming colors is very interface dependant. To +%D support international setups, we define both english and +%D interface dependant colors. We use the color inheritance +%D mechanisms to implement the interface dependant ones. + +%D First we define some simple primary \cap{RGB} and \cap{CMYK} +%D colors. All colors are defined in \cap{RGB} color space. + +\definecolor [red] [r=1, g=0, b=0] +\definecolor [green] [r=0, g=1, b=0] +\definecolor [blue] [r=0, g=0, b=1] + +\definecolor [cyan] [r=0, g=1, b=1] +\definecolor [magenta] [r=1, g=0, b=1] +\definecolor [yellow] [r=1, g=1, b=0] + +\definecolor [white] [s=1] % [r=1, g=1, b=1] +\definecolor [black] [s=0] +\definecolor [gray] [s=.9] + +\definecolor [darkred] [r=.8, g=0, b=0] +\definecolor [middlered] [r=.9, g=0, b=0] +\definecolor [lightred] [r=1, g=0, b=0] + +\definecolor [darkgreen] [r=0, g=.6, b=0] +\definecolor [middlegreen] [r=0, g=.8, b=0] +\definecolor [lightgreen] [r=0, g=1, b=0] + +\definecolor [darkblue] [r=0, g=0, b=.8] +\definecolor [middleblue] [r=0, g=0, b=.9] +\definecolor [lightblue] [r=0, g=0, b=1] + +\definecolor [darkcyan] [r=.6, g=.8, b=.8] +\definecolor [middlecyan] [r=0, g=.8, b=.8] + +\definecolor [darkmagenta] [r=.8, g=.6, b=.8] +\definecolor [middlemagenta] [r=1, g=0, b=.6] + +\definecolor [darkyellow] [r=.8, g=.8, b=.6] +\definecolor [middleyellow] [r=1, g=1, b=.2] + +\definecolor [darkgray] [s=.5] +\definecolor [middlegray] [s=.7] +\definecolor [lightgray] [s=.9] + +%D These colors are mapped to interface dependant colornames. + +\startinterface dutch + + \definecolor [rood] [red] + \definecolor [groen] [green] + \definecolor [blauw] [blue] + + \definecolor [cyaan] [cyan] + \definecolor [magenta] [magenta] + \definecolor [geel] [yellow] + + \definecolor [wit] [white] + \definecolor [grijs] [gray] + \definecolor [zwart] [black] + + \definecolor [donkerrood] [darkred] + \definecolor [middelrood] [middlered] + \definecolor [lichtrood] [lightred] + + \definecolor [donkergroen] [darkgreen] + \definecolor [middelgroen] [middlegreen] + \definecolor [lichtgroen] [lightgreen] + + \definecolor [donkerblauw] [darkblue] + \definecolor [middelblauw] [middleblue] + \definecolor [lichtblauw] [lightblue] + + \definecolor [donkercyaan] [darkcyan] + \definecolor [middelcyaan] [middlecyan] + + \definecolor [donkermagenta] [darkmagenta] + \definecolor [middelmagenta] [middlemagenta] + + \definecolor [donkergeel] [darkyellow] + \definecolor [middelgeel] [middleyellow] + + \definecolor [donkergrijs] [darkgray] + \definecolor [middengrijs] [middlegray] + \definecolor [lichtgrijs] [lightgray] + +\stopinterface + +\startinterface german + + \definecolor [rot] [red] + \definecolor [gruen] [green] + \definecolor [blau] [blue] + + \definecolor [cyan] [cyan] + \definecolor [magenta] [magenta] + \definecolor [gelb] [yellow] + + \definecolor [weiss] [white] + \definecolor [grau] [gray] + \definecolor [schwarz] [black] + + \definecolor [dunkelrot] [darkred] + \definecolor [mittelrot] [middlered] + \definecolor [hellrot] [lightred] + + \definecolor [dunkelgruen] [darkgreen] + \definecolor [mittelgruen] [middlegreen] + \definecolor [hellgruen] [lightgreen] + + \definecolor [dunkelblau] [darkblue] + \definecolor [mittelblau] [middleblue] + \definecolor [hellblau] [lightblue] + + \definecolor [dunkelcyan] [darkcyan] + \definecolor [mittelcyan] [middlecyan] + + \definecolor [dunkelmagenta] [darkmagenta] + \definecolor [mittelmagenta] [middlemagenta] + + \definecolor [dunkelgelb] [darkyellow] + \definecolor [mittelgelb] [middleyellow] + + \definecolor [dunkelgrau] [darkgray] + \definecolor [mittelgrau] [middlegray] + \definecolor [hellgrau] [lightgray] + +\stopinterface + +\startinterface czech + + \definecolor [cervena] [red] + \definecolor [zelena] [green] + \definecolor [modra] [blue] + + \definecolor [azurova] [cyan] + \definecolor [fialova] [magenta] + \definecolor [zluta] [yellow] + + \definecolor [bila] [white] + \definecolor [cerna] [black] + + \definecolor [tmavecervena] [darkred] + \definecolor [strednecervena] [middlered] + \definecolor [svetlecervena] [lightred] + + \definecolor [tmavezelena] [darkgreen] + \definecolor [strednezelena] [middlegreen] + \definecolor [svetlezelena] [lightgreen] + + \definecolor [tmavemodra] [darkblue] + \definecolor [strednemodra] [middleblue] + \definecolor [svetlemodra] [lightblue] + + \definecolor [tmaveazurova] [darkcyan] + \definecolor [stredneazurova] [middlecyan] + + \definecolor [tmavefialova] [darkmagenta] + \definecolor [strednefialova] [middlemagenta] + + \definecolor [tmavezluta] [darkyellow] + \definecolor [strednezluta] [middleyellow] + + \definecolor [tmaveseda] [darkgray] + \definecolor [stredneseda] [middlegray] + \definecolor [svetleseda] [lightgray] + +\stopinterface + +\startinterface italian + + \definecolor [rosso] [red] + \definecolor [verde] [green] + \definecolor [blu] [blue] + + \definecolor [azzurro] [cyan] + \definecolor [turchino] [cyan] + \definecolor [ciano] [cyan] + \definecolor [cremisi] [magenta] + \definecolor [giallo] [yellow] + + \definecolor [bianco] [white] + \definecolor [grigio] [gray] + \definecolor [nero] [black] + + \definecolor [rossoscuro] [darkred] + \definecolor [rossomedio] [middlered] + \definecolor [rossochiaro] [lightred] + + \definecolor [verdescuro] [darkgreen] + \definecolor [verdemedio] [middlegreen] + \definecolor [verdechiaro] [lightgreen] + + \definecolor [bluscuro] [darkblue] + \definecolor [blumedio] [middleblue] + \definecolor [bluchiaro] [lightblue] + + \definecolor [azzurroscuro] [darkcyan] + \definecolor [azzurrochiaro] [middlecyan] + + \definecolor [cremisiscuro] [darkmagenta] + \definecolor [cremisichiaro] [middlemagenta] + + + \definecolor [gialloscuro] [darkyellow] + \definecolor [giallomedio] [middleyellow] + + \definecolor [grigioscuro] [darkgray] + \definecolor [grigiomedio] [middlegray] + \definecolor [grigiochiaro] [lightgray] + +\stopinterface + +\startinterface romanian + + \definecolor [rosu] [red] + \definecolor [verde] [green] + \definecolor [albastru] [blue] + + \definecolor [cian] [cyan] + \definecolor [magenta] [magenta] + \definecolor [galben] [yellow] + + \definecolor [alb] [white] + \definecolor [gri] [gray] + \definecolor [negru] [black] + + \definecolor [rosuinchis] [darkred] + \definecolor [rosumediu] [middlered] + \definecolor [rosudeschis] [lightred] + + \definecolor [verdeinchis] [darkgreen] + \definecolor [verdemediu] [middlegreen] + \definecolor [verdedeschis] [lightgreen] + + \definecolor [albastruinchis] [darkblue] + \definecolor [albastrumediu] [middleblue] + \definecolor [albastrudeschis] [lightblue] + + \definecolor [cianinchis] [darkcyan] + \definecolor [cianmediu] [middlecyan] + + \definecolor [magentainchis] [darkmagenta] + \definecolor [magentamediu] [middlemagenta] + + \definecolor [galbeninchis] [darkyellow] + \definecolor [galbenmediu] [middleyellow] + + \definecolor [griinchis] [darkgray] + \definecolor [grimediu] [middlegray] + \definecolor [grideschis] [lightgray] + +\stopinterface + +%D Like colors, we first define the english colorgroups. These +%D colorgroups are tuned for distinctive gray scale printing. + +% todo : more efficient and real gray + +\definecolorgroup + [gray] + [0.95:0.95:0.95, + 0.90:0.90:0.90, + 0.80:0.80:0.80, + 0.70:0.70:0.70, + 0.60:0.60:0.60, + 0.50:0.50:0.50, + 0.40:0.40:0.40, + 0.30:0.30:0.30, + 0.20:0.20:0.20, + 0.10:0.10:0.10, + 0.00:0.00:0.00] + +\definecolorgroup + [red] + [1.00:0.90:0.90, + 1.00:0.80:0.80, + 1.00:0.70:0.70, + 1.00:0.55:0.55, + 1.00:0.40:0.40, + 1.00:0.25:0.25, + 1.00:0.15:0.15, + 0.90:0.00:0.00] + +\definecolorgroup + [green] + [0.90:1.00:0.90, + 0.70:1.00:0.70, + 0.50:1.00:0.50, + 0.30:1.00:0.30, + 0.15:0.90:0.15, + 0.00:0.80:0.00, + 0.00:0.65:0.00, + 0.00:0.50:0.00] + +\definecolorgroup + [blue] + [0.90:0.95:1.00, + 0.80:0.90:1.00, + 0.55:0.85:1.00, + 0.30:0.80:1.00, + 0.15:0.75:1.00, + 0.00:0.70:1.00, + 0.00:0.55:1.00, + 0.00:0.40:1.00] + +\definecolorgroup + [cyan] + [0.80:1.00:1.00, + 0.60:1.00:1.00, + 0.30:1.00:1.00, + 0.00:0.95:0.95, + 0.00:0.85:0.85, + 0.00:0.75:0.75, + 0.00:0.60:0.60, + 0.00:0.50:0.50] + +\definecolorgroup + [magenta] + [1.00:0.90:1.00, + 1.00:0.80:1.00, + 1.00:0.65:1.00, + 1.00:0.50:1.00, + 1.00:0.35:1.00, + 1.00:0.15:1.00, + 0.90:0.05:0.90, + 0.80:0.00:0.80] + +\definecolorgroup + [yellow] + [1.00:1.00:0.70, + 1.00:1.00:0.00, + 1.00:0.85:0.05, + 1.00:0.70:0.00, + 1.00:0.55:0.00, + 0.95:0.40:0.00, + 0.80:0.30:0.00, + 0.60:0.30:0.00] + +\definecolorgroup + [red*] + [1.00:0.95:0.95, + 1.00:0.90:0.90, + 1.00:0.80:0.80, + 1.00:0.70:0.70, + 1.00:0.60:0.60, + 1.00:0.50:0.50, + 1.00:0.40:0.40, + 1.00:0.30:0.30] + +\definecolorgroup + [green*] + [0.95:1.00:0.95, + 0.90:1.00:0.90, + 0.80:1.00:0.80, + 0.70:1.00:0.70, + 0.60:1.00:0.60, + 0.50:1.00:0.50, + 0.40:1.00:0.40, + 0.30:1.00:0.30] + +\definecolorgroup + [blue*] + [0.95:0.95:1.00, + 0.90:0.90:1.00, + 0.80:0.80:1.00, + 0.70:0.70:1.00, + 0.60:0.60:1.00, + 0.50:0.50:1.00, + 0.40:0.40:1.00, + 0.30:0.30:1.00] + +\definecolorgroup + [yellow*] + [1.00:1.00:0.10, + 1.00:1.00:0.00, + 0.90:0.90:0.00, + 0.80:0.80:0.00, + 0.70:0.70:0.00, + 0.60:0.60:0.00, + 0.50:0.50:0.00, + 0.40:0.40:0.00] + +%D For the sake of implementing interface dependant color +%D groups we support colorgroup duplication. + +\startinterface dutch + \definecolorgroup [grijs] [gray] + \definecolorgroup [rood] [red] + \definecolorgroup [groen] [green] + \definecolorgroup [blauw] [blue] + \definecolorgroup [cyaan] [cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [geel] [yellow] + \definecolorgroup [rood*] [red*] + \definecolorgroup [groen*] [green*] + \definecolorgroup [blauw*] [blue*] + \definecolorgroup [geel*] [yellow*] +\stopinterface + +\startinterface german + \definecolorgroup [grau] [gray] + \definecolorgroup [rot] [red] + \definecolorgroup [gruen] [green] + \definecolorgroup [blau] [blue] + \definecolorgroup [cyan] [cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [gelb] [yellow] + \definecolorgroup [rot*] [red*] + \definecolorgroup [gruen*] [green*] + \definecolorgroup [blau*] [blue*] + \definecolorgroup [gelb*] [yellow*] +\stopinterface + +\startinterface czech + \definecolorgroup [seda] [gray] + \definecolorgroup [cervena] [red] + \definecolorgroup [zelena] [green] + \definecolorgroup [modra] [blue] + \definecolorgroup [azurova] [cyan] + \definecolorgroup [fialova] [magenta] + \definecolorgroup [zluta] [yellow] + \definecolorgroup [cervena*] [red*] + \definecolorgroup [zelena*] [green*] + \definecolorgroup [modra*] [blue*] + \definecolorgroup [zluta*] [yellow*] +\stopinterface + +\startinterface italian + \definecolorgroup [grigio] [gray] + \definecolorgroup [rosso] [red] + \definecolorgroup [verde] [green] + \definecolorgroup [blu] [blue] + \definecolorgroup [ciano] [cyan] + \definecolorgroup [azzurro] [cyan] + \definecolorgroup [turchino][cyan] + \definecolorgroup [magenta] [magenta] + \definecolorgroup [cremisi] [magenta] + \definecolorgroup [giallo] [yellow] + \definecolorgroup [rosso*] [red*] + \definecolorgroup [verde*] [green*] + \definecolorgroup [blu*] [blue*] + \definecolorgroup [giallo*] [yellow*] +\stopinterface + +%D The next set of color palets is quite language independant. +%D These palets are meant as examples. + +\definepalet + [alfa] + [ top=red:7, + bottom=green:6, + up=blue:5, + down=cyan:4, + strange=magenta:3, + charm=yellow:2] + +\definepalet + [beta] + [ top=red:7, + bottom=green:5, + up=blue:3, + down=cyan:6, + strange=magenta:2, + charm=yellow:1] + +\definepalet + [gamma] + [ top=red:2, + bottom=green:5, + up=blue:3, + down=cyan:6, + strange=magenta:7, + charm=yellow:4] + +\definepalet + [delta] + [ top=yellow*:5, + bottom=yellow*:3, + up=yellow*:2, + down=magenta:6, + strange=blue:4, + charm=blue:1] + +\definepalet + [epsilon] + [ top=cyan:7, + bottom=cyan:5, + up=blue:3, + down=yellow:6, + strange=yellow:4, + charm=yellow:2] + +\definepalet + [zeta] + [ top=red:6, + bottom=green:5, + up=blue:7, + down=cyan:4, + strange=magenta:3, + charm=yellow:2] + +%D The next four colors are used for typesetting verbatim \TEX\ +%D in color. + +\definecolor [texcolorone] [middlered] +\definecolor [texcolortwo] [middlegreen] +\definecolor [texcolorthree] [middleblue] +\definecolor [texcolorfour] [darkyellow] + +%D Bonus (needed for FO test): + +\definecolor [orange] [r=1,g=.5] + +\endinput diff --git a/tex/context/base/colo-rgb.tex b/tex/context/base/colo-rgb.tex deleted file mode 100644 index 038e0ab0b..000000000 --- a/tex/context/base/colo-rgb.tex +++ /dev/null @@ -1,530 +0,0 @@ -%D \module -%D [ file=colo-rgb, -%D version=1995.01.01, -%D title=\CONTEXT\ Color Macros, -%D subtitle=RGB, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 Just to give users a start we define some colors. While -%D switching fonts is as international as can be, thanks to the -%D mnemonics, naming colors is very interface dependant. To -%D support international setups, we define both english and -%D interface dependant colors. We use the color inheritance -%D mechanisms to implement the interface dependant ones. - -%D First we define some simple primary \cap{RGB} and \cap{CMYK} -%D colors. All colors are defined in \cap{RGB} color space. - -\definecolor [red] [r=1, g=0, b=0] -\definecolor [green] [r=0, g=1, b=0] -\definecolor [blue] [r=0, g=0, b=1] - -\definecolor [cyan] [r=0, g=1, b=1] -\definecolor [magenta] [r=1, g=0, b=1] -\definecolor [yellow] [r=1, g=1, b=0] - -\definecolor [white] [s=1] % [r=1, g=1, b=1] -\definecolor [black] [s=0] -\definecolor [gray] [s=.9] - -\definecolor [darkred] [r=.8, g=0, b=0] -\definecolor [middlered] [r=.9, g=0, b=0] -\definecolor [lightred] [r=1, g=0, b=0] - -\definecolor [darkgreen] [r=0, g=.6, b=0] -\definecolor [middlegreen] [r=0, g=.8, b=0] -\definecolor [lightgreen] [r=0, g=1, b=0] - -\definecolor [darkblue] [r=0, g=0, b=.8] -\definecolor [middleblue] [r=0, g=0, b=.9] -\definecolor [lightblue] [r=0, g=0, b=1] - -\definecolor [darkcyan] [r=.6, g=.8, b=.8] -\definecolor [middlecyan] [r=0, g=.8, b=.8] - -\definecolor [darkmagenta] [r=.8, g=.6, b=.8] -\definecolor [middlemagenta] [r=1, g=0, b=.6] - -\definecolor [darkyellow] [r=.8, g=.8, b=.6] -\definecolor [middleyellow] [r=1, g=1, b=.2] - -\definecolor [darkgray] [s=.5] -\definecolor [middlegray] [s=.7] -\definecolor [lightgray] [s=.9] - -%D These colors are mapped to interface dependant colornames. - -\startinterface dutch - - \definecolor [rood] [red] - \definecolor [groen] [green] - \definecolor [blauw] [blue] - - \definecolor [cyaan] [cyan] - \definecolor [magenta] [magenta] - \definecolor [geel] [yellow] - - \definecolor [wit] [white] - \definecolor [grijs] [gray] - \definecolor [zwart] [black] - - \definecolor [donkerrood] [darkred] - \definecolor [middelrood] [middlered] - \definecolor [lichtrood] [lightred] - - \definecolor [donkergroen] [darkgreen] - \definecolor [middelgroen] [middlegreen] - \definecolor [lichtgroen] [lightgreen] - - \definecolor [donkerblauw] [darkblue] - \definecolor [middelblauw] [middleblue] - \definecolor [lichtblauw] [lightblue] - - \definecolor [donkercyaan] [darkcyan] - \definecolor [middelcyaan] [middlecyan] - - \definecolor [donkermagenta] [darkmagenta] - \definecolor [middelmagenta] [middlemagenta] - - \definecolor [donkergeel] [darkyellow] - \definecolor [middelgeel] [middleyellow] - - \definecolor [donkergrijs] [darkgray] - \definecolor [middengrijs] [middlegray] - \definecolor [lichtgrijs] [lightgray] - -\stopinterface - -\startinterface german - - \definecolor [rot] [red] - \definecolor [gruen] [green] - \definecolor [blau] [blue] - - \definecolor [cyan] [cyan] - \definecolor [magenta] [magenta] - \definecolor [gelb] [yellow] - - \definecolor [weiss] [white] - \definecolor [grau] [gray] - \definecolor [schwarz] [black] - - \definecolor [dunkelrot] [darkred] - \definecolor [mittelrot] [middlered] - \definecolor [hellrot] [lightred] - - \definecolor [dunkelgruen] [darkgreen] - \definecolor [mittelgruen] [middlegreen] - \definecolor [hellgruen] [lightgreen] - - \definecolor [dunkelblau] [darkblue] - \definecolor [mittelblau] [middleblue] - \definecolor [hellblau] [lightblue] - - \definecolor [dunkelcyan] [darkcyan] - \definecolor [mittelcyan] [middlecyan] - - \definecolor [dunkelmagenta] [darkmagenta] - \definecolor [mittelmagenta] [middlemagenta] - - \definecolor [dunkelgelb] [darkyellow] - \definecolor [mittelgelb] [middleyellow] - - \definecolor [dunkelgrau] [darkgray] - \definecolor [mittelgrau] [middlegray] - \definecolor [hellgrau] [lightgray] - -\stopinterface - -\startinterface czech - - \definecolor [cervena] [red] - \definecolor [zelena] [green] - \definecolor [modra] [blue] - - \definecolor [azurova] [cyan] - \definecolor [fialova] [magenta] - \definecolor [zluta] [yellow] - - \definecolor [bila] [white] - \definecolor [cerna] [black] - - \definecolor [tmavecervena] [darkred] - \definecolor [strednecervena] [middlered] - \definecolor [svetlecervena] [lightred] - - \definecolor [tmavezelena] [darkgreen] - \definecolor [strednezelena] [middlegreen] - \definecolor [svetlezelena] [lightgreen] - - \definecolor [tmavemodra] [darkblue] - \definecolor [strednemodra] [middleblue] - \definecolor [svetlemodra] [lightblue] - - \definecolor [tmaveazurova] [darkcyan] - \definecolor [stredneazurova] [middlecyan] - - \definecolor [tmavefialova] [darkmagenta] - \definecolor [strednefialova] [middlemagenta] - - \definecolor [tmavezluta] [darkyellow] - \definecolor [strednezluta] [middleyellow] - - \definecolor [tmaveseda] [darkgray] - \definecolor [stredneseda] [middlegray] - \definecolor [svetleseda] [lightgray] - -\stopinterface - -\startinterface italian - - \definecolor [rosso] [red] - \definecolor [verde] [green] - \definecolor [blu] [blue] - - \definecolor [azzurro] [cyan] - \definecolor [turchino] [cyan] - \definecolor [ciano] [cyan] - \definecolor [cremisi] [magenta] - \definecolor [giallo] [yellow] - - \definecolor [bianco] [white] - \definecolor [grigio] [gray] - \definecolor [nero] [black] - - \definecolor [rossoscuro] [darkred] - \definecolor [rossomedio] [middlered] - \definecolor [rossochiaro] [lightred] - - \definecolor [verdescuro] [darkgreen] - \definecolor [verdemedio] [middlegreen] - \definecolor [verdechiaro] [lightgreen] - - \definecolor [bluscuro] [darkblue] - \definecolor [blumedio] [middleblue] - \definecolor [bluchiaro] [lightblue] - - \definecolor [azzurroscuro] [darkcyan] - \definecolor [azzurrochiaro] [middlecyan] - - \definecolor [cremisiscuro] [darkmagenta] - \definecolor [cremisichiaro] [middlemagenta] - - - \definecolor [gialloscuro] [darkyellow] - \definecolor [giallomedio] [middleyellow] - - \definecolor [grigioscuro] [darkgray] - \definecolor [grigiomedio] [middlegray] - \definecolor [grigiochiaro] [lightgray] - -\stopinterface - -\startinterface romanian - - \definecolor [rosu] [red] - \definecolor [verde] [green] - \definecolor [albastru] [blue] - - \definecolor [cian] [cyan] - \definecolor [magenta] [magenta] - \definecolor [galben] [yellow] - - \definecolor [alb] [white] - \definecolor [gri] [gray] - \definecolor [negru] [black] - - \definecolor [rosuinchis] [darkred] - \definecolor [rosumediu] [middlered] - \definecolor [rosudeschis] [lightred] - - \definecolor [verdeinchis] [darkgreen] - \definecolor [verdemediu] [middlegreen] - \definecolor [verdedeschis] [lightgreen] - - \definecolor [albastruinchis] [darkblue] - \definecolor [albastrumediu] [middleblue] - \definecolor [albastrudeschis] [lightblue] - - \definecolor [cianinchis] [darkcyan] - \definecolor [cianmediu] [middlecyan] - - \definecolor [magentainchis] [darkmagenta] - \definecolor [magentamediu] [middlemagenta] - - \definecolor [galbeninchis] [darkyellow] - \definecolor [galbenmediu] [middleyellow] - - \definecolor [griinchis] [darkgray] - \definecolor [grimediu] [middlegray] - \definecolor [grideschis] [lightgray] - -\stopinterface - -%D Like colors, we first define the english colorgroups. These -%D colorgroups are tuned for distinctive gray scale printing. - -% todo : more efficient and real gray - -\definecolorgroup - [gray] - [0.95:0.95:0.95, - 0.90:0.90:0.90, - 0.80:0.80:0.80, - 0.70:0.70:0.70, - 0.60:0.60:0.60, - 0.50:0.50:0.50, - 0.40:0.40:0.40, - 0.30:0.30:0.30, - 0.20:0.20:0.20, - 0.10:0.10:0.10, - 0.00:0.00:0.00] - -\definecolorgroup - [red] - [1.00:0.90:0.90, - 1.00:0.80:0.80, - 1.00:0.70:0.70, - 1.00:0.55:0.55, - 1.00:0.40:0.40, - 1.00:0.25:0.25, - 1.00:0.15:0.15, - 0.90:0.00:0.00] - -\definecolorgroup - [green] - [0.90:1.00:0.90, - 0.70:1.00:0.70, - 0.50:1.00:0.50, - 0.30:1.00:0.30, - 0.15:0.90:0.15, - 0.00:0.80:0.00, - 0.00:0.65:0.00, - 0.00:0.50:0.00] - -\definecolorgroup - [blue] - [0.90:0.95:1.00, - 0.80:0.90:1.00, - 0.55:0.85:1.00, - 0.30:0.80:1.00, - 0.15:0.75:1.00, - 0.00:0.70:1.00, - 0.00:0.55:1.00, - 0.00:0.40:1.00] - -\definecolorgroup - [cyan] - [0.80:1.00:1.00, - 0.60:1.00:1.00, - 0.30:1.00:1.00, - 0.00:0.95:0.95, - 0.00:0.85:0.85, - 0.00:0.75:0.75, - 0.00:0.60:0.60, - 0.00:0.50:0.50] - -\definecolorgroup - [magenta] - [1.00:0.90:1.00, - 1.00:0.80:1.00, - 1.00:0.65:1.00, - 1.00:0.50:1.00, - 1.00:0.35:1.00, - 1.00:0.15:1.00, - 0.90:0.05:0.90, - 0.80:0.00:0.80] - -\definecolorgroup - [yellow] - [1.00:1.00:0.70, - 1.00:1.00:0.00, - 1.00:0.85:0.05, - 1.00:0.70:0.00, - 1.00:0.55:0.00, - 0.95:0.40:0.00, - 0.80:0.30:0.00, - 0.60:0.30:0.00] - -\definecolorgroup - [red*] - [1.00:0.95:0.95, - 1.00:0.90:0.90, - 1.00:0.80:0.80, - 1.00:0.70:0.70, - 1.00:0.60:0.60, - 1.00:0.50:0.50, - 1.00:0.40:0.40, - 1.00:0.30:0.30] - -\definecolorgroup - [green*] - [0.95:1.00:0.95, - 0.90:1.00:0.90, - 0.80:1.00:0.80, - 0.70:1.00:0.70, - 0.60:1.00:0.60, - 0.50:1.00:0.50, - 0.40:1.00:0.40, - 0.30:1.00:0.30] - -\definecolorgroup - [blue*] - [0.95:0.95:1.00, - 0.90:0.90:1.00, - 0.80:0.80:1.00, - 0.70:0.70:1.00, - 0.60:0.60:1.00, - 0.50:0.50:1.00, - 0.40:0.40:1.00, - 0.30:0.30:1.00] - -\definecolorgroup - [yellow*] - [1.00:1.00:0.10, - 1.00:1.00:0.00, - 0.90:0.90:0.00, - 0.80:0.80:0.00, - 0.70:0.70:0.00, - 0.60:0.60:0.00, - 0.50:0.50:0.00, - 0.40:0.40:0.00] - -%D For the sake of implementing interface dependant color -%D groups we support colorgroup duplication. - -\startinterface dutch - \definecolorgroup [grijs] [gray] - \definecolorgroup [rood] [red] - \definecolorgroup [groen] [green] - \definecolorgroup [blauw] [blue] - \definecolorgroup [cyaan] [cyan] - \definecolorgroup [magenta] [magenta] - \definecolorgroup [geel] [yellow] - \definecolorgroup [rood*] [red*] - \definecolorgroup [groen*] [green*] - \definecolorgroup [blauw*] [blue*] - \definecolorgroup [geel*] [yellow*] -\stopinterface - -\startinterface german - \definecolorgroup [grau] [gray] - \definecolorgroup [rot] [red] - \definecolorgroup [gruen] [green] - \definecolorgroup [blau] [blue] - \definecolorgroup [cyan] [cyan] - \definecolorgroup [magenta] [magenta] - \definecolorgroup [gelb] [yellow] - \definecolorgroup [rot*] [red*] - \definecolorgroup [gruen*] [green*] - \definecolorgroup [blau*] [blue*] - \definecolorgroup [gelb*] [yellow*] -\stopinterface - -\startinterface czech - \definecolorgroup [seda] [gray] - \definecolorgroup [cervena] [red] - \definecolorgroup [zelena] [green] - \definecolorgroup [modra] [blue] - \definecolorgroup [azurova] [cyan] - \definecolorgroup [fialova] [magenta] - \definecolorgroup [zluta] [yellow] - \definecolorgroup [cervena*] [red*] - \definecolorgroup [zelena*] [green*] - \definecolorgroup [modra*] [blue*] - \definecolorgroup [zluta*] [yellow*] -\stopinterface - -\startinterface italian - \definecolorgroup [grigio] [gray] - \definecolorgroup [rosso] [red] - \definecolorgroup [verde] [green] - \definecolorgroup [blu] [blue] - \definecolorgroup [ciano] [cyan] - \definecolorgroup [azzurro] [cyan] - \definecolorgroup [turchino][cyan] - \definecolorgroup [magenta] [magenta] - \definecolorgroup [cremisi] [magenta] - \definecolorgroup [giallo] [yellow] - \definecolorgroup [rosso*] [red*] - \definecolorgroup [verde*] [green*] - \definecolorgroup [blu*] [blue*] - \definecolorgroup [giallo*] [yellow*] -\stopinterface - -%D The next set of color palets is quite language independant. -%D These palets are meant as examples. - -\definepalet - [alfa] - [ top=red:7, - bottom=green:6, - up=blue:5, - down=cyan:4, - strange=magenta:3, - charm=yellow:2] - -\definepalet - [beta] - [ top=red:7, - bottom=green:5, - up=blue:3, - down=cyan:6, - strange=magenta:2, - charm=yellow:1] - -\definepalet - [gamma] - [ top=red:2, - bottom=green:5, - up=blue:3, - down=cyan:6, - strange=magenta:7, - charm=yellow:4] - -\definepalet - [delta] - [ top=yellow*:5, - bottom=yellow*:3, - up=yellow*:2, - down=magenta:6, - strange=blue:4, - charm=blue:1] - -\definepalet - [epsilon] - [ top=cyan:7, - bottom=cyan:5, - up=blue:3, - down=yellow:6, - strange=yellow:4, - charm=yellow:2] - -\definepalet - [zeta] - [ top=red:6, - bottom=green:5, - up=blue:7, - down=cyan:4, - strange=magenta:3, - charm=yellow:2] - -%D The next four colors are used for typesetting verbatim \TEX\ -%D in color. - -\definecolor [texcolorone] [middlered] -\definecolor [texcolortwo] [middlegreen] -\definecolor [texcolorthree] [middleblue] -\definecolor [texcolorfour] [darkyellow] - -%D Bonus (needed for FO test): - -\definecolor [orange] [r=1,g=.5] - -\endinput diff --git a/tex/context/base/colo-run.mkii b/tex/context/base/colo-run.mkii new file mode 100644 index 000000000..d94ea9801 --- /dev/null +++ b/tex/context/base/colo-run.mkii @@ -0,0 +1,257 @@ +%D \module +%D [ file=colo-run, +%D version=1997.04.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=Runtime loaded commands, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 + +% temp hack (not do be documented) + +% \gdef\doformatcolorP#1:#2:#3:#4:#5:#6\od % was undefined in colo-ini +% {#1\colorformatseparator +% \dodoformatcolor{#2}\colorformatseparator +% \dodoformatcolor{#3}\colorformatseparator +% \dodoformatcolor{#4}\colorformatseparator} + +% \gdef\doformatgrayP#1:#2:#3:#4:#5:#6\od +% {todo} + +% so far + +\gdef\showpalet + {\dodoubleargument\doshowpalet} + +\gdef\doshowpalet[#1][#2]% + {\doifdefined{\??pa#1} + {\doifinsetelse\v!vertical{#2} + {\showverticalpalet[#1][#2]} + {\showhorizontalpalet[#1][#2]}}} + +\gdef\showverticalpalet[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet[#1] + \def\rule + {\vrule\!!width3em\!!height\strutht\!!depth\strutdp} + \tabskip\zeropoint + \def\doshowpalet##1% + {\doifinsetelse\v!number{#2}{##1\hskip.5em}{}& + \color[##1]{\rule}\graycolor[##1]{\rule}& + \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr} + \halign + {\hss##&\hss##\hss&##\cr + &\doifinset{\v!name}{#2}{\strut#1}&\cr% + \processpalet[#1]\doshowpalet\crcr}}} + +\gdef\showhorizontalpalet[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet[#1] + \tabskip\zeropoint + \!!widtha\zeropoint + \doifinset\v!number{#2} + {\def\doshowpalet##1% + {\setbox0\hbox{##1}% + \ifdim\!!widtha<\wd0\!!widtha\wd0\fi}% + \processpalet[#1]\doshowpalet}% + \advance\!!widtha 1em + \ifdim\!!widtha<5em + \!!widtha5em + \fi + \halign + {##&&\hbox to \!!widtha{\hss##\hss}\cr + \doifinset\v!number{#2} + {\def\doshowpalet##1{&\strut##1}% + \processpalet[#1]\doshowpalet}\cr + \doifinset\v!name{#2}{#1\hskip.5em}% + \def\doshowpalet##1% + {&\strut\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}% + \processpalet[#1]\doshowpalet\crcr + \noalign{\vskip-\strutdepth}% + \def\doshowpalet##1% + {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}% + \processpalet[#1]\doshowpalet\crcr + \doifinset\v!value{#2} + {\def\doshowpalet##1% + {&\vbox + {\hsize\!!widtha + \vskip.25ex + \everypar{\strut} + \veryraggedcenter + \let\colorformatseparator=\endgraf + \colorvalue{##1}}}% + \processpalet[#1]\doshowpalet}% + \crcr}}} + +\gdef\processpalet[#1]% + {\expanded{\globalprocesscommalist[\getvalue{\??pa#1}]}} + +\gdef\showcolorgroup + {\dodoubleargument\doshowcolorgroup} + +\gdef\doshowcolorgroup[#1][#2]% + {\doifcolor{#1:1} + {\doifinsetelse\v!vertical{#2} + {\showverticalcolorgroup[#1][#2]} + {\showhorizontalcolorgroup[#1][#2]}}} + +\gdef\showhorizontalcolorgroup[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet + \tabskip\zeropoint + \def\rule + {\vrule\!!width4em\!!height\strutht\!!depth\strutdp} + \def\colorformatseparator{\strut\cr} + \def\dodoshowgroup##1% + {\halign + {\hss####\hss\cr + \doifinset\v!number{#2}{\strut##1}\cr + \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr + \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr + \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}} + \def\doshowgroup##1% + {\doifcolor{#1:##1} + {\vbox{\dodoshowgroup{##1}}}}% + \hbox + {\doifinset\v!name{#2} + {\strut + \doifinsetelse\v!value{#2} + {\raise3\lineheight\hbox{#1\hskip.5em}} + {#1}% + \hskip.5em}% + \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4% + \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}} + +\gdef\showverticalcolorgroup[#1][#2]% + {\localvbox + {\offinterlineskip + \setuppalet + \tabskip\zeropoint + \def\rule + {\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}% + \def\doshowgroup##1% + {\doifcolor{#1:##1} + {\doifinset\v!number{#2}{##1\hskip.5em}& + \color[#1:##1]{\rule}\graycolor[#1:##1]{\rule}& + \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}% + \halign + {\hss##&\hss##\hss&##\hss\cr + &\doifinset\v!name{#2}{\strut#1}&\crcr + \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4% + \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}} + +\gdef\showcolor + {\dosingleempty\doshowcolor} + +\gdef\doshowcolor[#1]% + {\bgroup + \iffirstargument + \let\colorlist\empty % not really used, only for colo-run + \let\colorstyle\empty + \settrue\collectcolorsinlist + \setupcolor[#1]% + \fi + \def\rule + {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}% + \def\docommand##1% + {\NC\graycolor[##1]{\rule}\NC\color[##1]{\rule}\NC\grayvalue{##1}\NC\colorvalue{##1}\NC##1\NC\NR}% + \starttabulate[|l|l|l|l|l|l|l|] + \expanded{\globalprocesscommalist[\colorlist]}\docommand + \stoptabulate + \egroup} + +\gdef\comparepalet + {\dosingleargument\docomparepalet} + +\gdef\docomparepalet[#1]% + {\doifdefined{\??pa#1} + {\hbox + {\dodocomparepalet\color[#1]% + \quad + \dodocomparepalet\graycolor[#1]}}} + +\gdef\dodocomparepalet#1[#2]% + {\localvbox + {\offinterlineskip + \setuppalet[#2] + \getcommacommandsize[\getvalue{\??pa#2}] + \!!widtha2em\relax + \hsize\commalistsize\!!widtha + \def\rule% + {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex} + \def\dododocomparepalet##1% + {\hbox + {\setbox0\hbox + {#1[##1]{\vrule\!!width\hsize\!!height3ex}}% + \wd0\zeropoint + \box0 + \hbox to \hsize + {\def\dododocomparepalet####1% + {\hbox to \!!widtha + {\hss#1[####1]{\rule}\hss}}% + \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}} + \endgraf} + \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}} + +\gdef\comparecolorgroup + {\dosingleargument\docomparecolorgroup} + +\gdef\docomparecolorgroup[#1]% + {\doifcolor{#1:1} + {\hbox + {\dodocomparecolorgroup\color[#1]% + \quad + \dodocomparecolorgroup\graycolor[#1]}}} + +\gdef\dodocomparecolorgroup#1[#2]% + {\localvbox + {\!!counta\zerocount + \dorecurse{15} + {\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}} + \!!widtha2em\relax + \hsize\!!counta\!!widtha + \def\rule + {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex} + \def\dododocomparecolorgroup##1% + {\hbox to \hsize + {\setbox0\hbox + {#1[#2:##1]{\vrule\!!width\hsize\!!height3ex}}% + \wd0\zeropoint + \box0 + \hbox to \hsize + {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\rule}\hss}}} + \endgraf} + \dorecurse\!!counta{\dododocomparecolorgroup\recurselevel}}} + +\gdef\dogetcolorcomponents#1% + {\doifelsenothing{#1} + {\appendtoks + \TB + \to \scratchtoks} + {\appendtoks + \NC\showcolorbar[#1]\NC#1\NC\transparencycomponents{#1}\NC\colorcomponents{#1}\NC \NR + \to \scratchtoks}} + +\gdef\showcolorbar[#1]% + {\backgroundline[#1]{\strut\enspace\color[white]{white}\enspace\color[black]{black}\enspace}} + +\gdef\showcolorcomponents[#1]% + {\begingroup + \scratchtoks{\TB}% + \processcommacommand[#1]\dogetcolorcomponents + \starttabulate[|lT|lT|lT|lT|] + \NC color \NC name \NC transparency \NC specification \NC\NR + \the\scratchtoks + \stoptabulate + \endgroup} + +\protect \endinput diff --git a/tex/context/base/colo-run.tex b/tex/context/base/colo-run.tex deleted file mode 100644 index d94ea9801..000000000 --- a/tex/context/base/colo-run.tex +++ /dev/null @@ -1,257 +0,0 @@ -%D \module -%D [ file=colo-run, -%D version=1997.04.01, -%D title=\CONTEXT\ Color Macros, -%D subtitle=Runtime loaded commands, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 - -% temp hack (not do be documented) - -% \gdef\doformatcolorP#1:#2:#3:#4:#5:#6\od % was undefined in colo-ini -% {#1\colorformatseparator -% \dodoformatcolor{#2}\colorformatseparator -% \dodoformatcolor{#3}\colorformatseparator -% \dodoformatcolor{#4}\colorformatseparator} - -% \gdef\doformatgrayP#1:#2:#3:#4:#5:#6\od -% {todo} - -% so far - -\gdef\showpalet - {\dodoubleargument\doshowpalet} - -\gdef\doshowpalet[#1][#2]% - {\doifdefined{\??pa#1} - {\doifinsetelse\v!vertical{#2} - {\showverticalpalet[#1][#2]} - {\showhorizontalpalet[#1][#2]}}} - -\gdef\showverticalpalet[#1][#2]% - {\localvbox - {\offinterlineskip - \setuppalet[#1] - \def\rule - {\vrule\!!width3em\!!height\strutht\!!depth\strutdp} - \tabskip\zeropoint - \def\doshowpalet##1% - {\doifinsetelse\v!number{#2}{##1\hskip.5em}{}& - \color[##1]{\rule}\graycolor[##1]{\rule}& - \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr} - \halign - {\hss##&\hss##\hss&##\cr - &\doifinset{\v!name}{#2}{\strut#1}&\cr% - \processpalet[#1]\doshowpalet\crcr}}} - -\gdef\showhorizontalpalet[#1][#2]% - {\localvbox - {\offinterlineskip - \setuppalet[#1] - \tabskip\zeropoint - \!!widtha\zeropoint - \doifinset\v!number{#2} - {\def\doshowpalet##1% - {\setbox0\hbox{##1}% - \ifdim\!!widtha<\wd0\!!widtha\wd0\fi}% - \processpalet[#1]\doshowpalet}% - \advance\!!widtha 1em - \ifdim\!!widtha<5em - \!!widtha5em - \fi - \halign - {##&&\hbox to \!!widtha{\hss##\hss}\cr - \doifinset\v!number{#2} - {\def\doshowpalet##1{&\strut##1}% - \processpalet[#1]\doshowpalet}\cr - \doifinset\v!name{#2}{#1\hskip.5em}% - \def\doshowpalet##1% - {&\strut\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}% - \processpalet[#1]\doshowpalet\crcr - \noalign{\vskip-\strutdepth}% - \def\doshowpalet##1% - {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}% - \processpalet[#1]\doshowpalet\crcr - \doifinset\v!value{#2} - {\def\doshowpalet##1% - {&\vbox - {\hsize\!!widtha - \vskip.25ex - \everypar{\strut} - \veryraggedcenter - \let\colorformatseparator=\endgraf - \colorvalue{##1}}}% - \processpalet[#1]\doshowpalet}% - \crcr}}} - -\gdef\processpalet[#1]% - {\expanded{\globalprocesscommalist[\getvalue{\??pa#1}]}} - -\gdef\showcolorgroup - {\dodoubleargument\doshowcolorgroup} - -\gdef\doshowcolorgroup[#1][#2]% - {\doifcolor{#1:1} - {\doifinsetelse\v!vertical{#2} - {\showverticalcolorgroup[#1][#2]} - {\showhorizontalcolorgroup[#1][#2]}}} - -\gdef\showhorizontalcolorgroup[#1][#2]% - {\localvbox - {\offinterlineskip - \setuppalet - \tabskip\zeropoint - \def\rule - {\vrule\!!width4em\!!height\strutht\!!depth\strutdp} - \def\colorformatseparator{\strut\cr} - \def\dodoshowgroup##1% - {\halign - {\hss####\hss\cr - \doifinset\v!number{#2}{\strut##1}\cr - \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr - \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr - \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}} - \def\doshowgroup##1% - {\doifcolor{#1:##1} - {\vbox{\dodoshowgroup{##1}}}}% - \hbox - {\doifinset\v!name{#2} - {\strut - \doifinsetelse\v!value{#2} - {\raise3\lineheight\hbox{#1\hskip.5em}} - {#1}% - \hskip.5em}% - \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4% - \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}} - -\gdef\showverticalcolorgroup[#1][#2]% - {\localvbox - {\offinterlineskip - \setuppalet - \tabskip\zeropoint - \def\rule - {\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}% - \def\doshowgroup##1% - {\doifcolor{#1:##1} - {\doifinset\v!number{#2}{##1\hskip.5em}& - \color[#1:##1]{\rule}\graycolor[#1:##1]{\rule}& - \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}% - \halign - {\hss##&\hss##\hss&##\hss\cr - &\doifinset\v!name{#2}{\strut#1}&\crcr - \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4% - \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}} - -\gdef\showcolor - {\dosingleempty\doshowcolor} - -\gdef\doshowcolor[#1]% - {\bgroup - \iffirstargument - \let\colorlist\empty % not really used, only for colo-run - \let\colorstyle\empty - \settrue\collectcolorsinlist - \setupcolor[#1]% - \fi - \def\rule - {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}% - \def\docommand##1% - {\NC\graycolor[##1]{\rule}\NC\color[##1]{\rule}\NC\grayvalue{##1}\NC\colorvalue{##1}\NC##1\NC\NR}% - \starttabulate[|l|l|l|l|l|l|l|] - \expanded{\globalprocesscommalist[\colorlist]}\docommand - \stoptabulate - \egroup} - -\gdef\comparepalet - {\dosingleargument\docomparepalet} - -\gdef\docomparepalet[#1]% - {\doifdefined{\??pa#1} - {\hbox - {\dodocomparepalet\color[#1]% - \quad - \dodocomparepalet\graycolor[#1]}}} - -\gdef\dodocomparepalet#1[#2]% - {\localvbox - {\offinterlineskip - \setuppalet[#2] - \getcommacommandsize[\getvalue{\??pa#2}] - \!!widtha2em\relax - \hsize\commalistsize\!!widtha - \def\rule% - {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex} - \def\dododocomparepalet##1% - {\hbox - {\setbox0\hbox - {#1[##1]{\vrule\!!width\hsize\!!height3ex}}% - \wd0\zeropoint - \box0 - \hbox to \hsize - {\def\dododocomparepalet####1% - {\hbox to \!!widtha - {\hss#1[####1]{\rule}\hss}}% - \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}} - \endgraf} - \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}} - -\gdef\comparecolorgroup - {\dosingleargument\docomparecolorgroup} - -\gdef\docomparecolorgroup[#1]% - {\doifcolor{#1:1} - {\hbox - {\dodocomparecolorgroup\color[#1]% - \quad - \dodocomparecolorgroup\graycolor[#1]}}} - -\gdef\dodocomparecolorgroup#1[#2]% - {\localvbox - {\!!counta\zerocount - \dorecurse{15} - {\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}} - \!!widtha2em\relax - \hsize\!!counta\!!widtha - \def\rule - {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex} - \def\dododocomparecolorgroup##1% - {\hbox to \hsize - {\setbox0\hbox - {#1[#2:##1]{\vrule\!!width\hsize\!!height3ex}}% - \wd0\zeropoint - \box0 - \hbox to \hsize - {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\rule}\hss}}} - \endgraf} - \dorecurse\!!counta{\dododocomparecolorgroup\recurselevel}}} - -\gdef\dogetcolorcomponents#1% - {\doifelsenothing{#1} - {\appendtoks - \TB - \to \scratchtoks} - {\appendtoks - \NC\showcolorbar[#1]\NC#1\NC\transparencycomponents{#1}\NC\colorcomponents{#1}\NC \NR - \to \scratchtoks}} - -\gdef\showcolorbar[#1]% - {\backgroundline[#1]{\strut\enspace\color[white]{white}\enspace\color[black]{black}\enspace}} - -\gdef\showcolorcomponents[#1]% - {\begingroup - \scratchtoks{\TB}% - \processcommacommand[#1]\dogetcolorcomponents - \starttabulate[|lT|lT|lT|lT|] - \NC color \NC name \NC transparency \NC specification \NC\NR - \the\scratchtoks - \stoptabulate - \endgroup} - -\protect \endinput diff --git a/tex/context/base/colo-x11.mkii b/tex/context/base/colo-x11.mkii new file mode 100644 index 000000000..45d3aac62 --- /dev/null +++ b/tex/context/base/colo-x11.mkii @@ -0,0 +1,677 @@ +%D \module +%D [ file=colo-x11, +%D version=2009.11.13, +%D title=\CONTEXT\ Color Macros, +%D subtitle=X11, +%D author=Alan Braslau] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D Standard X11 rgb colors (from \type {/usr/share/X11/rgb.txt}): + +\doifnotmode{mkiv} { + \input colo-hex.mkii +} + +\definecolor [snow] [h=fffafa] +\definecolor [ghostwhite] [h=f8f8ff] +\definecolor [whitesmoke] [s=0.96] +\definecolor [gainsboro] [s=0.86] +\definecolor [floralwhite] [h=fffaf0] +\definecolor [oldlace] [h=fdf5e6] +\definecolor [linen] [h=faf0e6] +\definecolor [antiquewhite] [h=faebd7] +\definecolor [papayawhip] [h=ffefd5] +\definecolor [blanchedalmond] [h=ffebcd] +\definecolor [bisque] [h=ffe4c4] +\definecolor [peachpuff] [h=ffdab9] +\definecolor [navajowhite] [h=ffdead] +\definecolor [moccasin] [h=ffe4b5] +\definecolor [cornsilk] [h=fff8dc] +\definecolor [ivory] [h=fffff0] +\definecolor [lemonchiffon] [h=fffacd] +\definecolor [seashell] [h=fff5ee] +\definecolor [honeydew] [h=f0fff0] +\definecolor [mintcream] [h=f5fffa] +\definecolor [azure] [h=f0ffff] +\definecolor [aliceblue] [h=f0f8ff] +\definecolor [lavender] [h=e6e6fa] +\definecolor [lavenderblush] [h=fff0f5] +\definecolor [mistyrose] [h=ffe4e1] +\definecolor [white] [s=1] +\definecolor [black] [s=0] +\definecolor [darkslategray] [h=2f4f4f] +\definecolor [darkslategrey] [darkslategray] +\definecolor [dimgray] [s=0.41] +\definecolor [dimgrey] [dimgray] +\definecolor [slategray] [h=708090] +\definecolor [slategrey] [slategray] +\definecolor [lightslategray] [h=778899] +\definecolor [lightslategrey] [lightslategray] +\definecolor [gray] [s=0.75] +\definecolor [grey] [gray] +\definecolor [lightgrey] [s=0.83] +\definecolor [lightgray] [lightgrey] +\definecolor [midnightblue] [h=191970] +\definecolor [navy] [h=000080] +\definecolor [navyblue] [navy] +\definecolor [cornflowerblue] [h=6495ed] +\definecolor [darkslateblue] [h=483d8b] +\definecolor [slateblue] [h=6a5acd] +\definecolor [mediumslateblue] [h=7b68ee] +\definecolor [lightslateblue] [h=8470ff] +\definecolor [mediumblue] [h=0000cd] +\definecolor [royalblue] [h=4169e1] +\definecolor [blue] [h=0000ff] +\definecolor [dodgerblue] [h=1e90ff] +\definecolor [deepskyblue] [h=00bfff] +\definecolor [skyblue] [h=87ceeb] +\definecolor [lightskyblue] [h=87cefa] +\definecolor [steelblue] [h=4682b4] +\definecolor [lightsteelblue] [h=b0c4de] +\definecolor [lightblue] [h=add8e6] +\definecolor [powderblue] [h=b0e0e6] +\definecolor [paleturquoise] [h=afeeee] +\definecolor [darkturquoise] [h=00ced1] +\definecolor [mediumturquoise] [h=48d1cc] +\definecolor [turquoise] [h=40e0d0] +\definecolor [cyan] [h=00ffff] +\definecolor [lightcyan] [h=e0ffff] +\definecolor [cadetblue] [h=5f9ea0] +\definecolor [mediumaquamarine] [h=66cdaa] +\definecolor [aquamarine] [h=7fffd4] +\definecolor [darkgreen] [h=006400] +\definecolor [darkolivegreen] [h=556b2f] +\definecolor [darkseagreen] [h=8fbc8f] +\definecolor [seagreen] [h=2e8b57] +\definecolor [mediumseagreen] [h=3cb371] +\definecolor [lightseagreen] [h=20b2aa] +\definecolor [palegreen] [h=98fb98] +\definecolor [springgreen] [h=00ff7f] +\definecolor [lawngreen] [h=7cfc00] +\definecolor [green] [h=00ff00] +\definecolor [chartreuse] [h=7fff00] +\definecolor [mediumspringgreen] [h=00fa9a] +\definecolor [greenyellow] [h=adff2f] +\definecolor [limegreen] [h=32cd32] +\definecolor [yellowgreen] [h=9acd32] +\definecolor [forestgreen] [h=228b22] +\definecolor [olivedrab] [h=6b8e23] +\definecolor [darkkhaki] [h=bdb76b] +\definecolor [khaki] [h=f0e68c] +\definecolor [palegoldenrod] [h=eee8aa] +\definecolor [lightgoldenrodyellow] [h=fafad2] +\definecolor [lightyellow] [h=ffffe0] +\definecolor [yellow] [h=ffff00] +\definecolor [gold] [h=ffd700] +\definecolor [lightgoldenrod] [h=eedd82] +\definecolor [goldenrod] [h=daa520] +\definecolor [darkgoldenrod] [h=b8860b] +\definecolor [rosybrown] [h=bc8f8f] +\definecolor [indianred] [h=cd5c5c] +\definecolor [saddlebrown] [h=8b4513] +\definecolor [sienna] [h=a0522d] +\definecolor [peru] [h=cd853f] +\definecolor [burlywood] [h=deb887] +\definecolor [beige] [h=f5f5dc] +\definecolor [wheat] [h=f5deb3] +\definecolor [sandybrown] [h=f4a460] +\definecolor [tan] [h=d2b48c] +\definecolor [chocolate] [h=d2691e] +\definecolor [firebrick] [h=b22222] +\definecolor [brown] [h=a52a2a] +\definecolor [darksalmon] [h=e9967a] +\definecolor [salmon] [h=fa8072] +\definecolor [lightsalmon] [h=ffa07a] +\definecolor [orange] [h=ffa500] +\definecolor [darkorange] [h=ff8c00] +\definecolor [coral] [h=ff7f50] +\definecolor [lightcoral] [h=f08080] +\definecolor [tomato] [h=ff6347] +\definecolor [orangered] [h=ff4500] +\definecolor [red] [h=ff0000] +\definecolor [hotpink] [h=ff69b4] +\definecolor [deeppink] [h=ff1493] +\definecolor [pink] [h=ffc0cb] +\definecolor [lightpink] [h=ffb6c1] +\definecolor [palevioletred] [h=db7093] +\definecolor [maroon] [h=b03060] +\definecolor [mediumvioletred] [h=c71585] +\definecolor [violetred] [h=d02090] +\definecolor [magenta] [h=ff00ff] +\definecolor [violet] [h=ee82ee] +\definecolor [plum] [h=dda0dd] +\definecolor [orchid] [h=da70d6] +\definecolor [mediumorchid] [h=ba55d3] +\definecolor [darkorchid] [h=9932cc] +\definecolor [darkviolet] [h=9400d3] +\definecolor [blueviolet] [h=8a2be2] +\definecolor [purple] [h=a020f0] +\definecolor [mediumpurple] [h=9370db] +\definecolor [thistle] [h=d8bfd8] +\definecolor [snow1] [h=fffafa] +\definecolor [snow2] [h=eee9e9] +\definecolor [snow3] [h=cdc9c9] +\definecolor [snow4] [h=8b8989] +\definecolor [seashell1] [h=fff5ee] +\definecolor [seashell2] [h=eee5de] +\definecolor [seashell3] [h=cdc5bf] +\definecolor [seashell4] [h=8b8682] +\definecolor [antiquewhite1] [h=ffefdb] +\definecolor [antiquewhite2] [h=eedfcc] +\definecolor [antiquewhite3] [h=cdc0b0] +\definecolor [antiquewhite4] [h=8b8378] +\definecolor [bisque1] [h=ffe4c4] +\definecolor [bisque2] [h=eed5b7] +\definecolor [bisque3] [h=cdb79e] +\definecolor [bisque4] [h=8b7d6b] +\definecolor [peachpuff1] [h=ffdab9] +\definecolor [peachpuff2] [h=eecbad] +\definecolor [peachpuff3] [h=cdaf95] +\definecolor [peachpuff4] [h=8b7765] +\definecolor [navajowhite1] [h=ffdead] +\definecolor [navajowhite2] [h=eecfa1] +\definecolor [navajowhite3] [h=cdb38b] +\definecolor [navajowhite4] [h=8b795e] +\definecolor [lemonchiffon1] [h=fffacd] +\definecolor [lemonchiffon2] [h=eee9bf] +\definecolor [lemonchiffon3] [h=cdc9a5] +\definecolor [lemonchiffon4] [h=8b8970] +\definecolor [cornsilk1] [h=fff8dc] +\definecolor [cornsilk2] [h=eee8cd] +\definecolor [cornsilk3] [h=cdc8b1] +\definecolor [cornsilk4] [h=8b8878] +\definecolor [ivory1] [h=fffff0] +\definecolor [ivory2] [h=eeeee0] +\definecolor [ivory3] [h=cdcdc1] +\definecolor [ivory4] [h=8b8b83] +\definecolor [honeydew1] [h=f0fff0] +\definecolor [honeydew2] [h=e0eee0] +\definecolor [honeydew3] [h=c1cdc1] +\definecolor [honeydew4] [h=838b83] +\definecolor [lavenderblush1] [h=fff0f5] +\definecolor [lavenderblush2] [h=eee0e5] +\definecolor [lavenderblush3] [h=cdc1c5] +\definecolor [lavenderblush4] [h=8b8386] +\definecolor [mistyrose1] [h=ffe4e1] +\definecolor [mistyrose2] [h=eed5d2] +\definecolor [mistyrose3] [h=cdb7b5] +\definecolor [mistyrose4] [h=8b7d7b] +\definecolor [azure1] [h=f0ffff] +\definecolor [azure2] [h=e0eeee] +\definecolor [azure3] [h=c1cdcd] +\definecolor [azure4] [h=838b8b] +\definecolor [slateblue1] [h=836fff] +\definecolor [slateblue2] [h=7a67ee] +\definecolor [slateblue3] [h=6959cd] +\definecolor [slateblue4] [h=473c8b] +\definecolor [royalblue1] [h=4876ff] +\definecolor [royalblue2] [h=436eee] +\definecolor [royalblue3] [h=3a5fcd] +\definecolor [royalblue4] [h=27408b] +\definecolor [blue1] [h=0000ff] +\definecolor [blue2] [h=0000ee] +\definecolor [blue3] [h=0000cd] +\definecolor [blue4] [h=00008b] +\definecolor [dodgerblue1] [h=1e90ff] +\definecolor [dodgerblue2] [h=1c86ee] +\definecolor [dodgerblue3] [h=1874cd] +\definecolor [dodgerblue4] [h=104e8b] +\definecolor [steelblue1] [h=63b8ff] +\definecolor [steelblue2] [h=5cacee] +\definecolor [steelblue3] [h=4f94cd] +\definecolor [steelblue4] [h=36648b] +\definecolor [deepskyblue1] [h=00bfff] +\definecolor [deepskyblue2] [h=00b2ee] +\definecolor [deepskyblue3] [h=009acd] +\definecolor [deepskyblue4] [h=00688b] +\definecolor [skyblue1] [h=87ceff] +\definecolor [skyblue2] [h=7ec0ee] +\definecolor [skyblue3] [h=6ca6cd] +\definecolor [skyblue4] [h=4a708b] +\definecolor [lightskyblue1] [h=b0e2ff] +\definecolor [lightskyblue2] [h=a4d3ee] +\definecolor [lightskyblue3] [h=8db6cd] +\definecolor [lightskyblue4] [h=607b8b] +\definecolor [slategray1] [h=c6e2ff] +\definecolor [slategray2] [h=b9d3ee] +\definecolor [slategray3] [h=9fb6cd] +\definecolor [slategray4] [h=6c7b8b] +\definecolor [lightsteelblue1] [h=cae1ff] +\definecolor [lightsteelblue2] [h=bcd2ee] +\definecolor [lightsteelblue3] [h=a2b5cd] +\definecolor [lightsteelblue4] [h=6e7b8b] +\definecolor [lightblue1] [h=bfefff] +\definecolor [lightblue2] [h=b2dfee] +\definecolor [lightblue3] [h=9ac0cd] +\definecolor [lightblue4] [h=68838b] +\definecolor [lightcyan1] [h=e0ffff] +\definecolor [lightcyan2] [h=d1eeee] +\definecolor [lightcyan3] [h=b4cdcd] +\definecolor [lightcyan4] [h=7a8b8b] +\definecolor [paleturquoise1] [h=bbffff] +\definecolor [paleturquoise2] [h=aeeeee] +\definecolor [paleturquoise3] [h=96cdcd] +\definecolor [paleturquoise4] [h=668b8b] +\definecolor [cadetblue1] [h=98f5ff] +\definecolor [cadetblue2] [h=8ee5ee] +\definecolor [cadetblue3] [h=7ac5cd] +\definecolor [cadetblue4] [h=53868b] +\definecolor [turquoise1] [h=00f5ff] +\definecolor [turquoise2] [h=00e5ee] +\definecolor [turquoise3] [h=00c5cd] +\definecolor [turquoise4] [h=00868b] +\definecolor [cyan1] [h=00ffff] +\definecolor [cyan2] [h=00eeee] +\definecolor [cyan3] [h=00cdcd] +\definecolor [cyan4] [h=008b8b] +\definecolor [darkslategray1] [h=97ffff] +\definecolor [darkslategray2] [h=8deeee] +\definecolor [darkslategray3] [h=79cdcd] +\definecolor [darkslategray4] [h=528b8b] +\definecolor [aquamarine1] [h=7fffd4] +\definecolor [aquamarine2] [h=76eec6] +\definecolor [aquamarine3] [h=66cdaa] +\definecolor [aquamarine4] [h=458b74] +\definecolor [darkseagreen1] [h=c1ffc1] +\definecolor [darkseagreen2] [h=b4eeb4] +\definecolor [darkseagreen3] [h=9bcd9b] +\definecolor [darkseagreen4] [h=698b69] +\definecolor [seagreen1] [h=54ff9f] +\definecolor [seagreen2] [h=4eee94] +\definecolor [seagreen3] [h=43cd80] +\definecolor [seagreen4] [h=2e8b57] +\definecolor [palegreen1] [h=9aff9a] +\definecolor [palegreen2] [h=90ee90] +\definecolor [palegreen3] [h=7ccd7c] +\definecolor [palegreen4] [h=548b54] +\definecolor [springgreen1] [h=00ff7f] +\definecolor [springgreen2] [h=00ee76] +\definecolor [springgreen3] [h=00cd66] +\definecolor [springgreen4] [h=008b45] +\definecolor [green1] [h=00ff00] +\definecolor [green2] [h=00ee00] +\definecolor [green3] [h=00cd00] +\definecolor [green4] [h=008b00] +\definecolor [chartreuse1] [h=7fff00] +\definecolor [chartreuse2] [h=76ee00] +\definecolor [chartreuse3] [h=66cd00] +\definecolor [chartreuse4] [h=458b00] +\definecolor [olivedrab1] [h=c0ff3e] +\definecolor [olivedrab2] [h=b3ee3a] +\definecolor [olivedrab3] [h=9acd32] +\definecolor [olivedrab4] [h=698b22] +\definecolor [darkolivegreen1] [h=caff70] +\definecolor [darkolivegreen2] [h=bcee68] +\definecolor [darkolivegreen3] [h=a2cd5a] +\definecolor [darkolivegreen4] [h=6e8b3d] +\definecolor [khaki1] [h=fff68f] +\definecolor [khaki2] [h=eee685] +\definecolor [khaki3] [h=cdc673] +\definecolor [khaki4] [h=8b864e] +\definecolor [lightgoldenrod1] [h=ffec8b] +\definecolor [lightgoldenrod2] [h=eedc82] +\definecolor [lightgoldenrod3] [h=cdbe70] +\definecolor [lightgoldenrod4] [h=8b814c] +\definecolor [lightyellow1] [h=ffffe0] +\definecolor [lightyellow2] [h=eeeed1] +\definecolor [lightyellow3] [h=cdcdb4] +\definecolor [lightyellow4] [h=8b8b7a] +\definecolor [yellow1] [h=ffff00] +\definecolor [yellow2] [h=eeee00] +\definecolor [yellow3] [h=cdcd00] +\definecolor [yellow4] [h=8b8b00] +\definecolor [gold1] [h=ffd700] +\definecolor [gold2] [h=eec900] +\definecolor [gold3] [h=cdad00] +\definecolor [gold4] [h=8b7500] +\definecolor [goldenrod1] [h=ffc125] +\definecolor [goldenrod2] [h=eeb422] +\definecolor [goldenrod3] [h=cd9b1d] +\definecolor [goldenrod4] [h=8b6914] +\definecolor [darkgoldenrod1] [h=ffb90f] +\definecolor [darkgoldenrod2] [h=eead0e] +\definecolor [darkgoldenrod3] [h=cd950c] +\definecolor [darkgoldenrod4] [h=8b6508] +\definecolor [rosybrown1] [h=ffc1c1] +\definecolor [rosybrown2] [h=eeb4b4] +\definecolor [rosybrown3] [h=cd9b9b] +\definecolor [rosybrown4] [h=8b6969] +\definecolor [indianred1] [h=ff6a6a] +\definecolor [indianred2] [h=ee6363] +\definecolor [indianred3] [h=cd5555] +\definecolor [indianred4] [h=8b3a3a] +\definecolor [sienna1] [h=ff8247] +\definecolor [sienna2] [h=ee7942] +\definecolor [sienna3] [h=cd6839] +\definecolor [sienna4] [h=8b4726] +\definecolor [burlywood1] [h=ffd39b] +\definecolor [burlywood2] [h=eec591] +\definecolor [burlywood3] [h=cdaa7d] +\definecolor [burlywood4] [h=8b7355] +\definecolor [wheat1] [h=ffe7ba] +\definecolor [wheat2] [h=eed8ae] +\definecolor [wheat3] [h=cdba96] +\definecolor [wheat4] [h=8b7e66] +\definecolor [tan1] [h=ffa54f] +\definecolor [tan2] [h=ee9a49] +\definecolor [tan3] [h=cd853f] +\definecolor [tan4] [h=8b5a2b] +\definecolor [chocolate1] [h=ff7f24] +\definecolor [chocolate2] [h=ee7621] +\definecolor [chocolate3] [h=cd661d] +\definecolor [chocolate4] [h=8b4513] +\definecolor [firebrick1] [h=ff3030] +\definecolor [firebrick2] [h=ee2c2c] +\definecolor [firebrick3] [h=cd2626] +\definecolor [firebrick4] [h=8b1a1a] +\definecolor [brown1] [h=ff4040] +\definecolor [brown2] [h=ee3b3b] +\definecolor [brown3] [h=cd3333] +\definecolor [brown4] [h=8b2323] +\definecolor [salmon1] [h=ff8c69] +\definecolor [salmon2] [h=ee8262] +\definecolor [salmon3] [h=cd7054] +\definecolor [salmon4] [h=8b4c39] +\definecolor [lightsalmon1] [h=ffa07a] +\definecolor [lightsalmon2] [h=ee9572] +\definecolor [lightsalmon3] [h=cd8162] +\definecolor [lightsalmon4] [h=8b5742] +\definecolor [orange1] [h=ffa500] +\definecolor [orange2] [h=ee9a00] +\definecolor [orange3] [h=cd8500] +\definecolor [orange4] [h=8b5a00] +\definecolor [darkorange1] [h=ff7f00] +\definecolor [darkorange2] [h=ee7600] +\definecolor [darkorange3] [h=cd6600] +\definecolor [darkorange4] [h=8b4500] +\definecolor [coral1] [h=ff7256] +\definecolor [coral2] [h=ee6a50] +\definecolor [coral3] [h=cd5b45] +\definecolor [coral4] [h=8b3e2f] +\definecolor [tomato1] [h=ff6347] +\definecolor [tomato2] [h=ee5c42] +\definecolor [tomato3] [h=cd4f39] +\definecolor [tomato4] [h=8b3626] +\definecolor [orangered1] [h=ff4500] +\definecolor [orangered2] [h=ee4000] +\definecolor [orangered3] [h=cd3700] +\definecolor [orangered4] [h=8b2500] +\definecolor [red1] [h=ff0000] +\definecolor [red2] [h=ee0000] +\definecolor [red3] [h=cd0000] +\definecolor [red4] [h=8b0000] +\definecolor [debianred] [h=d70751] +\definecolor [deeppink1] [h=ff1493] +\definecolor [deeppink2] [h=ee1289] +\definecolor [deeppink3] [h=cd1076] +\definecolor [deeppink4] [h=8b0a50] +\definecolor [hotpink1] [h=ff6eb4] +\definecolor [hotpink2] [h=ee6aa7] +\definecolor [hotpink3] [h=cd6090] +\definecolor [hotpink4] [h=8b3a62] +\definecolor [pink1] [h=ffb5c5] +\definecolor [pink2] [h=eea9b8] +\definecolor [pink3] [h=cd919e] +\definecolor [pink4] [h=8b636c] +\definecolor [lightpink1] [h=ffaeb9] +\definecolor [lightpink2] [h=eea2ad] +\definecolor [lightpink3] [h=cd8c95] +\definecolor [lightpink4] [h=8b5f65] +\definecolor [palevioletred1] [h=ff82ab] +\definecolor [palevioletred2] [h=ee799f] +\definecolor [palevioletred3] [h=cd6889] +\definecolor [palevioletred4] [h=8b475d] +\definecolor [maroon1] [h=ff34b3] +\definecolor [maroon2] [h=ee30a7] +\definecolor [maroon3] [h=cd2990] +\definecolor [maroon4] [h=8b1c62] +\definecolor [violetred1] [h=ff3e96] +\definecolor [violetred2] [h=ee3a8c] +\definecolor [violetred3] [h=cd3278] +\definecolor [violetred4] [h=8b2252] +\definecolor [magenta1] [h=ff00ff] +\definecolor [magenta2] [h=ee00ee] +\definecolor [magenta3] [h=cd00cd] +\definecolor [magenta4] [h=8b008b] +\definecolor [orchid1] [h=ff83fa] +\definecolor [orchid2] [h=ee7ae9] +\definecolor [orchid3] [h=cd69c9] +\definecolor [orchid4] [h=8b4789] +\definecolor [plum1] [h=ffbbff] +\definecolor [plum2] [h=eeaeee] +\definecolor [plum3] [h=cd96cd] +\definecolor [plum4] [h=8b668b] +\definecolor [mediumorchid1] [h=e066ff] +\definecolor [mediumorchid2] [h=d15fee] +\definecolor [mediumorchid3] [h=b452cd] +\definecolor [mediumorchid4] [h=7a378b] +\definecolor [darkorchid1] [h=bf3eff] +\definecolor [darkorchid2] [h=b23aee] +\definecolor [darkorchid3] [h=9a32cd] +\definecolor [darkorchid4] [h=68228b] +\definecolor [purple1] [h=9b30ff] +\definecolor [purple2] [h=912cee] +\definecolor [purple3] [h=7d26cd] +\definecolor [purple4] [h=551a8b] +\definecolor [mediumpurple1] [h=ab82ff] +\definecolor [mediumpurple2] [h=9f79ee] +\definecolor [mediumpurple3] [h=8968cd] +\definecolor [mediumpurple4] [h=5d478b] +\definecolor [thistle1] [h=ffe1ff] +\definecolor [thistle2] [h=eed2ee] +\definecolor [thistle3] [h=cdb5cd] +\definecolor [thistle4] [h=8b7b8b] +\definecolor [gray0] [s=0.00] +\definecolor [grey0] [gray0] +\definecolor [gray1] [s=0.01] +\definecolor [grey1] [gray1] +\definecolor [gray2] [s=0.02] +\definecolor [grey2] [gray2] +\definecolor [gray3] [s=0.03] +\definecolor [grey3] [gray3] +\definecolor [gray4] [s=0.04] +\definecolor [grey4] [gray4] +\definecolor [gray5] [s=0.05] +\definecolor [grey5] [gray5] +\definecolor [gray6] [s=0.06] +\definecolor [grey6] [gray6] +\definecolor [gray7] [s=0.07] +\definecolor [grey7] [gray7] +\definecolor [gray8] [s=0.08] +\definecolor [grey8] [gray8] +\definecolor [gray9] [s=0.09] +\definecolor [grey9] [gray9] +\definecolor [gray10] [s=0.10] +\definecolor [grey10] [gray10] +\definecolor [gray11] [s=0.11] +\definecolor [grey11] [gray11] +\definecolor [gray12] [s=0.12] +\definecolor [grey12] [gray12] +\definecolor [gray13] [s=0.13] +\definecolor [grey13] [gray13] +\definecolor [gray14] [s=0.14] +\definecolor [grey14] [gray14] +\definecolor [gray15] [s=0.15] +\definecolor [grey15] [gray15] +\definecolor [gray16] [s=0.16] +\definecolor [grey16] [gray16] +\definecolor [gray17] [s=0.17] +\definecolor [grey17] [gray17] +\definecolor [gray18] [s=0.18] +\definecolor [grey18] [gray18] +\definecolor [gray19] [s=0.19] +\definecolor [grey19] [gray19] +\definecolor [gray20] [s=0.20] +\definecolor [grey20] [gray20] +\definecolor [gray21] [s=0.21] +\definecolor [grey21] [gray21] +\definecolor [gray22] [s=0.22] +\definecolor [grey22] [gray22] +\definecolor [gray23] [s=0.23] +\definecolor [grey23] [gray23] +\definecolor [gray24] [s=0.24] +\definecolor [grey24] [gray24] +\definecolor [gray25] [s=0.25] +\definecolor [grey25] [gray25] +\definecolor [gray26] [s=0.26] +\definecolor [grey26] [gray26] +\definecolor [gray27] [s=0.27] +\definecolor [grey27] [gray27] +\definecolor [gray28] [s=0.28] +\definecolor [grey28] [gray28] +\definecolor [gray29] [s=0.29] +\definecolor [grey29] [gray29] +\definecolor [gray30] [s=0.30] +\definecolor [grey30] [gray30] +\definecolor [gray31] [s=0.31] +\definecolor [grey31] [gray31] +\definecolor [gray32] [s=0.32] +\definecolor [grey32] [gray32] +\definecolor [gray33] [s=0.33] +\definecolor [grey33] [gray33] +\definecolor [gray34] [s=0.34] +\definecolor [grey34] [gray34] +\definecolor [gray35] [s=0.35] +\definecolor [grey35] [gray35] +\definecolor [gray36] [s=0.36] +\definecolor [grey36] [gray36] +\definecolor [gray37] [s=0.37] +\definecolor [grey37] [gray37] +\definecolor [gray38] [s=0.38] +\definecolor [grey38] [gray38] +\definecolor [gray39] [s=0.39] +\definecolor [grey39] [gray39] +\definecolor [gray40] [s=0.40] +\definecolor [grey40] [gray40] +\definecolor [gray41] [s=0.41] +\definecolor [grey41] [gray41] +\definecolor [gray42] [s=0.42] +\definecolor [grey42] [gray42] +\definecolor [gray43] [s=0.43] +\definecolor [grey43] [gray43] +\definecolor [gray44] [s=0.44] +\definecolor [grey44] [gray44] +\definecolor [gray45] [s=0.45] +\definecolor [grey45] [gray45] +\definecolor [gray46] [s=0.46] +\definecolor [grey46] [gray46] +\definecolor [gray47] [s=0.47] +\definecolor [grey47] [gray47] +\definecolor [gray48] [s=0.48] +\definecolor [grey48] [gray48] +\definecolor [gray49] [s=0.49] +\definecolor [grey49] [gray49] +\definecolor [gray50] [s=0.50] +\definecolor [grey50] [gray50] +\definecolor [gray51] [s=0.51] +\definecolor [grey51] [gray51] +\definecolor [gray52] [s=0.52] +\definecolor [grey52] [gray52] +\definecolor [gray53] [s=0.53] +\definecolor [grey53] [gray53] +\definecolor [gray54] [s=0.54] +\definecolor [grey54] [gray54] +\definecolor [gray55] [s=0.55] +\definecolor [grey55] [gray55] +\definecolor [gray56] [s=0.56] +\definecolor [grey56] [gray56] +\definecolor [gray57] [s=0.57] +\definecolor [grey57] [gray57] +\definecolor [gray58] [s=0.58] +\definecolor [grey58] [gray58] +\definecolor [gray59] [s=0.59] +\definecolor [grey59] [gray59] +\definecolor [gray60] [s=0.60] +\definecolor [grey60] [gray60] +\definecolor [gray61] [s=0.61] +\definecolor [grey61] [gray61] +\definecolor [gray62] [s=0.62] +\definecolor [grey62] [gray62] +\definecolor [gray63] [s=0.63] +\definecolor [grey63] [gray63] +\definecolor [gray64] [s=0.64] +\definecolor [grey64] [gray64] +\definecolor [gray65] [s=0.65] +\definecolor [grey65] [gray65] +\definecolor [gray66] [s=0.66] +\definecolor [grey66] [gray66] +\definecolor [gray67] [s=0.67] +\definecolor [grey67] [gray67] +\definecolor [gray68] [s=0.68] +\definecolor [grey68] [gray68] +\definecolor [gray69] [s=0.69] +\definecolor [grey69] [gray69] +\definecolor [gray70] [s=0.70] +\definecolor [grey70] [gray70] +\definecolor [gray71] [s=0.71] +\definecolor [grey71] [gray71] +\definecolor [gray72] [s=0.72] +\definecolor [grey72] [gray72] +\definecolor [gray73] [s=0.73] +\definecolor [grey73] [gray73] +\definecolor [gray74] [s=0.74] +\definecolor [grey74] [gray74] +\definecolor [gray75] [s=0.75] +\definecolor [grey75] [gray75] +\definecolor [gray76] [s=0.76] +\definecolor [grey76] [gray76] +\definecolor [gray77] [s=0.77] +\definecolor [grey77] [gray77] +\definecolor [gray78] [s=0.78] +\definecolor [grey78] [gray78] +\definecolor [gray79] [s=0.79] +\definecolor [grey79] [gray79] +\definecolor [gray80] [s=0.80] +\definecolor [grey80] [gray80] +\definecolor [gray81] [s=0.81] +\definecolor [grey81] [gray81] +\definecolor [gray82] [s=0.82] +\definecolor [grey82] [gray82] +\definecolor [gray83] [s=0.83] +\definecolor [grey83] [gray83] +\definecolor [gray84] [s=0.84] +\definecolor [grey84] [gray84] +\definecolor [gray85] [s=0.85] +\definecolor [grey85] [gray85] +\definecolor [gray86] [s=0.86] +\definecolor [grey86] [gray86] +\definecolor [gray87] [s=0.87] +\definecolor [grey87] [gray87] +\definecolor [gray88] [s=0.88] +\definecolor [grey88] [gray88] +\definecolor [gray89] [s=0.89] +\definecolor [grey89] [gray89] +\definecolor [gray90] [s=0.90] +\definecolor [grey90] [gray90] +\definecolor [gray91] [s=0.91] +\definecolor [grey91] [gray91] +\definecolor [gray92] [s=0.92] +\definecolor [grey92] [gray92] +\definecolor [gray93] [s=0.93] +\definecolor [grey93] [gray93] +\definecolor [gray94] [s=0.94] +\definecolor [grey94] [gray94] +\definecolor [gray95] [s=0.95] +\definecolor [grey95] [gray95] +\definecolor [gray96] [s=0.96] +\definecolor [grey96] [gray96] +\definecolor [gray97] [s=0.97] +\definecolor [grey97] [gray97] +\definecolor [gray98] [s=0.98] +\definecolor [grey98] [gray98] +\definecolor [gray99] [s=0.99] +\definecolor [grey99] [gray99] +\definecolor [gray100] [s=1.00] +\definecolor [grey100] [gray100] +\definecolor [darkgrey] [s=0.66] +\definecolor [darkgray] [darkgrey] +\definecolor [darkblue] [h=00008b] +\definecolor [darkcyan] [h=008b8b] +\definecolor [darkmagenta] [h=8b008b] +\definecolor [darkred] [h=8b0000] +\definecolor [lightgreen] [h=90ee90] + +\endinput diff --git a/tex/context/base/colo-x11.tex b/tex/context/base/colo-x11.tex deleted file mode 100644 index 45d3aac62..000000000 --- a/tex/context/base/colo-x11.tex +++ /dev/null @@ -1,677 +0,0 @@ -%D \module -%D [ file=colo-x11, -%D version=2009.11.13, -%D title=\CONTEXT\ Color Macros, -%D subtitle=X11, -%D author=Alan Braslau] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D Standard X11 rgb colors (from \type {/usr/share/X11/rgb.txt}): - -\doifnotmode{mkiv} { - \input colo-hex.mkii -} - -\definecolor [snow] [h=fffafa] -\definecolor [ghostwhite] [h=f8f8ff] -\definecolor [whitesmoke] [s=0.96] -\definecolor [gainsboro] [s=0.86] -\definecolor [floralwhite] [h=fffaf0] -\definecolor [oldlace] [h=fdf5e6] -\definecolor [linen] [h=faf0e6] -\definecolor [antiquewhite] [h=faebd7] -\definecolor [papayawhip] [h=ffefd5] -\definecolor [blanchedalmond] [h=ffebcd] -\definecolor [bisque] [h=ffe4c4] -\definecolor [peachpuff] [h=ffdab9] -\definecolor [navajowhite] [h=ffdead] -\definecolor [moccasin] [h=ffe4b5] -\definecolor [cornsilk] [h=fff8dc] -\definecolor [ivory] [h=fffff0] -\definecolor [lemonchiffon] [h=fffacd] -\definecolor [seashell] [h=fff5ee] -\definecolor [honeydew] [h=f0fff0] -\definecolor [mintcream] [h=f5fffa] -\definecolor [azure] [h=f0ffff] -\definecolor [aliceblue] [h=f0f8ff] -\definecolor [lavender] [h=e6e6fa] -\definecolor [lavenderblush] [h=fff0f5] -\definecolor [mistyrose] [h=ffe4e1] -\definecolor [white] [s=1] -\definecolor [black] [s=0] -\definecolor [darkslategray] [h=2f4f4f] -\definecolor [darkslategrey] [darkslategray] -\definecolor [dimgray] [s=0.41] -\definecolor [dimgrey] [dimgray] -\definecolor [slategray] [h=708090] -\definecolor [slategrey] [slategray] -\definecolor [lightslategray] [h=778899] -\definecolor [lightslategrey] [lightslategray] -\definecolor [gray] [s=0.75] -\definecolor [grey] [gray] -\definecolor [lightgrey] [s=0.83] -\definecolor [lightgray] [lightgrey] -\definecolor [midnightblue] [h=191970] -\definecolor [navy] [h=000080] -\definecolor [navyblue] [navy] -\definecolor [cornflowerblue] [h=6495ed] -\definecolor [darkslateblue] [h=483d8b] -\definecolor [slateblue] [h=6a5acd] -\definecolor [mediumslateblue] [h=7b68ee] -\definecolor [lightslateblue] [h=8470ff] -\definecolor [mediumblue] [h=0000cd] -\definecolor [royalblue] [h=4169e1] -\definecolor [blue] [h=0000ff] -\definecolor [dodgerblue] [h=1e90ff] -\definecolor [deepskyblue] [h=00bfff] -\definecolor [skyblue] [h=87ceeb] -\definecolor [lightskyblue] [h=87cefa] -\definecolor [steelblue] [h=4682b4] -\definecolor [lightsteelblue] [h=b0c4de] -\definecolor [lightblue] [h=add8e6] -\definecolor [powderblue] [h=b0e0e6] -\definecolor [paleturquoise] [h=afeeee] -\definecolor [darkturquoise] [h=00ced1] -\definecolor [mediumturquoise] [h=48d1cc] -\definecolor [turquoise] [h=40e0d0] -\definecolor [cyan] [h=00ffff] -\definecolor [lightcyan] [h=e0ffff] -\definecolor [cadetblue] [h=5f9ea0] -\definecolor [mediumaquamarine] [h=66cdaa] -\definecolor [aquamarine] [h=7fffd4] -\definecolor [darkgreen] [h=006400] -\definecolor [darkolivegreen] [h=556b2f] -\definecolor [darkseagreen] [h=8fbc8f] -\definecolor [seagreen] [h=2e8b57] -\definecolor [mediumseagreen] [h=3cb371] -\definecolor [lightseagreen] [h=20b2aa] -\definecolor [palegreen] [h=98fb98] -\definecolor [springgreen] [h=00ff7f] -\definecolor [lawngreen] [h=7cfc00] -\definecolor [green] [h=00ff00] -\definecolor [chartreuse] [h=7fff00] -\definecolor [mediumspringgreen] [h=00fa9a] -\definecolor [greenyellow] [h=adff2f] -\definecolor [limegreen] [h=32cd32] -\definecolor [yellowgreen] [h=9acd32] -\definecolor [forestgreen] [h=228b22] -\definecolor [olivedrab] [h=6b8e23] -\definecolor [darkkhaki] [h=bdb76b] -\definecolor [khaki] [h=f0e68c] -\definecolor [palegoldenrod] [h=eee8aa] -\definecolor [lightgoldenrodyellow] [h=fafad2] -\definecolor [lightyellow] [h=ffffe0] -\definecolor [yellow] [h=ffff00] -\definecolor [gold] [h=ffd700] -\definecolor [lightgoldenrod] [h=eedd82] -\definecolor [goldenrod] [h=daa520] -\definecolor [darkgoldenrod] [h=b8860b] -\definecolor [rosybrown] [h=bc8f8f] -\definecolor [indianred] [h=cd5c5c] -\definecolor [saddlebrown] [h=8b4513] -\definecolor [sienna] [h=a0522d] -\definecolor [peru] [h=cd853f] -\definecolor [burlywood] [h=deb887] -\definecolor [beige] [h=f5f5dc] -\definecolor [wheat] [h=f5deb3] -\definecolor [sandybrown] [h=f4a460] -\definecolor [tan] [h=d2b48c] -\definecolor [chocolate] [h=d2691e] -\definecolor [firebrick] [h=b22222] -\definecolor [brown] [h=a52a2a] -\definecolor [darksalmon] [h=e9967a] -\definecolor [salmon] [h=fa8072] -\definecolor [lightsalmon] [h=ffa07a] -\definecolor [orange] [h=ffa500] -\definecolor [darkorange] [h=ff8c00] -\definecolor [coral] [h=ff7f50] -\definecolor [lightcoral] [h=f08080] -\definecolor [tomato] [h=ff6347] -\definecolor [orangered] [h=ff4500] -\definecolor [red] [h=ff0000] -\definecolor [hotpink] [h=ff69b4] -\definecolor [deeppink] [h=ff1493] -\definecolor [pink] [h=ffc0cb] -\definecolor [lightpink] [h=ffb6c1] -\definecolor [palevioletred] [h=db7093] -\definecolor [maroon] [h=b03060] -\definecolor [mediumvioletred] [h=c71585] -\definecolor [violetred] [h=d02090] -\definecolor [magenta] [h=ff00ff] -\definecolor [violet] [h=ee82ee] -\definecolor [plum] [h=dda0dd] -\definecolor [orchid] [h=da70d6] -\definecolor [mediumorchid] [h=ba55d3] -\definecolor [darkorchid] [h=9932cc] -\definecolor [darkviolet] [h=9400d3] -\definecolor [blueviolet] [h=8a2be2] -\definecolor [purple] [h=a020f0] -\definecolor [mediumpurple] [h=9370db] -\definecolor [thistle] [h=d8bfd8] -\definecolor [snow1] [h=fffafa] -\definecolor [snow2] [h=eee9e9] -\definecolor [snow3] [h=cdc9c9] -\definecolor [snow4] [h=8b8989] -\definecolor [seashell1] [h=fff5ee] -\definecolor [seashell2] [h=eee5de] -\definecolor [seashell3] [h=cdc5bf] -\definecolor [seashell4] [h=8b8682] -\definecolor [antiquewhite1] [h=ffefdb] -\definecolor [antiquewhite2] [h=eedfcc] -\definecolor [antiquewhite3] [h=cdc0b0] -\definecolor [antiquewhite4] [h=8b8378] -\definecolor [bisque1] [h=ffe4c4] -\definecolor [bisque2] [h=eed5b7] -\definecolor [bisque3] [h=cdb79e] -\definecolor [bisque4] [h=8b7d6b] -\definecolor [peachpuff1] [h=ffdab9] -\definecolor [peachpuff2] [h=eecbad] -\definecolor [peachpuff3] [h=cdaf95] -\definecolor [peachpuff4] [h=8b7765] -\definecolor [navajowhite1] [h=ffdead] -\definecolor [navajowhite2] [h=eecfa1] -\definecolor [navajowhite3] [h=cdb38b] -\definecolor [navajowhite4] [h=8b795e] -\definecolor [lemonchiffon1] [h=fffacd] -\definecolor [lemonchiffon2] [h=eee9bf] -\definecolor [lemonchiffon3] [h=cdc9a5] -\definecolor [lemonchiffon4] [h=8b8970] -\definecolor [cornsilk1] [h=fff8dc] -\definecolor [cornsilk2] [h=eee8cd] -\definecolor [cornsilk3] [h=cdc8b1] -\definecolor [cornsilk4] [h=8b8878] -\definecolor [ivory1] [h=fffff0] -\definecolor [ivory2] [h=eeeee0] -\definecolor [ivory3] [h=cdcdc1] -\definecolor [ivory4] [h=8b8b83] -\definecolor [honeydew1] [h=f0fff0] -\definecolor [honeydew2] [h=e0eee0] -\definecolor [honeydew3] [h=c1cdc1] -\definecolor [honeydew4] [h=838b83] -\definecolor [lavenderblush1] [h=fff0f5] -\definecolor [lavenderblush2] [h=eee0e5] -\definecolor [lavenderblush3] [h=cdc1c5] -\definecolor [lavenderblush4] [h=8b8386] -\definecolor [mistyrose1] [h=ffe4e1] -\definecolor [mistyrose2] [h=eed5d2] -\definecolor [mistyrose3] [h=cdb7b5] -\definecolor [mistyrose4] [h=8b7d7b] -\definecolor [azure1] [h=f0ffff] -\definecolor [azure2] [h=e0eeee] -\definecolor [azure3] [h=c1cdcd] -\definecolor [azure4] [h=838b8b] -\definecolor [slateblue1] [h=836fff] -\definecolor [slateblue2] [h=7a67ee] -\definecolor [slateblue3] [h=6959cd] -\definecolor [slateblue4] [h=473c8b] -\definecolor [royalblue1] [h=4876ff] -\definecolor [royalblue2] [h=436eee] -\definecolor [royalblue3] [h=3a5fcd] -\definecolor [royalblue4] [h=27408b] -\definecolor [blue1] [h=0000ff] -\definecolor [blue2] [h=0000ee] -\definecolor [blue3] [h=0000cd] -\definecolor [blue4] [h=00008b] -\definecolor [dodgerblue1] [h=1e90ff] -\definecolor [dodgerblue2] [h=1c86ee] -\definecolor [dodgerblue3] [h=1874cd] -\definecolor [dodgerblue4] [h=104e8b] -\definecolor [steelblue1] [h=63b8ff] -\definecolor [steelblue2] [h=5cacee] -\definecolor [steelblue3] [h=4f94cd] -\definecolor [steelblue4] [h=36648b] -\definecolor [deepskyblue1] [h=00bfff] -\definecolor [deepskyblue2] [h=00b2ee] -\definecolor [deepskyblue3] [h=009acd] -\definecolor [deepskyblue4] [h=00688b] -\definecolor [skyblue1] [h=87ceff] -\definecolor [skyblue2] [h=7ec0ee] -\definecolor [skyblue3] [h=6ca6cd] -\definecolor [skyblue4] [h=4a708b] -\definecolor [lightskyblue1] [h=b0e2ff] -\definecolor [lightskyblue2] [h=a4d3ee] -\definecolor [lightskyblue3] [h=8db6cd] -\definecolor [lightskyblue4] [h=607b8b] -\definecolor [slategray1] [h=c6e2ff] -\definecolor [slategray2] [h=b9d3ee] -\definecolor [slategray3] [h=9fb6cd] -\definecolor [slategray4] [h=6c7b8b] -\definecolor [lightsteelblue1] [h=cae1ff] -\definecolor [lightsteelblue2] [h=bcd2ee] -\definecolor [lightsteelblue3] [h=a2b5cd] -\definecolor [lightsteelblue4] [h=6e7b8b] -\definecolor [lightblue1] [h=bfefff] -\definecolor [lightblue2] [h=b2dfee] -\definecolor [lightblue3] [h=9ac0cd] -\definecolor [lightblue4] [h=68838b] -\definecolor [lightcyan1] [h=e0ffff] -\definecolor [lightcyan2] [h=d1eeee] -\definecolor [lightcyan3] [h=b4cdcd] -\definecolor [lightcyan4] [h=7a8b8b] -\definecolor [paleturquoise1] [h=bbffff] -\definecolor [paleturquoise2] [h=aeeeee] -\definecolor [paleturquoise3] [h=96cdcd] -\definecolor [paleturquoise4] [h=668b8b] -\definecolor [cadetblue1] [h=98f5ff] -\definecolor [cadetblue2] [h=8ee5ee] -\definecolor [cadetblue3] [h=7ac5cd] -\definecolor [cadetblue4] [h=53868b] -\definecolor [turquoise1] [h=00f5ff] -\definecolor [turquoise2] [h=00e5ee] -\definecolor [turquoise3] [h=00c5cd] -\definecolor [turquoise4] [h=00868b] -\definecolor [cyan1] [h=00ffff] -\definecolor [cyan2] [h=00eeee] -\definecolor [cyan3] [h=00cdcd] -\definecolor [cyan4] [h=008b8b] -\definecolor [darkslategray1] [h=97ffff] -\definecolor [darkslategray2] [h=8deeee] -\definecolor [darkslategray3] [h=79cdcd] -\definecolor [darkslategray4] [h=528b8b] -\definecolor [aquamarine1] [h=7fffd4] -\definecolor [aquamarine2] [h=76eec6] -\definecolor [aquamarine3] [h=66cdaa] -\definecolor [aquamarine4] [h=458b74] -\definecolor [darkseagreen1] [h=c1ffc1] -\definecolor [darkseagreen2] [h=b4eeb4] -\definecolor [darkseagreen3] [h=9bcd9b] -\definecolor [darkseagreen4] [h=698b69] -\definecolor [seagreen1] [h=54ff9f] -\definecolor [seagreen2] [h=4eee94] -\definecolor [seagreen3] [h=43cd80] -\definecolor [seagreen4] [h=2e8b57] -\definecolor [palegreen1] [h=9aff9a] -\definecolor [palegreen2] [h=90ee90] -\definecolor [palegreen3] [h=7ccd7c] -\definecolor [palegreen4] [h=548b54] -\definecolor [springgreen1] [h=00ff7f] -\definecolor [springgreen2] [h=00ee76] -\definecolor [springgreen3] [h=00cd66] -\definecolor [springgreen4] [h=008b45] -\definecolor [green1] [h=00ff00] -\definecolor [green2] [h=00ee00] -\definecolor [green3] [h=00cd00] -\definecolor [green4] [h=008b00] -\definecolor [chartreuse1] [h=7fff00] -\definecolor [chartreuse2] [h=76ee00] -\definecolor [chartreuse3] [h=66cd00] -\definecolor [chartreuse4] [h=458b00] -\definecolor [olivedrab1] [h=c0ff3e] -\definecolor [olivedrab2] [h=b3ee3a] -\definecolor [olivedrab3] [h=9acd32] -\definecolor [olivedrab4] [h=698b22] -\definecolor [darkolivegreen1] [h=caff70] -\definecolor [darkolivegreen2] [h=bcee68] -\definecolor [darkolivegreen3] [h=a2cd5a] -\definecolor [darkolivegreen4] [h=6e8b3d] -\definecolor [khaki1] [h=fff68f] -\definecolor [khaki2] [h=eee685] -\definecolor [khaki3] [h=cdc673] -\definecolor [khaki4] [h=8b864e] -\definecolor [lightgoldenrod1] [h=ffec8b] -\definecolor [lightgoldenrod2] [h=eedc82] -\definecolor [lightgoldenrod3] [h=cdbe70] -\definecolor [lightgoldenrod4] [h=8b814c] -\definecolor [lightyellow1] [h=ffffe0] -\definecolor [lightyellow2] [h=eeeed1] -\definecolor [lightyellow3] [h=cdcdb4] -\definecolor [lightyellow4] [h=8b8b7a] -\definecolor [yellow1] [h=ffff00] -\definecolor [yellow2] [h=eeee00] -\definecolor [yellow3] [h=cdcd00] -\definecolor [yellow4] [h=8b8b00] -\definecolor [gold1] [h=ffd700] -\definecolor [gold2] [h=eec900] -\definecolor [gold3] [h=cdad00] -\definecolor [gold4] [h=8b7500] -\definecolor [goldenrod1] [h=ffc125] -\definecolor [goldenrod2] [h=eeb422] -\definecolor [goldenrod3] [h=cd9b1d] -\definecolor [goldenrod4] [h=8b6914] -\definecolor [darkgoldenrod1] [h=ffb90f] -\definecolor [darkgoldenrod2] [h=eead0e] -\definecolor [darkgoldenrod3] [h=cd950c] -\definecolor [darkgoldenrod4] [h=8b6508] -\definecolor [rosybrown1] [h=ffc1c1] -\definecolor [rosybrown2] [h=eeb4b4] -\definecolor [rosybrown3] [h=cd9b9b] -\definecolor [rosybrown4] [h=8b6969] -\definecolor [indianred1] [h=ff6a6a] -\definecolor [indianred2] [h=ee6363] -\definecolor [indianred3] [h=cd5555] -\definecolor [indianred4] [h=8b3a3a] -\definecolor [sienna1] [h=ff8247] -\definecolor [sienna2] [h=ee7942] -\definecolor [sienna3] [h=cd6839] -\definecolor [sienna4] [h=8b4726] -\definecolor [burlywood1] [h=ffd39b] -\definecolor [burlywood2] [h=eec591] -\definecolor [burlywood3] [h=cdaa7d] -\definecolor [burlywood4] [h=8b7355] -\definecolor [wheat1] [h=ffe7ba] -\definecolor [wheat2] [h=eed8ae] -\definecolor [wheat3] [h=cdba96] -\definecolor [wheat4] [h=8b7e66] -\definecolor [tan1] [h=ffa54f] -\definecolor [tan2] [h=ee9a49] -\definecolor [tan3] [h=cd853f] -\definecolor [tan4] [h=8b5a2b] -\definecolor [chocolate1] [h=ff7f24] -\definecolor [chocolate2] [h=ee7621] -\definecolor [chocolate3] [h=cd661d] -\definecolor [chocolate4] [h=8b4513] -\definecolor [firebrick1] [h=ff3030] -\definecolor [firebrick2] [h=ee2c2c] -\definecolor [firebrick3] [h=cd2626] -\definecolor [firebrick4] [h=8b1a1a] -\definecolor [brown1] [h=ff4040] -\definecolor [brown2] [h=ee3b3b] -\definecolor [brown3] [h=cd3333] -\definecolor [brown4] [h=8b2323] -\definecolor [salmon1] [h=ff8c69] -\definecolor [salmon2] [h=ee8262] -\definecolor [salmon3] [h=cd7054] -\definecolor [salmon4] [h=8b4c39] -\definecolor [lightsalmon1] [h=ffa07a] -\definecolor [lightsalmon2] [h=ee9572] -\definecolor [lightsalmon3] [h=cd8162] -\definecolor [lightsalmon4] [h=8b5742] -\definecolor [orange1] [h=ffa500] -\definecolor [orange2] [h=ee9a00] -\definecolor [orange3] [h=cd8500] -\definecolor [orange4] [h=8b5a00] -\definecolor [darkorange1] [h=ff7f00] -\definecolor [darkorange2] [h=ee7600] -\definecolor [darkorange3] [h=cd6600] -\definecolor [darkorange4] [h=8b4500] -\definecolor [coral1] [h=ff7256] -\definecolor [coral2] [h=ee6a50] -\definecolor [coral3] [h=cd5b45] -\definecolor [coral4] [h=8b3e2f] -\definecolor [tomato1] [h=ff6347] -\definecolor [tomato2] [h=ee5c42] -\definecolor [tomato3] [h=cd4f39] -\definecolor [tomato4] [h=8b3626] -\definecolor [orangered1] [h=ff4500] -\definecolor [orangered2] [h=ee4000] -\definecolor [orangered3] [h=cd3700] -\definecolor [orangered4] [h=8b2500] -\definecolor [red1] [h=ff0000] -\definecolor [red2] [h=ee0000] -\definecolor [red3] [h=cd0000] -\definecolor [red4] [h=8b0000] -\definecolor [debianred] [h=d70751] -\definecolor [deeppink1] [h=ff1493] -\definecolor [deeppink2] [h=ee1289] -\definecolor [deeppink3] [h=cd1076] -\definecolor [deeppink4] [h=8b0a50] -\definecolor [hotpink1] [h=ff6eb4] -\definecolor [hotpink2] [h=ee6aa7] -\definecolor [hotpink3] [h=cd6090] -\definecolor [hotpink4] [h=8b3a62] -\definecolor [pink1] [h=ffb5c5] -\definecolor [pink2] [h=eea9b8] -\definecolor [pink3] [h=cd919e] -\definecolor [pink4] [h=8b636c] -\definecolor [lightpink1] [h=ffaeb9] -\definecolor [lightpink2] [h=eea2ad] -\definecolor [lightpink3] [h=cd8c95] -\definecolor [lightpink4] [h=8b5f65] -\definecolor [palevioletred1] [h=ff82ab] -\definecolor [palevioletred2] [h=ee799f] -\definecolor [palevioletred3] [h=cd6889] -\definecolor [palevioletred4] [h=8b475d] -\definecolor [maroon1] [h=ff34b3] -\definecolor [maroon2] [h=ee30a7] -\definecolor [maroon3] [h=cd2990] -\definecolor [maroon4] [h=8b1c62] -\definecolor [violetred1] [h=ff3e96] -\definecolor [violetred2] [h=ee3a8c] -\definecolor [violetred3] [h=cd3278] -\definecolor [violetred4] [h=8b2252] -\definecolor [magenta1] [h=ff00ff] -\definecolor [magenta2] [h=ee00ee] -\definecolor [magenta3] [h=cd00cd] -\definecolor [magenta4] [h=8b008b] -\definecolor [orchid1] [h=ff83fa] -\definecolor [orchid2] [h=ee7ae9] -\definecolor [orchid3] [h=cd69c9] -\definecolor [orchid4] [h=8b4789] -\definecolor [plum1] [h=ffbbff] -\definecolor [plum2] [h=eeaeee] -\definecolor [plum3] [h=cd96cd] -\definecolor [plum4] [h=8b668b] -\definecolor [mediumorchid1] [h=e066ff] -\definecolor [mediumorchid2] [h=d15fee] -\definecolor [mediumorchid3] [h=b452cd] -\definecolor [mediumorchid4] [h=7a378b] -\definecolor [darkorchid1] [h=bf3eff] -\definecolor [darkorchid2] [h=b23aee] -\definecolor [darkorchid3] [h=9a32cd] -\definecolor [darkorchid4] [h=68228b] -\definecolor [purple1] [h=9b30ff] -\definecolor [purple2] [h=912cee] -\definecolor [purple3] [h=7d26cd] -\definecolor [purple4] [h=551a8b] -\definecolor [mediumpurple1] [h=ab82ff] -\definecolor [mediumpurple2] [h=9f79ee] -\definecolor [mediumpurple3] [h=8968cd] -\definecolor [mediumpurple4] [h=5d478b] -\definecolor [thistle1] [h=ffe1ff] -\definecolor [thistle2] [h=eed2ee] -\definecolor [thistle3] [h=cdb5cd] -\definecolor [thistle4] [h=8b7b8b] -\definecolor [gray0] [s=0.00] -\definecolor [grey0] [gray0] -\definecolor [gray1] [s=0.01] -\definecolor [grey1] [gray1] -\definecolor [gray2] [s=0.02] -\definecolor [grey2] [gray2] -\definecolor [gray3] [s=0.03] -\definecolor [grey3] [gray3] -\definecolor [gray4] [s=0.04] -\definecolor [grey4] [gray4] -\definecolor [gray5] [s=0.05] -\definecolor [grey5] [gray5] -\definecolor [gray6] [s=0.06] -\definecolor [grey6] [gray6] -\definecolor [gray7] [s=0.07] -\definecolor [grey7] [gray7] -\definecolor [gray8] [s=0.08] -\definecolor [grey8] [gray8] -\definecolor [gray9] [s=0.09] -\definecolor [grey9] [gray9] -\definecolor [gray10] [s=0.10] -\definecolor [grey10] [gray10] -\definecolor [gray11] [s=0.11] -\definecolor [grey11] [gray11] -\definecolor [gray12] [s=0.12] -\definecolor [grey12] [gray12] -\definecolor [gray13] [s=0.13] -\definecolor [grey13] [gray13] -\definecolor [gray14] [s=0.14] -\definecolor [grey14] [gray14] -\definecolor [gray15] [s=0.15] -\definecolor [grey15] [gray15] -\definecolor [gray16] [s=0.16] -\definecolor [grey16] [gray16] -\definecolor [gray17] [s=0.17] -\definecolor [grey17] [gray17] -\definecolor [gray18] [s=0.18] -\definecolor [grey18] [gray18] -\definecolor [gray19] [s=0.19] -\definecolor [grey19] [gray19] -\definecolor [gray20] [s=0.20] -\definecolor [grey20] [gray20] -\definecolor [gray21] [s=0.21] -\definecolor [grey21] [gray21] -\definecolor [gray22] [s=0.22] -\definecolor [grey22] [gray22] -\definecolor [gray23] [s=0.23] -\definecolor [grey23] [gray23] -\definecolor [gray24] [s=0.24] -\definecolor [grey24] [gray24] -\definecolor [gray25] [s=0.25] -\definecolor [grey25] [gray25] -\definecolor [gray26] [s=0.26] -\definecolor [grey26] [gray26] -\definecolor [gray27] [s=0.27] -\definecolor [grey27] [gray27] -\definecolor [gray28] [s=0.28] -\definecolor [grey28] [gray28] -\definecolor [gray29] [s=0.29] -\definecolor [grey29] [gray29] -\definecolor [gray30] [s=0.30] -\definecolor [grey30] [gray30] -\definecolor [gray31] [s=0.31] -\definecolor [grey31] [gray31] -\definecolor [gray32] [s=0.32] -\definecolor [grey32] [gray32] -\definecolor [gray33] [s=0.33] -\definecolor [grey33] [gray33] -\definecolor [gray34] [s=0.34] -\definecolor [grey34] [gray34] -\definecolor [gray35] [s=0.35] -\definecolor [grey35] [gray35] -\definecolor [gray36] [s=0.36] -\definecolor [grey36] [gray36] -\definecolor [gray37] [s=0.37] -\definecolor [grey37] [gray37] -\definecolor [gray38] [s=0.38] -\definecolor [grey38] [gray38] -\definecolor [gray39] [s=0.39] -\definecolor [grey39] [gray39] -\definecolor [gray40] [s=0.40] -\definecolor [grey40] [gray40] -\definecolor [gray41] [s=0.41] -\definecolor [grey41] [gray41] -\definecolor [gray42] [s=0.42] -\definecolor [grey42] [gray42] -\definecolor [gray43] [s=0.43] -\definecolor [grey43] [gray43] -\definecolor [gray44] [s=0.44] -\definecolor [grey44] [gray44] -\definecolor [gray45] [s=0.45] -\definecolor [grey45] [gray45] -\definecolor [gray46] [s=0.46] -\definecolor [grey46] [gray46] -\definecolor [gray47] [s=0.47] -\definecolor [grey47] [gray47] -\definecolor [gray48] [s=0.48] -\definecolor [grey48] [gray48] -\definecolor [gray49] [s=0.49] -\definecolor [grey49] [gray49] -\definecolor [gray50] [s=0.50] -\definecolor [grey50] [gray50] -\definecolor [gray51] [s=0.51] -\definecolor [grey51] [gray51] -\definecolor [gray52] [s=0.52] -\definecolor [grey52] [gray52] -\definecolor [gray53] [s=0.53] -\definecolor [grey53] [gray53] -\definecolor [gray54] [s=0.54] -\definecolor [grey54] [gray54] -\definecolor [gray55] [s=0.55] -\definecolor [grey55] [gray55] -\definecolor [gray56] [s=0.56] -\definecolor [grey56] [gray56] -\definecolor [gray57] [s=0.57] -\definecolor [grey57] [gray57] -\definecolor [gray58] [s=0.58] -\definecolor [grey58] [gray58] -\definecolor [gray59] [s=0.59] -\definecolor [grey59] [gray59] -\definecolor [gray60] [s=0.60] -\definecolor [grey60] [gray60] -\definecolor [gray61] [s=0.61] -\definecolor [grey61] [gray61] -\definecolor [gray62] [s=0.62] -\definecolor [grey62] [gray62] -\definecolor [gray63] [s=0.63] -\definecolor [grey63] [gray63] -\definecolor [gray64] [s=0.64] -\definecolor [grey64] [gray64] -\definecolor [gray65] [s=0.65] -\definecolor [grey65] [gray65] -\definecolor [gray66] [s=0.66] -\definecolor [grey66] [gray66] -\definecolor [gray67] [s=0.67] -\definecolor [grey67] [gray67] -\definecolor [gray68] [s=0.68] -\definecolor [grey68] [gray68] -\definecolor [gray69] [s=0.69] -\definecolor [grey69] [gray69] -\definecolor [gray70] [s=0.70] -\definecolor [grey70] [gray70] -\definecolor [gray71] [s=0.71] -\definecolor [grey71] [gray71] -\definecolor [gray72] [s=0.72] -\definecolor [grey72] [gray72] -\definecolor [gray73] [s=0.73] -\definecolor [grey73] [gray73] -\definecolor [gray74] [s=0.74] -\definecolor [grey74] [gray74] -\definecolor [gray75] [s=0.75] -\definecolor [grey75] [gray75] -\definecolor [gray76] [s=0.76] -\definecolor [grey76] [gray76] -\definecolor [gray77] [s=0.77] -\definecolor [grey77] [gray77] -\definecolor [gray78] [s=0.78] -\definecolor [grey78] [gray78] -\definecolor [gray79] [s=0.79] -\definecolor [grey79] [gray79] -\definecolor [gray80] [s=0.80] -\definecolor [grey80] [gray80] -\definecolor [gray81] [s=0.81] -\definecolor [grey81] [gray81] -\definecolor [gray82] [s=0.82] -\definecolor [grey82] [gray82] -\definecolor [gray83] [s=0.83] -\definecolor [grey83] [gray83] -\definecolor [gray84] [s=0.84] -\definecolor [grey84] [gray84] -\definecolor [gray85] [s=0.85] -\definecolor [grey85] [gray85] -\definecolor [gray86] [s=0.86] -\definecolor [grey86] [gray86] -\definecolor [gray87] [s=0.87] -\definecolor [grey87] [gray87] -\definecolor [gray88] [s=0.88] -\definecolor [grey88] [gray88] -\definecolor [gray89] [s=0.89] -\definecolor [grey89] [gray89] -\definecolor [gray90] [s=0.90] -\definecolor [grey90] [gray90] -\definecolor [gray91] [s=0.91] -\definecolor [grey91] [gray91] -\definecolor [gray92] [s=0.92] -\definecolor [grey92] [gray92] -\definecolor [gray93] [s=0.93] -\definecolor [grey93] [gray93] -\definecolor [gray94] [s=0.94] -\definecolor [grey94] [gray94] -\definecolor [gray95] [s=0.95] -\definecolor [grey95] [gray95] -\definecolor [gray96] [s=0.96] -\definecolor [grey96] [gray96] -\definecolor [gray97] [s=0.97] -\definecolor [grey97] [gray97] -\definecolor [gray98] [s=0.98] -\definecolor [grey98] [gray98] -\definecolor [gray99] [s=0.99] -\definecolor [grey99] [gray99] -\definecolor [gray100] [s=1.00] -\definecolor [grey100] [gray100] -\definecolor [darkgrey] [s=0.66] -\definecolor [darkgray] [darkgrey] -\definecolor [darkblue] [h=00008b] -\definecolor [darkcyan] [h=008b8b] -\definecolor [darkmagenta] [h=8b008b] -\definecolor [darkred] [h=8b0000] -\definecolor [lightgreen] [h=90ee90] - -\endinput diff --git a/tex/context/base/colo-xwi.mkii b/tex/context/base/colo-xwi.mkii new file mode 100644 index 000000000..81e09d871 --- /dev/null +++ b/tex/context/base/colo-xwi.mkii @@ -0,0 +1,142 @@ +%D \module +%D [ file=colo-xwi, +%D version=1995.01.01, +%D title=\CONTEXT\ Color Macros, +%D subtitle=X Windows, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 I've forgotten where I got these definitions from, but maybe +%D they can be of use. + +\definecolor [aliceblue] [r=0.94,g=0.97,b=1.00] +\definecolor [antiquewhite] [r=0.98,g=0.92,b=0.84] +\definecolor [aquamarine] [r=0.50,g=1.00,b=0.83] +\definecolor [azure] [r=0.94,g=1.00,b=1.00] +\definecolor [beige] [r=0.96,g=0.96,b=0.86] +\definecolor [bisque] [r=1.00,g=0.89,b=0.77] +\definecolor [black] [s=0] % [r=0.00,g=0.00,b=0.00] +\definecolor [blanchedalmond] [r=1.00,g=0.92,b=0.80] +\definecolor [blue] [r=0.00,g=0.00,b=1.00] +\definecolor [blueviolet] [r=0.54,g=0.17,b=0.89] +\definecolor [brown] [r=0.65,g=0.16,b=0.16] +\definecolor [burlywood] [r=0.87,g=0.72,b=0.53] +\definecolor [cadetblue] [r=0.37,g=0.62,b=0.63] +\definecolor [chartreuse] [r=0.50,g=1.00,b=0.00] +\definecolor [chocolate] [r=0.82,g=0.41,b=0.12] +\definecolor [coral] [r=1.00,g=0.50,b=0.31] +\definecolor [cornflowerblue] [r=0.39,g=0.58,b=0.93] +\definecolor [cornsilk] [r=1.00,g=0.97,b=0.86] +\definecolor [cyan] [r=0.00,g=1.00,b=1.00] +\definecolor [darkgoldenrod] [r=0.72,g=0.53,b=0.04] +\definecolor [darkgreen] [r=0.00,g=0.39,b=0.00] +\definecolor [darkkhaki] [r=0.74,g=0.72,b=0.42] +\definecolor [darkolivegreen] [r=0.33,g=0.42,b=0.18] +\definecolor [darkorange] [r=1.00,g=0.55,b=0.00] +\definecolor [darkorchid] [r=0.60,g=0.20,b=0.80] +\definecolor [darksalmon] [r=0.91,g=0.59,b=0.48] +\definecolor [darkseagreen] [r=0.56,g=0.74,b=0.56] +\definecolor [darkslateblue] [r=0.28,g=0.24,b=0.55] +\definecolor [darkturquoise] [r=0.00,g=0.81,b=0.82] +\definecolor [darkviolet] [r=0.58,g=0.00,b=0.83] +\definecolor [deeppink] [r=1.00,g=0.08,b=0.58] +\definecolor [deepskyblue] [r=0.00,g=0.75,b=1.00] +\definecolor [dodgerblue] [r=0.12,g=0.56,b=1.00] +\definecolor [firebrick] [r=0.70,g=0.13,b=0.13] +\definecolor [floralwhite] [r=1.00,g=0.98,b=0.94] +\definecolor [forestgreen] [r=0.13,g=0.55,b=0.13] +\definecolor [gainsboro] [r=0.86,g=0.86,b=0.86] +\definecolor [ghostwhite] [r=0.97,g=0.97,b=1.00] +\definecolor [gold] [r=1.00,g=0.84,b=0.00] +\definecolor [goldenrod] [r=0.85,g=0.65,b=0.13] +\definecolor [green] [r=0.00,g=1.00,b=0.00] +\definecolor [greenyellow] [r=0.68,g=1.00,b=0.18] +\definecolor [honeydew] [r=0.94,g=1.00,b=0.94] +\definecolor [hotpink] [r=1.00,g=0.41,b=0.71] +\definecolor [indianred] [r=0.80,g=0.36,b=0.36] +\definecolor [ivory] [r=1.00,g=1.00,b=0.94] +\definecolor [khaki] [r=0.94,g=0.90,b=0.55] +\definecolor [lavender] [r=0.90,g=0.90,b=0.98] +\definecolor [lavenderblush] [r=1.00,g=0.94,b=0.96] +\definecolor [lawngreen] [r=0.49,g=0.99,b=0.00] +\definecolor [lemonchiffon] [r=1.00,g=0.98,b=0.80] +\definecolor [lightblue] [r=0.68,g=0.85,b=0.90] +\definecolor [lightcoral] [r=0.94,g=0.50,b=0.50] +\definecolor [lightcyan] [r=0.88,g=1.00,b=1.00] +\definecolor [lightgoldenrod] [r=0.93,g=0.87,b=0.51] +\definecolor [lightgoldenrodyellow] [r=0.98,g=0.98,b=0.82] +\definecolor [lightpink] [r=1.00,g=0.71,b=0.76] +\definecolor [lightsalmon] [r=1.00,g=0.63,b=0.48] +\definecolor [lightseagreen] [r=0.13,g=0.70,b=0.67] +\definecolor [lightskyblue] [r=0.53,g=0.81,b=0.98] +\definecolor [lightslateblue] [r=0.52,g=0.44,b=1.00] +\definecolor [lightsteelblue] [r=0.69,g=0.77,b=0.87] +\definecolor [lightyellow] [r=1.00,g=1.00,b=0.88] +\definecolor [limegreen] [r=0.20,g=0.80,b=0.20] +\definecolor [linen] [r=0.98,g=0.94,b=0.90] +\definecolor [magenta] [r=1.00,g=0.00,b=1.00] +\definecolor [maroon] [r=0.69,g=0.19,b=0.38] +\definecolor [mediumaquamarine] [r=0.40,g=0.80,b=0.67] +\definecolor [mediumblue] [r=0.00,g=0.00,b=0.80] +\definecolor [mediumorchid] [r=0.73,g=0.33,b=0.83] +\definecolor [mediumpurple] [r=0.58,g=0.44,b=0.86] +\definecolor [mediumseagreen] [r=0.24,g=0.70,b=0.44] +\definecolor [mediumslateblue] [r=0.48,g=0.41,b=0.93] +\definecolor [mediumspringgreen] [r=0.00,g=0.98,b=0.60] +\definecolor [mediumturquoise] [r=0.28,g=0.82,b=0.80] +\definecolor [mediumvioletred] [r=0.78,g=0.08,b=0.52] +\definecolor [midnightblue] [r=0.10,g=0.10,b=0.44] +\definecolor [mintcream] [r=0.96,g=1.00,b=0.98] +\definecolor [mistyrose] [r=1.00,g=0.89,b=0.88] +\definecolor [moccasin] [r=1.00,g=0.89,b=0.71] +\definecolor [navajowhite] [r=1.00,g=0.87,b=0.68] +\definecolor [navy] [r=0.00,g=0.00,b=0.50] +\definecolor [navyblue] [r=0.00,g=0.00,b=0.50] +\definecolor [oldlace] [r=0.99,g=0.96,b=0.90] +\definecolor [olivedrab] [r=0.42,g=0.56,b=0.14] +\definecolor [orange] [r=1.00,g=0.65,b=0.00] +\definecolor [orangered] [r=1.00,g=0.27,b=0.00] +\definecolor [orchid] [r=0.85,g=0.44,b=0.84] +\definecolor [palegoldenrod] [r=0.93,g=0.91,b=0.67] +\definecolor [palegreen] [r=0.60,g=0.98,b=0.60] +\definecolor [paleturquoise] [r=0.69,g=0.93,b=0.93] +\definecolor [palevioletred] [r=0.86,g=0.44,b=0.58] +\definecolor [papayawhip] [r=1.00,g=0.94,b=0.84] +\definecolor [peachpuff] [r=1.00,g=0.85,b=0.73] +\definecolor [peru] [r=0.80,g=0.52,b=0.25] +\definecolor [pink] [r=1.00,g=0.75,b=0.80] +\definecolor [plum] [r=0.87,g=0.63,b=0.87] +\definecolor [powderblue] [r=0.69,g=0.88,b=0.90] +\definecolor [purple] [r=0.63,g=0.13,b=0.94] +\definecolor [red ] [r=1.00,g=0.00,b=0.00] +\definecolor [rosybrown] [r=0.74,g=0.56,b=0.56] +\definecolor [royalblue] [r=0.25,g=0.41,b=0.88] +\definecolor [saddlebrown] [r=0.55,g=0.27,b=0.07] +\definecolor [salmon] [r=0.98,g=0.50,b=0.45] +\definecolor [sandybrown] [r=0.96,g=0.64,b=0.38] +\definecolor [seagreen] [r=0.18,g=0.55,b=0.34] +\definecolor [seashell] [r=1.00,g=0.96,b=0.93] +\definecolor [sienna] [r=0.63,g=0.32,b=0.18] +\definecolor [skyblue] [r=0.53,g=0.81,b=0.92] +\definecolor [slateblue] [r=0.42,g=0.35,b=0.80] +\definecolor [snow] [r=1.00,g=0.98,b=0.98] +\definecolor [springgreen] [r=0.00,g=1.00,b=0.50] +\definecolor [steelblue] [r=0.27,g=0.51,b=0.71] +\definecolor [tan ] [r=0.82,g=0.71,b=0.55] +\definecolor [thistle] [r=0.85,g=0.75,b=0.85] +\definecolor [tomato] [r=1.00,g=0.39,b=0.28] +\definecolor [turquoise] [r=0.25,g=0.88,b=0.82] +\definecolor [violet] [r=0.93,g=0.51,b=0.93] +\definecolor [violetred] [r=0.82,g=0.13,b=0.56] +\definecolor [wheat] [r=0.96,g=0.87,b=0.70] +\definecolor [white] [r=1.00,g=1.00,b=1.00] +\definecolor [whitesmoke] [s=0.96] % [r=0.96,g=0.96,b=0.96] +\definecolor [yellow] [r=1.00,g=1.00,b=0.00] +\definecolor [yellowgreen] [r=0.60,g=0.80,b=0.20] + +\endinput diff --git a/tex/context/base/colo-xwi.tex b/tex/context/base/colo-xwi.tex deleted file mode 100644 index 81e09d871..000000000 --- a/tex/context/base/colo-xwi.tex +++ /dev/null @@ -1,142 +0,0 @@ -%D \module -%D [ file=colo-xwi, -%D version=1995.01.01, -%D title=\CONTEXT\ Color Macros, -%D subtitle=X Windows, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 I've forgotten where I got these definitions from, but maybe -%D they can be of use. - -\definecolor [aliceblue] [r=0.94,g=0.97,b=1.00] -\definecolor [antiquewhite] [r=0.98,g=0.92,b=0.84] -\definecolor [aquamarine] [r=0.50,g=1.00,b=0.83] -\definecolor [azure] [r=0.94,g=1.00,b=1.00] -\definecolor [beige] [r=0.96,g=0.96,b=0.86] -\definecolor [bisque] [r=1.00,g=0.89,b=0.77] -\definecolor [black] [s=0] % [r=0.00,g=0.00,b=0.00] -\definecolor [blanchedalmond] [r=1.00,g=0.92,b=0.80] -\definecolor [blue] [r=0.00,g=0.00,b=1.00] -\definecolor [blueviolet] [r=0.54,g=0.17,b=0.89] -\definecolor [brown] [r=0.65,g=0.16,b=0.16] -\definecolor [burlywood] [r=0.87,g=0.72,b=0.53] -\definecolor [cadetblue] [r=0.37,g=0.62,b=0.63] -\definecolor [chartreuse] [r=0.50,g=1.00,b=0.00] -\definecolor [chocolate] [r=0.82,g=0.41,b=0.12] -\definecolor [coral] [r=1.00,g=0.50,b=0.31] -\definecolor [cornflowerblue] [r=0.39,g=0.58,b=0.93] -\definecolor [cornsilk] [r=1.00,g=0.97,b=0.86] -\definecolor [cyan] [r=0.00,g=1.00,b=1.00] -\definecolor [darkgoldenrod] [r=0.72,g=0.53,b=0.04] -\definecolor [darkgreen] [r=0.00,g=0.39,b=0.00] -\definecolor [darkkhaki] [r=0.74,g=0.72,b=0.42] -\definecolor [darkolivegreen] [r=0.33,g=0.42,b=0.18] -\definecolor [darkorange] [r=1.00,g=0.55,b=0.00] -\definecolor [darkorchid] [r=0.60,g=0.20,b=0.80] -\definecolor [darksalmon] [r=0.91,g=0.59,b=0.48] -\definecolor [darkseagreen] [r=0.56,g=0.74,b=0.56] -\definecolor [darkslateblue] [r=0.28,g=0.24,b=0.55] -\definecolor [darkturquoise] [r=0.00,g=0.81,b=0.82] -\definecolor [darkviolet] [r=0.58,g=0.00,b=0.83] -\definecolor [deeppink] [r=1.00,g=0.08,b=0.58] -\definecolor [deepskyblue] [r=0.00,g=0.75,b=1.00] -\definecolor [dodgerblue] [r=0.12,g=0.56,b=1.00] -\definecolor [firebrick] [r=0.70,g=0.13,b=0.13] -\definecolor [floralwhite] [r=1.00,g=0.98,b=0.94] -\definecolor [forestgreen] [r=0.13,g=0.55,b=0.13] -\definecolor [gainsboro] [r=0.86,g=0.86,b=0.86] -\definecolor [ghostwhite] [r=0.97,g=0.97,b=1.00] -\definecolor [gold] [r=1.00,g=0.84,b=0.00] -\definecolor [goldenrod] [r=0.85,g=0.65,b=0.13] -\definecolor [green] [r=0.00,g=1.00,b=0.00] -\definecolor [greenyellow] [r=0.68,g=1.00,b=0.18] -\definecolor [honeydew] [r=0.94,g=1.00,b=0.94] -\definecolor [hotpink] [r=1.00,g=0.41,b=0.71] -\definecolor [indianred] [r=0.80,g=0.36,b=0.36] -\definecolor [ivory] [r=1.00,g=1.00,b=0.94] -\definecolor [khaki] [r=0.94,g=0.90,b=0.55] -\definecolor [lavender] [r=0.90,g=0.90,b=0.98] -\definecolor [lavenderblush] [r=1.00,g=0.94,b=0.96] -\definecolor [lawngreen] [r=0.49,g=0.99,b=0.00] -\definecolor [lemonchiffon] [r=1.00,g=0.98,b=0.80] -\definecolor [lightblue] [r=0.68,g=0.85,b=0.90] -\definecolor [lightcoral] [r=0.94,g=0.50,b=0.50] -\definecolor [lightcyan] [r=0.88,g=1.00,b=1.00] -\definecolor [lightgoldenrod] [r=0.93,g=0.87,b=0.51] -\definecolor [lightgoldenrodyellow] [r=0.98,g=0.98,b=0.82] -\definecolor [lightpink] [r=1.00,g=0.71,b=0.76] -\definecolor [lightsalmon] [r=1.00,g=0.63,b=0.48] -\definecolor [lightseagreen] [r=0.13,g=0.70,b=0.67] -\definecolor [lightskyblue] [r=0.53,g=0.81,b=0.98] -\definecolor [lightslateblue] [r=0.52,g=0.44,b=1.00] -\definecolor [lightsteelblue] [r=0.69,g=0.77,b=0.87] -\definecolor [lightyellow] [r=1.00,g=1.00,b=0.88] -\definecolor [limegreen] [r=0.20,g=0.80,b=0.20] -\definecolor [linen] [r=0.98,g=0.94,b=0.90] -\definecolor [magenta] [r=1.00,g=0.00,b=1.00] -\definecolor [maroon] [r=0.69,g=0.19,b=0.38] -\definecolor [mediumaquamarine] [r=0.40,g=0.80,b=0.67] -\definecolor [mediumblue] [r=0.00,g=0.00,b=0.80] -\definecolor [mediumorchid] [r=0.73,g=0.33,b=0.83] -\definecolor [mediumpurple] [r=0.58,g=0.44,b=0.86] -\definecolor [mediumseagreen] [r=0.24,g=0.70,b=0.44] -\definecolor [mediumslateblue] [r=0.48,g=0.41,b=0.93] -\definecolor [mediumspringgreen] [r=0.00,g=0.98,b=0.60] -\definecolor [mediumturquoise] [r=0.28,g=0.82,b=0.80] -\definecolor [mediumvioletred] [r=0.78,g=0.08,b=0.52] -\definecolor [midnightblue] [r=0.10,g=0.10,b=0.44] -\definecolor [mintcream] [r=0.96,g=1.00,b=0.98] -\definecolor [mistyrose] [r=1.00,g=0.89,b=0.88] -\definecolor [moccasin] [r=1.00,g=0.89,b=0.71] -\definecolor [navajowhite] [r=1.00,g=0.87,b=0.68] -\definecolor [navy] [r=0.00,g=0.00,b=0.50] -\definecolor [navyblue] [r=0.00,g=0.00,b=0.50] -\definecolor [oldlace] [r=0.99,g=0.96,b=0.90] -\definecolor [olivedrab] [r=0.42,g=0.56,b=0.14] -\definecolor [orange] [r=1.00,g=0.65,b=0.00] -\definecolor [orangered] [r=1.00,g=0.27,b=0.00] -\definecolor [orchid] [r=0.85,g=0.44,b=0.84] -\definecolor [palegoldenrod] [r=0.93,g=0.91,b=0.67] -\definecolor [palegreen] [r=0.60,g=0.98,b=0.60] -\definecolor [paleturquoise] [r=0.69,g=0.93,b=0.93] -\definecolor [palevioletred] [r=0.86,g=0.44,b=0.58] -\definecolor [papayawhip] [r=1.00,g=0.94,b=0.84] -\definecolor [peachpuff] [r=1.00,g=0.85,b=0.73] -\definecolor [peru] [r=0.80,g=0.52,b=0.25] -\definecolor [pink] [r=1.00,g=0.75,b=0.80] -\definecolor [plum] [r=0.87,g=0.63,b=0.87] -\definecolor [powderblue] [r=0.69,g=0.88,b=0.90] -\definecolor [purple] [r=0.63,g=0.13,b=0.94] -\definecolor [red ] [r=1.00,g=0.00,b=0.00] -\definecolor [rosybrown] [r=0.74,g=0.56,b=0.56] -\definecolor [royalblue] [r=0.25,g=0.41,b=0.88] -\definecolor [saddlebrown] [r=0.55,g=0.27,b=0.07] -\definecolor [salmon] [r=0.98,g=0.50,b=0.45] -\definecolor [sandybrown] [r=0.96,g=0.64,b=0.38] -\definecolor [seagreen] [r=0.18,g=0.55,b=0.34] -\definecolor [seashell] [r=1.00,g=0.96,b=0.93] -\definecolor [sienna] [r=0.63,g=0.32,b=0.18] -\definecolor [skyblue] [r=0.53,g=0.81,b=0.92] -\definecolor [slateblue] [r=0.42,g=0.35,b=0.80] -\definecolor [snow] [r=1.00,g=0.98,b=0.98] -\definecolor [springgreen] [r=0.00,g=1.00,b=0.50] -\definecolor [steelblue] [r=0.27,g=0.51,b=0.71] -\definecolor [tan ] [r=0.82,g=0.71,b=0.55] -\definecolor [thistle] [r=0.85,g=0.75,b=0.85] -\definecolor [tomato] [r=1.00,g=0.39,b=0.28] -\definecolor [turquoise] [r=0.25,g=0.88,b=0.82] -\definecolor [violet] [r=0.93,g=0.51,b=0.93] -\definecolor [violetred] [r=0.82,g=0.13,b=0.56] -\definecolor [wheat] [r=0.96,g=0.87,b=0.70] -\definecolor [white] [r=1.00,g=1.00,b=1.00] -\definecolor [whitesmoke] [s=0.96] % [r=0.96,g=0.96,b=0.96] -\definecolor [yellow] [r=1.00,g=1.00,b=0.00] -\definecolor [yellowgreen] [r=0.60,g=0.80,b=0.20] - -\endinput diff --git a/tex/context/base/cont-cs.mkii b/tex/context/base/cont-cs.mkii new file mode 100644 index 000000000..82980acc2 --- /dev/null +++ b/tex/context/base/cont-cs.mkii @@ -0,0 +1,26 @@ +%D \module +%D [ file=cont-cs, +%D version=1998.12.02, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Czech Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{czech} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!cs] + +\ifnum\texengine=\luatexengine \else + \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] +\fi + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-cs.mkiv b/tex/context/base/cont-cs.mkiv new file mode 100644 index 000000000..552bc5f51 --- /dev/null +++ b/tex/context/base/cont-cs.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-cs, +%D version=1998.12.02, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Czech Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{czech} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!cs] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-cs.tex b/tex/context/base/cont-cs.tex deleted file mode 100644 index 10fd16748..000000000 --- a/tex/context/base/cont-cs.tex +++ /dev/null @@ -1,37 +0,0 @@ -%D \module -%D [ file=cont-cs, -%D version=1998.12.02, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ Czech Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{czech} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!cs] - -\installlanguage [\s!en] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!sk] [\c!state=\v!start] -\installlanguage [\s!cs] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-de.mkii b/tex/context/base/cont-de.mkii new file mode 100644 index 000000000..3aec10a93 --- /dev/null +++ b/tex/context/base/cont-de.mkii @@ -0,0 +1,26 @@ +%D \module +%D [ file=cont-de, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ German Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{german} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!de] + +\ifnum\texengine=\luatexengine \else + \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] +\fi + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-de.mkiv b/tex/context/base/cont-de.mkiv new file mode 100644 index 000000000..43251a206 --- /dev/null +++ b/tex/context/base/cont-de.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-de, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ German Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{german} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!de] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-de.tex b/tex/context/base/cont-de.tex deleted file mode 100644 index 19743527e..000000000 --- a/tex/context/base/cont-de.tex +++ /dev/null @@ -1,42 +0,0 @@ -%D \module -%D [ file=cont-de, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ German Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{german} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!de] - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!nl] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] - -\installlanguage [deo] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-en.mkii b/tex/context/base/cont-en.mkii new file mode 100644 index 000000000..5e91365bd --- /dev/null +++ b/tex/context/base/cont-en.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=cont-en, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ English Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!en] + +\setupencoding[default=ec] + +\usetypescript[fallback][\defaultencoding] + +\setupbodyfont[rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-en.mkiv b/tex/context/base/cont-en.mkiv new file mode 100644 index 000000000..88724ca8f --- /dev/null +++ b/tex/context/base/cont-en.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-en, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ English Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!en] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-en.tex b/tex/context/base/cont-en.tex deleted file mode 100644 index 42ad12b1a..000000000 --- a/tex/context/base/cont-en.tex +++ /dev/null @@ -1,44 +0,0 @@ -%D \module -%D [ file=cont-en, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ English Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!en] - -% Do we need more defaults? or maybe all languages? - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!pt] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] -\installlanguage [\s!nl] [\c!state=\v!start] -\installlanguage [\s!cs] [\c!state=\v!start] -\installlanguage [\s!sk] [\c!state=\v!start] -\installlanguage [\s!pl] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine -% \prependtoks -% \the \everysetupdocument -% \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-fr.mkii b/tex/context/base/cont-fr.mkii new file mode 100644 index 000000000..aea4cb625 --- /dev/null +++ b/tex/context/base/cont-fr.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=cont-de, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ French Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!fr] + +\setupencoding[default=ec] + +\usetypescript[fallback][\defaultencoding] + +\setupbodyfont[rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-fr.mkiv b/tex/context/base/cont-fr.mkiv new file mode 100644 index 000000000..5de684314 --- /dev/null +++ b/tex/context/base/cont-fr.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-de, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ French Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!fr] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-fr.tex b/tex/context/base/cont-fr.tex deleted file mode 100644 index 0b9b98df2..000000000 --- a/tex/context/base/cont-fr.tex +++ /dev/null @@ -1,40 +0,0 @@ -%D \module -%D [ file=cont-de, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ French Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!fr] - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!nl] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-gb.mkii b/tex/context/base/cont-gb.mkii new file mode 100644 index 000000000..24f52416d --- /dev/null +++ b/tex/context/base/cont-gb.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=cont-uk, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ English Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!gb] + +\setupencoding[default=ec] + +\usetypescript[fallback][\defaultencoding] + +\setupbodyfont[rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-gb.mkiv b/tex/context/base/cont-gb.mkiv new file mode 100644 index 000000000..ed4f65b66 --- /dev/null +++ b/tex/context/base/cont-gb.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-uk, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ English Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!gb] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-gb.tex b/tex/context/base/cont-gb.tex deleted file mode 100644 index bd18f20ff..000000000 --- a/tex/context/base/cont-gb.tex +++ /dev/null @@ -1,40 +0,0 @@ -%D \module -%D [ file=cont-uk, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ English Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{english} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!gb] - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!nl] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-it.mkii b/tex/context/base/cont-it.mkii new file mode 100644 index 000000000..5c8163a4e --- /dev/null +++ b/tex/context/base/cont-it.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=cont-it, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Italian Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!it] + +\setupencoding[default=ec] + +\usetypescript[fallback][\defaultencoding] + +\setupbodyfont[rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-it.mkiv b/tex/context/base/cont-it.mkiv new file mode 100644 index 000000000..02e831891 --- /dev/null +++ b/tex/context/base/cont-it.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-it, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Italian Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!it] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-it.tex b/tex/context/base/cont-it.tex deleted file mode 100644 index 03a1e5175..000000000 --- a/tex/context/base/cont-it.tex +++ /dev/null @@ -1,39 +0,0 @@ -%D \module -%D [ file=cont-it, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ Italian Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{italian} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!it] - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-log.mkii b/tex/context/base/cont-log.mkii new file mode 100644 index 000000000..c89a2dd8f --- /dev/null +++ b/tex/context/base/cont-log.mkii @@ -0,0 +1,304 @@ +%D \module +%D [ file=cont-log, +%D version=1995.10.10, +%D title=\CONTEXT\ Miscellaneous Macros, +%D subtitle=\TEX\ Logos, +%D author=J. Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 TeX Logos} + +%D The system that is used to typeset this text is called \TEX, +%D typeset with an lowered~E. From te beginning of \TEX, +%D authors of macro packages adapted this raising and lowering +%D style. In this module we define some of those logos. + +%D The Computer Modern detection hack is gone as we now have Latin +%D Modern which has more kerning pairs. + +\unprotect + +\def\Mkern#1% + {{\setbox\scratchbox\hbox{M}\kern#1\wd\scratchbox}} + +\unexpanded\def\TeX + {T% + \Mkern{-.1667}\lower.5ex\hbox{E}% + \Mkern{-.125}X} + +\unexpanded\def\ConTeXt{Con\TeX t} +\unexpanded\def\PPCHTeX{ppch\TeX} +\unexpanded\def\PRAGMA {Pragma ADE} + +\unexpanded\def\LaTeX % requested by erik frambach + {{\setbox\scratchbox\hbox{L}% + \scratchdimen\ht\scratchbox + \setbox\scratchbox\hbox{\txx A}% + L\kern-.55\wd\scratchbox + \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}% + \kern-.2\wd\scratchbox\TeX}} + +\unexpanded\def\TaBlE + {T% + \kern-.27em\lower.5ex\hbox{A}% + \kern-.18emB% + \kern-.1em\lower.5ex\hbox{L}% + \kern-.075emE} + +\unexpanded\def\PiCTeX + {P% + \kern-.12em\lower.5ex\hbox{I}% + \kern-.075em C% + \kern-.11em\TeX} + +\def\AMSswitch#1% + {$\cal\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$} + +\unexpanded\def\AmSTeX + {\AMSswitch A% + \kern-.1667em\lower.5ex\hbox{\AMSswitch M}% + \kern-.125em\AMSswitch S% + -\TeX} + +\unexpanded\def\LamSTeX + {L% + \kern-.4em\raise.3ex\hbox{\AMSswitch A}% + \kern-.25em\lower.4ex\hbox{\AMSswitch M}% + \kern-.1em{\AMSswitch S}% + -\TeX} + +\unexpanded\def\AmSLaTeX + {\AMSswitch A% + \kern-.1667em\lower.5ex\hbox{\AMSswitch M}% + \kern-.125em\AMSswitch S% + -\LaTeX} + +%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version: +%D +%D \def\Context +%D {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern +%D -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}} +%D +%D I changed this into one that adapts itself: + +\unexpanded\def\Context + {{C\kern -.0667em\getscaledglyph{.8}\empty{O\kern -.0667emN\kern + -.0549emT\doifitalicelse{\kern-.1em}{\kern-.1667em}\lower.5ex\hbox + {E}\doifitalicelse\empty{\kern-.11em}X\kern-.055emT}}} + +%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the +%D current fontsize, an ugly but usefull hack. + +% rather hard coded +% +% \loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol] +% +% \unexpanded\def\setMFPfont +% {\font\logofont=logo% +% \ifnum\fam=\bffam\c!bf\else +% \ifnum\fam=\slfam\c!sl\else +% \ifnum\fam=\itfam\c!sl\else +% \ifnum\fam=\bsfam\c!bf\else +% \ifnum\fam=\bifam\c!bf\else +% \fi\fi\fi\fi\fi +% 10 at \currentfontscale\bodyfontsize +% \logofont} +% +% or: +% +% \definefontsynonym [MetaLogo] [logo10] +% \definefontsynonym [MetaLogoBold] [logobf10] +% \definefontsynonym [MetaLogoSlanted] [logosl10] +% \definefontsynonym [MetaLogoItalic] [logosl10] +% \definefontsynonym [MetaLogoBoldSlanted] [logobf10] +% \definefontsynonym [MetaLogoBoldtalic] [logobf10] +% +% \loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol] +% +% \def\setMFPfont{\symbolicfont{MetaLogo}} + +\let\logofont\nullfont + +\loadmapfile[original-base.map] + +\unexpanded\def\setMFPfont% more sensitive for low level changes + {\font\logofont=logo% + \ifx\fontalternative\c!bf\else + \ifx\fontalternative\c!it\else + \ifx\fontalternative\c!sl\else + \ifx\fontalternative\c!bi\else + \ifx\fontalternative\c!bs\else + \fi\fi\fi\fi\fi + 10 at \currentfontscale\bodyfontsize + \logofont} + +%\unexpanded\def\MetaFont% +% {\hbox{\setMFPfont METAFONT}} +% +%\unexpanded\def\MetaPost% +% {\hbox{\setMFPfont METAPOST}} + +\def\MetaHyphen% there is no hyphenchar in this font + {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}} + +\unexpanded\def\MetaFont + {{\setMFPfont META\MetaHyphen FONT}} + +\unexpanded\def\MetaPost + {{\setMFPfont META\MetaHyphen POST}} + +\unexpanded\def\MetaFun + {MetaFun} + +%D \macros +%D {TEX, METAFONT, METAPOST, METAFUN, +%D PICTEX, TABLE, +%D CONTEXT, PPCHTEX, +%D AMSTEX, LATEX, LAMSTEX} +%D +%D We define the funny written ones as well as the less +%D error prone upper case names (in \CONTEXT\ we tend to +%D write all user defined commands, like abbreviations, in +%D uppercase.) + +\unexpanded\def\METAFONT {\MetaFont} +\unexpanded\def\METAPOST {\MetaPost} +\unexpanded\def\PPCHTEX {\PPCHTeX} +\unexpanded\def\CONTEXT {\ConTeXt} +\unexpanded\def\METAFUN {\MetaFun} + +\unexpanded\def\TEX {\TeX} +\unexpanded\def\LATEX {\LaTeX} +\unexpanded\def\PICTEX {\PiCTeX} +\unexpanded\def\TABLE {\TaBlE} +\unexpanded\def\AMSTEX {\AmSTeX} +\unexpanded\def\LAMSTEX {\LamSTeX} +\unexpanded\def\INRSTEX {inrs\TeX} + +%D And this is how they show up: \TeX, \MetaFont, \MetaPost, +%D \PiCTeX, \TaBlE, \ConTeXt, \PPCHTeX, \AmSTeX, \LaTeX, +%D \LamSTeX. + +%D Some placeholders: + +\unexpanded\def\eTeX {\mathematics{\varepsilon}-\TeX} +\unexpanded\def\pdfTeX {pdf\TeX} +\unexpanded\def\pdfeTeX{pdfe-\TeX} +\unexpanded\def\luaTeX {lua\TeX} +\unexpanded\def\metaTeX{meta\TeX} +\unexpanded\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX} + +% Adapted from a patch by Mojca: + +\def\@XeTeX@ + {\setbox\scratchbox\hbox{E}% + \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}} + +\ifnum\texengine=\pdftexengine + + \unexpanded\def\XeTeX + {X\lower.5ex + \hbox + {\kern-.15em + \ifx\fontalternative\c!bf\mirror{E}\else + \ifx\fontalternative\c!it \@XeTeX@\else + \ifx\fontalternative\c!sl \@XeTeX@\else + \ifx\fontalternative\c!bi \@XeTeX@\else + \ifx\fontalternative\c!bs \@XeTeX@\else + \mirror{E}\fi\fi\fi\fi\fi}% + \kern-.1667em \TeX} + +\else + + \unexpanded\def\XeTeX + {X\lower.5ex + \hbox + {\kern-.15em + \iffontchar\font"018E\relax + \char"018E% + \else + \ifx\fontalternative\c!bf\mirror{E}\else + \ifx\fontalternative\c!it \@XeTeX@\else + \ifx\fontalternative\c!sl \@XeTeX@\else + \ifx\fontalternative\c!bi \@XeTeX@\else + \ifx\fontalternative\c!bs \@XeTeX@\else + \mirror{E}\fi\fi\fi\fi\fi + \fi}% + \kern-.1667em \TeX} + +\fi + +\let\ETEX \eTeX +\let\PDFTEX \pdfTeX +\let\PDFETEX\pdfeTeX +\let\LUATEX \luaTeX +\let\LuaTeX \luaTeX +\let\XETEX \XeTeX + +\unexpanded\def\MkApproved % joke, not used so it might move + {\dontleavehmode\rotate + [\c!rotation={\ifnum\texengine=\luatexengine\ctxlua{tex.write(45-45*\the\luatexversion/100)}\else0\fi}, + \c!align=\v!middle, + \c!foregroundstyle=\v!type, + \c!foregroundcolor=darkred, + \c!frame=\v!on, + \c!offset=1ex, + \c!background=\v!color, + \c!backgroundcolor=lightgray, + \c!framecolor=darkred, + \c!rulethickness=2pt] + {Mk\ifnum\texengine=\luatexengine IV\else II\fi\\approved}} + +% \unexpanded\def\luaTeX +% {\dontleavehmode\begingroup +% Lua% +% \setbox0\hbox{oT}% +% \setbox2\hbox{o\kern0ptT}% +% \ifdim\wd0=\wd2 +% \setbox0\hbox dir TRT{To}% +% \setbox2\hbox{T\kern0pto}% +% \hskip\dimexpr\wd0-\wd2\relax +% \fi +% \TeX +% \endgroup} +% +% a further iteration from the list, patched again + +% \ifx\fontalternative\c!it -\else +% \ifx\fontalternative\c!sl -\else +% \ifx\fontalternative\c!bi -\else +% \ifx\fontalternative\c!bs -\fi\fi\fi\fi + +\def\LuaTeX + {\dontleavehmode + \begingroup + Lua% + % hope for kerning, try aT + \setbox0\hbox{aT}% + \setbox2\hbox{a\kern\zeropoint T}% + \ifdim\wd0=\wd2 % kerns can go two ways + % no aT kerning, try oT as a is not symmetrical + \setbox0\hbox{oT}% + \setbox2\hbox{o\kern\zeropoint T}% + \ifdim\wd0=\wd2 % kerns can go two ways + % no aT and oT kerning, try To + \setbox0\hbox{To}% + \setbox2\hbox{T\kern\zeropoint o}% + % maybe we need to compensate for the angle (sl/it/bs/bi) + \fi + \ifdim\wd0=\wd2\else + \kern\dimexpr\wd0-\wd2\relax + \fi + \fi + \TeX + \endgroup} + +\let\luaTeX \LuaTeX +\let\LUATEX \LuaTeX + +\protect \endinput diff --git a/tex/context/base/cont-log.mkiv b/tex/context/base/cont-log.mkiv new file mode 100644 index 000000000..158aee85c --- /dev/null +++ b/tex/context/base/cont-log.mkiv @@ -0,0 +1,249 @@ +%D \module +%D [ file=cont-log, +%D version=1995.10.10, +%D title=\CONTEXT\ Miscellaneous Macros, +%D subtitle=\TEX\ Logos, +%D author=J. Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 TeX Logos} + +%D The system that is used to typeset this text is called \TEX, +%D typeset with an lowered~E. From te beginning of \TEX, +%D authors of macro packages adapted this raising and lowering +%D style. In this module we define some of those logos. + +\unprotect + +\def\Mkern#1% + {{\setbox\scratchbox\hbox{M}\kern#1\wd\scratchbox}} + +\unexpanded\def\TeX + {T% + \Mkern{-.1667}\lower.5ex\hbox{E}% + \Mkern{-.125}X} + +\unexpanded\def\ConTeXt{Con\TeX t} +\unexpanded\def\PPCHTeX{ppch\TeX} +\unexpanded\def\PRAGMA {Pragma ADE} + +\unexpanded\def\LaTeX % requested by erik frambach + {{\setbox\scratchbox\hbox{L}% + \scratchdimen\ht\scratchbox + \setbox\scratchbox\hbox{\txx A}% + L\kern-.55\wd\scratchbox + \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}% + \kern-.2\wd\scratchbox\TeX}} + +\unexpanded\def\TaBlE + {T% + \kern-.27em\lower.5ex\hbox{A}% + \kern-.18emB% + \kern-.1em\lower.5ex\hbox{L}% + \kern-.075emE} + +\unexpanded\def\PiCTeX + {P% + \kern-.12em\lower.5ex\hbox{I}% + \kern-.075em C% + \kern-.11em\TeX} + +\def\AMSswitch#1% + {$\cal\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$} + +\unexpanded\def\AmSTeX + {\AMSswitch A% + \kern-.1667em\lower.5ex\hbox{\AMSswitch M}% + \kern-.125em\AMSswitch S% + -\TeX} + +\unexpanded\def\LamSTeX + {L% + \kern-.4em\raise.3ex\hbox{\AMSswitch A}% + \kern-.25em\lower.4ex\hbox{\AMSswitch M}% + \kern-.1em{\AMSswitch S}% + -\TeX} + +\unexpanded\def\AmSLaTeX + {\AMSswitch A% + \kern-.1667em\lower.5ex\hbox{\AMSswitch M}% + \kern-.125em\AMSswitch S% + -\LaTeX} + +%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version: +%D +%D \def\Context +%D {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern +%D -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}} +%D +%D I changed this into one that adapts itself: + +\unexpanded\def\Context + {{C\kern -.0667em\getscaledglyph{.8}\empty{O\kern -.0667emN\kern + -.0549emT\doifitalicelse{\kern-.1em}{\kern-.1667em}\lower.5ex\hbox + {E}\doifitalicelse\empty{\kern-.11em}X\kern-.055emT}}} + +%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the +%D current fontsize, an ugly but usefull hack. + +\let\logofont\nullfont + +\loadmapfile[original-base.map] + +\unexpanded\def\setMFPfont% more sensitive for low level changes + {\font\logofont=logo% + \ifx\fontalternative\c!bf\else + \ifx\fontalternative\c!it\else + \ifx\fontalternative\c!sl\else + \ifx\fontalternative\c!bi\else + \ifx\fontalternative\c!bs\else + \fi\fi\fi\fi\fi + 10 at \currentfontscale\bodyfontsize + \logofont} + +\def\MetaHyphen% there is no hyphenchar in this font + {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}} + +\unexpanded\def\MetaFont + {{\setMFPfont META\MetaHyphen FONT}} + +\unexpanded\def\MetaPost + {{\setMFPfont META\MetaHyphen POST}} + +\unexpanded\def\MetaFun + {MetaFun} + +%D \macros +%D {TEX, METAFONT, METAPOST, METAFUN, +%D PICTEX, TABLE, +%D CONTEXT, PPCHTEX, +%D AMSTEX, LATEX, LAMSTEX} +%D +%D We define the funny written ones as well as the less +%D error prone upper case names (in \CONTEXT\ we tend to +%D write all user defined commands, like abbreviations, in +%D uppercase.) + +\unexpanded\def\METAFONT {\MetaFont} +\unexpanded\def\METAPOST {\MetaPost} +\unexpanded\def\PPCHTEX {\PPCHTeX} +\unexpanded\def\CONTEXT {\ConTeXt} +\unexpanded\def\METAFUN {\MetaFun} + +\unexpanded\def\TEX {\TeX} +\unexpanded\def\LATEX {\LaTeX} +\unexpanded\def\PICTEX {\PiCTeX} +\unexpanded\def\TABLE {\TaBlE} +\unexpanded\def\AMSTEX {\AmSTeX} +\unexpanded\def\LAMSTEX {\LamSTeX} +\unexpanded\def\INRSTEX {inrs\TeX} + +%D And this is how they show up: \TeX, \MetaFont, \MetaPost, +%D \PiCTeX, \TaBlE, \ConTeXt, \PPCHTeX, \AmSTeX, \LaTeX, +%D \LamSTeX. + +%D Some placeholders: + +\unexpanded\def\eTeX {\mathematics{\varepsilon}-\TeX} +\unexpanded\def\pdfTeX {pdf\TeX} +\unexpanded\def\pdfeTeX{pdfe-\TeX} +\unexpanded\def\luaTeX {lua\TeX} +\unexpanded\def\metaTeX{meta\TeX} +\unexpanded\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX} + +% Adapted from a patch by Mojca: + +\def\@XeTeX@ + {\setbox\scratchbox\hbox{E}% + \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}} + +\unexpanded\def\XeTeX + {X\lower.5ex + \hbox + {\kern-.15em + \iffontchar\font"018E\relax + \char"018E% + \else + \ifx\fontalternative\c!bf\mirror{E}\else + \ifx\fontalternative\c!it \@XeTeX@\else + \ifx\fontalternative\c!sl \@XeTeX@\else + \ifx\fontalternative\c!bi \@XeTeX@\else + \ifx\fontalternative\c!bs \@XeTeX@\else + \mirror{E}\fi\fi\fi\fi\fi + \fi}% + \kern-.1667em \TeX} + +\let\ETEX \eTeX +\let\PDFTEX \pdfTeX +\let\PDFETEX\pdfeTeX +\let\LUATEX \luaTeX +\let\LuaTeX \luaTeX +\let\XETEX \XeTeX + +\unexpanded\def\MkApproved % joke, not used so it might move + {\dontleavehmode\rotate + [\c!rotation={\ifnum\texengine=\luatexengine\ctxlua{tex.write(45-45*\the\luatexversion/100)}\else0\fi}, + \c!align=\v!middle, + \c!foregroundstyle=\v!type, + \c!foregroundcolor=darkred, + \c!frame=\v!on, + \c!offset=1ex, + \c!background=\v!color, + \c!backgroundcolor=lightgray, + \c!framecolor=darkred, + \c!rulethickness=2pt] + {Mk\ifnum\texengine=\luatexengine IV\else II\fi\\approved}} + +% \unexpanded\def\luaTeX +% {\dontleavehmode\begingroup +% Lua% +% \setbox0\hbox{oT}% +% \setbox2\hbox{o\kern0ptT}% +% \ifdim\wd0=\wd2 +% \setbox0\hbox dir TRT{To}% +% \setbox2\hbox{T\kern0pto}% +% \hskip\dimexpr\wd0-\wd2\relax +% \fi +% \TeX +% \endgroup} +% +% a further iteration from the list, patched again + +% \ifx\fontalternative\c!it -\else +% \ifx\fontalternative\c!sl -\else +% \ifx\fontalternative\c!bi -\else +% \ifx\fontalternative\c!bs -\fi\fi\fi\fi + +\def\LuaTeX + {\dontleavehmode + \begingroup + Lua% + % hope for kerning, try aT + \setbox0\hbox{aT}% + \setbox2\hbox{a\kern\zeropoint T}% + \ifdim\wd0=\wd2 % kerns can go two ways + % no aT kerning, try oT as a is not symmetrical + \setbox0\hbox{oT}% + \setbox2\hbox{o\kern\zeropoint T}% + \ifdim\wd0=\wd2 % kerns can go two ways + % no aT and oT kerning, try To + \setbox0\hbox{To}% + \setbox2\hbox{T\kern\zeropoint o}% + % maybe we need to compensate for the angle (sl/it/bs/bi) + \fi + \ifdim\wd0=\wd2\else + \kern\dimexpr\wd0-\wd2\relax + \fi + \fi + \TeX + \endgroup} + +\let\luaTeX \LuaTeX +\let\LUATEX \LuaTeX + +\protect \endinput diff --git a/tex/context/base/cont-log.tex b/tex/context/base/cont-log.tex deleted file mode 100644 index c89a2dd8f..000000000 --- a/tex/context/base/cont-log.tex +++ /dev/null @@ -1,304 +0,0 @@ -%D \module -%D [ file=cont-log, -%D version=1995.10.10, -%D title=\CONTEXT\ Miscellaneous Macros, -%D subtitle=\TEX\ Logos, -%D author=J. Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 TeX Logos} - -%D The system that is used to typeset this text is called \TEX, -%D typeset with an lowered~E. From te beginning of \TEX, -%D authors of macro packages adapted this raising and lowering -%D style. In this module we define some of those logos. - -%D The Computer Modern detection hack is gone as we now have Latin -%D Modern which has more kerning pairs. - -\unprotect - -\def\Mkern#1% - {{\setbox\scratchbox\hbox{M}\kern#1\wd\scratchbox}} - -\unexpanded\def\TeX - {T% - \Mkern{-.1667}\lower.5ex\hbox{E}% - \Mkern{-.125}X} - -\unexpanded\def\ConTeXt{Con\TeX t} -\unexpanded\def\PPCHTeX{ppch\TeX} -\unexpanded\def\PRAGMA {Pragma ADE} - -\unexpanded\def\LaTeX % requested by erik frambach - {{\setbox\scratchbox\hbox{L}% - \scratchdimen\ht\scratchbox - \setbox\scratchbox\hbox{\txx A}% - L\kern-.55\wd\scratchbox - \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}% - \kern-.2\wd\scratchbox\TeX}} - -\unexpanded\def\TaBlE - {T% - \kern-.27em\lower.5ex\hbox{A}% - \kern-.18emB% - \kern-.1em\lower.5ex\hbox{L}% - \kern-.075emE} - -\unexpanded\def\PiCTeX - {P% - \kern-.12em\lower.5ex\hbox{I}% - \kern-.075em C% - \kern-.11em\TeX} - -\def\AMSswitch#1% - {$\cal\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$} - -\unexpanded\def\AmSTeX - {\AMSswitch A% - \kern-.1667em\lower.5ex\hbox{\AMSswitch M}% - \kern-.125em\AMSswitch S% - -\TeX} - -\unexpanded\def\LamSTeX - {L% - \kern-.4em\raise.3ex\hbox{\AMSswitch A}% - \kern-.25em\lower.4ex\hbox{\AMSswitch M}% - \kern-.1em{\AMSswitch S}% - -\TeX} - -\unexpanded\def\AmSLaTeX - {\AMSswitch A% - \kern-.1667em\lower.5ex\hbox{\AMSswitch M}% - \kern-.125em\AMSswitch S% - -\LaTeX} - -%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version: -%D -%D \def\Context -%D {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern -%D -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}} -%D -%D I changed this into one that adapts itself: - -\unexpanded\def\Context - {{C\kern -.0667em\getscaledglyph{.8}\empty{O\kern -.0667emN\kern - -.0549emT\doifitalicelse{\kern-.1em}{\kern-.1667em}\lower.5ex\hbox - {E}\doifitalicelse\empty{\kern-.11em}X\kern-.055emT}}} - -%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the -%D current fontsize, an ugly but usefull hack. - -% rather hard coded -% -% \loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol] -% -% \unexpanded\def\setMFPfont -% {\font\logofont=logo% -% \ifnum\fam=\bffam\c!bf\else -% \ifnum\fam=\slfam\c!sl\else -% \ifnum\fam=\itfam\c!sl\else -% \ifnum\fam=\bsfam\c!bf\else -% \ifnum\fam=\bifam\c!bf\else -% \fi\fi\fi\fi\fi -% 10 at \currentfontscale\bodyfontsize -% \logofont} -% -% or: -% -% \definefontsynonym [MetaLogo] [logo10] -% \definefontsynonym [MetaLogoBold] [logobf10] -% \definefontsynonym [MetaLogoSlanted] [logosl10] -% \definefontsynonym [MetaLogoItalic] [logosl10] -% \definefontsynonym [MetaLogoBoldSlanted] [logobf10] -% \definefontsynonym [MetaLogoBoldtalic] [logobf10] -% -% \loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol] -% -% \def\setMFPfont{\symbolicfont{MetaLogo}} - -\let\logofont\nullfont - -\loadmapfile[original-base.map] - -\unexpanded\def\setMFPfont% more sensitive for low level changes - {\font\logofont=logo% - \ifx\fontalternative\c!bf\else - \ifx\fontalternative\c!it\else - \ifx\fontalternative\c!sl\else - \ifx\fontalternative\c!bi\else - \ifx\fontalternative\c!bs\else - \fi\fi\fi\fi\fi - 10 at \currentfontscale\bodyfontsize - \logofont} - -%\unexpanded\def\MetaFont% -% {\hbox{\setMFPfont METAFONT}} -% -%\unexpanded\def\MetaPost% -% {\hbox{\setMFPfont METAPOST}} - -\def\MetaHyphen% there is no hyphenchar in this font - {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}} - -\unexpanded\def\MetaFont - {{\setMFPfont META\MetaHyphen FONT}} - -\unexpanded\def\MetaPost - {{\setMFPfont META\MetaHyphen POST}} - -\unexpanded\def\MetaFun - {MetaFun} - -%D \macros -%D {TEX, METAFONT, METAPOST, METAFUN, -%D PICTEX, TABLE, -%D CONTEXT, PPCHTEX, -%D AMSTEX, LATEX, LAMSTEX} -%D -%D We define the funny written ones as well as the less -%D error prone upper case names (in \CONTEXT\ we tend to -%D write all user defined commands, like abbreviations, in -%D uppercase.) - -\unexpanded\def\METAFONT {\MetaFont} -\unexpanded\def\METAPOST {\MetaPost} -\unexpanded\def\PPCHTEX {\PPCHTeX} -\unexpanded\def\CONTEXT {\ConTeXt} -\unexpanded\def\METAFUN {\MetaFun} - -\unexpanded\def\TEX {\TeX} -\unexpanded\def\LATEX {\LaTeX} -\unexpanded\def\PICTEX {\PiCTeX} -\unexpanded\def\TABLE {\TaBlE} -\unexpanded\def\AMSTEX {\AmSTeX} -\unexpanded\def\LAMSTEX {\LamSTeX} -\unexpanded\def\INRSTEX {inrs\TeX} - -%D And this is how they show up: \TeX, \MetaFont, \MetaPost, -%D \PiCTeX, \TaBlE, \ConTeXt, \PPCHTeX, \AmSTeX, \LaTeX, -%D \LamSTeX. - -%D Some placeholders: - -\unexpanded\def\eTeX {\mathematics{\varepsilon}-\TeX} -\unexpanded\def\pdfTeX {pdf\TeX} -\unexpanded\def\pdfeTeX{pdfe-\TeX} -\unexpanded\def\luaTeX {lua\TeX} -\unexpanded\def\metaTeX{meta\TeX} -\unexpanded\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX} - -% Adapted from a patch by Mojca: - -\def\@XeTeX@ - {\setbox\scratchbox\hbox{E}% - \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}} - -\ifnum\texengine=\pdftexengine - - \unexpanded\def\XeTeX - {X\lower.5ex - \hbox - {\kern-.15em - \ifx\fontalternative\c!bf\mirror{E}\else - \ifx\fontalternative\c!it \@XeTeX@\else - \ifx\fontalternative\c!sl \@XeTeX@\else - \ifx\fontalternative\c!bi \@XeTeX@\else - \ifx\fontalternative\c!bs \@XeTeX@\else - \mirror{E}\fi\fi\fi\fi\fi}% - \kern-.1667em \TeX} - -\else - - \unexpanded\def\XeTeX - {X\lower.5ex - \hbox - {\kern-.15em - \iffontchar\font"018E\relax - \char"018E% - \else - \ifx\fontalternative\c!bf\mirror{E}\else - \ifx\fontalternative\c!it \@XeTeX@\else - \ifx\fontalternative\c!sl \@XeTeX@\else - \ifx\fontalternative\c!bi \@XeTeX@\else - \ifx\fontalternative\c!bs \@XeTeX@\else - \mirror{E}\fi\fi\fi\fi\fi - \fi}% - \kern-.1667em \TeX} - -\fi - -\let\ETEX \eTeX -\let\PDFTEX \pdfTeX -\let\PDFETEX\pdfeTeX -\let\LUATEX \luaTeX -\let\LuaTeX \luaTeX -\let\XETEX \XeTeX - -\unexpanded\def\MkApproved % joke, not used so it might move - {\dontleavehmode\rotate - [\c!rotation={\ifnum\texengine=\luatexengine\ctxlua{tex.write(45-45*\the\luatexversion/100)}\else0\fi}, - \c!align=\v!middle, - \c!foregroundstyle=\v!type, - \c!foregroundcolor=darkred, - \c!frame=\v!on, - \c!offset=1ex, - \c!background=\v!color, - \c!backgroundcolor=lightgray, - \c!framecolor=darkred, - \c!rulethickness=2pt] - {Mk\ifnum\texengine=\luatexengine IV\else II\fi\\approved}} - -% \unexpanded\def\luaTeX -% {\dontleavehmode\begingroup -% Lua% -% \setbox0\hbox{oT}% -% \setbox2\hbox{o\kern0ptT}% -% \ifdim\wd0=\wd2 -% \setbox0\hbox dir TRT{To}% -% \setbox2\hbox{T\kern0pto}% -% \hskip\dimexpr\wd0-\wd2\relax -% \fi -% \TeX -% \endgroup} -% -% a further iteration from the list, patched again - -% \ifx\fontalternative\c!it -\else -% \ifx\fontalternative\c!sl -\else -% \ifx\fontalternative\c!bi -\else -% \ifx\fontalternative\c!bs -\fi\fi\fi\fi - -\def\LuaTeX - {\dontleavehmode - \begingroup - Lua% - % hope for kerning, try aT - \setbox0\hbox{aT}% - \setbox2\hbox{a\kern\zeropoint T}% - \ifdim\wd0=\wd2 % kerns can go two ways - % no aT kerning, try oT as a is not symmetrical - \setbox0\hbox{oT}% - \setbox2\hbox{o\kern\zeropoint T}% - \ifdim\wd0=\wd2 % kerns can go two ways - % no aT and oT kerning, try To - \setbox0\hbox{To}% - \setbox2\hbox{T\kern\zeropoint o}% - % maybe we need to compensate for the angle (sl/it/bs/bi) - \fi - \ifdim\wd0=\wd2\else - \kern\dimexpr\wd0-\wd2\relax - \fi - \fi - \TeX - \endgroup} - -\let\luaTeX \LuaTeX -\let\LUATEX \LuaTeX - -\protect \endinput diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index a1600a876..3e7c555e3 100644 --- a/tex/context/base/cont-new.mkii +++ b/tex/context/base/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.01.24 10:00} +\newcontextversion{2011.01.24 23:51} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index e4ad7d28a..4d19378a0 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2011.01.24 10:00} +\newcontextversion{2011.01.24 23:51} %D This file is loaded at runtime, thereby providing an %D excellent place for hacks, patches, extensions and new diff --git a/tex/context/base/cont-nl.mkii b/tex/context/base/cont-nl.mkii new file mode 100644 index 000000000..f013c0d79 --- /dev/null +++ b/tex/context/base/cont-nl.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=cont-nl, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Dutch Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{dutch} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!nl] + +\setupencoding[default=ec] + +\usetypescript[fallback][\defaultencoding] + +\setupbodyfont[rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-nl.mkiv b/tex/context/base/cont-nl.mkiv new file mode 100644 index 000000000..4b64b6aeb --- /dev/null +++ b/tex/context/base/cont-nl.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-nl, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Dutch Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{dutch} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!nl] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-nl.tex b/tex/context/base/cont-nl.tex deleted file mode 100644 index 1b02d4242..000000000 --- a/tex/context/base/cont-nl.tex +++ /dev/null @@ -1,40 +0,0 @@ -%D \module -%D [ file=cont-nl, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ Dutch Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{dutch} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!nl] - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!nl] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-pe.mkiv b/tex/context/base/cont-pe.mkiv new file mode 100644 index 000000000..a6f259ea4 --- /dev/null +++ b/tex/context/base/cont-pe.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-en, +%D version=1997.08.19, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ English Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{persian} \def\messageinterface{english} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!pe] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-pe.tex b/tex/context/base/cont-pe.tex deleted file mode 100644 index cd3557f9c..000000000 --- a/tex/context/base/cont-pe.tex +++ /dev/null @@ -1,43 +0,0 @@ -%D \module -%D [ file=cont-en, -%D version=1997.08.19, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ English Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{persian} \def\messageinterface{english} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!pe] - -% Do we need more defaults? or maybe all languages? - -\installlanguage [\s!us] [\c!state=\v!start] -\installlanguage [\s!gb] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!fr] [\c!state=\v!start] -\installlanguage [\s!es] [\c!state=\v!start] -\installlanguage [\s!it] [\c!state=\v!start] -\installlanguage [\s!nl] [\c!state=\v!start] -\installlanguage [\s!pe] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-ro.mkii b/tex/context/base/cont-ro.mkii new file mode 100644 index 000000000..84c31167b --- /dev/null +++ b/tex/context/base/cont-ro.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=cont-ro, +%D version=2000.01.09, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Romanian Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{romanian} + +\input context.mkii + +\unprotect + +\setupcurrentlanguage[\s!ro] + +\setupencoding[default=ec] + +\usetypescript[fallback][\defaultencoding] + +\setupbodyfont[rm,12pt] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-ro.mkiv b/tex/context/base/cont-ro.mkiv new file mode 100644 index 000000000..d52bd1e3a --- /dev/null +++ b/tex/context/base/cont-ro.mkiv @@ -0,0 +1,22 @@ +%D \module +%D [ file=cont-ro, +%D version=2000.01.09, +%D title=\CONTEXT, +%D subtitle=\CONTEXT\ Romanian Format Generation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{romanian} + +\input context.mkiv + +\unprotect + +\setupcurrentlanguage[\s!ro] + +\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/cont-ro.tex b/tex/context/base/cont-ro.tex deleted file mode 100644 index 0b1dc2c09..000000000 --- a/tex/context/base/cont-ro.tex +++ /dev/null @@ -1,36 +0,0 @@ -%D \module -%D [ file=cont-ro, -%D version=2000.01.09, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ Romanian Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{romanian} - -\input context.tex - -\unprotect - -\setupcurrentlanguage[\s!ro] - -\installlanguage [\s!en] [\c!state=\v!start] -\installlanguage [\s!de] [\c!state=\v!start] -\installlanguage [\s!ro] [\c!state=\v!start] - -\ifnum\texengine=\luatexengine - % will be runtime option: typeface - \appendtoks - \usetypescript[modern] - \setuptypeface[modern] - \to \everyjob -\else - \setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt] -\fi - -\protect \errorstopmode \dump \endinput diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index db0f1a210..b45b5e22e 100644 --- a/tex/context/base/context.mkii +++ b/tex/context/base/context.mkii @@ -11,11 +11,39 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 + +%D From the next string (which is set by the script that assembles the +%D distribution) later on we will calculate a number that can be used +%D by use modules to identify the feature level. Starting with version +%D 2004.8.30 the low level interface is english. Watch out and adapt +%D your styles an modules. + +\edef\contextformat {\jobname} +\edef\contextversion{2011.01.24 23:51} + +%D For those who want to use this: + +\let\fmtname \contextformat +\let\fmtversion\contextversion + +%D Loading: + +\edef\mksuffix {mkii} +\edef\contextmark{MKII} + +\ifx\normalinput\undefined \let\normalinput\input \fi + +\def\loadcorefile#1{\normalinput#1\relax} +\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax} +\def\loadmkiifile#1{\normalinput#1\relax} +\def\loadmkivfile#1{} + %D First we load the system modules. These implement a lot of %D manipulation macros. The first one loads \PLAIN\ \TEX, as %D minimal as possible. -\loadcorefile{syst-ini} +\loadmarkfile{syst-ini} \loadmarkfile{syst-pln} \loadmarkfile{norm-tex} @@ -348,12 +376,12 @@ %D These macros are loaded last since they overload and|/|or %D extend previously defined ones. -\loadcorefile{xtag-ini} -\loadcorefile{xtag-ext} -\loadcorefile{xtag-exp} -\loadcorefile{xtag-pre} -\loadcorefile{xtag-xsd} -\loadcorefile{xtag-rng} +\loadmarkfile{xtag-ini} +\loadmarkfile{xtag-ext} +\loadmarkfile{xtag-exp} +\loadmarkfile{xtag-pre} +\loadmarkfile{xtag-xsd} +\loadmarkfile{xtag-rng} %D How about this: @@ -362,7 +390,7 @@ %D \TEX\ related logo's are always typeset in a special way. %D Here they come: -\loadcorefile{cont-log} +\loadmarkfile{cont-log} %D This one overloads af few things: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index f0c6417cf..040247a97 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -11,11 +11,39 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 + +%D From the next string (which is set by the script that assembles the +%D distribution) later on we will calculate a number that can be used +%D by use modules to identify the feature level. Starting with version +%D 2004.8.30 the low level interface is english. Watch out and adapt +%D your styles an modules. + +\edef\contextformat {\jobname} +\edef\contextversion{2011.01.24 23:51} + +%D For those who want to use this: + +\let\fmtname \contextformat +\let\fmtversion\contextversion + +%D Loading: + +\edef\mksuffix {mkiv} +\edef\contextmark{MKIV} + +\ifx\normalinput\undefined \let\normalinput\input \fi + +\def\loadcorefile#1{\normalinput#1\relax} +\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax} +\def\loadmkiifile#1{} +\def\loadmkivfile#1{\normalinput#1\relax} + %D First we load the system modules. These implement a lot of %D manipulation macros. We start with setting up some basic \TEX\ %D machinery. -\loadcorefile{syst-ini} +\loadmarkfile{syst-ini} %D We just quit if new functionality is expected. @@ -138,24 +166,7 @@ \loadmarkfile{lang-mis} \loadmarkfile{lang-url} - -\loadmarkfile{lang-ger} -\loadmarkfile{lang-ita} -\loadmarkfile{lang-sla} -\loadmarkfile{lang-alt} -\loadmarkfile{lang-ana} -\loadmarkfile{lang-art} -\loadmarkfile{lang-bal} -\loadmarkfile{lang-cel} -\loadmarkfile{lang-grk} -\loadmarkfile{lang-ind} -\loadmarkfile{lang-ura} -\loadmarkfile{lang-vn} -\loadmarkfile{lang-cyr} - -\loadmarkfile{lang-ara} -\loadmarkfile{lang-cjk} - +\loadmarkfile{lang-def} \loadmarkfile{lang-wrd} % can be optional \loadmarkfile{symb-ini} @@ -363,7 +374,7 @@ \loadmarkfile{meta-xml} -\loadcorefile{cont-log} +\loadmarkfile{cont-log} \loadmarkfile{task-ini} @@ -399,7 +410,7 @@ \to \everyjob \appendtoks - \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.tex")}% can become automatic + \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkiv")}% can become automatic \to \everydump \protect \errorstopmode \dump \endinput diff --git a/tex/context/base/context.tex b/tex/context/base/context.tex deleted file mode 100644 index a58bf3377..000000000 --- a/tex/context/base/context.tex +++ /dev/null @@ -1,225 +0,0 @@ -%D \module -%D [ file=context, -%D version=1995.10.10, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 - -%D From the next string (which is set by the script that assembles the -%D distribution) later on we will calculate a number that can be used -%D by use modules to identify the feature level. Starting with version -%D 2004.8.30 the low level interface is english. Watch out and adapt -%D your styles an modules. - -\edef\contextformat {\jobname} -\edef\contextversion{2011.01.24 10:00} - -%D For those who want to use this: - -\let\fmtname \contextformat -\let\fmtversion\contextversion - -\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 - -%D We have two versions, one for \PDFTEX\ and \XETEX, and one for -%D \LUATEX. - -\chardef\contextmarkmode = \ifx\directlua\undefined 2 \else 4 \fi - -\def\loadcorefile#1{\normalinput#1\relax} -\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax} - -\ifnum\contextmarkmode=4 - \def\loadmarkiifile#1{} \let\loadmarkivfile\loadcorefile \edef\mksuffix {mkiv} \edef\contextmark{MKIV} -\else - \def\loadmarkivfile#1{} \let\loadmarkiifile\loadcorefile \edef\mksuffix {mkii} \edef\contextmark{MKII} -\fi - -\let\loadmkiifile\loadmarkiifile -\let\loadmkivfile\loadmarkivfile -\let\loadmkfile \loadmarkfile - -%D Welcome to the main module. When this module is ran through -%D \type{initex} or \type {tex -i} or \type {whatevertex} using -%D \type{whatever switch}, the \CONTEXT\ format file is -%D generated. During this process the user is asked for an -%D interface language. Supplying \type{dutch} will generate a -%D dutch version of \CONTEXT, supplying \type {english} will of -%D course end op in a english version. -%D -%D Another option is to use \TEXEXEC\ (for \MKII): -%D -%D \starttyping -%D texexec --make [--alone] [--engine] [--all] -%D texexec --make [--alone] [--engine] en nl ... metafun mptopdf -%D \stoptyping -%D -%D More information can be found in the \TEXEXEC\ manual. -%D -%D For \MKIV\ you have to do: -%D -%D \starttyping -%D luatools --generate -%D context --make en nl ... -%D \stoptyping - -%D When you write modules (or extensions) you should avoid -%D conflicts with existing macro names and mechanisms. If you are -%D coming from another macro package, don't assume that macros -%D with the same name are doing the same! \CONTEXT\ was written -%D from scratch and therefore similarities are often a coincidence -%D (to some extent one always ends up with the same names for -%D similar concepts). The underlying models for elementary subsystems -%D that deal with encodings, languages and fonts probably differ. -%D -%D Time has learned that users coming from \LATEX\ should not fall -%D into thinking that macros like \type {\protect} represent the -%D same functionality in both systems; actually, due to the way -%D \CONTEXT\ is set up, some of those macros do complete different -%D things. Macro packages evolve independent of each other, which -%D means that code written for one system will not work in another -%D system, unless it's real generic code. -%D -%D An API will become available soon (keep an eye on the ConTeXt -%D Wiki www.contextgarden.org) and or listen in to the context -%D mailing list (ntg-context@ntg.nl). Much additional information -%D can be found at the PRAGMA website (www.pragma-ade.com). - -%D We now go either the \MKII\ or \MKIV\ route: - -\loadmarkfile{context} - -%D Let's quit this file when doing a \type {cont-..} generation. - -\doifparentfileelse{context}{\donothing}{\endinput} - -%D Unless we're generating a \type {cont-..} format, we also -%D do the following. - -%D Except from english, no hyphenation patterns are loaded -%D yet. Users can specify their needs in the next module: - -\loaduserspecifications - -%D Next we default to the same language as the interface. - -\unprotect - -\installlanguage [\s!us] [\c!state=\v!start] - -\startinterface english - \installlanguage [\s!gb] [\c!state=\v!start] -\stopinterface - -\appendtoks \language [\s!us] \to \everyjob -\appendtoks \mainlanguage [\s!us] \to \everyjob - -\startinterface german - - \installlanguage [\s!de] [\c!state=\v!start] - - \appendtoks \language [\s!de] \to \everyjob - \appendtoks \mainlanguage [\s!de] \to \everyjob - -\stopinterface - -\startinterface dutch - - \installlanguage [\s!nl] [\c!state=\v!start] - - \appendtoks \language [\s!nl] \to \everyjob - \appendtoks \mainlanguage [\s!nl] \to \everyjob - -\stopinterface - -\startinterface czech - - \installlanguage [\s!cs] [\c!state=\v!start] - - \appendtoks \language [\s!cs] \to \everyjob - \appendtoks \mainlanguage [\s!cs] \to \everyjob - -\stopinterface - -\startinterface italian - - \installlanguage [\s!it] [\c!state=\v!start] - - \appendtoks \language [\s!it] \to \everyjob - \appendtoks \mainlanguage [\s!it] \to \everyjob - -\stopinterface - -\startinterface romanian - - \installlanguage [\s!ro] [\c!state=\v!start] - - \appendtoks \language [\s!ro] \to \everyjob - \appendtoks \mainlanguage [\s!ro] \to \everyjob - -\stopinterface - -\startinterface french - - \installlanguage [\s!fr] [\c!state=\v!start] - - \appendtoks \language [\s!fr] \to \everyjob - \appendtoks \mainlanguage [\s!fr] \to \everyjob - -\stopinterface - -\startinterface persian - - \installlanguage [\s!pe] [\c!state=\v!start] - - \appendtoks \language [\s!pe] \to \everyjob - \appendtoks \mainlanguage [\s!pe] \to \everyjob - -\stopinterface - -\protect - -%D Finally we (pre)load some fonts. - -\setupencoding[default=ec] - -\usetypescript[fallback][\defaultencoding] - -\setupbodyfont[rm,12pt] - -%D The next hook can be used to generate a local (extended) -%D format. This file is only searched for at the current -%D path. - -% \readlocfile{cont-def.tex} -% {\writestatus{loading}{adding extensions from cont-def}} -% {} - -%D Now dumping the format is all that's left to be done. - -\errorstopmode \dump - -\endinput diff --git a/tex/context/base/core-fil.mkii b/tex/context/base/core-fil.mkii index ad22ade1e..0355920c7 100644 --- a/tex/context/base/core-fil.mkii +++ b/tex/context/base/core-fil.mkii @@ -324,7 +324,7 @@ \startreadingfile \startnointerference % \bgroup \cleanupfeatures % better \setnormalcatcodes / test first - \readfile{#2}\donothing\donothing + \readfile{#2.\mksuffix}\donothing\donothing \stopnointerference % \egroup \stopreadingfile \doglobal\setflag{#2}}% diff --git a/tex/context/base/core-fil.mkiv b/tex/context/base/core-fil.mkiv index ac3f88d26..e54095bb1 100644 --- a/tex/context/base/core-fil.mkiv +++ b/tex/context/base/core-fil.mkiv @@ -212,7 +212,7 @@ \startreadingfile \startnointerference % \bgroup \cleanupfeatures % better \setnormalcatcodes / test first - \readfile{#2}\donothing\donothing + \readfile{#2.\mksuffix}\donothing\donothing \stopnointerference % \egroup \stopreadingfile \doglobal\setflag{#2}}% diff --git a/tex/context/base/enco-ini.mkii b/tex/context/base/enco-ini.mkii index 33825f94d..a277e7450 100644 --- a/tex/context/base/enco-ini.mkii +++ b/tex/context/base/enco-ini.mkii @@ -747,11 +747,11 @@ %D can be used to check the correct loading of hyphenation %D patterns. -\fetchruntimecommand \showaccents {\f!encodingprefix\s!run.mkii} -\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run.mkii} -\fetchruntimecommand \showcharacterbounds {\f!encodingprefix\s!run.mkii} -\fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run.mkii} -\fetchruntimecommand \showmapping {\f!encodingprefix\s!run.mkii} +\fetchruntimecommand \showaccents {\f!encodingprefix\s!run} +\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run} +\fetchruntimecommand \showcharacterbounds {\f!encodingprefix\s!run} +\fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run} +\fetchruntimecommand \showmapping {\f!encodingprefix\s!run} %D \macros %D {everyuppercase, EveryUppercase, diff --git a/tex/context/base/font-ini.mkii b/tex/context/base/font-ini.mkii index e0b7a3e4e..7b84125fa 100644 --- a/tex/context/base/font-ini.mkii +++ b/tex/context/base/font-ini.mkii @@ -3663,7 +3663,7 @@ %D The implementation is rather straightforward in using %D \type{\halign}. -\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run} %D \macros %D {showfontstrip, testminimalbaseline, showminimalbaseline} @@ -3674,9 +3674,9 @@ %D %D \showfontstrip \blank \showminimalbaseline -\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkii} -\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkii} -\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run} +\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run} +\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run} %D \macros %D {showkerning} @@ -3685,7 +3685,7 @@ %D %D \showkerning{Can you guess what kerning is?} -\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showkerning {\f!fontprefix\s!run} %D \macros %D {showbodyfontenvironment} @@ -3698,7 +3698,7 @@ %D %D \showsetup{showbodyfontenvironment} -\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run} %D \macros %D {showfont,showfontstyle,showligatures} @@ -3719,11 +3719,11 @@ % to be internationalized -\fetchruntimecommand \showfont {\f!fontprefix\s!run.mkii} -\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run.mkii} -\fetchruntimecommand \showligature {\f!fontprefix\s!run.mkii} -\fetchruntimecommand \showligatures {\f!fontprefix\s!run.mkii} -\fetchruntimecommand \showcharratio {\f!fontprefix\s!run.mkii} +\fetchruntimecommand \showfont {\f!fontprefix\s!run} +\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run} +\fetchruntimecommand \showligature {\f!fontprefix\s!run} +\fetchruntimecommand \showligatures {\f!fontprefix\s!run} +\fetchruntimecommand \showcharratio {\f!fontprefix\s!run} %D \macros %D {getglyph, symbolicfont} diff --git a/tex/context/base/font-ini.mkiv b/tex/context/base/font-ini.mkiv index f0f63f465..ffd099318 100644 --- a/tex/context/base/font-ini.mkiv +++ b/tex/context/base/font-ini.mkiv @@ -3554,7 +3554,7 @@ %D The implementation is rather straightforward in using %D \type{\halign}. -\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run.mkiv} +\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run} %D \macros %D {showfontstrip, testminimalbaseline, showminimalbaseline} @@ -3565,9 +3565,9 @@ %D %D \showfontstrip \blank \showminimalbaseline -\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run.mkiv} -\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run.mkiv} -\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run.mkiv} +\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run} +\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run} +\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run} %D \macros %D {showkerning} @@ -3576,7 +3576,7 @@ %D %D \showkerning{Can you guess what kerning is?} -\fetchruntimecommand \showkerning {\f!fontprefix\s!run.mkiv} +\fetchruntimecommand \showkerning {\f!fontprefix\s!run} %D \macros %D {showbodyfontenvironment} @@ -3589,7 +3589,7 @@ %D %D \showsetup{showbodyfontenvironment} -\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run.mkiv} +\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run} %D \macros %D {showfont,showfontstyle,showligatures} @@ -3605,11 +3605,11 @@ % to be internationalized -\fetchruntimecommand \showfont {\f!fontprefix\s!run.mkiv} -\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run.mkiv} -\fetchruntimecommand \showligature {\f!fontprefix\s!run.mkiv} -\fetchruntimecommand \showligatures {\f!fontprefix\s!run.mkiv} -\fetchruntimecommand \showcharratio {\f!fontprefix\s!run.mkiv} +\fetchruntimecommand \showfont {\f!fontprefix\s!run} +\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run} +\fetchruntimecommand \showligature {\f!fontprefix\s!run} +\fetchruntimecommand \showligatures {\f!fontprefix\s!run} +\fetchruntimecommand \showcharratio {\f!fontprefix\s!run} %D \macros %D {getglyph, symbolicfont} diff --git a/tex/context/base/java-ans.mkii b/tex/context/base/java-ans.mkii new file mode 100644 index 000000000..636c894f9 --- /dev/null +++ b/tex/context/base/java-ans.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=java-ans, +%D version=1998.06.01, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Answer Analization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\startJSpreamble{Do_Check_Answer} used later + + function Do_Check_Answer (field, value) + { if (event.value.toLowerCase()==value.toLowerCase()) + { event.target.hidden = true } + % { event.target.display = display.hidden } + return("\040") } // funny, "" does not work + +\stopJSpreamble + +\startJScode{Check_Answer} uses {Do_Check_Answer} + event.value = Do_Check_Answer(JS_S_1, JS_S_2) ; +\stopJScode + +\endinput diff --git a/tex/context/base/java-ans.tex b/tex/context/base/java-ans.tex deleted file mode 100644 index 636c894f9..000000000 --- a/tex/context/base/java-ans.tex +++ /dev/null @@ -1,28 +0,0 @@ -%D \module -%D [ file=java-ans, -%D version=1998.06.01, -%D title=\CONTEXT\ JavaScript Macros, -%D subtitle=Answer Analization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -\startJSpreamble{Do_Check_Answer} used later - - function Do_Check_Answer (field, value) - { if (event.value.toLowerCase()==value.toLowerCase()) - { event.target.hidden = true } - % { event.target.display = display.hidden } - return("\040") } // funny, "" does not work - -\stopJSpreamble - -\startJScode{Check_Answer} uses {Do_Check_Answer} - event.value = Do_Check_Answer(JS_S_1, JS_S_2) ; -\stopJScode - -\endinput diff --git a/tex/context/base/java-exa.mkii b/tex/context/base/java-exa.mkii new file mode 100644 index 000000000..f40f70f84 --- /dev/null +++ b/tex/context/base/java-exa.mkii @@ -0,0 +1,395 @@ +%D \module +%D [ file=java-exa, +%D version=2002.??.??, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Example Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% XFDF versus HTML +% localhost versus remote versus set + +% filename | filename-nr => name +% fakename | fakename-nr => file upload, unless localhost +% +% we erase the list because otherwise we end up in browser remembering +% problems; also, it is not possible to set upload fields 'manually' + +\startJSpreamble request_1 used now + + var example_method = "HTML" ; + var example_host = "" ; + var example_port = "" ; + var example_url = "" ; + var example_file = "" ; + + var example_log = true ; % false + + function stripped_exa_value( name ) { + f = this.getField(name) ; + if (f) { + str = f.value ; + if (str.indexOf(name+'-')==0) { + str = str.substr(name.length+1) ; + } + return str ; + } else { + return "" ; + } + } + + function identify_example_url ( ) { + if (example_log) { + console.clear ; + console.println("base url: "+this.baseURL) ; + console.println("this url: "+this.URL) ; + } + if (this.baseURL != "") { + example_url = this.baseURL ; + } else { + if (this.URL != "") { + example_url = this.URL + } + } + if (example_url.indexOf("file://")>=0) { + example_url = "" ; + } + str = stripped_exa_value("examplehost") ; + if (str != "auto") { + example_host = str ; + if (str == "localhost") { + example_port = "8061" + } + } + str = stripped_exa_value("exampleport") ; + if (str != "auto") { + example_port = str ; + } + if (example_log) { + console.println("example_url: "+example_url) ; + console.println("example_host: "+example_host) ; + console.println("example_port: "+example_port) ; + } + } + + function check_example_url ( url ) { + if (url.indexOf("file://")>=0) { + url = "http://localhost:8061" ; + console.println("file url replaced by: "+url) ; + } else { + if (url.indexOf("://")<0) { + url = "http://" + url ; + } + if (example_log) { + console.println("url before check: "+url) ; + } +% url = url.replace(/(http:\\\/\\\/.+)(\\\/.*$)/, "$1") ; + url = url.replace(/(https*:\\\/\\\/.+?)(\\\/.*$)/, "$1/exarequest") ; + if (example_log) { + console.println("url after check: "+url) ; + } + } + return url ; + } + + function set_example_xfdf ( method ) { + example_method = method ; + } + + function set_example_file ( file ) { + example_method = file ; + } + + function set_example_host ( host ) { + example_host = host ; + } + + function set_example_port ( port ) { + example_host = host ; + } + + function do_erase_example_file(tag) { + f = this.getField(tag) ; + if (f) { + f.value = "" ; + } + } + + function do_erase_example_list(tag) { + for (i=1;i<=100;i++) { + f = this.getField(tag+"-"+i) ; + if (f) { + f.value = "" ; + } else { + return + } + } + } + + function do_submit_example_url ( url ) { + if ((example_method == "XFDF" ) || (url.indexOf("localhost")>=0)) { + do_erase_example_file("fakename") ; + do_erase_example_list("fakename") ; + } + url = check_example_url(url) ; + if (example_log) { + console.println("submitting form to "+url+" using method "+example_method) ; + } + if (example_file != "") { + url = url + "/" + example_file ; + } + % we need the bFDF for acrobat 5 + this.submitForm({cURL : url, bFDF : false, cSubmitAs : example_method}) ; + } + + function submit_example_form ( ) { + identify_example_url() ; + if (example_host != "") { + if (example_port != "") { + do_submit_example_url(example_host+":"+example_port) ; + } else { + do_submit_example_url(example_host) ; + } + } else { + if (example_url != "") { + do_submit_example_url(example_url) ; + } else { + if (example_port != "") { + do_submit_example_url("localhost"+":"+example_port) ; + } else { + do_submit_example_url("localhost:8061") ; % local exampler + } + } + } + resetfilename () ; + } + + function submit_form ( host, port) { + set_example_host(host) ; + set_example_post(post) ; + submit_example_form ; + } + +\stopJSpreamble + +\startJSpreamble request_2 used now + + var exa_command = "" ; + var exa_option = "" ; + var exa_filename = "" ; + var exa_filelist = "" ; + var exa_registered = "" ; + + function set_request (command,option) { + exa_command = command ; + if (exa_command == "") { + exa_option = option ; + } else { if (option == "") { + exa_option = "" ; + } else { if (option.indexOf("--")<0) { + exa_option = "--action=" + option ; + } else { + exa_option = option ; + } } } + } + + function assemble_request ( ) { + v = this.getField('filename') ; + if (v) { + exa_filename = v.value ; + } + v = this.getField('filelist') ; + if (v) { + exa_filelist = v.value ; + } +% exa_filename = exa_filename.replace(/\\\\/g,'/') ; +% exa_filelist = exa_filelist.replace(/\\\\/g,'/') ; + str = "\\n" ; + str = str+"" ; + if (exa_filelist == "") { + exa_filelist = exa_registered ; + } else { if (exa_registered != "") { + exa_filelist = exa_filelist + "\\n" + exa_registered ; + } } + if (exa_command != "") { + str = str+""+exa_command+"" ; + } + if (exa_option != "") { + str = str+""+exa_option+"" ; + } + if (exa_filename != "") { + str = str+""+exa_filename+"" ; + } + var fls = "" ; + if (exa_filelist != "") { + % old method, soon obsolete + lst = exa_filelist.split(/\\s/) ; + for (i=0;i"+lst[i]+"" ; + } + } else { if (exa_multiple) { + for (i=1;i<=100;i++) { + % console.println("file field "+i) ; + f = this.getField("filename-"+ i) ; +% if (f) { if (f.value != "") { +% if (g) { if (g.value == "") { +% fls = fls+""+f.value+"" ; +% } else { +% fls = fls+""+f.value+"" ; +% } } else { +% fls = fls+""+f.value+"" ; +% } +% } } + if (f) { if (f.value != "") { + fls = fls + "" ; + } else { + % console.println("b") ; + fls = fls + " label='" + g.value + "'>" ; + } } else { + % console.println("c") ; + fls = fls + ">" ; + } + fls = fls + f.value + "" ; + } } + } + } } + if (fls != "") { + str = str + "" + fls + "" ; + } + str = str + "" ; + v = this.getField('exa:request') ; + if (v) { + v.value = str ; + } + } + +\stopJSpreamble + +\startJSpreamble request_3 used now + + var exa_multiple = false ; + + function setfilename ( suffixes ) { + if (event.targetName) { + var name = event.targetName ; + var fake = name.replace(/filename/,"fakename") ; + } else { + var name = 'filename' ; + var fake = 'fakename' ; + } + f = this.getField(fake) ; + if (f) { + f.browseForFileToSubmit() ; + if ((suffixes != "") && (f.value != "")) { + % + s = suffixes.replace(/,/g,"|") ; + r = new RegExp() ; + s = "\\\\.(" + s + ")$" ; + r.compile(s, "i") ; + if (f.value.search(r)<=0) { + f.value = "" ; + app.alert('This filetype is not permitted.') ; + % + % lst = suffixes.split(/,/) ; + % ok = false ; + % for (i=0;i=0) { +% f.value = "" ; +% } +% } + } + this.dirty = false ; + } + + function addfilename () { + if (exa_multiple) { + h = this.getField("filelist") ; + g = this.getField("filename") ; + if ((g) && (h)) { + str = g.value ; + if (h.value == "") { + h.value = str ; + } else { + h.value = h.value + "\\n" + str ; + } + g.value = "" ; + this.value = "" ; + } + } + this.dirty = false ; + } + + % this only works with client that assembles request + + function registerfilename (str) { + if (str!="") { + h = this.getField("filelist") ; + if (h) { + if (h.value != "") { + h.value = h.value + "\\n" ; + } + h.value = h.value + str ; + } else { + if (exa_registered != "") { + exa_registered = exa_registered + "\\n" ; + } + exa_registered = exa_registered + str ; + } + } + console.show ; + console.println('registered files') ; + console.println("file: "+str) ; + console.println("list: "+exa_registered) ; + this.dirty = false ; + } + + function checkfilename () { + } + + function getfilename ( suffixes ) { + setfilename(suffixes) ; + checkfilename() ; + addfilename() ; + } + + function resetfilename () { + do_erase_example_file("fakename") ; + do_erase_example_file("filename") ; + do_erase_example_file("filelist") ; + do_erase_example_list("filename") ; + do_erase_example_list("fakename") ; + } + +\stopJSpreamble + +\endinput diff --git a/tex/context/base/java-exa.tex b/tex/context/base/java-exa.tex deleted file mode 100644 index f40f70f84..000000000 --- a/tex/context/base/java-exa.tex +++ /dev/null @@ -1,395 +0,0 @@ -%D \module -%D [ file=java-exa, -%D version=2002.??.??, -%D title=\CONTEXT\ JavaScript Macros, -%D subtitle=Example Support, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% XFDF versus HTML -% localhost versus remote versus set - -% filename | filename-nr => name -% fakename | fakename-nr => file upload, unless localhost -% -% we erase the list because otherwise we end up in browser remembering -% problems; also, it is not possible to set upload fields 'manually' - -\startJSpreamble request_1 used now - - var example_method = "HTML" ; - var example_host = "" ; - var example_port = "" ; - var example_url = "" ; - var example_file = "" ; - - var example_log = true ; % false - - function stripped_exa_value( name ) { - f = this.getField(name) ; - if (f) { - str = f.value ; - if (str.indexOf(name+'-')==0) { - str = str.substr(name.length+1) ; - } - return str ; - } else { - return "" ; - } - } - - function identify_example_url ( ) { - if (example_log) { - console.clear ; - console.println("base url: "+this.baseURL) ; - console.println("this url: "+this.URL) ; - } - if (this.baseURL != "") { - example_url = this.baseURL ; - } else { - if (this.URL != "") { - example_url = this.URL - } - } - if (example_url.indexOf("file://")>=0) { - example_url = "" ; - } - str = stripped_exa_value("examplehost") ; - if (str != "auto") { - example_host = str ; - if (str == "localhost") { - example_port = "8061" - } - } - str = stripped_exa_value("exampleport") ; - if (str != "auto") { - example_port = str ; - } - if (example_log) { - console.println("example_url: "+example_url) ; - console.println("example_host: "+example_host) ; - console.println("example_port: "+example_port) ; - } - } - - function check_example_url ( url ) { - if (url.indexOf("file://")>=0) { - url = "http://localhost:8061" ; - console.println("file url replaced by: "+url) ; - } else { - if (url.indexOf("://")<0) { - url = "http://" + url ; - } - if (example_log) { - console.println("url before check: "+url) ; - } -% url = url.replace(/(http:\\\/\\\/.+)(\\\/.*$)/, "$1") ; - url = url.replace(/(https*:\\\/\\\/.+?)(\\\/.*$)/, "$1/exarequest") ; - if (example_log) { - console.println("url after check: "+url) ; - } - } - return url ; - } - - function set_example_xfdf ( method ) { - example_method = method ; - } - - function set_example_file ( file ) { - example_method = file ; - } - - function set_example_host ( host ) { - example_host = host ; - } - - function set_example_port ( port ) { - example_host = host ; - } - - function do_erase_example_file(tag) { - f = this.getField(tag) ; - if (f) { - f.value = "" ; - } - } - - function do_erase_example_list(tag) { - for (i=1;i<=100;i++) { - f = this.getField(tag+"-"+i) ; - if (f) { - f.value = "" ; - } else { - return - } - } - } - - function do_submit_example_url ( url ) { - if ((example_method == "XFDF" ) || (url.indexOf("localhost")>=0)) { - do_erase_example_file("fakename") ; - do_erase_example_list("fakename") ; - } - url = check_example_url(url) ; - if (example_log) { - console.println("submitting form to "+url+" using method "+example_method) ; - } - if (example_file != "") { - url = url + "/" + example_file ; - } - % we need the bFDF for acrobat 5 - this.submitForm({cURL : url, bFDF : false, cSubmitAs : example_method}) ; - } - - function submit_example_form ( ) { - identify_example_url() ; - if (example_host != "") { - if (example_port != "") { - do_submit_example_url(example_host+":"+example_port) ; - } else { - do_submit_example_url(example_host) ; - } - } else { - if (example_url != "") { - do_submit_example_url(example_url) ; - } else { - if (example_port != "") { - do_submit_example_url("localhost"+":"+example_port) ; - } else { - do_submit_example_url("localhost:8061") ; % local exampler - } - } - } - resetfilename () ; - } - - function submit_form ( host, port) { - set_example_host(host) ; - set_example_post(post) ; - submit_example_form ; - } - -\stopJSpreamble - -\startJSpreamble request_2 used now - - var exa_command = "" ; - var exa_option = "" ; - var exa_filename = "" ; - var exa_filelist = "" ; - var exa_registered = "" ; - - function set_request (command,option) { - exa_command = command ; - if (exa_command == "") { - exa_option = option ; - } else { if (option == "") { - exa_option = "" ; - } else { if (option.indexOf("--")<0) { - exa_option = "--action=" + option ; - } else { - exa_option = option ; - } } } - } - - function assemble_request ( ) { - v = this.getField('filename') ; - if (v) { - exa_filename = v.value ; - } - v = this.getField('filelist') ; - if (v) { - exa_filelist = v.value ; - } -% exa_filename = exa_filename.replace(/\\\\/g,'/') ; -% exa_filelist = exa_filelist.replace(/\\\\/g,'/') ; - str = "\\n" ; - str = str+"" ; - if (exa_filelist == "") { - exa_filelist = exa_registered ; - } else { if (exa_registered != "") { - exa_filelist = exa_filelist + "\\n" + exa_registered ; - } } - if (exa_command != "") { - str = str+""+exa_command+"" ; - } - if (exa_option != "") { - str = str+""+exa_option+"" ; - } - if (exa_filename != "") { - str = str+""+exa_filename+"" ; - } - var fls = "" ; - if (exa_filelist != "") { - % old method, soon obsolete - lst = exa_filelist.split(/\\s/) ; - for (i=0;i"+lst[i]+"" ; - } - } else { if (exa_multiple) { - for (i=1;i<=100;i++) { - % console.println("file field "+i) ; - f = this.getField("filename-"+ i) ; -% if (f) { if (f.value != "") { -% if (g) { if (g.value == "") { -% fls = fls+""+f.value+"" ; -% } else { -% fls = fls+""+f.value+"" ; -% } } else { -% fls = fls+""+f.value+"" ; -% } -% } } - if (f) { if (f.value != "") { - fls = fls + "" ; - } else { - % console.println("b") ; - fls = fls + " label='" + g.value + "'>" ; - } } else { - % console.println("c") ; - fls = fls + ">" ; - } - fls = fls + f.value + "" ; - } } - } - } } - if (fls != "") { - str = str + "" + fls + "" ; - } - str = str + "" ; - v = this.getField('exa:request') ; - if (v) { - v.value = str ; - } - } - -\stopJSpreamble - -\startJSpreamble request_3 used now - - var exa_multiple = false ; - - function setfilename ( suffixes ) { - if (event.targetName) { - var name = event.targetName ; - var fake = name.replace(/filename/,"fakename") ; - } else { - var name = 'filename' ; - var fake = 'fakename' ; - } - f = this.getField(fake) ; - if (f) { - f.browseForFileToSubmit() ; - if ((suffixes != "") && (f.value != "")) { - % - s = suffixes.replace(/,/g,"|") ; - r = new RegExp() ; - s = "\\\\.(" + s + ")$" ; - r.compile(s, "i") ; - if (f.value.search(r)<=0) { - f.value = "" ; - app.alert('This filetype is not permitted.') ; - % - % lst = suffixes.split(/,/) ; - % ok = false ; - % for (i=0;i=0) { -% f.value = "" ; -% } -% } - } - this.dirty = false ; - } - - function addfilename () { - if (exa_multiple) { - h = this.getField("filelist") ; - g = this.getField("filename") ; - if ((g) && (h)) { - str = g.value ; - if (h.value == "") { - h.value = str ; - } else { - h.value = h.value + "\\n" + str ; - } - g.value = "" ; - this.value = "" ; - } - } - this.dirty = false ; - } - - % this only works with client that assembles request - - function registerfilename (str) { - if (str!="") { - h = this.getField("filelist") ; - if (h) { - if (h.value != "") { - h.value = h.value + "\\n" ; - } - h.value = h.value + str ; - } else { - if (exa_registered != "") { - exa_registered = exa_registered + "\\n" ; - } - exa_registered = exa_registered + str ; - } - } - console.show ; - console.println('registered files') ; - console.println("file: "+str) ; - console.println("list: "+exa_registered) ; - this.dirty = false ; - } - - function checkfilename () { - } - - function getfilename ( suffixes ) { - setfilename(suffixes) ; - checkfilename() ; - addfilename() ; - } - - function resetfilename () { - do_erase_example_file("fakename") ; - do_erase_example_file("filename") ; - do_erase_example_file("filelist") ; - do_erase_example_list("filename") ; - do_erase_example_list("fakename") ; - } - -\stopJSpreamble - -\endinput diff --git a/tex/context/base/java-fil.mkii b/tex/context/base/java-fil.mkii new file mode 100644 index 000000000..4d79a2ace --- /dev/null +++ b/tex/context/base/java-fil.mkii @@ -0,0 +1,48 @@ +%D \module +%D [ file=java-fil, +%D version=1998.06.01, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Filing and Printing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\startJSpreamble Auxiliary used now + + function DocumentFileName () + { var Paths = this.path.split("/") ; + Paths = Paths[Paths.length-1].split(".") ; + return(Paths[0]) } + + function Print_Page_Range(From, To) % gaat mis, nog geen args mogelijk + { if ((Number(From)>0)&&(Number(To)>=Number(From))) + { var myFrom = Number(From)-1 ; + var myTo = Number(To)-1 ; + this.print(false,myFrom,myTo,true) } } + + function Print_This_Page () + { this.print(false,this.pageNum,this.pageNum,true) } + +\stopJSpreamble + +\definereference + [PrintSubPaginas] + [JS(Print_Page_Range{\firstsubpage,\lastsubpage})] + +\definereference + [PrintSubPages] + [JS(Print_Page_Range{\firstsubpage,\lastsubpage})] + +\definereference + [PrintDezePagina] + [JS(Print_This_Page)] + +\definereference + [PrintThisPage] + [JS(Print_This_Page)] + +\endinput diff --git a/tex/context/base/java-fil.tex b/tex/context/base/java-fil.tex deleted file mode 100644 index 4d79a2ace..000000000 --- a/tex/context/base/java-fil.tex +++ /dev/null @@ -1,48 +0,0 @@ -%D \module -%D [ file=java-fil, -%D version=1998.06.01, -%D title=\CONTEXT\ JavaScript Macros, -%D subtitle=Filing and Printing, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -\startJSpreamble Auxiliary used now - - function DocumentFileName () - { var Paths = this.path.split("/") ; - Paths = Paths[Paths.length-1].split(".") ; - return(Paths[0]) } - - function Print_Page_Range(From, To) % gaat mis, nog geen args mogelijk - { if ((Number(From)>0)&&(Number(To)>=Number(From))) - { var myFrom = Number(From)-1 ; - var myTo = Number(To)-1 ; - this.print(false,myFrom,myTo,true) } } - - function Print_This_Page () - { this.print(false,this.pageNum,this.pageNum,true) } - -\stopJSpreamble - -\definereference - [PrintSubPaginas] - [JS(Print_Page_Range{\firstsubpage,\lastsubpage})] - -\definereference - [PrintSubPages] - [JS(Print_Page_Range{\firstsubpage,\lastsubpage})] - -\definereference - [PrintDezePagina] - [JS(Print_This_Page)] - -\definereference - [PrintThisPage] - [JS(Print_This_Page)] - -\endinput diff --git a/tex/context/base/java-fld.mkii b/tex/context/base/java-fld.mkii new file mode 100644 index 000000000..93a90dc0a --- /dev/null +++ b/tex/context/base/java-fld.mkii @@ -0,0 +1,475 @@ +%D \module +%D [ file=java-fld, +%D version=1998.05.20, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Field Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% will be simplified, since we now parse functions + +% nu nog alles geladen, moet dus anders + +\startJSpreamble {Sanitize_TeX_Input} used later + + function Sanitized_TeX_String (value) + { var v = value ; + v = v.replace( /\\\\oe/g,"\\234") ; + v = v.replace( /\\\\<>/g,"\\273") ; + v = v.replace( /\\\\`A/g,"\\300") ; + v = v.replace( /\\\\'A/g,"\\301") ; + v = v.replace( /\\\\^A/g,"\\302") ; + v = v.replace( /\\\\~A/g,"\\303") ; + v = v.replace( /\\\\"A/g,"\\304") ; + v = v.replace( /\\\\oA/g,"\\305") ; + v = v.replace( /\\\\AE/g,"\\306") ; + v = v.replace( /\\\\,C/g,"\\307") ; + v = v.replace( /\\\\`E/g,"\\310") ; + v = v.replace( /\\\\'E/g,"\\311") ; + v = v.replace( /\\\\^E/g,"\\312") ; + v = v.replace( /\\\\"E/g,"\\313") ; + v = v.replace( /\\\\`I/g,"\\314") ; + v = v.replace( /\\\\'I/g,"\\315") ; + v = v.replace( /\\\\^I/g,"\\316") ; + v = v.replace( /\\\\"I/g,"\\317") ; + v = v.replace( /\\\\~N/g,"\\321") ; + v = v.replace( /\\\\`O/g,"\\322") ; + v = v.replace( /\\\\'O/g,"\\323") ; + v = v.replace( /\\\\^O/g,"\\324") ; + v = v.replace( /\\\\~O/g,"\\325") ; + v = v.replace( /\\\\"O/g,"\\326") ; + v = v.replace( /\\\\`U/g,"\\331") ; + v = v.replace( /\\\\'U/g,"\\332") ; + v = v.replace( /\\\\^U/g,"\\333") ; + v = v.replace( /\\\\"U/g,"\\334") ; + v = v.replace( /\\\\'Y/g,"\\335") ; + v = v.replace( /\\\\ss/g,"\\337") ; + v = v.replace( /\\\\`a/g,"\\340") ; + v = v.replace( /\\\\'a/g,"\\341") ; + v = v.replace( /\\\\^a/g,"\\342") ; + v = v.replace( /\\\\~a/g,"\\343") ; + v = v.replace( /\\\\"a/g,"\\344") ; + v = v.replace( /\\\\oa/g,"\\345") ; + v = v.replace( /\\\\ae/g,"\\346") ; + v = v.replace( /\\\\,c/g,"\\347") ; + v = v.replace( /\\\\`e/g,"\\350") ; + v = v.replace( /\\\\'e/g,"\\351") ; + v = v.replace( /\\\\^e/g,"\\352") ; + v = v.replace( /\\\\"e/g,"\\353") ; + v = v.replace( /\\\\`i/g,"\\354") ; + v = v.replace( /\\\\'i/g,"\\355") ; + v = v.replace( /\\\\^i/g,"\\356") ; + v = v.replace( /\\\\"i/g,"\\357") ; + v = v.replace( /\\\\~n/g,"\\361") ; + v = v.replace( /\\\\`o/g,"\\362") ; + v = v.replace( /\\\\'o/g,"\\363") ; + v = v.replace( /\\\\^o/g,"\\364") ; + v = v.replace( /\\\\~o/g,"\\365") ; + v = v.replace( /\\\\"o/g,"\\366") ; + v = v.replace( /\\\\`u/g,"\\371") ; + v = v.replace( /\\\\'u/g,"\\372") ; + v = v.replace( /\\\\^u/g,"\\373") ; + v = v.replace( /\\\\"u/g,"\\374") ; + v = v.replace( /\\\\'y/g,"\\375") ; + v = v.replace( /\\\\"y/g,"\\377") ; + return(v) } + + var TeX_Key_Mode = 0 ; + + function Initialize_TeX_Keystroke () + { TeX_Key_Char = "" ; + TeX_Key_Mode = 0 } + + function Sanitized_TeX_Keystroke (change) + { if (change=="\\\\") + { TeX_Key_Mode = 1 ; + return("") } + else if (TeX_Key_Mode==1) + { TeX_Key_Mode = 2 ; + TeX_Key_Char = change ; + return("") } + else if (TeX_Key_Mode==2) + { TeX_Key_Mode = 0 ; + TeX_Key_Char = "\\\\"+TeX_Key_Char+change ; + return(Sanitized_TeX_String(TeX_Key_Char)) } + else + { TeX_Key_Mode = 0 ; + return(change) } } + +\stopJSpreamble + +\startJScode {Initialize_TeX_Key} uses {Sanitize_TeX_Input} + Initialize_TeX_Keystroke() ; +\stopJScode + +\startJScode {Convert_TeX_Key} uses {Sanitize_TeX_Input} + if (!event.willCommit) + { event.change = Sanitized_TeX_Keystroke(event.change) } +\stopJScode + +\startJScode{Convert_TeX_String} uses {Sanitize_TeX_Input} + event.value = Sanitized_TeX_String(event.value) ; +\stopJScode + +\startJSpreamble fields_1 used now + +var visible_field = new Array() ; +var visible_fields = 0 ; + +function PresetFields ( ) + { this.syncAnnotScan() } + +function Preset_Fields ( ) + { this.syncAnnotScan() } + +function Hide_When_Down ( ) + { event.target.hidden = true } + +function Hide_Field ( Name ) + { var v = this.getField(Name) ; + if (v) + { v.hidden = true ; + v.readonly = true ; + this.dirty = false } } + +function Do_Vide_Field ( Name, Closable ) + { var v = this.getField(Name) ; + if (v) + { ++visible_fields ; + visible_field[visible_fields] = Name ; + v.hidden = false ; + if (Closable) + { v.readonly = false ; + v.value = "On" } + this.dirty = false } } + +function Vide_Field ( Name ) + { Do_Vide_Field(Name,false) } + +function Vide_Hide_Field ( Name ) + { Do_Vide_Field(Name,true) } + +function Hide_Fields () + { while (visible_fields>0) + { Hide_Field(visible_field[visible_fields]) ; + --visible_fields } } + +function Vide_Fields ( Name ) + { Hide_Fields () ; + Vide_Field ( Name) } + +function Vide_Hide_Fields ( Name ) + { Hide_Fields () ; + Vide_Hide_Field ( Name) } + +function Toggle_Hide ( Name ) + { var v = this.getField(Name) ; + if (v) + { v.hidden = !v.hidden ; + this.dirty = false } } + +function Field_On ( Name ) + { v = this.getField(Name) ; + if (v) { v.value = "On" ; this.dirty = false } } + +function Field_Off ( Name ) + { var v = this.getField(Name) ; + if (v) { v.value = "Off" ; this.dirty = false } } + +function Toggle_Value ( Name ) + { var v = this.getField(Name) ; + if (v) + { if (v.value=="On") + { v.value = "Off" } + else + { v.value = "On" } } + this.dirty = false } + +function Toggle_Read ( Name ) + { var v = this.getField(Name); + if (v) { v.readonly = !v.readonly } } + +function Flip_Fields ( Name ) + { var Names = Name.split(",") ; + for (var i=0;i0) { + var v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + if (v.value == "On") { + v.value = "Off" ; + } + } + fieldset.number-- ; + v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + v.value = "On" ; + } + } + } +} + +function Next_Walk_Field ( FieldSet ) { + var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; + if (fieldset) { + Do_Stop_Auto_Walk_Field(FieldSet) ; + fieldset.running = false ; + fieldset.paused = false ; + var f = fieldset.number + 1 ; + var v = this.getField(FieldSet + ":" + f) ; + if (v) { + var v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + if (v.value == "On") { + v.value = "Off" ; + } + } + fieldset.number++ ; + v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + v.value = "On" ; + } + } + } +} + +function Set_Walk_Field_Delay ( FieldSet, Delay ) { + var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; + if (fieldset) { + if (Delay) { + fieldset.delay = Delay ; + if (fieldset.running) { + Do_Stop_Auto_Walk_Field(FieldSet) ; + Do_Start_Auto_Walk_Field(FieldSet) ; + } + } + } +} + +\stopJSpreamble + +\definereference[Walk] [JS(Walk_Field)] +\definereference[StartWalk] [JS(Start_Walk_Field)] +\definereference[StopWalk] [JS(Stop_Walk_Field)] +\definereference[PauseWalk] [JS(Pause_Walk_Field)] +\definereference[ResetWalk] [JS(Reset_Walk_Field)] +\definereference[PreviousWalk][JS(Previous_Walk_Field)] +\definereference[NextWalk] [JS(Next_Walk_Field)] +\definereference[SetWalkDelay][JS(Set_Walk_Field_Delay)] + +\endinput diff --git a/tex/context/base/java-fld.tex b/tex/context/base/java-fld.tex deleted file mode 100644 index 93a90dc0a..000000000 --- a/tex/context/base/java-fld.tex +++ /dev/null @@ -1,475 +0,0 @@ -%D \module -%D [ file=java-fld, -%D version=1998.05.20, -%D title=\CONTEXT\ JavaScript Macros, -%D subtitle=Field Support, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% will be simplified, since we now parse functions - -% nu nog alles geladen, moet dus anders - -\startJSpreamble {Sanitize_TeX_Input} used later - - function Sanitized_TeX_String (value) - { var v = value ; - v = v.replace( /\\\\oe/g,"\\234") ; - v = v.replace( /\\\\<>/g,"\\273") ; - v = v.replace( /\\\\`A/g,"\\300") ; - v = v.replace( /\\\\'A/g,"\\301") ; - v = v.replace( /\\\\^A/g,"\\302") ; - v = v.replace( /\\\\~A/g,"\\303") ; - v = v.replace( /\\\\"A/g,"\\304") ; - v = v.replace( /\\\\oA/g,"\\305") ; - v = v.replace( /\\\\AE/g,"\\306") ; - v = v.replace( /\\\\,C/g,"\\307") ; - v = v.replace( /\\\\`E/g,"\\310") ; - v = v.replace( /\\\\'E/g,"\\311") ; - v = v.replace( /\\\\^E/g,"\\312") ; - v = v.replace( /\\\\"E/g,"\\313") ; - v = v.replace( /\\\\`I/g,"\\314") ; - v = v.replace( /\\\\'I/g,"\\315") ; - v = v.replace( /\\\\^I/g,"\\316") ; - v = v.replace( /\\\\"I/g,"\\317") ; - v = v.replace( /\\\\~N/g,"\\321") ; - v = v.replace( /\\\\`O/g,"\\322") ; - v = v.replace( /\\\\'O/g,"\\323") ; - v = v.replace( /\\\\^O/g,"\\324") ; - v = v.replace( /\\\\~O/g,"\\325") ; - v = v.replace( /\\\\"O/g,"\\326") ; - v = v.replace( /\\\\`U/g,"\\331") ; - v = v.replace( /\\\\'U/g,"\\332") ; - v = v.replace( /\\\\^U/g,"\\333") ; - v = v.replace( /\\\\"U/g,"\\334") ; - v = v.replace( /\\\\'Y/g,"\\335") ; - v = v.replace( /\\\\ss/g,"\\337") ; - v = v.replace( /\\\\`a/g,"\\340") ; - v = v.replace( /\\\\'a/g,"\\341") ; - v = v.replace( /\\\\^a/g,"\\342") ; - v = v.replace( /\\\\~a/g,"\\343") ; - v = v.replace( /\\\\"a/g,"\\344") ; - v = v.replace( /\\\\oa/g,"\\345") ; - v = v.replace( /\\\\ae/g,"\\346") ; - v = v.replace( /\\\\,c/g,"\\347") ; - v = v.replace( /\\\\`e/g,"\\350") ; - v = v.replace( /\\\\'e/g,"\\351") ; - v = v.replace( /\\\\^e/g,"\\352") ; - v = v.replace( /\\\\"e/g,"\\353") ; - v = v.replace( /\\\\`i/g,"\\354") ; - v = v.replace( /\\\\'i/g,"\\355") ; - v = v.replace( /\\\\^i/g,"\\356") ; - v = v.replace( /\\\\"i/g,"\\357") ; - v = v.replace( /\\\\~n/g,"\\361") ; - v = v.replace( /\\\\`o/g,"\\362") ; - v = v.replace( /\\\\'o/g,"\\363") ; - v = v.replace( /\\\\^o/g,"\\364") ; - v = v.replace( /\\\\~o/g,"\\365") ; - v = v.replace( /\\\\"o/g,"\\366") ; - v = v.replace( /\\\\`u/g,"\\371") ; - v = v.replace( /\\\\'u/g,"\\372") ; - v = v.replace( /\\\\^u/g,"\\373") ; - v = v.replace( /\\\\"u/g,"\\374") ; - v = v.replace( /\\\\'y/g,"\\375") ; - v = v.replace( /\\\\"y/g,"\\377") ; - return(v) } - - var TeX_Key_Mode = 0 ; - - function Initialize_TeX_Keystroke () - { TeX_Key_Char = "" ; - TeX_Key_Mode = 0 } - - function Sanitized_TeX_Keystroke (change) - { if (change=="\\\\") - { TeX_Key_Mode = 1 ; - return("") } - else if (TeX_Key_Mode==1) - { TeX_Key_Mode = 2 ; - TeX_Key_Char = change ; - return("") } - else if (TeX_Key_Mode==2) - { TeX_Key_Mode = 0 ; - TeX_Key_Char = "\\\\"+TeX_Key_Char+change ; - return(Sanitized_TeX_String(TeX_Key_Char)) } - else - { TeX_Key_Mode = 0 ; - return(change) } } - -\stopJSpreamble - -\startJScode {Initialize_TeX_Key} uses {Sanitize_TeX_Input} - Initialize_TeX_Keystroke() ; -\stopJScode - -\startJScode {Convert_TeX_Key} uses {Sanitize_TeX_Input} - if (!event.willCommit) - { event.change = Sanitized_TeX_Keystroke(event.change) } -\stopJScode - -\startJScode{Convert_TeX_String} uses {Sanitize_TeX_Input} - event.value = Sanitized_TeX_String(event.value) ; -\stopJScode - -\startJSpreamble fields_1 used now - -var visible_field = new Array() ; -var visible_fields = 0 ; - -function PresetFields ( ) - { this.syncAnnotScan() } - -function Preset_Fields ( ) - { this.syncAnnotScan() } - -function Hide_When_Down ( ) - { event.target.hidden = true } - -function Hide_Field ( Name ) - { var v = this.getField(Name) ; - if (v) - { v.hidden = true ; - v.readonly = true ; - this.dirty = false } } - -function Do_Vide_Field ( Name, Closable ) - { var v = this.getField(Name) ; - if (v) - { ++visible_fields ; - visible_field[visible_fields] = Name ; - v.hidden = false ; - if (Closable) - { v.readonly = false ; - v.value = "On" } - this.dirty = false } } - -function Vide_Field ( Name ) - { Do_Vide_Field(Name,false) } - -function Vide_Hide_Field ( Name ) - { Do_Vide_Field(Name,true) } - -function Hide_Fields () - { while (visible_fields>0) - { Hide_Field(visible_field[visible_fields]) ; - --visible_fields } } - -function Vide_Fields ( Name ) - { Hide_Fields () ; - Vide_Field ( Name) } - -function Vide_Hide_Fields ( Name ) - { Hide_Fields () ; - Vide_Hide_Field ( Name) } - -function Toggle_Hide ( Name ) - { var v = this.getField(Name) ; - if (v) - { v.hidden = !v.hidden ; - this.dirty = false } } - -function Field_On ( Name ) - { v = this.getField(Name) ; - if (v) { v.value = "On" ; this.dirty = false } } - -function Field_Off ( Name ) - { var v = this.getField(Name) ; - if (v) { v.value = "Off" ; this.dirty = false } } - -function Toggle_Value ( Name ) - { var v = this.getField(Name) ; - if (v) - { if (v.value=="On") - { v.value = "Off" } - else - { v.value = "On" } } - this.dirty = false } - -function Toggle_Read ( Name ) - { var v = this.getField(Name); - if (v) { v.readonly = !v.readonly } } - -function Flip_Fields ( Name ) - { var Names = Name.split(",") ; - for (var i=0;i0) { - var v = this.getField(FieldSet + ":" + fieldset.number) ; - if (v) { - if (v.value == "On") { - v.value = "Off" ; - } - } - fieldset.number-- ; - v = this.getField(FieldSet + ":" + fieldset.number) ; - if (v) { - v.value = "On" ; - } - } - } -} - -function Next_Walk_Field ( FieldSet ) { - var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; - if (fieldset) { - Do_Stop_Auto_Walk_Field(FieldSet) ; - fieldset.running = false ; - fieldset.paused = false ; - var f = fieldset.number + 1 ; - var v = this.getField(FieldSet + ":" + f) ; - if (v) { - var v = this.getField(FieldSet + ":" + fieldset.number) ; - if (v) { - if (v.value == "On") { - v.value = "Off" ; - } - } - fieldset.number++ ; - v = this.getField(FieldSet + ":" + fieldset.number) ; - if (v) { - v.value = "On" ; - } - } - } -} - -function Set_Walk_Field_Delay ( FieldSet, Delay ) { - var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; - if (fieldset) { - if (Delay) { - fieldset.delay = Delay ; - if (fieldset.running) { - Do_Stop_Auto_Walk_Field(FieldSet) ; - Do_Start_Auto_Walk_Field(FieldSet) ; - } - } - } -} - -\stopJSpreamble - -\definereference[Walk] [JS(Walk_Field)] -\definereference[StartWalk] [JS(Start_Walk_Field)] -\definereference[StopWalk] [JS(Stop_Walk_Field)] -\definereference[PauseWalk] [JS(Pause_Walk_Field)] -\definereference[ResetWalk] [JS(Reset_Walk_Field)] -\definereference[PreviousWalk][JS(Previous_Walk_Field)] -\definereference[NextWalk] [JS(Next_Walk_Field)] -\definereference[SetWalkDelay][JS(Set_Walk_Field_Delay)] - -\endinput diff --git a/tex/context/base/java-imp-ans.mkiv b/tex/context/base/java-imp-ans.mkiv new file mode 100644 index 000000000..636c894f9 --- /dev/null +++ b/tex/context/base/java-imp-ans.mkiv @@ -0,0 +1,28 @@ +%D \module +%D [ file=java-ans, +%D version=1998.06.01, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Answer Analization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\startJSpreamble{Do_Check_Answer} used later + + function Do_Check_Answer (field, value) + { if (event.value.toLowerCase()==value.toLowerCase()) + { event.target.hidden = true } + % { event.target.display = display.hidden } + return("\040") } // funny, "" does not work + +\stopJSpreamble + +\startJScode{Check_Answer} uses {Do_Check_Answer} + event.value = Do_Check_Answer(JS_S_1, JS_S_2) ; +\stopJScode + +\endinput diff --git a/tex/context/base/java-imp-exa.mkiv b/tex/context/base/java-imp-exa.mkiv new file mode 100644 index 000000000..f40f70f84 --- /dev/null +++ b/tex/context/base/java-imp-exa.mkiv @@ -0,0 +1,395 @@ +%D \module +%D [ file=java-exa, +%D version=2002.??.??, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Example Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% XFDF versus HTML +% localhost versus remote versus set + +% filename | filename-nr => name +% fakename | fakename-nr => file upload, unless localhost +% +% we erase the list because otherwise we end up in browser remembering +% problems; also, it is not possible to set upload fields 'manually' + +\startJSpreamble request_1 used now + + var example_method = "HTML" ; + var example_host = "" ; + var example_port = "" ; + var example_url = "" ; + var example_file = "" ; + + var example_log = true ; % false + + function stripped_exa_value( name ) { + f = this.getField(name) ; + if (f) { + str = f.value ; + if (str.indexOf(name+'-')==0) { + str = str.substr(name.length+1) ; + } + return str ; + } else { + return "" ; + } + } + + function identify_example_url ( ) { + if (example_log) { + console.clear ; + console.println("base url: "+this.baseURL) ; + console.println("this url: "+this.URL) ; + } + if (this.baseURL != "") { + example_url = this.baseURL ; + } else { + if (this.URL != "") { + example_url = this.URL + } + } + if (example_url.indexOf("file://")>=0) { + example_url = "" ; + } + str = stripped_exa_value("examplehost") ; + if (str != "auto") { + example_host = str ; + if (str == "localhost") { + example_port = "8061" + } + } + str = stripped_exa_value("exampleport") ; + if (str != "auto") { + example_port = str ; + } + if (example_log) { + console.println("example_url: "+example_url) ; + console.println("example_host: "+example_host) ; + console.println("example_port: "+example_port) ; + } + } + + function check_example_url ( url ) { + if (url.indexOf("file://")>=0) { + url = "http://localhost:8061" ; + console.println("file url replaced by: "+url) ; + } else { + if (url.indexOf("://")<0) { + url = "http://" + url ; + } + if (example_log) { + console.println("url before check: "+url) ; + } +% url = url.replace(/(http:\\\/\\\/.+)(\\\/.*$)/, "$1") ; + url = url.replace(/(https*:\\\/\\\/.+?)(\\\/.*$)/, "$1/exarequest") ; + if (example_log) { + console.println("url after check: "+url) ; + } + } + return url ; + } + + function set_example_xfdf ( method ) { + example_method = method ; + } + + function set_example_file ( file ) { + example_method = file ; + } + + function set_example_host ( host ) { + example_host = host ; + } + + function set_example_port ( port ) { + example_host = host ; + } + + function do_erase_example_file(tag) { + f = this.getField(tag) ; + if (f) { + f.value = "" ; + } + } + + function do_erase_example_list(tag) { + for (i=1;i<=100;i++) { + f = this.getField(tag+"-"+i) ; + if (f) { + f.value = "" ; + } else { + return + } + } + } + + function do_submit_example_url ( url ) { + if ((example_method == "XFDF" ) || (url.indexOf("localhost")>=0)) { + do_erase_example_file("fakename") ; + do_erase_example_list("fakename") ; + } + url = check_example_url(url) ; + if (example_log) { + console.println("submitting form to "+url+" using method "+example_method) ; + } + if (example_file != "") { + url = url + "/" + example_file ; + } + % we need the bFDF for acrobat 5 + this.submitForm({cURL : url, bFDF : false, cSubmitAs : example_method}) ; + } + + function submit_example_form ( ) { + identify_example_url() ; + if (example_host != "") { + if (example_port != "") { + do_submit_example_url(example_host+":"+example_port) ; + } else { + do_submit_example_url(example_host) ; + } + } else { + if (example_url != "") { + do_submit_example_url(example_url) ; + } else { + if (example_port != "") { + do_submit_example_url("localhost"+":"+example_port) ; + } else { + do_submit_example_url("localhost:8061") ; % local exampler + } + } + } + resetfilename () ; + } + + function submit_form ( host, port) { + set_example_host(host) ; + set_example_post(post) ; + submit_example_form ; + } + +\stopJSpreamble + +\startJSpreamble request_2 used now + + var exa_command = "" ; + var exa_option = "" ; + var exa_filename = "" ; + var exa_filelist = "" ; + var exa_registered = "" ; + + function set_request (command,option) { + exa_command = command ; + if (exa_command == "") { + exa_option = option ; + } else { if (option == "") { + exa_option = "" ; + } else { if (option.indexOf("--")<0) { + exa_option = "--action=" + option ; + } else { + exa_option = option ; + } } } + } + + function assemble_request ( ) { + v = this.getField('filename') ; + if (v) { + exa_filename = v.value ; + } + v = this.getField('filelist') ; + if (v) { + exa_filelist = v.value ; + } +% exa_filename = exa_filename.replace(/\\\\/g,'/') ; +% exa_filelist = exa_filelist.replace(/\\\\/g,'/') ; + str = "\\n" ; + str = str+"" ; + if (exa_filelist == "") { + exa_filelist = exa_registered ; + } else { if (exa_registered != "") { + exa_filelist = exa_filelist + "\\n" + exa_registered ; + } } + if (exa_command != "") { + str = str+""+exa_command+"" ; + } + if (exa_option != "") { + str = str+""+exa_option+"" ; + } + if (exa_filename != "") { + str = str+""+exa_filename+"" ; + } + var fls = "" ; + if (exa_filelist != "") { + % old method, soon obsolete + lst = exa_filelist.split(/\\s/) ; + for (i=0;i"+lst[i]+"" ; + } + } else { if (exa_multiple) { + for (i=1;i<=100;i++) { + % console.println("file field "+i) ; + f = this.getField("filename-"+ i) ; +% if (f) { if (f.value != "") { +% if (g) { if (g.value == "") { +% fls = fls+""+f.value+"" ; +% } else { +% fls = fls+""+f.value+"" ; +% } } else { +% fls = fls+""+f.value+"" ; +% } +% } } + if (f) { if (f.value != "") { + fls = fls + "" ; + } else { + % console.println("b") ; + fls = fls + " label='" + g.value + "'>" ; + } } else { + % console.println("c") ; + fls = fls + ">" ; + } + fls = fls + f.value + "" ; + } } + } + } } + if (fls != "") { + str = str + "" + fls + "" ; + } + str = str + "" ; + v = this.getField('exa:request') ; + if (v) { + v.value = str ; + } + } + +\stopJSpreamble + +\startJSpreamble request_3 used now + + var exa_multiple = false ; + + function setfilename ( suffixes ) { + if (event.targetName) { + var name = event.targetName ; + var fake = name.replace(/filename/,"fakename") ; + } else { + var name = 'filename' ; + var fake = 'fakename' ; + } + f = this.getField(fake) ; + if (f) { + f.browseForFileToSubmit() ; + if ((suffixes != "") && (f.value != "")) { + % + s = suffixes.replace(/,/g,"|") ; + r = new RegExp() ; + s = "\\\\.(" + s + ")$" ; + r.compile(s, "i") ; + if (f.value.search(r)<=0) { + f.value = "" ; + app.alert('This filetype is not permitted.') ; + % + % lst = suffixes.split(/,/) ; + % ok = false ; + % for (i=0;i=0) { +% f.value = "" ; +% } +% } + } + this.dirty = false ; + } + + function addfilename () { + if (exa_multiple) { + h = this.getField("filelist") ; + g = this.getField("filename") ; + if ((g) && (h)) { + str = g.value ; + if (h.value == "") { + h.value = str ; + } else { + h.value = h.value + "\\n" + str ; + } + g.value = "" ; + this.value = "" ; + } + } + this.dirty = false ; + } + + % this only works with client that assembles request + + function registerfilename (str) { + if (str!="") { + h = this.getField("filelist") ; + if (h) { + if (h.value != "") { + h.value = h.value + "\\n" ; + } + h.value = h.value + str ; + } else { + if (exa_registered != "") { + exa_registered = exa_registered + "\\n" ; + } + exa_registered = exa_registered + str ; + } + } + console.show ; + console.println('registered files') ; + console.println("file: "+str) ; + console.println("list: "+exa_registered) ; + this.dirty = false ; + } + + function checkfilename () { + } + + function getfilename ( suffixes ) { + setfilename(suffixes) ; + checkfilename() ; + addfilename() ; + } + + function resetfilename () { + do_erase_example_file("fakename") ; + do_erase_example_file("filename") ; + do_erase_example_file("filelist") ; + do_erase_example_list("filename") ; + do_erase_example_list("fakename") ; + } + +\stopJSpreamble + +\endinput diff --git a/tex/context/base/java-imp-fil.mkiv b/tex/context/base/java-imp-fil.mkiv new file mode 100644 index 000000000..4d79a2ace --- /dev/null +++ b/tex/context/base/java-imp-fil.mkiv @@ -0,0 +1,48 @@ +%D \module +%D [ file=java-fil, +%D version=1998.06.01, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Filing and Printing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\startJSpreamble Auxiliary used now + + function DocumentFileName () + { var Paths = this.path.split("/") ; + Paths = Paths[Paths.length-1].split(".") ; + return(Paths[0]) } + + function Print_Page_Range(From, To) % gaat mis, nog geen args mogelijk + { if ((Number(From)>0)&&(Number(To)>=Number(From))) + { var myFrom = Number(From)-1 ; + var myTo = Number(To)-1 ; + this.print(false,myFrom,myTo,true) } } + + function Print_This_Page () + { this.print(false,this.pageNum,this.pageNum,true) } + +\stopJSpreamble + +\definereference + [PrintSubPaginas] + [JS(Print_Page_Range{\firstsubpage,\lastsubpage})] + +\definereference + [PrintSubPages] + [JS(Print_Page_Range{\firstsubpage,\lastsubpage})] + +\definereference + [PrintDezePagina] + [JS(Print_This_Page)] + +\definereference + [PrintThisPage] + [JS(Print_This_Page)] + +\endinput diff --git a/tex/context/base/java-imp-fld.mkiv b/tex/context/base/java-imp-fld.mkiv new file mode 100644 index 000000000..93a90dc0a --- /dev/null +++ b/tex/context/base/java-imp-fld.mkiv @@ -0,0 +1,475 @@ +%D \module +%D [ file=java-fld, +%D version=1998.05.20, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Field Support, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% will be simplified, since we now parse functions + +% nu nog alles geladen, moet dus anders + +\startJSpreamble {Sanitize_TeX_Input} used later + + function Sanitized_TeX_String (value) + { var v = value ; + v = v.replace( /\\\\oe/g,"\\234") ; + v = v.replace( /\\\\<>/g,"\\273") ; + v = v.replace( /\\\\`A/g,"\\300") ; + v = v.replace( /\\\\'A/g,"\\301") ; + v = v.replace( /\\\\^A/g,"\\302") ; + v = v.replace( /\\\\~A/g,"\\303") ; + v = v.replace( /\\\\"A/g,"\\304") ; + v = v.replace( /\\\\oA/g,"\\305") ; + v = v.replace( /\\\\AE/g,"\\306") ; + v = v.replace( /\\\\,C/g,"\\307") ; + v = v.replace( /\\\\`E/g,"\\310") ; + v = v.replace( /\\\\'E/g,"\\311") ; + v = v.replace( /\\\\^E/g,"\\312") ; + v = v.replace( /\\\\"E/g,"\\313") ; + v = v.replace( /\\\\`I/g,"\\314") ; + v = v.replace( /\\\\'I/g,"\\315") ; + v = v.replace( /\\\\^I/g,"\\316") ; + v = v.replace( /\\\\"I/g,"\\317") ; + v = v.replace( /\\\\~N/g,"\\321") ; + v = v.replace( /\\\\`O/g,"\\322") ; + v = v.replace( /\\\\'O/g,"\\323") ; + v = v.replace( /\\\\^O/g,"\\324") ; + v = v.replace( /\\\\~O/g,"\\325") ; + v = v.replace( /\\\\"O/g,"\\326") ; + v = v.replace( /\\\\`U/g,"\\331") ; + v = v.replace( /\\\\'U/g,"\\332") ; + v = v.replace( /\\\\^U/g,"\\333") ; + v = v.replace( /\\\\"U/g,"\\334") ; + v = v.replace( /\\\\'Y/g,"\\335") ; + v = v.replace( /\\\\ss/g,"\\337") ; + v = v.replace( /\\\\`a/g,"\\340") ; + v = v.replace( /\\\\'a/g,"\\341") ; + v = v.replace( /\\\\^a/g,"\\342") ; + v = v.replace( /\\\\~a/g,"\\343") ; + v = v.replace( /\\\\"a/g,"\\344") ; + v = v.replace( /\\\\oa/g,"\\345") ; + v = v.replace( /\\\\ae/g,"\\346") ; + v = v.replace( /\\\\,c/g,"\\347") ; + v = v.replace( /\\\\`e/g,"\\350") ; + v = v.replace( /\\\\'e/g,"\\351") ; + v = v.replace( /\\\\^e/g,"\\352") ; + v = v.replace( /\\\\"e/g,"\\353") ; + v = v.replace( /\\\\`i/g,"\\354") ; + v = v.replace( /\\\\'i/g,"\\355") ; + v = v.replace( /\\\\^i/g,"\\356") ; + v = v.replace( /\\\\"i/g,"\\357") ; + v = v.replace( /\\\\~n/g,"\\361") ; + v = v.replace( /\\\\`o/g,"\\362") ; + v = v.replace( /\\\\'o/g,"\\363") ; + v = v.replace( /\\\\^o/g,"\\364") ; + v = v.replace( /\\\\~o/g,"\\365") ; + v = v.replace( /\\\\"o/g,"\\366") ; + v = v.replace( /\\\\`u/g,"\\371") ; + v = v.replace( /\\\\'u/g,"\\372") ; + v = v.replace( /\\\\^u/g,"\\373") ; + v = v.replace( /\\\\"u/g,"\\374") ; + v = v.replace( /\\\\'y/g,"\\375") ; + v = v.replace( /\\\\"y/g,"\\377") ; + return(v) } + + var TeX_Key_Mode = 0 ; + + function Initialize_TeX_Keystroke () + { TeX_Key_Char = "" ; + TeX_Key_Mode = 0 } + + function Sanitized_TeX_Keystroke (change) + { if (change=="\\\\") + { TeX_Key_Mode = 1 ; + return("") } + else if (TeX_Key_Mode==1) + { TeX_Key_Mode = 2 ; + TeX_Key_Char = change ; + return("") } + else if (TeX_Key_Mode==2) + { TeX_Key_Mode = 0 ; + TeX_Key_Char = "\\\\"+TeX_Key_Char+change ; + return(Sanitized_TeX_String(TeX_Key_Char)) } + else + { TeX_Key_Mode = 0 ; + return(change) } } + +\stopJSpreamble + +\startJScode {Initialize_TeX_Key} uses {Sanitize_TeX_Input} + Initialize_TeX_Keystroke() ; +\stopJScode + +\startJScode {Convert_TeX_Key} uses {Sanitize_TeX_Input} + if (!event.willCommit) + { event.change = Sanitized_TeX_Keystroke(event.change) } +\stopJScode + +\startJScode{Convert_TeX_String} uses {Sanitize_TeX_Input} + event.value = Sanitized_TeX_String(event.value) ; +\stopJScode + +\startJSpreamble fields_1 used now + +var visible_field = new Array() ; +var visible_fields = 0 ; + +function PresetFields ( ) + { this.syncAnnotScan() } + +function Preset_Fields ( ) + { this.syncAnnotScan() } + +function Hide_When_Down ( ) + { event.target.hidden = true } + +function Hide_Field ( Name ) + { var v = this.getField(Name) ; + if (v) + { v.hidden = true ; + v.readonly = true ; + this.dirty = false } } + +function Do_Vide_Field ( Name, Closable ) + { var v = this.getField(Name) ; + if (v) + { ++visible_fields ; + visible_field[visible_fields] = Name ; + v.hidden = false ; + if (Closable) + { v.readonly = false ; + v.value = "On" } + this.dirty = false } } + +function Vide_Field ( Name ) + { Do_Vide_Field(Name,false) } + +function Vide_Hide_Field ( Name ) + { Do_Vide_Field(Name,true) } + +function Hide_Fields () + { while (visible_fields>0) + { Hide_Field(visible_field[visible_fields]) ; + --visible_fields } } + +function Vide_Fields ( Name ) + { Hide_Fields () ; + Vide_Field ( Name) } + +function Vide_Hide_Fields ( Name ) + { Hide_Fields () ; + Vide_Hide_Field ( Name) } + +function Toggle_Hide ( Name ) + { var v = this.getField(Name) ; + if (v) + { v.hidden = !v.hidden ; + this.dirty = false } } + +function Field_On ( Name ) + { v = this.getField(Name) ; + if (v) { v.value = "On" ; this.dirty = false } } + +function Field_Off ( Name ) + { var v = this.getField(Name) ; + if (v) { v.value = "Off" ; this.dirty = false } } + +function Toggle_Value ( Name ) + { var v = this.getField(Name) ; + if (v) + { if (v.value=="On") + { v.value = "Off" } + else + { v.value = "On" } } + this.dirty = false } + +function Toggle_Read ( Name ) + { var v = this.getField(Name); + if (v) { v.readonly = !v.readonly } } + +function Flip_Fields ( Name ) + { var Names = Name.split(",") ; + for (var i=0;i0) { + var v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + if (v.value == "On") { + v.value = "Off" ; + } + } + fieldset.number-- ; + v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + v.value = "On" ; + } + } + } +} + +function Next_Walk_Field ( FieldSet ) { + var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; + if (fieldset) { + Do_Stop_Auto_Walk_Field(FieldSet) ; + fieldset.running = false ; + fieldset.paused = false ; + var f = fieldset.number + 1 ; + var v = this.getField(FieldSet + ":" + f) ; + if (v) { + var v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + if (v.value == "On") { + v.value = "Off" ; + } + } + fieldset.number++ ; + v = this.getField(FieldSet + ":" + fieldset.number) ; + if (v) { + v.value = "On" ; + } + } + } +} + +function Set_Walk_Field_Delay ( FieldSet, Delay ) { + var fieldset = Do_Get_Check_Walk_Field(FieldSet) ; + if (fieldset) { + if (Delay) { + fieldset.delay = Delay ; + if (fieldset.running) { + Do_Stop_Auto_Walk_Field(FieldSet) ; + Do_Start_Auto_Walk_Field(FieldSet) ; + } + } + } +} + +\stopJSpreamble + +\definereference[Walk] [JS(Walk_Field)] +\definereference[StartWalk] [JS(Start_Walk_Field)] +\definereference[StopWalk] [JS(Stop_Walk_Field)] +\definereference[PauseWalk] [JS(Pause_Walk_Field)] +\definereference[ResetWalk] [JS(Reset_Walk_Field)] +\definereference[PreviousWalk][JS(Previous_Walk_Field)] +\definereference[NextWalk] [JS(Next_Walk_Field)] +\definereference[SetWalkDelay][JS(Set_Walk_Field_Delay)] + +\endinput diff --git a/tex/context/base/java-imp-stp.mkiv b/tex/context/base/java-imp-stp.mkiv new file mode 100644 index 000000000..df4fbcc2f --- /dev/null +++ b/tex/context/base/java-imp-stp.mkiv @@ -0,0 +1,121 @@ +%D \module +%D [ file=java-stp, +%D version=2004.03.15, +%D title=\CONTEXT\ JavaScript Macros, +%D subtitle=Stepping, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% we define ocglist global, otherwise we quickly run into a memory hog (even +% out of memory in a 512 Meg machine) + +% we cannot use doc_visited[this.pageNum] instead of doc_currentstep because +% of some funny side effect (i.e. dup or so) + +\startJSpreamble Steps used now + + var doc_ocglist = this.getOCGs() ; + var doc_stepname = "step" ; + var doc_currentstep = 0 ; + var doc_maxstep = 50 ; + var doc_visited = new Array() ; + var doc_busy = new Array() ; + + function SetupStepper ( layername, laststep ) { + doc_stepname = layername ; + doc_maxstep = laststep ; + for (var i=0; i<=this.numPages; i++) { + doc_visited[i] = 0 ; + doc_busy[i] = 0 ; + } + } + + for (var i=0; i<=this.numPages; i++) { + doc_visited[i] = 0 ; + doc_busy[i] = 0 ; + } + + function GetOCG ( name ) { + for (var i=0; i < doc_ocglist.length; i++) { + if (doc_ocglist[i].name == name) { + return doc_ocglist[i] ; + } + } + return null ; + } + + function CheckBusy ( ) { + var ocg = GetOCG("step:busy") ; + if (ocg != null) { + if (doc_visited[this.pageNum]==0) { + ocg.state = true ; + } else { + if (doc_visited[this.pageNum] 18. March 2010 - -\unprotect - -\installlanguage - [\s!tr] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!year,\ ,\v!month,\ ,\v!day}] - -\installlanguage - [\s!tk] - [\c!spacing=\v!broad, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!year,\ ,\v!month,\ ,\v!day} - \s!patterns=\s!tk, - \s!lefthyphenmin=1, - \s!righthyphenmin=2] - -\installlanguage [turkish] [\s!tr] -\installlanguage [turkmen] [\s!tk] - -\protect \endinput diff --git a/tex/context/base/lang-ana.mkiv b/tex/context/base/lang-ana.mkiv deleted file mode 100644 index c108655c4..000000000 --- a/tex/context/base/lang-ana.mkiv +++ /dev/null @@ -1,24 +0,0 @@ -%D \module -%D [ file=lang-ana, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Anatolian Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Anatolian Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. - -\unprotect - -\protect \endinput diff --git a/tex/context/base/lang-ara.mkiv b/tex/context/base/lang-ara.mkiv deleted file mode 100644 index d576df488..000000000 --- a/tex/context/base/lang-ara.mkiv +++ /dev/null @@ -1,63 +0,0 @@ -%D \module -%D [ file=lang-ara, -%D version=2008.06.20, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Arabic Languages, -%D author=Khaled Hosny, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Language Macros / Arabic Languages} - -\unprotect - -\definesystemconstant {arabic} -\definesystemvariable {ar} - -\installlanguage - [\s!ar] - [\c!spacing=\v!broad, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,\ ,\v!month,{،\ },\v!year}] - -\installlanguage [\s!arabic] [\s!ar] - -% Just aliases to "ar" for now - -\installlanguage[\s!ar-ae][\c!default=\s!ar] % U.A.E. -\installlanguage[\s!ar-bh][\c!default=\s!ar] % Bahrain -\installlanguage[\s!ar-eg][\c!default=\s!ar] % Egypt -\installlanguage[\s!ar-in][\c!default=\s!ar] % India? -\installlanguage[\s!ar-kw][\c!default=\s!ar] % Kuwait -\installlanguage[\s!ar-ly][\c!default=\s!ar] % Libya -\installlanguage[\s!ar-om][\c!default=\s!ar] % Oman -\installlanguage[\s!ar-qa][\c!default=\s!ar] % Qatar -\installlanguage[\s!ar-sa][\c!default=\s!ar] % Saudi Arabia -\installlanguage[\s!ar-sd][\c!default=\s!ar] % Sudan -\installlanguage[\s!ar-tn][\c!default=\s!ar] % Tunisia -\installlanguage[\s!ar-ye][\c!default=\s!ar] % Yemen - -% Syriac months - -\installlanguage[\s!ar-sy][\c!default=\s!ar] % Syria -\installlanguage[\s!ar-iq][\c!default=\s!ar-sy] % Iraq -\installlanguage[\s!ar-jo][\c!default=\s!ar-sy] % Jordan -\installlanguage[\s!ar-lb][\c!default=\s!ar-sy] % Lebanon - -% Maghribi months - -\installlanguage[\s!ar-dz][\c!default=\s!ar] % Algeria -\installlanguage[\s!ar-ma][\c!default=\s!ar] % Morocco - -\protect \endinput diff --git a/tex/context/base/lang-art.mkiv b/tex/context/base/lang-art.mkiv deleted file mode 100644 index e8be91630..000000000 --- a/tex/context/base/lang-art.mkiv +++ /dev/null @@ -1,26 +0,0 @@ -%D \module -%D [ file=lang--art, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Artificial Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Artificial Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. - -% Esperanto - -\unprotect - -\protect \endinput diff --git a/tex/context/base/lang-bal.mkiv b/tex/context/base/lang-bal.mkiv deleted file mode 100644 index a6d03a2ab..000000000 --- a/tex/context/base/lang-bal.mkiv +++ /dev/null @@ -1,44 +0,0 @@ -%D \module -%D [ file=lang-bal, -%D version=2010.01.21, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Baltic Languages, -%D author=Marius Aleknevičius, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Baltic Languages} - -%D The framework of this module is set up by Hans Hagen while -%D all the translations were done by Marius Aleknevičius. If -%D you have suggestions, don't hesitate to send us an email. - -%D This file is in \UTF\ encoding and is meant for \MKIV. - -% Lettish/Latvian, Lietuvių/Lithuanian - -\unprotect - -\installlanguage - [\s!lt] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\lowerleftdoubleninequote, - \c!rightquote=\upperrightdoublesixquote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoublesixquote, - \c!date={\v!year,~m.,\ ,\v!month,\ ,\v!day,~d.}, - \s!patterns=\s!lt, - \s!lefthyphenmin=2, - \s!righthyphenmin=2] - -\installlanguage [lithuanian] [\s!lt] - -\protect \endinput diff --git a/tex/context/base/lang-cel.mkiv b/tex/context/base/lang-cel.mkiv deleted file mode 100644 index 4d93957f1..000000000 --- a/tex/context/base/lang-cel.mkiv +++ /dev/null @@ -1,26 +0,0 @@ -%D \module -%D [ file=lang-cel, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Celtic Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Celtic Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. - -% Breton, Welsh, Irish, Manx, Scottish Gaelic - -\unprotect - -\protect \endinput diff --git a/tex/context/base/lang-cjk.mkiv b/tex/context/base/lang-cjk.mkiv deleted file mode 100644 index 4594c52b4..000000000 --- a/tex/context/base/lang-cjk.mkiv +++ /dev/null @@ -1,48 +0,0 @@ -%D \module -%D [ file=lang-chi, -%D version=2009.03.02, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Chinese, -%D author={Hans Hagen \& Wang Lei}, -%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 Derived from \MKII\ files. - -\writestatus{loading}{ConTeXt Language Macros / CJK} - -\definesystemconstant {chinese} \definesystemconstant {cn} -\definesystemconstant {japanese} \definesystemconstant {ja} -\definesystemconstant {korean} \definesystemconstant {kr} - -\unprotect - -\installlanguage - [\s!cn] - [\c!leftsentence=——, - \c!rightsentence=——, - \c!leftsubsentence=——, - \c!rightsubsentence=——, - \c!leftquote=‘, - \c!rightquote=’, - \c!leftquotation=“, - \c!rightquotation=”, - \c!date={\v!year,年,\ ,\v!month,\v!day,日}] - -\installlanguage - [\s!ja] - [\c!leftsentence=——, - \c!rightsentence=——, - \c!leftsubsentence=——, - \c!rightsubsentence=——, - \c!leftquote=‘, - \c!rightquote=’, - \c!leftquotation=「, - \c!rightquotation=」, - \c!date={西暦,\v!year,年,\v!month,月,\v!day,日}] - -\protect \endinput diff --git a/tex/context/base/lang-cyr.mkiv b/tex/context/base/lang-cyr.mkiv deleted file mode 100644 index a07fe8d4a..000000000 --- a/tex/context/base/lang-cyr.mkiv +++ /dev/null @@ -1,60 +0,0 @@ -%D \module -%D [ file=lang-cyr, -%D version=2003.01.24, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Cyrillic Languages, -%D author=see below, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Cyrillic Languages} - -%D The cyrillic languages always use a dedicated input regime. -%D Therefore we define the labels using symbolic names. -%D Support for cyrillic is initiated by Olga Briginets who -%D also layed the base for the language, encoding and font -%D definition. Later Alexander Bokovoy and Victor Figurnov -%D improved things. I (Hans Hagen) mainly cleaned things up -%D a bit. - -\unprotect - -\installlanguage - [\s!ru] - [\s!lefthyphenmin=2, - \s!righthyphenmin=2, - \c!spacing=\v!packed, - \c!leftsentence=\leftguillemot, - \c!rightsentence=\rightguillemot, - \c!leftsubsentence=\lowerleftdoubleninequote, - \c!rightsubsentence=\upperrightdoubleninequote, - \c!leftquote=\lowerleftdoubleninequote, - \c!rightquote=\upperrightdoubleninequote, - \c!leftquotation=\leftguillemot, - \c!rightquotation=\rightguillemot, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!ua] - [\s!lefthyphenmin=2, - \s!righthyphenmin=2, - \c!spacing=\v!packed, - \c!leftsentence=\leftguillemot, - \c!rightsentence=\rightguillemot, - \c!leftsubsentence=\lowerleftdoubleninequote, - \c!rightsubsentence=\upperrightdoubleninequote, - \c!leftquote=\lowerleftdoubleninequote, - \c!rightquote=\upperrightdoubleninequote, - \c!leftquotation=\leftguillemot, - \c!rightquotation=\rightguillemot, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}, - \s!patterns=\s!uk] - -\installlanguage [russian] [\s!ru] -\installlanguage [ukrainian] [\s!ua] - -\protect \endinput diff --git a/tex/context/base/lang-def.mkiv b/tex/context/base/lang-def.mkiv new file mode 100644 index 000000000..88f4f1cdf --- /dev/null +++ b/tex/context/base/lang-def.mkiv @@ -0,0 +1,715 @@ +%D \module +%D [ file=lang-def, +%D version=2011.01.24, % merge of language files +%D title=\CONTEXT\ Language Macros, +%D subtitle=Languages Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt Language Macros / Definitions} + +%D See \type {lang-*.tex} for some historic notes. + +\unprotect + +% Germanic Languages: Danish, Faeroese, Icelandic, Norwegian, +% Swedish, German, Yiddish, Afrikaans, Dutch, English, Flemush, +% Frisian, Plattdeutsch + +\installlanguage + [\s!nl] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!en] + [\c!spacing=\v!broad, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!month,\ ,\v!day,{,\ },\v!year}, + \s!patterns=\s!us, + \s!lefthyphenmin=2, + \s!righthyphenmin=3] + +\installlanguage + [\s!de] + [\c!spacing=\v!packed, + \s!lefthyphenmin=3, + \s!righthyphenmin=3, + \c!leftsentence={\hbox{--~}}, + \c!rightsentence={\hbox{~--}}, + \c!leftsubsentence={--}, + \c!rightsubsentence={--}, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsinglesixquote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoublesixquote, + \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!da] + [\c!spacing=\v!packed, + \c!leftsentence={\hbox{--\hskip.5em}}, + \c!rightsentence={\hbox{\hskip.5em--}}, + \c!leftsubsentence={--}, + \c!rightsubsentence={--}, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsinglesixquote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoublesixquote, + \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!sv] + [\c!spacing=\v!packed, + \c!leftsentence={\hbox{--~}}, + \c!rightsentence={\hbox{~--}}, + \c!leftsubsentence={--}, + \c!rightsubsentence={--}, + \c!leftquote=\upperrightsingleninequote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperrightdoubleninequote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!af] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!year,\ ,\v!month,\ ,\v!day}] + +\installlanguage + [\s!nb] + [spacing=packed, + lefthyphenmin=2, + righthyphenmin=2, + leftsentence=---, + rightsentence=---, + leftsubsentence=---, + rightsubsentence=---, + leftquote=\upperleftsinglesixquote, + rightquote=\upperrightsingleninequote, + leftquotation=\leftguillemot, + rightquotation=\rightguillemot, + date={day,{.},\ ,month,\ ,year}] + +\installlanguage + [\s!nn] + [spacing=packed, + lefthyphenmin=2, + righthyphenmin=2, + leftsentence=---, + rightsentence=---, + leftsubsentence=---, + rightsubsentence=---, + leftquote=\upperleftsinglesixquote, + rightquote=\upperrightsingleninequote, + leftquotation=\leftguillemot, + rightquotation=\rightguillemot, + date={day,{.},\ ,month,\ ,year}] + +\installlanguage [\s!no] [\s!nb] +\installlanguage [\s!norwegian] [\s!nb] +\installlanguage [\s!bokmal] [\s!nb] +\installlanguage [\s!nynorsk] [\s!nn] + +\installlanguage % old german + [deo] + [\c!spacing=\v!packed, + \c!default=\s!de] + +\installlanguage + [de-de] + [\c!spacing=\v!packed, + \c!default=\s!de] + +\installlanguage + [de-at] + [\c!spacing=\v!packed, + \c!default=\s!de, + \c!leftquote=\leftguillemot, + \c!rightquote=\rightguillemot, + \c!leftquotation=\leftguillemot, + \c!rightquotation=\rightguillemot] + +\installlanguage + [de-ch] + [\c!spacing=\v!packed, + \c!default=\s!de] + +%D And some alternative (but very real) english patterns: + +\installlanguage + [en-gb] + [\c!default=\s!en, + \s!patterns=\s!gb, + \s!lefthyphenmin=3, + \s!righthyphenmin=3] + +\installlanguage + [en-us] + [\c!default=\s!en, + \s!patterns=\s!us] + +\installlanguage [\s!uk] [\s!en-\s!gb] +\installlanguage [\s!us] [\s!en-\s!us] + +\installlanguage [usenglish] [\s!en-\s!us] +\installlanguage [ukenglish] [\s!en-\s!gb] +\installlanguage [english] [\s!en] +\installlanguage [dutch] [\s!nl] +\installlanguage [german] [\s!de] +\installlanguage [danish] [\s!da] +\installlanguage [swedish] [\s!sv] +\installlanguage [afrikaans] [\s!af] + +%D Next we implement couple of ordinal mumber converters: + +\def\enordinaldaynumber#1% + {#1\ifnum\lasttwodigits{#1}=11 + \highordinalstr{th}% + \else\ifnum\lasttwodigits{#1}=12 + \highordinalstr{th}% + \else\ifnum\lasttwodigits{#1}=13 + \highordinalstr{th}% + \else\ifcase\lastdigit{#1}% + \highordinalstr{th}% + \or % 1 + \highordinalstr{st}% + \or % 2 + \highordinalstr{nd}% + \or % 3 + \highordinalstr{rd}% + \else + \highordinalstr{th}% + \fi\fi\fi\fi} + +% \def\enordinaldaynumber#1% +% {#1\ordinalstr{\ifnum\lasttwodigits{#1}=11 th\else\ifcase\lastdigit{#1} +% th\or st\or nd\or rd\else th\fi\fi}} + +\def\nlordinaldaynumber#1% + {#1\highordinalstr{e}} + +% Slavic Languages: Belarussian, Russian, Ukrainian, Bulgarian, +% Macedonian, Serbian, Croatian, Slovenian, Czech, Kushubian, +% Lusatian/Sorbian/Wendish, Polish, Slovak, Albanian, Illyrian, +% Armenian + +\installlanguage + [\s!pl] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!cs] + [\c!spacing=\v!packed, + \c!leftsentence=\thickglue--\thickglue\penalty-20\relax, % hh, \relax added + \c!rightsentence=\thickglue--\thickglue\penalty-20\relax, + \c!leftsubsentence=~---~\penalty-20\relax, + \c!rightsubsentence=~---~\penalty-20\relax, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsinglesixquote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoublesixquote, + \c!date={\v!day,{.\,},\v!month,\ ,\v!year}] + +\installlanguage + [\s!sk] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,{.\,},\v!month,\ ,\v!year}] + +\installlanguage + [\s!hr] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!sl] + [\c!spacing=\v!packed, + \c!leftsentence={\hbox{--~}}, + \c!rightsentence={\hbox{~--}}, + \c!leftsubsentence={--}, + \c!rightsubsentence={--}, + %\c!leftquote=\lowerleftsingleninequote, + %\c!rightquote=\upperrightsinglesixquote, + %\c!leftquotation=\lowerleftdoubleninequote, + %\c!rightquotation=\upperrightdoublesixquote, + \c!leftquote=\guilsingleright, + \c!rightquote=\guilsingleleft, + \c!leftquotation=\rightguillemot, + \c!rightquotation=\leftguillemot, + \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] + +\installlanguage [polish] [\s!pl] +\installlanguage [czech] [\s!cs] +\installlanguage [slovak] [\s!sk] +\installlanguage [croatian] [\s!hr] +\installlanguage [slovenian] [\s!sl] +\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?) + +\installlanguage [cz] [\s!cs] + +\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}} + +\def\sloveniancharacters{\doconvertsloveniancharacters\sloveniancharacter} +\def\slovenianCharacters{\doconvertsloveniancharacters\slovenianCharacter} + +%D Define general-purpose macros for Slovenian character enumerations: + +\defineconversion [sloveniancharacter] [\sloveniancharacter] +\defineconversion [slovenianCharacter] [\slovenianCharacter] + +\defineconversion [sloveniancharacters] [\sloveniancharacters] +\defineconversion [slovenianCharacters] [\slovenianCharacters] + +%D Define these as the general character enumeration when +%D language is Slovenian. If you feel uncomfortable with this, +%D mail Mojca, since she promised to to take the heat. + +\defineconversion [sl] [character] [\sloveniancharacter] +\defineconversion [sl] [Character] [\slovenianCharacter] + +\defineconversion [sl] [characters] [\sloveniancharacters] +\defineconversion [sl] [Characters] [\slovenianCharacters] + +\defineconversion [sl] [a] [\sloveniancharacters] +\defineconversion [sl] [A] [\slovenianCharacters] +\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters] +\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters] + +\def\sloveniancharacters#1{\ctxlua{converters.alphabetic(\number#1,"sl")}} +\def\slovenianCharacters#1{\ctxlua{converters.Alphabetic(\number#1,"sl")}} + +% Cyrillic Languages + +\installlanguage + [\s!ru] + [\s!lefthyphenmin=2, + \s!righthyphenmin=2, + \c!spacing=\v!packed, + \c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\lowerleftdoubleninequote, + \c!rightsubsentence=\upperrightdoubleninequote, + \c!leftquote=\lowerleftdoubleninequote, + \c!rightquote=\upperrightdoubleninequote, + \c!leftquotation=\leftguillemot, + \c!rightquotation=\rightguillemot, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!ua] + [\s!lefthyphenmin=2, + \s!righthyphenmin=2, + \c!spacing=\v!packed, + \c!leftsentence=\leftguillemot, + \c!rightsentence=\rightguillemot, + \c!leftsubsentence=\lowerleftdoubleninequote, + \c!rightsubsentence=\upperrightdoubleninequote, + \c!leftquote=\lowerleftdoubleninequote, + \c!rightquote=\upperrightdoubleninequote, + \c!leftquotation=\leftguillemot, + \c!rightquotation=\rightguillemot, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}, + \s!patterns=\s!uk] + +\installlanguage [russian] [\s!ru] +\installlanguage [ukrainian] [\s!ua] + +% Uralic Languages: Cheremiss, Estonian, Finnish, Karelian, Laap, +% Mordvinian, Permian tongues, Hungarian, Ostyak, Vogul, Samoyed + +\installlanguage + [\s!fi] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!year,\ ,\v!month,\ ,\v!day}] + +\installlanguage + [\s!hu] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\lowerleftsingleninequote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!year,.,\ ,\v!month,\ ,\v!day,.}] + +\installlanguage [finish] [\s!fi] +\installlanguage [hungarian] [\s!hu] + +% Altaic Languages: Uigur, Uzbek, Azeri/Azerbaijani, Chuvash, +% Turkish, Turkmen, Kazakh, Kazar, Kireghiz, Noghay, Talar, +% Buryat, Kalmuck, Khalkha + +\installlanguage + [\s!tr] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!year,\ ,\v!month,\ ,\v!day}] + +\installlanguage + [\s!tk] + [\c!spacing=\v!broad, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!year,\ ,\v!month,\ ,\v!day} + \s!patterns=\s!tk, + \s!lefthyphenmin=1, + \s!righthyphenmin=2] + +\installlanguage [turkish] [\s!tr] +\installlanguage [turkmen] [\s!tk] + +% Anatolian Languages + +% Arabic Languages + +\definesystemconstant {arabic} +\definesystemvariable {ar} + +\installlanguage + [\s!ar] + [\c!spacing=\v!broad, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,\ ,\v!month,{،\ },\v!year}] + +\installlanguage [\s!arabic] [\s!ar] + +% Just aliases to "ar" for now + +\installlanguage[\s!ar-ae][\c!default=\s!ar] % U.A.E. +\installlanguage[\s!ar-bh][\c!default=\s!ar] % Bahrain +\installlanguage[\s!ar-eg][\c!default=\s!ar] % Egypt +\installlanguage[\s!ar-in][\c!default=\s!ar] % India? +\installlanguage[\s!ar-kw][\c!default=\s!ar] % Kuwait +\installlanguage[\s!ar-ly][\c!default=\s!ar] % Libya +\installlanguage[\s!ar-om][\c!default=\s!ar] % Oman +\installlanguage[\s!ar-qa][\c!default=\s!ar] % Qatar +\installlanguage[\s!ar-sa][\c!default=\s!ar] % Saudi Arabia +\installlanguage[\s!ar-sd][\c!default=\s!ar] % Sudan +\installlanguage[\s!ar-tn][\c!default=\s!ar] % Tunisia +\installlanguage[\s!ar-ye][\c!default=\s!ar] % Yemen + +% Syriac months + +\installlanguage[\s!ar-sy][\c!default=\s!ar] % Syria +\installlanguage[\s!ar-iq][\c!default=\s!ar-sy] % Iraq +\installlanguage[\s!ar-jo][\c!default=\s!ar-sy] % Jordan +\installlanguage[\s!ar-lb][\c!default=\s!ar-sy] % Lebanon + +% Maghribi months + +\installlanguage[\s!ar-dz][\c!default=\s!ar] % Algeria +\installlanguage[\s!ar-ma][\c!default=\s!ar] % Morocco + +% Artificial Languages: Esperanto + +% Baltic Languages: Lettish/Latvian, Lietuvių/Lithuanian + +\installlanguage + [\s!lt] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\lowerleftdoubleninequote, + \c!rightquote=\upperrightdoublesixquote, + \c!leftquotation=\lowerleftdoubleninequote, + \c!rightquotation=\upperrightdoublesixquote, + \c!date={\v!year,~m.,\ ,\v!month,\ ,\v!day,~d.}, + \s!patterns=\s!lt, + \s!lefthyphenmin=2, + \s!righthyphenmin=2] + +\installlanguage [lithuanian] [\s!lt] + +% Celtic: Breton, Welsh, Irish, Manx, Scottish Gaelic + +% CJK + +\definesystemconstant {chinese} \definesystemconstant {cn} +\definesystemconstant {japanese} \definesystemconstant {ja} +\definesystemconstant {korean} \definesystemconstant {kr} + +\installlanguage + [\s!cn] + [\c!leftsentence=——, + \c!rightsentence=——, + \c!leftsubsentence=——, + \c!rightsubsentence=——, + \c!leftquote=‘, + \c!rightquote=’, + \c!leftquotation=“, + \c!rightquotation=”, + \c!date={\v!year,年,\ ,\v!month,\v!day,日}] + +\installlanguage + [\s!ja] + [\c!leftsentence=——, + \c!rightsentence=——, + \c!leftsubsentence=——, + \c!rightsubsentence=——, + \c!leftquote=‘, + \c!rightquote=’, + \c!leftquotation=「, + \c!rightquotation=」, + \c!date={西暦,\v!year,年,\v!month,月,\v!day,日}] + +% Greek + +\installlanguage + [\s!gr] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\greekleftquot, + \c!rightquote=\greekrightquot, + \c!leftquotation=\greekleftquot, + \c!rightquotation=\greekrightquot, + \c!date={\v!day\ \v!month\ \v!year}, + \s!patterns=\s!agr] % ok? + +\installlanguage [greek] [\s!gr] + +\installlanguage + [\s!agr] + [\s!default=\s!gr, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote] + +\installlanguage [ancientgreek] [\s!agr] +\installlanguage [grk] [\s!agr] + +% Indo-Iranian Languages: 34. + +% Italic Languages: Latin, Italian, Rhaeto-Romanic, Rumanian, +% Sardian, Catalan, French, Ladino, Portuguese, Proven\c{c}al, +% Spanish + +\ifx\guillemotspace\undefined \let\guillemotspace\empty \fi +\ifx\sentencespace \undefined \let\sentencespace \empty \fi + +\installlanguage + [\s!fr] + [\c!spacing=\v!packed, + \c!leftsentence=\emdash, + \c!rightsentence=\emdash, + \c!leftsubsentence=\emdash, + \c!rightsubsentence=\emdash, + \c!leftquote=\leftguillemot, + \c!rightquote=\rightguillemot, + \c!leftquotation=\leftguillemot, + \c!rightquotation=\rightguillemot, + \c!date={\v!day+,\v!space,\v!month,\v!space,\v!year}] + +\installlanguage + [\s!es] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +\installlanguage [sp] [\s!es] % old times context + +\installlanguage + [\s!ca] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +% Note GB left|/|right (sub)sentences are for \quote {incisi}. + +\installlanguage + [\s!it] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=--, + \c!rightsubsentence=--, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!leftspeech=\leftguillemot, + \c!middlespeech=\leftguillemot, + \c!rightspeech=\rightguillemot, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +\installlanguage % the same as italian + [\s!la] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\lowerrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\lowerrightdoubleninequote, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +\installlanguage + [\s!pt] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\upperleftsinglesixquote, + \c!rightquote=\upperrightsingleninequote, + \c!leftquotation=\upperleftdoublesixquote, + \c!rightquotation=\upperrightdoubleninequote, + \c!date={\v!year,\ ,\v!month,\ ,\v!day}] + +\installlanguage + [\s!ro] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\leftguillemot, + \c!rightquote=\rightguillemot, + \c!leftquotation=\lowerrightdoubleninequote, + \c!rightquotation=\upperleftdoublesixquote, + \c!date={\v!day,\ ,\v!month,\ ,\v!year}] + +%D For compatibility reasons we also define: + +\installlanguage [fa] [\s!fr] % for dutchies only + +\installlanguage [french] [\s!fr] +\installlanguage [spanish] [\s!es] +\installlanguage [catalan] [\s!ca] +\installlanguage [italian] [\s!it] +\installlanguage [latin] [\s!la] +\installlanguage [portuguese] [\s!pt] +\installlanguage [romanian] [\s!ro] + +%D Ordinal converters: + +\def\frordinaldaynumber#1% date is masculine + {\number#1\ifcase#1\or + \highordinalstr{er}% + \fi} + +\defineconversion [\s!fr] [\v!day+] [\frordinaldaynumber] + +% Vietnamese Language + +\installlanguage + [\s!vi] + [\c!spacing=\v!packed, + \c!leftsentence=---, + \c!rightsentence=---, + \c!leftsubsentence=---, + \c!rightsubsentence=---, + \c!leftquote=\quoteleft, + \c!rightquote=\quoteright, + \c!leftquotation=\quotedblleft, + \c!rightquotation=\quotedblright, + \c!date={{ },dd,{/},mm,{/},yy}] + +\installlanguage [vietnamese] [\s!vi] + +\protect \endinput diff --git a/tex/context/base/lang-ger.mkiv b/tex/context/base/lang-ger.mkiv deleted file mode 100644 index abba341a4..000000000 --- a/tex/context/base/lang-ger.mkiv +++ /dev/null @@ -1,259 +0,0 @@ -%D \module -%D [ file=lang-ger, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Germanic Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Germanic Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. -%D -%D \starttabulate[|lB|l|] -%D \NC Norwegian \NC Hans Fredrik Nordhaug \NC \NR -%D \NC Danish \NC Arne Jorgensen \NC \NR % check the o -%D \NC Afrikaans \NC \NC \NR -%D \stoptabulate - -% Danish, Faeroese, Icelandic, Norwegian, Swedish, German, Yiddish -% Afrikaans, Dutch, English, Flemush, Frisian, Plattdeutsch - -\unprotect - -\installlanguage - [\s!nl] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!en] - [\c!spacing=\v!broad, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!month,\ ,\v!day,{,\ },\v!year}, - \s!patterns=\s!us, - \s!lefthyphenmin=2, - \s!righthyphenmin=3] - -\installlanguage - [\s!de] - [\c!spacing=\v!packed, - \s!lefthyphenmin=3, - \s!righthyphenmin=3, - \c!leftsentence={\hbox{--~}}, - \c!rightsentence={\hbox{~--}}, - \c!leftsubsentence={--}, - \c!rightsubsentence={--}, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsinglesixquote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoublesixquote, - \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!da] - [\c!spacing=\v!packed, - \c!leftsentence={\hbox{--\hskip.5em}}, - \c!rightsentence={\hbox{\hskip.5em--}}, - \c!leftsubsentence={--}, - \c!rightsubsentence={--}, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsinglesixquote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoublesixquote, - \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!sv] - [\c!spacing=\v!packed, - \c!leftsentence={\hbox{--~}}, - \c!rightsentence={\hbox{~--}}, - \c!leftsubsentence={--}, - \c!rightsubsentence={--}, - \c!leftquote=\upperrightsingleninequote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperrightdoubleninequote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!af] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!year,\ ,\v!month,\ ,\v!day}] - -\installlanguage - [\s!nb] - [spacing=packed, - lefthyphenmin=2, - righthyphenmin=2, - leftsentence=---, - rightsentence=---, - leftsubsentence=---, - rightsubsentence=---, - leftquote=\upperleftsinglesixquote, - rightquote=\upperrightsingleninequote, - leftquotation=\leftguillemot, - rightquotation=\rightguillemot, - date={day,{.},\ ,month,\ ,year}] - -\installlanguage - [\s!nn] - [spacing=packed, - lefthyphenmin=2, - righthyphenmin=2, - leftsentence=---, - rightsentence=---, - leftsubsentence=---, - rightsubsentence=---, - leftquote=\upperleftsinglesixquote, - rightquote=\upperrightsingleninequote, - leftquotation=\leftguillemot, - rightquotation=\rightguillemot, - date={day,{.},\ ,month,\ ,year}] - -\installlanguage [\s!no] [\s!nb] -\installlanguage [\s!norwegian] [\s!nb] -\installlanguage [\s!bokmal] [\s!nb] -\installlanguage [\s!nynorsk] [\s!nn] - -%D Extra: - -% \mainlanguage[en] -% \mainlanguage[de] -% \mainlanguage[deo] -% \mainlanguage[de-de] -% \mainlanguage[de-at] -% \mainlanguage[de-ch] -% -% \starttext -% Die Herren Meier\index{Meier}, Müller\index{Müller}, Huber\index{Huber} -% und Schmidt\index{Schmidt} arbeiten in der gleichen Firma. -% -% \index{Mass}\index{Mas}\index{Maß}\index{Maße}\index{Masse} -% \index{Muller}\index{Mûller} -% \index{Hutte}\index{Hütte}\index{Huttf} -% \index{paar}\index{Paar} -% \index{a}\index{aa}\index{ä}\index{az}\index{aza} -% \index{o}\index{oo}\index{ö}\index{oz}\index{oza} -% \index{u}\index{uu}\index{ü}\index{uz}\index{uza}\index{üa} -% \index{call}\index{chip} -% -% \subject{Index} \placeindex -% \stoptext - -\installlanguage % old german - [deo] - [\c!spacing=\v!packed, - \c!default=\s!de] - -\installlanguage - [de-de] - [\c!spacing=\v!packed, - \c!default=\s!de] - -\installlanguage - [de-at] - [\c!spacing=\v!packed, - \c!default=\s!de, - \c!leftquote=\leftguillemot, - \c!rightquote=\rightguillemot, - \c!leftquotation=\leftguillemot, - \c!rightquotation=\rightguillemot] - -\installlanguage - [de-ch] - [\c!spacing=\v!packed, - \c!default=\s!de] - -%D And some alternative (but very real) english patterns: - -\installlanguage - [en-gb] - [\c!default=\s!en, - \s!patterns=\s!gb, - \s!lefthyphenmin=3, - \s!righthyphenmin=3] - -\installlanguage - [en-us] - [\c!default=\s!en, - \s!patterns=\s!us] - -\installlanguage [\s!uk] [\s!en-\s!gb] -\installlanguage [\s!us] [\s!en-\s!us] - -%D For compatibility reasons we also define: - -%installlanguage [du] [\s!de] % old times context -%installlanguage [sp] [\s!es] % old times context /lang-ita - -\installlanguage [usenglish] [\s!en-\s!us] -\installlanguage [ukenglish] [\s!en-\s!gb] -\installlanguage [english] [\s!en] -\installlanguage [dutch] [\s!nl] -\installlanguage [german] [\s!de] -\installlanguage [danish] [\s!da] -\installlanguage [swedish] [\s!sv] -\installlanguage [afrikaans] [\s!af] - -%D Next we implement couple of ordinal mumber converters: - -\def\enordinaldaynumber#1% - {#1\ifnum\lasttwodigits{#1}=11 - \highordinalstr{th}% - \else\ifnum\lasttwodigits{#1}=12 - \highordinalstr{th}% - \else\ifnum\lasttwodigits{#1}=13 - \highordinalstr{th}% - \else\ifcase\lastdigit{#1}% - \highordinalstr{th}% - \or % 1 - \highordinalstr{st}% - \or % 2 - \highordinalstr{nd}% - \or % 3 - \highordinalstr{rd}% - \else - \highordinalstr{th}% - \fi\fi\fi\fi} - -% \def\enordinaldaynumber#1% -% {#1\ordinalstr{\ifnum\lasttwodigits{#1}=11 th\else\ifcase\lastdigit{#1} -% th\or st\or nd\or rd\else th\fi\fi}} - -\def\nlordinaldaynumber#1% - {#1\highordinalstr{e}} - -\protect \endinput diff --git a/tex/context/base/lang-grk.mkiv b/tex/context/base/lang-grk.mkiv deleted file mode 100644 index 92bd9aca6..000000000 --- a/tex/context/base/lang-grk.mkiv +++ /dev/null @@ -1,48 +0,0 @@ -%D \module -%D [ file=lang-grk, -%D version=2003.04.01, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Uralic Languages, -%D author=Apostolos Syropoulos -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Greek} - -%D The framework of this module is set up by Hans Hagen while -%D all the translations have been done by Apostolos Syropoulos - -\unprotect - -\installlanguage - [\s!gr] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\greekleftquot, - \c!rightquote=\greekrightquot, - \c!leftquotation=\greekleftquot, - \c!rightquotation=\greekrightquot, - \c!date={\v!day\ \v!month\ \v!year}, - \s!patterns=\s!agr] % ok? - -\installlanguage [greek] [\s!gr] - -\installlanguage - [\s!agr] - [\s!default=\s!gr, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote] - -\installlanguage [ancientgreek] [\s!agr] -\installlanguage [grk] [\s!agr] - -\protect \endinput diff --git a/tex/context/base/lang-ind.mkiv b/tex/context/base/lang-ind.mkiv deleted file mode 100644 index 9b6e5ff1d..000000000 --- a/tex/context/base/lang-ind.mkiv +++ /dev/null @@ -1,26 +0,0 @@ -%D \module -%D [ file=lang--ind, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Indo Iranian Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / 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 / Indo-Iranian Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. - -% 34 languages - -\unprotect - -\protect \endinput diff --git a/tex/context/base/lang-ini.mkii b/tex/context/base/lang-ini.mkii index 91ac59847..50a3689cf 100644 --- a/tex/context/base/lang-ini.mkii +++ b/tex/context/base/lang-ini.mkii @@ -265,7 +265,7 @@ \fi \egroup} -\fetchruntimecommand \showpatterns {\f!languageprefix\s!run.mkii} +\fetchruntimecommand \showpatterns {\f!languageprefix\s!run} %D Since we can only load patterns in ini\TeX, we nil the %D loading before dumping (which saves a bit of memory, but diff --git a/tex/context/base/lang-ita.mkiv b/tex/context/base/lang-ita.mkiv deleted file mode 100644 index 2443825de..000000000 --- a/tex/context/base/lang-ita.mkiv +++ /dev/null @@ -1,157 +0,0 @@ -%D \module -%D [ file=lang-ita, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Italic Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% Todo: replace \'.. by \namedglyph - -\writestatus{loading}{ConTeXt Language Macros / Italic Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. -%D -%D \starttabulate[|lB|l|] -%D \NC Italian \NC Giuseppe Bilotta \NC \NR -%D \NC Romanian \NC Dan Seracu \NC \NR -%D \NC Portuguese \NC Pedro F. M. Mendon\c a \NC \NR -%D \stoptabulate - -% Latin, Italian, Rhaeto-Romanic, Rumanian, Sardian -% Catalan, French, Ladino, Portuguese, Proven\c{c}al, Spanish - -\unprotect - -\ifx\guillemotspace\undefined \let\guillemotspace\empty \fi -\ifx\sentencespace \undefined \let\sentencespace \empty \fi - -\installlanguage - [\s!fr] - [\c!spacing=\v!packed, - \c!leftsentence=\emdash, - \c!rightsentence=\emdash, - \c!leftsubsentence=\emdash, - \c!rightsubsentence=\emdash, - \c!leftquote=\leftguillemot, - \c!rightquote=\rightguillemot, - \c!leftquotation=\leftguillemot, - \c!rightquotation=\rightguillemot, - \c!date={\v!day+,\v!space,\v!month,\v!space,\v!year}] - -\installlanguage - [\s!es] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -\installlanguage [sp] [\s!es] % old times context - -\installlanguage - [\s!ca] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -% Note GB left|/|right (sub)sentences are for \quote {incisi}. - -\installlanguage - [\s!it] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=--, - \c!rightsubsentence=--, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!leftspeech=\leftguillemot, - \c!middlespeech=\leftguillemot, - \c!rightspeech=\rightguillemot, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -\installlanguage % the same as italian - [\s!la] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\lowerrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\lowerrightdoubleninequote, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!pt] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!year,\ ,\v!month,\ ,\v!day}] - -\installlanguage - [\s!ro] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\leftguillemot, - \c!rightquote=\rightguillemot, - \c!leftquotation=\lowerrightdoubleninequote, - \c!rightquotation=\upperleftdoublesixquote, - \c!date={\v!day,\ ,\v!month,\ ,\v!year}] - -%D For compatibility reasons we also define: - -\installlanguage [fa] [\s!fr] % for dutchies only - -\installlanguage [french] [\s!fr] -\installlanguage [spanish] [\s!es] -\installlanguage [catalan] [\s!ca] -\installlanguage [italian] [\s!it] -\installlanguage [latin] [\s!la] -\installlanguage [portuguese] [\s!pt] -\installlanguage [romanian] [\s!ro] - -%D Ordinal converters: - -\def\frordinaldaynumber#1% date is masculine - {\number#1\ifcase#1\or - \highordinalstr{er}% - \fi} - -\defineconversion [\s!fr] [\v!day+] [\frordinaldaynumber] - -\protect \endinput diff --git a/tex/context/base/lang-sla.mkiv b/tex/context/base/lang-sla.mkiv deleted file mode 100644 index 3bcf04c57..000000000 --- a/tex/context/base/lang-sla.mkiv +++ /dev/null @@ -1,179 +0,0 @@ -%D \module -%D [ file=lang-sla, -%D version=1999.09.13, % 1997.09.03 -%D title=\CONTEXT\ Language Macros, -%D subtitle=Slavic Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% Todo: replace \'.. by \namedglyph - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. -%D -%D \starttabulate[|lB|l|] -%D \NC Czech \NC Tom Hudec, Petr Sojka \NC \NR -%D \NC Polish \NC Grzegorz Sapijaszko \NC \NR -%D \NC Croatian \NC \Zcaron eljko Vrba \NC \NR -%D \NC Slovenian \NC Mojca Miklavec \NC \NR -%D \NC Cz and Sk \NC Richard Gabriel \NC \NR -%D \stoptabulate - -% Belarussian, Russian, Ukrainian, Bulgarian, Macedonian, -% Serbian, Croatian, Slovenian, Czech, Kushubian, -% Lusatian/Sorbian/Wendish, Polish, Slovak, Albanian, -% Illyrian, Armenian - -\writestatus{loading}{ConTeXt Language Macros / Slavic Languages} - -\unprotect - -\installlanguage - [\s!pl] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] - -\installlanguage - [\s!cs] - [\c!spacing=\v!packed, - \c!leftsentence=\thickglue--\thickglue\penalty-20\relax, % hh, \relax added - \c!rightsentence=\thickglue--\thickglue\penalty-20\relax, - \c!leftsubsentence=~---~\penalty-20\relax, - \c!rightsubsentence=~---~\penalty-20\relax, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsinglesixquote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoublesixquote, - \c!date={\v!day,{.\,},\v!month,\ ,\v!year}] - -\installlanguage - [\s!sk] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,{.\,},\v!month,\ ,\v!year}] - -\installlanguage - [\s!hr] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] - -%D The default quotation marks for Slovenian were chosen as -%D \lowerleftdoubleninequote these ones\upperrightdoublesixquote\ -%D which was probably due to the strong influence computers -%D had on typesetting, but \rightguillemot these ones\leftguillemot\ -%D are \quotation{more correct}. -%D -%D If you still want the other quotation marks, use this: -%D -%D \starttyping -%D \installlanguage -%D [sl] -%D [leftquote=\lowerleftsingleninequote, -%D rightquote=\upperrightsinglesixquote, -%D leftquotation=\lowerleftdoubleninequote, -%D rightquotation=\upperrightdoublesixquote] -%D \stoptyping -%D -%D If you disagree with the change, please send an email to Mojca, but -%D best use some pretty strong arguments because she loves S{\sl love}nia -%D too much to compromise on this. -%D -%D German faces approximately the same problem. I (MM) would prefer to -%D have something like: -%D -%D \starttyping -%D \mainlanguage[sl][quotationstyle=guillemot|doublequote] % better name needed -%D \stoptyping -%D -%D but users are expected to respect the rules of nice and correct -%D typography anyway. - -\installlanguage - [\s!sl] - [\c!spacing=\v!packed, - \c!leftsentence={\hbox{--~}}, - \c!rightsentence={\hbox{~--}}, - \c!leftsubsentence={--}, - \c!rightsubsentence={--}, - %\c!leftquote=\lowerleftsingleninequote, - %\c!rightquote=\upperrightsinglesixquote, - %\c!leftquotation=\lowerleftdoubleninequote, - %\c!rightquotation=\upperrightdoublesixquote, - \c!leftquote=\guilsingleright, - \c!rightquote=\guilsingleleft, - \c!leftquotation=\rightguillemot, - \c!rightquotation=\leftguillemot, - \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}] - -\installlanguage [polish] [\s!pl] -\installlanguage [czech] [\s!cs] -\installlanguage [slovak] [\s!sk] -\installlanguage [croatian] [\s!hr] -\installlanguage [slovenian] [\s!sl] -\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?) - -\installlanguage [cz] [\s!cs] - -\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}} - -\def\sloveniancharacters{\doconvertsloveniancharacters\sloveniancharacter} -\def\slovenianCharacters{\doconvertsloveniancharacters\slovenianCharacter} - -%D Define general-purpose macros for Slovenian character enumerations: - -\defineconversion [sloveniancharacter] [\sloveniancharacter] -\defineconversion [slovenianCharacter] [\slovenianCharacter] - -\defineconversion [sloveniancharacters] [\sloveniancharacters] -\defineconversion [slovenianCharacters] [\slovenianCharacters] - -%D Define these as the general character enumeration when -%D language is Slovenian. If you feel uncomfortable with this, -%D mail Mojca, since she promised to to take the heat. - -\defineconversion [sl] [character] [\sloveniancharacter] -\defineconversion [sl] [Character] [\slovenianCharacter] - -\defineconversion [sl] [characters] [\sloveniancharacters] -\defineconversion [sl] [Characters] [\slovenianCharacters] - -\defineconversion [sl] [a] [\sloveniancharacters] -\defineconversion [sl] [A] [\slovenianCharacters] -\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters] -\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters] - -\def\sloveniancharacters#1{\ctxlua{converters.alphabetic(\number#1,"sl")}} -\def\slovenianCharacters#1{\ctxlua{converters.Alphabetic(\number#1,"sl")}} - -\protect \endinput diff --git a/tex/context/base/lang-txt.lua b/tex/context/base/lang-txt.lua index 05e6f03bf..d0168356d 100644 --- a/tex/context/base/lang-txt.lua +++ b/tex/context/base/lang-txt.lua @@ -9,7 +9,8 @@ if not modules then modules = { } end modules ['lang-txt'] = { -- The content of this file is derived from the mkii lang-* files and -- early 2011 the mkii labels are generated from this file. The -- translations have been collected over years by users, using named --- glyphs. This file uses utf exclusively. +-- glyphs. This file uses utf exclusively. For those involved in the +-- translations see the 'lang-*.mkii' files. -- For the moment we keep this table in memory. In the future we can then -- enable labels. diff --git a/tex/context/base/lang-ura.mkiv b/tex/context/base/lang-ura.mkiv deleted file mode 100644 index 3b69d4696..000000000 --- a/tex/context/base/lang-ura.mkiv +++ /dev/null @@ -1,63 +0,0 @@ -%D \module -%D [ file=lang-sla, -%D version=1997.09.03, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Uralic Languages, -%D author=Hans Hagen / Tobias Burnus, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% Todo: replace \'.. by \namedglyph - -\writestatus{loading}{ConTeXt Language Macros / Uralic Languages} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. -%D -%D \starttabulate[|lB|l|] -%D \NC Finnish \NC \NC \NR -%D \NC Hungarian \NC Balazs Nagy \NC \NR -%D \stoptabulate - -% Cheremiss, Estonian, Finnish, Karelian, Laap, Mordvinian, -% Permian tongues, Hungarian, Ostyak, Vogul, Samoyed - -\unprotect - -\installlanguage - [\s!fi] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\upperleftsinglesixquote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\upperleftdoublesixquote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!year,\ ,\v!month,\ ,\v!day}] - -\installlanguage - [\s!hu] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\lowerleftsingleninequote, - \c!rightquote=\upperrightsingleninequote, - \c!leftquotation=\lowerleftdoubleninequote, - \c!rightquotation=\upperrightdoubleninequote, - \c!date={\v!year,.,\ ,\v!month,\ ,\v!day,.}] - -\installlanguage [finish] [\s!fi] -\installlanguage [hungarian] [\s!hu] - -\protect \endinput diff --git a/tex/context/base/lang-vn.mkiv b/tex/context/base/lang-vn.mkiv deleted file mode 100644 index 1e852d762..000000000 --- a/tex/context/base/lang-vn.mkiv +++ /dev/null @@ -1,43 +0,0 @@ -%D \module -%D [ file=lang-vn, -%D version=2004.11.22, % 1999.12.12, -%D title=\CONTEXT\ Language Macros, -%D subtitle=Vietnamese, -%D author={Han The Thanh \& Adam Lindsay \& Hans Hagen}, -%D date=\currentdate, -%D copyright=\PRAGMA] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt Language Macros / Vietnamese Language} - -%D The framework of this module is set up by Hans Hagen while -%D many of the first translations were done by Tobias. Later -%D on, corrections were made by users. If you have suggestions, -%D or feel that your name missing here, don't hesitate to send -%D us an email. -%D -%D \starttabulate[|lB|l|] -%D \NC Vietnamese \NC \THANH\ \NC \NR -%D \stoptabulate - -\unprotect - -\installlanguage - [\s!vi] - [\c!spacing=\v!packed, - \c!leftsentence=---, - \c!rightsentence=---, - \c!leftsubsentence=---, - \c!rightsubsentence=---, - \c!leftquote=\quoteleft, - \c!rightquote=\quoteright, - \c!leftquotation=\quotedblleft, - \c!rightquotation=\quotedblright, - \c!date={{ },dd,{/},mm,{/},yy}] - -\installlanguage [vietnamese] [\s!vi] - -\protect \endinput diff --git a/tex/context/base/lpdf-wid.lua b/tex/context/base/lpdf-wid.lua index 6caf2f6c4..7b535d1b1 100644 --- a/tex/context/base/lpdf-wid.lua +++ b/tex/context/base/lpdf-wid.lua @@ -227,7 +227,7 @@ function codeinjections.attachfile(specification) local width = specification.width or 0 local height = specification.height or 0 local depth = specification.depth or 0 - write_node(pdfannotation_node(width,height,depth,d())) + write_node(pdfannotation_node(width,height,depth,d())) -- somehow the dimensions come out wrong end function codeinjections.attachmentid(filename) diff --git a/tex/context/base/luat-fmt.lua b/tex/context/base/luat-fmt.lua index 2be205d8c..04f3143dd 100644 --- a/tex/context/base/luat-fmt.lua +++ b/tex/context/base/luat-fmt.lua @@ -35,10 +35,14 @@ function environment.make_format(name) end logs.simple("format path: %s",lfs.currentdir()) -- check source file - local texsourcename = file.addsuffix(name,"tex") + local texsourcename = file.addsuffix(name,"mkiv") local fulltexsourcename = resolvers.findfile(texsourcename,"tex") or "" if fulltexsourcename == "" then - logs.simple("no tex source file with name: %s",texsourcename) + texsourcename = file.addsuffix(name,"tex") + fulltexsourcename = resolvers.findfile(texsourcename,"tex") or "" + end + if fulltexsourcename == "" then + logs.simple("no tex source file with name: %s (mkiv or tex)",name) lfs.chdir(olddir) return else diff --git a/tex/context/base/math-ini.mkii b/tex/context/base/math-ini.mkii index f9dd859c4..9f7ab49e5 100644 --- a/tex/context/base/math-ini.mkii +++ b/tex/context/base/math-ini.mkii @@ -405,8 +405,8 @@ \appendtoks\autoenablemathcollection\to\mathstrategies -\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run.mkii} -\fetchruntimecommand \showmathtoken {\f!mathprefix\s!run.mkii} +\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run} +\fetchruntimecommand \showmathtoken {\f!mathprefix\s!run} \def\resetmathcollection[#1]% {\def\mathcollection{#1}% diff --git a/tex/context/base/meta-clp.mkii b/tex/context/base/meta-clp.mkii new file mode 100644 index 000000000..be2506b19 --- /dev/null +++ b/tex/context/base/meta-clp.mkii @@ -0,0 +1,164 @@ +%D \module +%D [ file=meta-clp, +%D version=2000.07.06, +%D title=\METAPOST\ Graphics, +%D subtitle=Clipping, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 In this library, we define a bunch of clipping paths that +%D can be fed to \type {\clip}. + +\startMPclip{ellipse} + clip currentpicture to unitcircle + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{negellipse} + clip currentpicture to (unitcircle peepholed unitsquare) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{urellipse} + clip currentpicture to urcircle scaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{ulellipse} + clip currentpicture to ulcircle scaled 2 shifted (1,0) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{llellipse} + clip currentpicture to llcircle scaled 2 shifted (1,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lrellipse} + clip currentpicture to lrcircle scaled 2 shifted (0,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{tellipse} + clip currentpicture to tcircle shifted (.5,0) yscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{bellipse} + clip currentpicture to bcircle shifted (.5,.5) yscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lellipse} + clip currentpicture to lcircle shifted (.5,.5) xscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{rellipse} + clip currentpicture to rcircle shifted (0,.5) xscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{diamond} + clip currentpicture to unitdiamond + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{negdiamond} + clip currentpicture to (unitdiamond peepholed unitsquare) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{urtriangle} + clip currentpicture to urtriangle scaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{ultriangle} + clip currentpicture to ultriangle scaled 2 shifted (1,0) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lltriangle} + clip currentpicture to lltriangle scaled 2 shifted (1,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lrtriangle} + clip currentpicture to lrtriangle scaled 2 shifted (0,1) + xscaled \width yscaled \height ; +\stopMPclip + +% More efficient: +% +% \def\dosimpleMPclip#1 +% {clip currentpicture to (#1) xscaled \width yscaled \height ;} +% +% \def\simpleMPclip#1#2% +% {\startMPclip{#1}\dosimpleMPclip{#2}\stopMPclip} +% +% \simpleMPclip {ellipse} {unitcircle} +% \simpleMPclip {diamond} {unitdiamond} +% +% \simpleMPclip {negellipse} {unitcircle peepholed unitsquare} +% \simpleMPclip {negdiamond} {unitdiamond peepholed unitsquare} +% +% \simpleMPclip {urellipse} {urcircle scaled 2 shifted (0,0)} +% \simpleMPclip {ulellipse} {ulcircle scaled 2 shifted (1,0)} +% \simpleMPclip {llellipse} {llcircle scaled 2 shifted (1,1)} +% \simpleMPclip {lrellipse} {lrcircle scaled 2 shifted (0,1)} +% +% \simpleMPclip {tellipse} {tcircle shifted (.5,0) yscaled 2} +% \simpleMPclip {bellipse} {bcircle shifted (.5,.5) yscaled 2} +% \simpleMPclip {lellipse} {lcircle shifted (.5,.5) xscaled 2} +% \simpleMPclip {rellipse} {rcircle shifted (0,.5) xscaled 2} +% +% \simpleMPclip {urtriangle} {urtriangle scaled 2 shifted (0,0)} +% \simpleMPclip {ultriangle} {ultriangle scaled 2 shifted (1,0)} +% \simpleMPclip {lltriangle} {lltriangle scaled 2 shifted (1,1)} +% \simpleMPclip {lrtriangle} {lrtriangle scaled 2 shifted (0,1)} + +%D \in {Figure} [fig:clipping paths] shows which paths are +%D predefined. When applied to a whole picture, their usage +%D is: +%D +%D \starttyping +%D \clip[nx=1,ny=1,mp=ellipse]{some clippable content} +%D \stoptyping +%D +%D \startbuffer +%D \setupclipping [nx=1,ny=1,x=1,y=1] +%D \setupblackrules[width=2cm,height=1cm] +%D \startcombination[6*3] % \startcombination[6*3] +%D {\clip[mp=urellipse] {\blackrule}} {urellipse} +%D {\clip[mp=ulellipse] {\blackrule}} {ulellipse} +%D {\clip[mp=llellipse] {\blackrule}} {llellipse} +%D {\clip[mp=lrellipse] {\blackrule}} {lrellipse} +%D {\clip[mp=ellipse] {\blackrule}} {ellipse} +%D {\clip[mp=negellipse]{\blackrule}} {negellipse} +%D {\clip[mp=tellipse] {\blackrule}} {tellipse} +%D {\clip[mp=bellipse] {\blackrule}} {bellipse} +%D {\clip[mp=lellipse] {\blackrule}} {lellipse} +%D {\clip[mp=rellipse] {\blackrule}} {rellipse} +%D {} {} +%D {} {} +%D {\clip[mp=urtriangle]{\blackrule}} {urtriangle} +%D {\clip[mp=ultriangle]{\blackrule}} {ultriangle} +%D {\clip[mp=lltriangle]{\blackrule}} {lltriangle} +%D {\clip[mp=lrtriangle]{\blackrule}} {lrtriangle} +%D {\clip[mp=diamond] {\blackrule}} {diamond} +%D {\clip[mp=negdiamond]{\blackrule}} {negdiamond} +%D \stopcombination % \stopcombination +%D \stopbuffer +%D +%D \placefigure % \placefigure +%D [here][fig:clipping paths] +%D {The predefined clipping paths.} +%D {\getbuffer} % {\getbuffer} + +\endinput diff --git a/tex/context/base/meta-clp.tex b/tex/context/base/meta-clp.tex deleted file mode 100644 index be2506b19..000000000 --- a/tex/context/base/meta-clp.tex +++ /dev/null @@ -1,164 +0,0 @@ -%D \module -%D [ file=meta-clp, -%D version=2000.07.06, -%D title=\METAPOST\ Graphics, -%D subtitle=Clipping, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 In this library, we define a bunch of clipping paths that -%D can be fed to \type {\clip}. - -\startMPclip{ellipse} - clip currentpicture to unitcircle - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{negellipse} - clip currentpicture to (unitcircle peepholed unitsquare) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{urellipse} - clip currentpicture to urcircle scaled 2 - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{ulellipse} - clip currentpicture to ulcircle scaled 2 shifted (1,0) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{llellipse} - clip currentpicture to llcircle scaled 2 shifted (1,1) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{lrellipse} - clip currentpicture to lrcircle scaled 2 shifted (0,1) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{tellipse} - clip currentpicture to tcircle shifted (.5,0) yscaled 2 - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{bellipse} - clip currentpicture to bcircle shifted (.5,.5) yscaled 2 - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{lellipse} - clip currentpicture to lcircle shifted (.5,.5) xscaled 2 - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{rellipse} - clip currentpicture to rcircle shifted (0,.5) xscaled 2 - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{diamond} - clip currentpicture to unitdiamond - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{negdiamond} - clip currentpicture to (unitdiamond peepholed unitsquare) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{urtriangle} - clip currentpicture to urtriangle scaled 2 - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{ultriangle} - clip currentpicture to ultriangle scaled 2 shifted (1,0) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{lltriangle} - clip currentpicture to lltriangle scaled 2 shifted (1,1) - xscaled \width yscaled \height ; -\stopMPclip - -\startMPclip{lrtriangle} - clip currentpicture to lrtriangle scaled 2 shifted (0,1) - xscaled \width yscaled \height ; -\stopMPclip - -% More efficient: -% -% \def\dosimpleMPclip#1 -% {clip currentpicture to (#1) xscaled \width yscaled \height ;} -% -% \def\simpleMPclip#1#2% -% {\startMPclip{#1}\dosimpleMPclip{#2}\stopMPclip} -% -% \simpleMPclip {ellipse} {unitcircle} -% \simpleMPclip {diamond} {unitdiamond} -% -% \simpleMPclip {negellipse} {unitcircle peepholed unitsquare} -% \simpleMPclip {negdiamond} {unitdiamond peepholed unitsquare} -% -% \simpleMPclip {urellipse} {urcircle scaled 2 shifted (0,0)} -% \simpleMPclip {ulellipse} {ulcircle scaled 2 shifted (1,0)} -% \simpleMPclip {llellipse} {llcircle scaled 2 shifted (1,1)} -% \simpleMPclip {lrellipse} {lrcircle scaled 2 shifted (0,1)} -% -% \simpleMPclip {tellipse} {tcircle shifted (.5,0) yscaled 2} -% \simpleMPclip {bellipse} {bcircle shifted (.5,.5) yscaled 2} -% \simpleMPclip {lellipse} {lcircle shifted (.5,.5) xscaled 2} -% \simpleMPclip {rellipse} {rcircle shifted (0,.5) xscaled 2} -% -% \simpleMPclip {urtriangle} {urtriangle scaled 2 shifted (0,0)} -% \simpleMPclip {ultriangle} {ultriangle scaled 2 shifted (1,0)} -% \simpleMPclip {lltriangle} {lltriangle scaled 2 shifted (1,1)} -% \simpleMPclip {lrtriangle} {lrtriangle scaled 2 shifted (0,1)} - -%D \in {Figure} [fig:clipping paths] shows which paths are -%D predefined. When applied to a whole picture, their usage -%D is: -%D -%D \starttyping -%D \clip[nx=1,ny=1,mp=ellipse]{some clippable content} -%D \stoptyping -%D -%D \startbuffer -%D \setupclipping [nx=1,ny=1,x=1,y=1] -%D \setupblackrules[width=2cm,height=1cm] -%D \startcombination[6*3] % \startcombination[6*3] -%D {\clip[mp=urellipse] {\blackrule}} {urellipse} -%D {\clip[mp=ulellipse] {\blackrule}} {ulellipse} -%D {\clip[mp=llellipse] {\blackrule}} {llellipse} -%D {\clip[mp=lrellipse] {\blackrule}} {lrellipse} -%D {\clip[mp=ellipse] {\blackrule}} {ellipse} -%D {\clip[mp=negellipse]{\blackrule}} {negellipse} -%D {\clip[mp=tellipse] {\blackrule}} {tellipse} -%D {\clip[mp=bellipse] {\blackrule}} {bellipse} -%D {\clip[mp=lellipse] {\blackrule}} {lellipse} -%D {\clip[mp=rellipse] {\blackrule}} {rellipse} -%D {} {} -%D {} {} -%D {\clip[mp=urtriangle]{\blackrule}} {urtriangle} -%D {\clip[mp=ultriangle]{\blackrule}} {ultriangle} -%D {\clip[mp=lltriangle]{\blackrule}} {lltriangle} -%D {\clip[mp=lrtriangle]{\blackrule}} {lrtriangle} -%D {\clip[mp=diamond] {\blackrule}} {diamond} -%D {\clip[mp=negdiamond]{\blackrule}} {negdiamond} -%D \stopcombination % \stopcombination -%D \stopbuffer -%D -%D \placefigure % \placefigure -%D [here][fig:clipping paths] -%D {The predefined clipping paths.} -%D {\getbuffer} % {\getbuffer} - -\endinput diff --git a/tex/context/base/meta-dum.mkii b/tex/context/base/meta-dum.mkii new file mode 100644 index 000000000..bc19f3c5f --- /dev/null +++ b/tex/context/base/meta-dum.mkii @@ -0,0 +1,123 @@ +%D \module +%D [ file=meta-dum, +%D version=2003.03.21, +%D title=\METAPOST\ Graphics, +%D subtitle=Dummy (External) Graphics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 This library overloads the normal external figure +%D placeholder by a nicer one. +%D +%D \startbuffer +%D \useMPlibrary[dum] +%D +%D \startlinecorrection +%D \externalfigure[unknown-a][width=3cm,height=1cm] +%D \stoplinecorrection +%D +%D \startlinecorrection +%D \externalfigure[unknown-b][width=4cm,height=5cm] +%D \stoplinecorrection +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +% currently preparempvariables is unable to resolve number +% fractions like reduction + +% June 22, 2003, this definition was patched to adapt itself +% to transparent colors + +\startuseMPgraphic{placeholder}{width,height,reduction,color} + numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ; + t := is_transparent(\MPvar{color}) ; + c := not_transparent(\MPvar{color}) ; + b := not_transparent(white) ; + w := \MPvar{width} ; + h := \MPvar{height} ; + r := \MPvar{reduction} ; + d := max(w,h) ; + p := unitsquare xyscaled (w,h) ; + cc := r[.5c,b] ; + fill p withcolor if t : transparent(1,.5,cc) else : cc fi ; + for i := 1 upto 60 : + cc := r[c randomized(.3,.9),b] ; + fill fullcircle + scaled (d/5 randomized (d/5)) + shifted (center p randomized (d)) + withcolor if t : transparent(1,.5,cc) else : cc fi ; + endfor ; + clip currentpicture to p ; +\stopuseMPgraphic + +\definepalet + [placeholder] + [1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow] + +% \newcounter \figurereplacementcycle + +\let\figurereplacementcycle\relax + +\setupexternalfigures + [\c!reduction=0, + \c!text=\v!yes] + +\let\normalexternalfigurereplacement\externalfigurereplacement + +\def\externalfigurereplacement#1#2#3% + {\getpaletsize[placeholder]% + \ifx\figurereplacementcycle\relax + \getrandomnumber \figurereplacementcycle \!!plusone \paletsize + \globallet \figurereplacementcycle \figurereplacementcycle + \else + \doglobal\increment\figurereplacementcycle + \fi + \ifnum\figurereplacementcycle>\paletsize + \globallet\figurereplacementcycle\!!plusone + \fi + \weightGRAYfalse % monochrome anyway + \MPcmykcolorsfalse + \MPspotcolorsfalse + \defineoverlay + [\s!dummy] + [\useMPgraphic + {placeholder}% + {width=\figurewidth, + height=\figureheight, + reduction=\@@efreduction, + color=placeholder:\figurereplacementcycle}]% + \expanded{\localframed + [\??ef] + [\c!width=\figurewidth, + \c!height=\figureheight, + \c!frame=\v!off, + \c!strut=\v!no, + \c!background=\s!dummy, + \c!foregroundcolor=\s!white]}% + {\doif\@@eftext\v!yes + {\infofont \setupinterlinespace \dohyphens % \nohyphens + \doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue + \doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue + \doifelse{#3}\s!unknown\!!donecfalse\!!donectrue + \if!!donea + name: \expanded{\verbatimstring{#1}}\strut\endgraf + \fi + \if!!doneb + \if!!donea file: \else \if!!donec file: \fi \fi + \expanded{\verbatimstring{#2}}\strut\endgraf + \fi + \if!!donec + state: \expanded{\verbatimstring{#3}}\strut\endgraf + \fi}}} + +\def\dummyfigure{\externalfigure[placeholder]} + +\protect \endinput diff --git a/tex/context/base/meta-dum.tex b/tex/context/base/meta-dum.tex deleted file mode 100644 index bc19f3c5f..000000000 --- a/tex/context/base/meta-dum.tex +++ /dev/null @@ -1,123 +0,0 @@ -%D \module -%D [ file=meta-dum, -%D version=2003.03.21, -%D title=\METAPOST\ Graphics, -%D subtitle=Dummy (External) Graphics, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 This library overloads the normal external figure -%D placeholder by a nicer one. -%D -%D \startbuffer -%D \useMPlibrary[dum] -%D -%D \startlinecorrection -%D \externalfigure[unknown-a][width=3cm,height=1cm] -%D \stoplinecorrection -%D -%D \startlinecorrection -%D \externalfigure[unknown-b][width=4cm,height=5cm] -%D \stoplinecorrection -%D \stopbuffer -%D -%D \typebuffer \getbuffer - -% currently preparempvariables is unable to resolve number -% fractions like reduction - -% June 22, 2003, this definition was patched to adapt itself -% to transparent colors - -\startuseMPgraphic{placeholder}{width,height,reduction,color} - numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ; - t := is_transparent(\MPvar{color}) ; - c := not_transparent(\MPvar{color}) ; - b := not_transparent(white) ; - w := \MPvar{width} ; - h := \MPvar{height} ; - r := \MPvar{reduction} ; - d := max(w,h) ; - p := unitsquare xyscaled (w,h) ; - cc := r[.5c,b] ; - fill p withcolor if t : transparent(1,.5,cc) else : cc fi ; - for i := 1 upto 60 : - cc := r[c randomized(.3,.9),b] ; - fill fullcircle - scaled (d/5 randomized (d/5)) - shifted (center p randomized (d)) - withcolor if t : transparent(1,.5,cc) else : cc fi ; - endfor ; - clip currentpicture to p ; -\stopuseMPgraphic - -\definepalet - [placeholder] - [1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow] - -% \newcounter \figurereplacementcycle - -\let\figurereplacementcycle\relax - -\setupexternalfigures - [\c!reduction=0, - \c!text=\v!yes] - -\let\normalexternalfigurereplacement\externalfigurereplacement - -\def\externalfigurereplacement#1#2#3% - {\getpaletsize[placeholder]% - \ifx\figurereplacementcycle\relax - \getrandomnumber \figurereplacementcycle \!!plusone \paletsize - \globallet \figurereplacementcycle \figurereplacementcycle - \else - \doglobal\increment\figurereplacementcycle - \fi - \ifnum\figurereplacementcycle>\paletsize - \globallet\figurereplacementcycle\!!plusone - \fi - \weightGRAYfalse % monochrome anyway - \MPcmykcolorsfalse - \MPspotcolorsfalse - \defineoverlay - [\s!dummy] - [\useMPgraphic - {placeholder}% - {width=\figurewidth, - height=\figureheight, - reduction=\@@efreduction, - color=placeholder:\figurereplacementcycle}]% - \expanded{\localframed - [\??ef] - [\c!width=\figurewidth, - \c!height=\figureheight, - \c!frame=\v!off, - \c!strut=\v!no, - \c!background=\s!dummy, - \c!foregroundcolor=\s!white]}% - {\doif\@@eftext\v!yes - {\infofont \setupinterlinespace \dohyphens % \nohyphens - \doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue - \doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue - \doifelse{#3}\s!unknown\!!donecfalse\!!donectrue - \if!!donea - name: \expanded{\verbatimstring{#1}}\strut\endgraf - \fi - \if!!doneb - \if!!donea file: \else \if!!donec file: \fi \fi - \expanded{\verbatimstring{#2}}\strut\endgraf - \fi - \if!!donec - state: \expanded{\verbatimstring{#3}}\strut\endgraf - \fi}}} - -\def\dummyfigure{\externalfigure[placeholder]} - -\protect \endinput diff --git a/tex/context/base/meta-fig.mkiv b/tex/context/base/meta-fig.mkiv index 4738316da..8c8ed03a7 100644 --- a/tex/context/base/meta-fig.mkiv +++ b/tex/context/base/meta-fig.mkiv @@ -58,6 +58,7 @@ \setupMPpage [\c!scale=1000, + \c!pagestate=, \c!strut=\v!no, \c!align=, \c!offset=\v!overlay, diff --git a/tex/context/base/meta-imp-clp.mkiv b/tex/context/base/meta-imp-clp.mkiv new file mode 100644 index 000000000..be2506b19 --- /dev/null +++ b/tex/context/base/meta-imp-clp.mkiv @@ -0,0 +1,164 @@ +%D \module +%D [ file=meta-clp, +%D version=2000.07.06, +%D title=\METAPOST\ Graphics, +%D subtitle=Clipping, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 In this library, we define a bunch of clipping paths that +%D can be fed to \type {\clip}. + +\startMPclip{ellipse} + clip currentpicture to unitcircle + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{negellipse} + clip currentpicture to (unitcircle peepholed unitsquare) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{urellipse} + clip currentpicture to urcircle scaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{ulellipse} + clip currentpicture to ulcircle scaled 2 shifted (1,0) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{llellipse} + clip currentpicture to llcircle scaled 2 shifted (1,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lrellipse} + clip currentpicture to lrcircle scaled 2 shifted (0,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{tellipse} + clip currentpicture to tcircle shifted (.5,0) yscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{bellipse} + clip currentpicture to bcircle shifted (.5,.5) yscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lellipse} + clip currentpicture to lcircle shifted (.5,.5) xscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{rellipse} + clip currentpicture to rcircle shifted (0,.5) xscaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{diamond} + clip currentpicture to unitdiamond + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{negdiamond} + clip currentpicture to (unitdiamond peepholed unitsquare) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{urtriangle} + clip currentpicture to urtriangle scaled 2 + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{ultriangle} + clip currentpicture to ultriangle scaled 2 shifted (1,0) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lltriangle} + clip currentpicture to lltriangle scaled 2 shifted (1,1) + xscaled \width yscaled \height ; +\stopMPclip + +\startMPclip{lrtriangle} + clip currentpicture to lrtriangle scaled 2 shifted (0,1) + xscaled \width yscaled \height ; +\stopMPclip + +% More efficient: +% +% \def\dosimpleMPclip#1 +% {clip currentpicture to (#1) xscaled \width yscaled \height ;} +% +% \def\simpleMPclip#1#2% +% {\startMPclip{#1}\dosimpleMPclip{#2}\stopMPclip} +% +% \simpleMPclip {ellipse} {unitcircle} +% \simpleMPclip {diamond} {unitdiamond} +% +% \simpleMPclip {negellipse} {unitcircle peepholed unitsquare} +% \simpleMPclip {negdiamond} {unitdiamond peepholed unitsquare} +% +% \simpleMPclip {urellipse} {urcircle scaled 2 shifted (0,0)} +% \simpleMPclip {ulellipse} {ulcircle scaled 2 shifted (1,0)} +% \simpleMPclip {llellipse} {llcircle scaled 2 shifted (1,1)} +% \simpleMPclip {lrellipse} {lrcircle scaled 2 shifted (0,1)} +% +% \simpleMPclip {tellipse} {tcircle shifted (.5,0) yscaled 2} +% \simpleMPclip {bellipse} {bcircle shifted (.5,.5) yscaled 2} +% \simpleMPclip {lellipse} {lcircle shifted (.5,.5) xscaled 2} +% \simpleMPclip {rellipse} {rcircle shifted (0,.5) xscaled 2} +% +% \simpleMPclip {urtriangle} {urtriangle scaled 2 shifted (0,0)} +% \simpleMPclip {ultriangle} {ultriangle scaled 2 shifted (1,0)} +% \simpleMPclip {lltriangle} {lltriangle scaled 2 shifted (1,1)} +% \simpleMPclip {lrtriangle} {lrtriangle scaled 2 shifted (0,1)} + +%D \in {Figure} [fig:clipping paths] shows which paths are +%D predefined. When applied to a whole picture, their usage +%D is: +%D +%D \starttyping +%D \clip[nx=1,ny=1,mp=ellipse]{some clippable content} +%D \stoptyping +%D +%D \startbuffer +%D \setupclipping [nx=1,ny=1,x=1,y=1] +%D \setupblackrules[width=2cm,height=1cm] +%D \startcombination[6*3] % \startcombination[6*3] +%D {\clip[mp=urellipse] {\blackrule}} {urellipse} +%D {\clip[mp=ulellipse] {\blackrule}} {ulellipse} +%D {\clip[mp=llellipse] {\blackrule}} {llellipse} +%D {\clip[mp=lrellipse] {\blackrule}} {lrellipse} +%D {\clip[mp=ellipse] {\blackrule}} {ellipse} +%D {\clip[mp=negellipse]{\blackrule}} {negellipse} +%D {\clip[mp=tellipse] {\blackrule}} {tellipse} +%D {\clip[mp=bellipse] {\blackrule}} {bellipse} +%D {\clip[mp=lellipse] {\blackrule}} {lellipse} +%D {\clip[mp=rellipse] {\blackrule}} {rellipse} +%D {} {} +%D {} {} +%D {\clip[mp=urtriangle]{\blackrule}} {urtriangle} +%D {\clip[mp=ultriangle]{\blackrule}} {ultriangle} +%D {\clip[mp=lltriangle]{\blackrule}} {lltriangle} +%D {\clip[mp=lrtriangle]{\blackrule}} {lrtriangle} +%D {\clip[mp=diamond] {\blackrule}} {diamond} +%D {\clip[mp=negdiamond]{\blackrule}} {negdiamond} +%D \stopcombination % \stopcombination +%D \stopbuffer +%D +%D \placefigure % \placefigure +%D [here][fig:clipping paths] +%D {The predefined clipping paths.} +%D {\getbuffer} % {\getbuffer} + +\endinput diff --git a/tex/context/base/meta-imp-dum.mkiv b/tex/context/base/meta-imp-dum.mkiv new file mode 100644 index 000000000..bc19f3c5f --- /dev/null +++ b/tex/context/base/meta-imp-dum.mkiv @@ -0,0 +1,123 @@ +%D \module +%D [ file=meta-dum, +%D version=2003.03.21, +%D title=\METAPOST\ Graphics, +%D subtitle=Dummy (External) Graphics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 This library overloads the normal external figure +%D placeholder by a nicer one. +%D +%D \startbuffer +%D \useMPlibrary[dum] +%D +%D \startlinecorrection +%D \externalfigure[unknown-a][width=3cm,height=1cm] +%D \stoplinecorrection +%D +%D \startlinecorrection +%D \externalfigure[unknown-b][width=4cm,height=5cm] +%D \stoplinecorrection +%D \stopbuffer +%D +%D \typebuffer \getbuffer + +% currently preparempvariables is unable to resolve number +% fractions like reduction + +% June 22, 2003, this definition was patched to adapt itself +% to transparent colors + +\startuseMPgraphic{placeholder}{width,height,reduction,color} + numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ; + t := is_transparent(\MPvar{color}) ; + c := not_transparent(\MPvar{color}) ; + b := not_transparent(white) ; + w := \MPvar{width} ; + h := \MPvar{height} ; + r := \MPvar{reduction} ; + d := max(w,h) ; + p := unitsquare xyscaled (w,h) ; + cc := r[.5c,b] ; + fill p withcolor if t : transparent(1,.5,cc) else : cc fi ; + for i := 1 upto 60 : + cc := r[c randomized(.3,.9),b] ; + fill fullcircle + scaled (d/5 randomized (d/5)) + shifted (center p randomized (d)) + withcolor if t : transparent(1,.5,cc) else : cc fi ; + endfor ; + clip currentpicture to p ; +\stopuseMPgraphic + +\definepalet + [placeholder] + [1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow] + +% \newcounter \figurereplacementcycle + +\let\figurereplacementcycle\relax + +\setupexternalfigures + [\c!reduction=0, + \c!text=\v!yes] + +\let\normalexternalfigurereplacement\externalfigurereplacement + +\def\externalfigurereplacement#1#2#3% + {\getpaletsize[placeholder]% + \ifx\figurereplacementcycle\relax + \getrandomnumber \figurereplacementcycle \!!plusone \paletsize + \globallet \figurereplacementcycle \figurereplacementcycle + \else + \doglobal\increment\figurereplacementcycle + \fi + \ifnum\figurereplacementcycle>\paletsize + \globallet\figurereplacementcycle\!!plusone + \fi + \weightGRAYfalse % monochrome anyway + \MPcmykcolorsfalse + \MPspotcolorsfalse + \defineoverlay + [\s!dummy] + [\useMPgraphic + {placeholder}% + {width=\figurewidth, + height=\figureheight, + reduction=\@@efreduction, + color=placeholder:\figurereplacementcycle}]% + \expanded{\localframed + [\??ef] + [\c!width=\figurewidth, + \c!height=\figureheight, + \c!frame=\v!off, + \c!strut=\v!no, + \c!background=\s!dummy, + \c!foregroundcolor=\s!white]}% + {\doif\@@eftext\v!yes + {\infofont \setupinterlinespace \dohyphens % \nohyphens + \doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue + \doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue + \doifelse{#3}\s!unknown\!!donecfalse\!!donectrue + \if!!donea + name: \expanded{\verbatimstring{#1}}\strut\endgraf + \fi + \if!!doneb + \if!!donea file: \else \if!!donec file: \fi \fi + \expanded{\verbatimstring{#2}}\strut\endgraf + \fi + \if!!donec + state: \expanded{\verbatimstring{#3}}\strut\endgraf + \fi}}} + +\def\dummyfigure{\externalfigure[placeholder]} + +\protect \endinput diff --git a/tex/context/base/meta-imp-mis.mkiv b/tex/context/base/meta-imp-mis.mkiv new file mode 100644 index 000000000..29ab43007 --- /dev/null +++ b/tex/context/base/meta-imp-mis.mkiv @@ -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(1,0,0,0) ; + currentpicture := currentpicture shifted (-4cm,0) ; + draw fullcircle scaled 3cm dashed evenly ; + draw fullcircle scaled 2cm dashed withdots ; + draw origin withpen pencircle scaled 3mm; + currentpicture := currentpicture shifted (-4cm,0) ; + fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red); + fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red); + fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green); + fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5)); + currentpicture := currentpicture shifted (12cm,-4cm) ; + draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ; + currentpicture := currentpicture shifted (-4cm,0) ; + % bug: shift + draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ; + draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ; + filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ; + currentpicture := currentpicture shifted (-4cm,0) ; + % shade cannot handle shift + circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ; + circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ; + filldraw boundingbox currentpicture enlarged (-bbheight(currentpicture)/2+2.5mm) withpen pencircle scaled 1pt withcolor .5white ; +\stopuseMPgraphic + +\protect \endinput diff --git a/tex/context/base/meta-imp-nav.mkiv b/tex/context/base/meta-imp-nav.mkiv new file mode 100644 index 000000000..9c1cbb4db --- /dev/null +++ b/tex/context/base/meta-imp-nav.mkiv @@ -0,0 +1,65 @@ +%D \module +%D [ file=meta-nav, +%D version=2003.03.28, +%D title=\METAPOST\ Graphics, +%D subtitle=Navigational Graphics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\startuniqueMPgraphic{navplus}{size,color,type,mode} + color c ; numeric s, t ; path p ; + t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ; + if \MPvar{mode} = 1 : c := .5[c,white] fi ; + if t = 1 : + p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle) + xyscaled (3,4) ; + elseif t = 2 : + p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle) + xyscaled (4,3) ; + else : + p := fullsquare xyscaled (3,3) ; + fi ; + draw p withpen pencircle scaled (1/2) withcolor .75white ; + fill p withcolor c ; + draw p withpen pencircle scaled (1/3) withcolor .5c ; + currentpicture := currentpicture scaled s ; + currentpicture := currentpicture shifted -center currentpicture ; +\stopuniqueMPgraphic + +\setupMPvariables + [navplus] + [size=1ex, + color=black, + type=1, + mode=0] + +\definepalet + [navplus] + [attach=darkred, + comment=darkblue] + +\definesymbol + [comment-normal] + [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}] +\definesymbol + [comment-down] + [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}] + +\definesymbol + [attach-normal] + [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}] +\definesymbol + [attach-down] + [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}] + +\unprotect + +\setupcomment [\c!symbol={comment-normal,comment-down}] +\setupattachments[\c!symbol={attach-normal,attach-down}] + +\protect \endinput diff --git a/tex/context/base/meta-imp-pre.mkiv b/tex/context/base/meta-imp-pre.mkiv new file mode 100644 index 000000000..cb861ff20 --- /dev/null +++ b/tex/context/base/meta-imp-pre.mkiv @@ -0,0 +1,68 @@ +%D \module +%D [ file=meta-pre, +%D version=2001.03.21, +%D title=\METAPOST\ Graphics, +%D subtitle=Predefined Goodies, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 In this library, we define a couple of handy graphics. + +% todo: use the predefine grid macros, mp code will move to +% mp-* file + +\startuseMPgraphic{pagegrid} + StartPage ; + drawoptions(withcolor .8white) ; + fill Field[Text][Text] ; + drawoptions(withcolor .65white) ; + fill Field[Footer][Text] ; + fill Field[Header][Text] ; + fill Field[LeftMargin][Text] ; + fill Field[RightMargin][Text] ; + drawoptions(withcolor .65yellow) ; + fill Field[LeftEdge][Text] ; + fill Field[RightEdge][Text] ; + fill Field[Bottom][Text] ; + fill Field[Top][Text] ; + drawoptions(withpen pencircle scaled .3pt withcolor .65white) ; + for i=-3cm step 1cm until PaperWidth+3cm : + draw (i,-3cm)--(i,PaperHeight+3cm) ; + endfor ; + for i=PaperHeight+3cm step -1cm until -3cm : + draw (-3cm,i)--(PaperWidth+3cm,i) ; + endfor ; + drawoptions(withpen pencircle scaled .15pt) ; + for i=.5cm-3cm step 1cm until PaperWidth+3cm : + draw (i,-3cm)--(i,PaperHeight+3cm) ; + endfor ; + for i=PaperHeight-.5cm+3cm step -1cm until -3cm : + draw (-3cm,i)--(PaperWidth+3cm,i) ; + endfor ; + drawoptions(withpen pencircle scaled .3pt withcolor .65red) ; + for i=0 step 1cm until PaperWidth : + draw (i,0)--(i,PaperHeight) ; + endfor ; + for i=PaperHeight step -1cm until 0 : + draw (0,i)--(PaperWidth,i) ; + endfor ; + drawoptions(withpen pencircle scaled .15pt withcolor .65red) ; + for i=.5cm step 1cm until PaperWidth : + draw (i,0)--(i,PaperHeight) ; + endfor ; + for i=PaperHeight-.5cm step -1cm until 0 : + draw (0,i)--(PaperWidth,i) ; + endfor ; + drawoptions(withpen pencircle scaled 5pt withcolor .65red) ; + draw ulcorner Page ; + StopPage ; +\stopuseMPgraphic + +\defineoverlay[pagegrid][\useMPgraphic{pagegrid}] + +\endinput diff --git a/tex/context/base/meta-imp-txt.mkiv b/tex/context/base/meta-imp-txt.mkiv new file mode 100644 index 000000000..474253a40 --- /dev/null +++ b/tex/context/base/meta-imp-txt.mkiv @@ -0,0 +1,304 @@ +%D \module +%D [ file=meta-txt, +%D version=2000.07.06, +%D title=\METAPOST\ Graphics, +%D subtitle=Text Tricks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 In this library some handy text manipulations are +%D defined. Some can and will be improved as soon as the +%D \TEX||\METAPOST\ interface is stable. Some of the +%D solutions may look weird, which is entirely my fault, +%D since I implemented them in the process of getting grip +%D on this kind of manipulations. Undoubtly better +%D \METAPOST\ code is possible, but my way of learning +%D this kind of trickery happens to be by \quote {trial +%D and error} and \quote {look and feel} (as well as +%D identifying tricks in Hobby's code). + +% textext ipv btex ... etex + +% we need a proper prefix here + +\unprotect + +\startMPextensions + if unknown context_text: input mp-text; fi; +\stopMPextensions + +%%%%%%% + +% \def\newchar#1{\chardef#1=0 } + +\ifdefined\MPtoks \else \newtoks\MPtoks \fi +\ifdefined\MPbox \else \newbox \MPbox \fi + +\ifdefined\parwidth \else \newdimen\parwidth \fi +\ifdefined\parheight \else \newdimen\parheight \fi +\ifdefined\parvoffset \else \newdimen\parvoffset \fi +\ifdefined\parhoffset \else \newdimen\parhoffset \fi +\ifdefined\parlines \else \newcount\parlines \fi +\ifdefined\partoks \else \newtoks \partoks \fi +\ifdefined\shapetextbox \else \newbox \shapetextbox \fi + \newif \ifparseries +\ifdefined\parfirst \else \chardef \parfirst=0 \fi + +\def\startshapetext[#1]% + {\global\newcounter\currentshapetext + \global\setbox\shapetextbox\vbox\bgroup + \expanded{\switchtobodyfont[\@@shbodyfont]}% + \dontcomplain + \hsize\parwidth + \setuptolerance[\v!verytolerant,\v!stretch]% + \!!counta\zerocount + \!!toksa\emptytoks + \def\docommand##1% + {\setbox\scratchbox\hbox{\useMPgraphic{##1}}% + \global\chardef\parfirst\zerocount + \getMPdata % \readlocfile{\MPdatafile}{}{}% + \setshapecharacteristics + \advance\!!counta by \parlines + \expandafter\appendtoks\the\partoks\to\!!toksa}% + \processcommalist[#1]\docommand + \global\parseriestrue + \xdef\totalparlines{\the\!!counta}% + \global\partoks\!!toksa + %\ifx\partoks\emptytoks\else % safeguard + \expanded{\parshape \the\!!counta \the\!!toksa}% + %\fi + \setshapecharacteristics % extra dummy + \ifparseries\def\par{\endgraf\adaptparshape}\fi + \EveryPar{\begstrut}} + +\def\stopshapetext + {\endstrut + %\removebottomthings + \egroup + \global\newcounter\currentshapetext + \getshapecharacteristics} + +\def\adaptparshape% + {\def\docommand##1% + {\ifcase\!!counta + \expandafter\appendtoks\space##1 \to\!!toksa + \else + \advance\!!counta \minusone + \fi}% + \!!counta\prevgraf + \doglobal\decrement(\totalparlines,\!!counta)% + \multiply\!!counta \plustwo + \!!toksa\emptytoks + \expanded{\processseparatedlist[\the\partoks][\space]}\docommand + \global\partoks\!!toksa + %\ifx\partoks\emptytoks\else % safeguard + \expanded{\parshape\totalparlines\the\partoks}% + }%\fi} + +\def\getshapecharacteristics% + {\doglobal\increment\currentshapetext + \doifdefinedelse{parlines:\currentshapetext} + {\global\parlines \getvalue{parlines:\currentshapetext}% + \global\chardef\parfirst \getvalue{parfirst:\currentshapetext}% + \global\parvoffset \getvalue{parvoffset:\currentshapetext}% + \global\parhoffset \getvalue{parhoffset:\currentshapetext}% + \global\parwidth \getvalue{parwidth:\currentshapetext}% + \global\parheight \getvalue{parheight:\currentshapetext}} + {\global\parlines \plusone + \global\chardef\parfirst \zerocount + \global\parvoffset \zeropoint + \global\parhoffset \zeropoint + \global\parwidth \hsize + \global\parheight \vsize}} + +\def\setshapecharacteristics% + {\doglobal\increment\currentshapetext + \setxvalue{parlines:\currentshapetext }{\the\parlines}% + \setxvalue{parfirst:\currentshapetext }{\the\parfirst}% + \setxvalue{parvoffset:\currentshapetext}{\the\parvoffset}% + \setxvalue{parhoffset:\currentshapetext}{\the\parhoffset}% + \setxvalue{parwidth:\currentshapetext }{\the\parwidth}% + \setxvalue{parheight:\currentshapetext }{\the\parheight}} + +\def\getshapetext% option: unvbox + {\vbox\bgroup + \forgetall + \setbox\scratchbox\vbox to \parheight + {\expanded{\switchtobodyfont[\@@shbodyfont]}% evt strutheight en + \splittopskip\strutheight % lineheight opslaan + \vskip\parvoffset % scheelt switch en + \ifcase\parfirst\or\vskip\lineheight\fi % is ook veiliger + \hskip\parhoffset + \hbox{\vsplit\shapetextbox to \parlines\lineheight}}% + \wd\scratchbox\parwidth + \ht\scratchbox\parheight + \dp\scratchbox\zeropoint + \box\scratchbox + \getshapecharacteristics + \egroup} + +\def\setupshapetexts% + {\dodoubleempty\getparameters[\??sh]} + +\setupshapetexts% + [\c!bodyfont=] + +%%%%%%% rotfont nog definieren + +\doifundefined{RotFont}{\definefont[RotFont][RegularBold]} + +\def\processfollowingtoken#1% strut toegevoegd + {\appendtoks#1\to\MPtoks + \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}% + \startMPdrawing + n := n + 1 ; len[n] := \the\wd\MPbox ; + \stopMPdrawing + \startMPdrawing[-] + % pic[n] := textext{\RotFont\setstrut\strut#1} ; % btex \RotFont\setstrut\strut#1 etex ; + pic[n] := btex \RotFont\setstrut\strut#1 etex ; + pic[n] := pic[n] shifted - llcorner pic[n] ; + \stopMPdrawing} + +\startuseMPgraphic{followtokens} + % we default to nothing +\stopuseMPgraphic + +\def\followtokens#1% + {\vbox\bgroup + \forgetall + \dontcomplain + \startMPenvironment + \doifundefined{RotFont}{\definefont[RotFont][RegularBold]} + \stopMPenvironment + \MPtoks\emptytoks + \resetMPdrawing + \startMPdrawing + \includeMPgraphic{followtokens} ; + picture pic[] ; numeric len[], n ; n := 0 ; + \stopMPdrawing + \handletokens#1\with\processfollowingtoken + \startMPdrawing + if unknown RotPath : path RotPath ; RotPath := origin ; fi ; + if unknown RotColor : color RotColor ; RotColor := black ; fi ; + if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ; + if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ; + numeric al, at, pl, wid, pos ; pair ap, ad ; + al := arclength RotPath ; + if al=0 : + al := len[n] + ExtraRot ; + RotPath := origin -- (al,0) ; + fi ; + if al1 : (n-1) else : 1 fi) ; + if TraceRot : + draw RotPath withpen pencircle scaled 1pt withcolor blue ; + fi ; + for i=1 upto n : + wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ; + pos := len[i]-wid/2 + (i-1)*pl ; + at := arctime pos of RotPath ; + ap := point at of RotPath ; + ad := direction at of RotPath ; + draw pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap + withcolor RotColor ; + if TraceRot : + draw boundingbox + pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap + withpen pencircle scaled .25pt withcolor red ; + draw ap + withpen pencircle scaled .50pt withcolor green ; + fi ; + endfor ; + \stopMPdrawing + \MPdrawingdonetrue + \getMPdrawing + \resetMPdrawing + \egroup} + +% \followtokens +% {This is just a dummy text, kerned by T{\kern +% -.1667em\lower .5ex\hbox {E}}{\kern -.125emX} and typeset +% in a circle using {\setMFPfont M}{\setMFPfont +% E}{\setMFPfont T}{\setMFPfont A}{\setMFPfont +% P}{\setMFPfont O}{\setMFPfont S}{\setMFPfont T}.\quad} + +\startuseMPgraphic{fuzzycount} + begingroup + save height, span, drift, d, cp ; + height := 3/ 5 * \baselinedistance ; + span := 1/ 3 * height ; + drift := 1/10 * height ; + pickup pencircle scaled (1/12 * height) ; + def d = (uniformdeviate drift) enddef ; + for i := 1 upto \MPvar{n} : + draw + if (i mod 5)=0 : ((-d-4.5span,d)--(+d-0.5span,height-d)) + else : ((-d,+d)--(+d,height-d)) fi + shifted (span*i,d-drift) ; + endfor; + picture cp ; cp := currentpicture ; % for readability + setbounds currentpicture to + (llcorner cp shifted (0,-ypart llcorner cp) -- + lrcorner cp shifted (0,-ypart lrcorner cp) -- + urcorner cp -- ulcorner cp -- cycle) ; + endgroup ; +\stopuseMPgraphic + +\setupMPvariables + [fuzzycount] + [n=10] + +\def\fuzzycount#1% + {{\tx\useMPgraphic{fuzzycount}{n=#1}}} + +\defineconversion[fuzzy][\fuzzycount] + +%%%%%%% + +\setupMPvariables + [EnglishRule] + [height=1ex, + width=\the\localhsize, % without \the, problems in non e-tex + color=darkgray] + +\defineblank + [EnglishRule] + [medium] + +\startuniqueMPgraphic{EnglishRule}{height,width,color} + height = \MPvar{height} ; + x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ; + y1 = y3 = 0 ; y2 = -y4 = height/2 ; + fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ; +\stopuniqueMPgraphic + +\def\EnglishRule% + {\startlinecorrection[EnglishRule] + \setlocalhsize \noindent \reuseMPgraphic{EnglishRule} + \stoplinecorrection} + +%D The following macro returns a tight bound character +%D sequence. +%D +%D \useMPlibrary[txt] +%D +%D \startlinecorrection +%D \TightText{\ss\bf 123}{0cm}{3cm}{red} +%D \stoplinecorrection + +\def\TightText#1#2#3#4% + {\hbox % \ruledhbox + {\startMPcode + picture p ; p := image (graphictext "#1" withfillcolor red) ; + draw p xsized #2 ysized #3 withcolor \MPcolor{#4} ; + \stopMPcode}} + +\protect \endinput diff --git a/tex/context/base/meta-ini.lua b/tex/context/base/meta-ini.lua new file mode 100644 index 000000000..776814f1d --- /dev/null +++ b/tex/context/base/meta-ini.lua @@ -0,0 +1,24 @@ +if not modules then modules = { } end modules ['meta-ini'] = { + version = 1.001, + comment = "companion to meta-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local format = string.format + +metapost = metapost or { } + +-- for the moment downward compatible + +local patterns = { "meta-imp-%s.mkiv", "meta-imp-%s.tex", "meta-%s.mkiv", "meta-%s.tex" } -- we are compatible + +function metapost.uselibrary(name) + commands.uselibrary(name,patterns,function(name,foundname) + context.startreadingfile() + context.showmessage("metapost",1,name) + context.input(foundname) + context.stopreadingfile() + end) +end diff --git a/tex/context/base/meta-ini.mkii b/tex/context/base/meta-ini.mkii index c07a5ada9..fd6ef9a61 100644 --- a/tex/context/base/meta-ini.mkii +++ b/tex/context/base/meta-ini.mkii @@ -626,7 +626,11 @@ \letvalueempty{\c!file\f!metapostprefix#1}% \makeshortfilename[\truefilename{\f!metapostprefix#1}]% \startreadingfile - \readsysfile\shortfilename{\showmessage\m!metapost1{#1}}\donothing + \readsysfile{\shortfilename.\mksuffix} + {\showmessage\m!metapost1{#1}} + {\readsysfile{\shortfilename.tex} + {\showmessage\m!metapost1{#1}} + \donothing}% \stopreadingfile \fi} diff --git a/tex/context/base/meta-ini.mkiv b/tex/context/base/meta-ini.mkiv index 917201b27..145251d87 100644 --- a/tex/context/base/meta-ini.mkiv +++ b/tex/context/base/meta-ini.mkiv @@ -13,6 +13,8 @@ \writestatus{loading}{MetaPost Graphics / Initializations} +\registerctxluafile{meta-ini}{1.001} + \unprotect %D Instead of sharing code with \MKII, I decided to copy @@ -837,16 +839,7 @@ %D Loading specific \METAPOST\ related definitions is %D accomplished by: -\def\douseMPlibrary#1% - {\ifcsname\c!file\f!metapostprefix#1\endcsname\else - \letvalueempty{\c!file\f!metapostprefix#1}% - \startreadingfile - \readsysfile{\truefilename{\f!metapostprefix#1}}{\showmessage\m!metapost1{#1}}\donothing - \stopreadingfile - \fi} - -\def\useMPlibrary[#1]% - {\processcommalist[#1]\douseMPlibrary} +\unexpanded\def\useMPlibrary[#1]{\ctxlua{metapost.uselibrary(\!!bs#1\!!es)}} %D \macros %D {setMPtext, MPtext, MPstring, MPbetex} diff --git a/tex/context/base/meta-mis.mkii b/tex/context/base/meta-mis.mkii new file mode 100644 index 000000000..29ab43007 --- /dev/null +++ b/tex/context/base/meta-mis.mkii @@ -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(1,0,0,0) ; + currentpicture := currentpicture shifted (-4cm,0) ; + draw fullcircle scaled 3cm dashed evenly ; + draw fullcircle scaled 2cm dashed withdots ; + draw origin withpen pencircle scaled 3mm; + currentpicture := currentpicture shifted (-4cm,0) ; + fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red); + fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red); + fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green); + fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5)); + currentpicture := currentpicture shifted (12cm,-4cm) ; + draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ; + currentpicture := currentpicture shifted (-4cm,0) ; + % bug: shift + draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ; + draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ; + filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ; + currentpicture := currentpicture shifted (-4cm,0) ; + % shade cannot handle shift + circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ; + circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ; + filldraw boundingbox currentpicture enlarged (-bbheight(currentpicture)/2+2.5mm) withpen pencircle scaled 1pt withcolor .5white ; +\stopuseMPgraphic + +\protect \endinput diff --git a/tex/context/base/meta-mis.tex b/tex/context/base/meta-mis.tex deleted file mode 100644 index 29ab43007..000000000 --- a/tex/context/base/meta-mis.tex +++ /dev/null @@ -1,54 +0,0 @@ -%D \module -%D [ file=meta-mis, -%D version=2006.06.06, -%D title=\METAPOST\ Graphics, -%D subtitle=Misc Test Graphics, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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(1,0,0,0) ; - currentpicture := currentpicture shifted (-4cm,0) ; - draw fullcircle scaled 3cm dashed evenly ; - draw fullcircle scaled 2cm dashed withdots ; - draw origin withpen pencircle scaled 3mm; - currentpicture := currentpicture shifted (-4cm,0) ; - fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red); - fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red); - fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green); - fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5)); - currentpicture := currentpicture shifted (12cm,-4cm) ; - draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ; - currentpicture := currentpicture shifted (-4cm,0) ; - % bug: shift - draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ; - draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ; - filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ; - currentpicture := currentpicture shifted (-4cm,0) ; - % shade cannot handle shift - circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ; - circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ; - filldraw boundingbox currentpicture enlarged (-bbheight(currentpicture)/2+2.5mm) withpen pencircle scaled 1pt withcolor .5white ; -\stopuseMPgraphic - -\protect \endinput diff --git a/tex/context/base/meta-nav.mkii b/tex/context/base/meta-nav.mkii new file mode 100644 index 000000000..9c1cbb4db --- /dev/null +++ b/tex/context/base/meta-nav.mkii @@ -0,0 +1,65 @@ +%D \module +%D [ file=meta-nav, +%D version=2003.03.28, +%D title=\METAPOST\ Graphics, +%D subtitle=Navigational Graphics, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +\startuniqueMPgraphic{navplus}{size,color,type,mode} + color c ; numeric s, t ; path p ; + t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ; + if \MPvar{mode} = 1 : c := .5[c,white] fi ; + if t = 1 : + p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle) + xyscaled (3,4) ; + elseif t = 2 : + p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle) + xyscaled (4,3) ; + else : + p := fullsquare xyscaled (3,3) ; + fi ; + draw p withpen pencircle scaled (1/2) withcolor .75white ; + fill p withcolor c ; + draw p withpen pencircle scaled (1/3) withcolor .5c ; + currentpicture := currentpicture scaled s ; + currentpicture := currentpicture shifted -center currentpicture ; +\stopuniqueMPgraphic + +\setupMPvariables + [navplus] + [size=1ex, + color=black, + type=1, + mode=0] + +\definepalet + [navplus] + [attach=darkred, + comment=darkblue] + +\definesymbol + [comment-normal] + [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}] +\definesymbol + [comment-down] + [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}] + +\definesymbol + [attach-normal] + [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}] +\definesymbol + [attach-down] + [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}] + +\unprotect + +\setupcomment [\c!symbol={comment-normal,comment-down}] +\setupattachments[\c!symbol={attach-normal,attach-down}] + +\protect \endinput diff --git a/tex/context/base/meta-nav.tex b/tex/context/base/meta-nav.tex deleted file mode 100644 index 9c1cbb4db..000000000 --- a/tex/context/base/meta-nav.tex +++ /dev/null @@ -1,65 +0,0 @@ -%D \module -%D [ file=meta-nav, -%D version=2003.03.28, -%D title=\METAPOST\ Graphics, -%D subtitle=Navigational Graphics, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -\startuniqueMPgraphic{navplus}{size,color,type,mode} - color c ; numeric s, t ; path p ; - t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ; - if \MPvar{mode} = 1 : c := .5[c,white] fi ; - if t = 1 : - p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle) - xyscaled (3,4) ; - elseif t = 2 : - p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle) - xyscaled (4,3) ; - else : - p := fullsquare xyscaled (3,3) ; - fi ; - draw p withpen pencircle scaled (1/2) withcolor .75white ; - fill p withcolor c ; - draw p withpen pencircle scaled (1/3) withcolor .5c ; - currentpicture := currentpicture scaled s ; - currentpicture := currentpicture shifted -center currentpicture ; -\stopuniqueMPgraphic - -\setupMPvariables - [navplus] - [size=1ex, - color=black, - type=1, - mode=0] - -\definepalet - [navplus] - [attach=darkred, - comment=darkblue] - -\definesymbol - [comment-normal] - [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}] -\definesymbol - [comment-down] - [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}] - -\definesymbol - [attach-normal] - [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}] -\definesymbol - [attach-down] - [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}] - -\unprotect - -\setupcomment [\c!symbol={comment-normal,comment-down}] -\setupattachments[\c!symbol={attach-normal,attach-down}] - -\protect \endinput diff --git a/tex/context/base/meta-pre.mkii b/tex/context/base/meta-pre.mkii new file mode 100644 index 000000000..cb861ff20 --- /dev/null +++ b/tex/context/base/meta-pre.mkii @@ -0,0 +1,68 @@ +%D \module +%D [ file=meta-pre, +%D version=2001.03.21, +%D title=\METAPOST\ Graphics, +%D subtitle=Predefined Goodies, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 In this library, we define a couple of handy graphics. + +% todo: use the predefine grid macros, mp code will move to +% mp-* file + +\startuseMPgraphic{pagegrid} + StartPage ; + drawoptions(withcolor .8white) ; + fill Field[Text][Text] ; + drawoptions(withcolor .65white) ; + fill Field[Footer][Text] ; + fill Field[Header][Text] ; + fill Field[LeftMargin][Text] ; + fill Field[RightMargin][Text] ; + drawoptions(withcolor .65yellow) ; + fill Field[LeftEdge][Text] ; + fill Field[RightEdge][Text] ; + fill Field[Bottom][Text] ; + fill Field[Top][Text] ; + drawoptions(withpen pencircle scaled .3pt withcolor .65white) ; + for i=-3cm step 1cm until PaperWidth+3cm : + draw (i,-3cm)--(i,PaperHeight+3cm) ; + endfor ; + for i=PaperHeight+3cm step -1cm until -3cm : + draw (-3cm,i)--(PaperWidth+3cm,i) ; + endfor ; + drawoptions(withpen pencircle scaled .15pt) ; + for i=.5cm-3cm step 1cm until PaperWidth+3cm : + draw (i,-3cm)--(i,PaperHeight+3cm) ; + endfor ; + for i=PaperHeight-.5cm+3cm step -1cm until -3cm : + draw (-3cm,i)--(PaperWidth+3cm,i) ; + endfor ; + drawoptions(withpen pencircle scaled .3pt withcolor .65red) ; + for i=0 step 1cm until PaperWidth : + draw (i,0)--(i,PaperHeight) ; + endfor ; + for i=PaperHeight step -1cm until 0 : + draw (0,i)--(PaperWidth,i) ; + endfor ; + drawoptions(withpen pencircle scaled .15pt withcolor .65red) ; + for i=.5cm step 1cm until PaperWidth : + draw (i,0)--(i,PaperHeight) ; + endfor ; + for i=PaperHeight-.5cm step -1cm until 0 : + draw (0,i)--(PaperWidth,i) ; + endfor ; + drawoptions(withpen pencircle scaled 5pt withcolor .65red) ; + draw ulcorner Page ; + StopPage ; +\stopuseMPgraphic + +\defineoverlay[pagegrid][\useMPgraphic{pagegrid}] + +\endinput diff --git a/tex/context/base/meta-pre.tex b/tex/context/base/meta-pre.tex deleted file mode 100644 index cb861ff20..000000000 --- a/tex/context/base/meta-pre.tex +++ /dev/null @@ -1,68 +0,0 @@ -%D \module -%D [ file=meta-pre, -%D version=2001.03.21, -%D title=\METAPOST\ Graphics, -%D subtitle=Predefined Goodies, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 In this library, we define a couple of handy graphics. - -% todo: use the predefine grid macros, mp code will move to -% mp-* file - -\startuseMPgraphic{pagegrid} - StartPage ; - drawoptions(withcolor .8white) ; - fill Field[Text][Text] ; - drawoptions(withcolor .65white) ; - fill Field[Footer][Text] ; - fill Field[Header][Text] ; - fill Field[LeftMargin][Text] ; - fill Field[RightMargin][Text] ; - drawoptions(withcolor .65yellow) ; - fill Field[LeftEdge][Text] ; - fill Field[RightEdge][Text] ; - fill Field[Bottom][Text] ; - fill Field[Top][Text] ; - drawoptions(withpen pencircle scaled .3pt withcolor .65white) ; - for i=-3cm step 1cm until PaperWidth+3cm : - draw (i,-3cm)--(i,PaperHeight+3cm) ; - endfor ; - for i=PaperHeight+3cm step -1cm until -3cm : - draw (-3cm,i)--(PaperWidth+3cm,i) ; - endfor ; - drawoptions(withpen pencircle scaled .15pt) ; - for i=.5cm-3cm step 1cm until PaperWidth+3cm : - draw (i,-3cm)--(i,PaperHeight+3cm) ; - endfor ; - for i=PaperHeight-.5cm+3cm step -1cm until -3cm : - draw (-3cm,i)--(PaperWidth+3cm,i) ; - endfor ; - drawoptions(withpen pencircle scaled .3pt withcolor .65red) ; - for i=0 step 1cm until PaperWidth : - draw (i,0)--(i,PaperHeight) ; - endfor ; - for i=PaperHeight step -1cm until 0 : - draw (0,i)--(PaperWidth,i) ; - endfor ; - drawoptions(withpen pencircle scaled .15pt withcolor .65red) ; - for i=.5cm step 1cm until PaperWidth : - draw (i,0)--(i,PaperHeight) ; - endfor ; - for i=PaperHeight-.5cm step -1cm until 0 : - draw (0,i)--(PaperWidth,i) ; - endfor ; - drawoptions(withpen pencircle scaled 5pt withcolor .65red) ; - draw ulcorner Page ; - StopPage ; -\stopuseMPgraphic - -\defineoverlay[pagegrid][\useMPgraphic{pagegrid}] - -\endinput diff --git a/tex/context/base/meta-txt.mkii b/tex/context/base/meta-txt.mkii new file mode 100644 index 000000000..474253a40 --- /dev/null +++ b/tex/context/base/meta-txt.mkii @@ -0,0 +1,304 @@ +%D \module +%D [ file=meta-txt, +%D version=2000.07.06, +%D title=\METAPOST\ Graphics, +%D subtitle=Text Tricks, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 In this library some handy text manipulations are +%D defined. Some can and will be improved as soon as the +%D \TEX||\METAPOST\ interface is stable. Some of the +%D solutions may look weird, which is entirely my fault, +%D since I implemented them in the process of getting grip +%D on this kind of manipulations. Undoubtly better +%D \METAPOST\ code is possible, but my way of learning +%D this kind of trickery happens to be by \quote {trial +%D and error} and \quote {look and feel} (as well as +%D identifying tricks in Hobby's code). + +% textext ipv btex ... etex + +% we need a proper prefix here + +\unprotect + +\startMPextensions + if unknown context_text: input mp-text; fi; +\stopMPextensions + +%%%%%%% + +% \def\newchar#1{\chardef#1=0 } + +\ifdefined\MPtoks \else \newtoks\MPtoks \fi +\ifdefined\MPbox \else \newbox \MPbox \fi + +\ifdefined\parwidth \else \newdimen\parwidth \fi +\ifdefined\parheight \else \newdimen\parheight \fi +\ifdefined\parvoffset \else \newdimen\parvoffset \fi +\ifdefined\parhoffset \else \newdimen\parhoffset \fi +\ifdefined\parlines \else \newcount\parlines \fi +\ifdefined\partoks \else \newtoks \partoks \fi +\ifdefined\shapetextbox \else \newbox \shapetextbox \fi + \newif \ifparseries +\ifdefined\parfirst \else \chardef \parfirst=0 \fi + +\def\startshapetext[#1]% + {\global\newcounter\currentshapetext + \global\setbox\shapetextbox\vbox\bgroup + \expanded{\switchtobodyfont[\@@shbodyfont]}% + \dontcomplain + \hsize\parwidth + \setuptolerance[\v!verytolerant,\v!stretch]% + \!!counta\zerocount + \!!toksa\emptytoks + \def\docommand##1% + {\setbox\scratchbox\hbox{\useMPgraphic{##1}}% + \global\chardef\parfirst\zerocount + \getMPdata % \readlocfile{\MPdatafile}{}{}% + \setshapecharacteristics + \advance\!!counta by \parlines + \expandafter\appendtoks\the\partoks\to\!!toksa}% + \processcommalist[#1]\docommand + \global\parseriestrue + \xdef\totalparlines{\the\!!counta}% + \global\partoks\!!toksa + %\ifx\partoks\emptytoks\else % safeguard + \expanded{\parshape \the\!!counta \the\!!toksa}% + %\fi + \setshapecharacteristics % extra dummy + \ifparseries\def\par{\endgraf\adaptparshape}\fi + \EveryPar{\begstrut}} + +\def\stopshapetext + {\endstrut + %\removebottomthings + \egroup + \global\newcounter\currentshapetext + \getshapecharacteristics} + +\def\adaptparshape% + {\def\docommand##1% + {\ifcase\!!counta + \expandafter\appendtoks\space##1 \to\!!toksa + \else + \advance\!!counta \minusone + \fi}% + \!!counta\prevgraf + \doglobal\decrement(\totalparlines,\!!counta)% + \multiply\!!counta \plustwo + \!!toksa\emptytoks + \expanded{\processseparatedlist[\the\partoks][\space]}\docommand + \global\partoks\!!toksa + %\ifx\partoks\emptytoks\else % safeguard + \expanded{\parshape\totalparlines\the\partoks}% + }%\fi} + +\def\getshapecharacteristics% + {\doglobal\increment\currentshapetext + \doifdefinedelse{parlines:\currentshapetext} + {\global\parlines \getvalue{parlines:\currentshapetext}% + \global\chardef\parfirst \getvalue{parfirst:\currentshapetext}% + \global\parvoffset \getvalue{parvoffset:\currentshapetext}% + \global\parhoffset \getvalue{parhoffset:\currentshapetext}% + \global\parwidth \getvalue{parwidth:\currentshapetext}% + \global\parheight \getvalue{parheight:\currentshapetext}} + {\global\parlines \plusone + \global\chardef\parfirst \zerocount + \global\parvoffset \zeropoint + \global\parhoffset \zeropoint + \global\parwidth \hsize + \global\parheight \vsize}} + +\def\setshapecharacteristics% + {\doglobal\increment\currentshapetext + \setxvalue{parlines:\currentshapetext }{\the\parlines}% + \setxvalue{parfirst:\currentshapetext }{\the\parfirst}% + \setxvalue{parvoffset:\currentshapetext}{\the\parvoffset}% + \setxvalue{parhoffset:\currentshapetext}{\the\parhoffset}% + \setxvalue{parwidth:\currentshapetext }{\the\parwidth}% + \setxvalue{parheight:\currentshapetext }{\the\parheight}} + +\def\getshapetext% option: unvbox + {\vbox\bgroup + \forgetall + \setbox\scratchbox\vbox to \parheight + {\expanded{\switchtobodyfont[\@@shbodyfont]}% evt strutheight en + \splittopskip\strutheight % lineheight opslaan + \vskip\parvoffset % scheelt switch en + \ifcase\parfirst\or\vskip\lineheight\fi % is ook veiliger + \hskip\parhoffset + \hbox{\vsplit\shapetextbox to \parlines\lineheight}}% + \wd\scratchbox\parwidth + \ht\scratchbox\parheight + \dp\scratchbox\zeropoint + \box\scratchbox + \getshapecharacteristics + \egroup} + +\def\setupshapetexts% + {\dodoubleempty\getparameters[\??sh]} + +\setupshapetexts% + [\c!bodyfont=] + +%%%%%%% rotfont nog definieren + +\doifundefined{RotFont}{\definefont[RotFont][RegularBold]} + +\def\processfollowingtoken#1% strut toegevoegd + {\appendtoks#1\to\MPtoks + \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}% + \startMPdrawing + n := n + 1 ; len[n] := \the\wd\MPbox ; + \stopMPdrawing + \startMPdrawing[-] + % pic[n] := textext{\RotFont\setstrut\strut#1} ; % btex \RotFont\setstrut\strut#1 etex ; + pic[n] := btex \RotFont\setstrut\strut#1 etex ; + pic[n] := pic[n] shifted - llcorner pic[n] ; + \stopMPdrawing} + +\startuseMPgraphic{followtokens} + % we default to nothing +\stopuseMPgraphic + +\def\followtokens#1% + {\vbox\bgroup + \forgetall + \dontcomplain + \startMPenvironment + \doifundefined{RotFont}{\definefont[RotFont][RegularBold]} + \stopMPenvironment + \MPtoks\emptytoks + \resetMPdrawing + \startMPdrawing + \includeMPgraphic{followtokens} ; + picture pic[] ; numeric len[], n ; n := 0 ; + \stopMPdrawing + \handletokens#1\with\processfollowingtoken + \startMPdrawing + if unknown RotPath : path RotPath ; RotPath := origin ; fi ; + if unknown RotColor : color RotColor ; RotColor := black ; fi ; + if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ; + if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ; + numeric al, at, pl, wid, pos ; pair ap, ad ; + al := arclength RotPath ; + if al=0 : + al := len[n] + ExtraRot ; + RotPath := origin -- (al,0) ; + fi ; + if al1 : (n-1) else : 1 fi) ; + if TraceRot : + draw RotPath withpen pencircle scaled 1pt withcolor blue ; + fi ; + for i=1 upto n : + wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ; + pos := len[i]-wid/2 + (i-1)*pl ; + at := arctime pos of RotPath ; + ap := point at of RotPath ; + ad := direction at of RotPath ; + draw pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap + withcolor RotColor ; + if TraceRot : + draw boundingbox + pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap + withpen pencircle scaled .25pt withcolor red ; + draw ap + withpen pencircle scaled .50pt withcolor green ; + fi ; + endfor ; + \stopMPdrawing + \MPdrawingdonetrue + \getMPdrawing + \resetMPdrawing + \egroup} + +% \followtokens +% {This is just a dummy text, kerned by T{\kern +% -.1667em\lower .5ex\hbox {E}}{\kern -.125emX} and typeset +% in a circle using {\setMFPfont M}{\setMFPfont +% E}{\setMFPfont T}{\setMFPfont A}{\setMFPfont +% P}{\setMFPfont O}{\setMFPfont S}{\setMFPfont T}.\quad} + +\startuseMPgraphic{fuzzycount} + begingroup + save height, span, drift, d, cp ; + height := 3/ 5 * \baselinedistance ; + span := 1/ 3 * height ; + drift := 1/10 * height ; + pickup pencircle scaled (1/12 * height) ; + def d = (uniformdeviate drift) enddef ; + for i := 1 upto \MPvar{n} : + draw + if (i mod 5)=0 : ((-d-4.5span,d)--(+d-0.5span,height-d)) + else : ((-d,+d)--(+d,height-d)) fi + shifted (span*i,d-drift) ; + endfor; + picture cp ; cp := currentpicture ; % for readability + setbounds currentpicture to + (llcorner cp shifted (0,-ypart llcorner cp) -- + lrcorner cp shifted (0,-ypart lrcorner cp) -- + urcorner cp -- ulcorner cp -- cycle) ; + endgroup ; +\stopuseMPgraphic + +\setupMPvariables + [fuzzycount] + [n=10] + +\def\fuzzycount#1% + {{\tx\useMPgraphic{fuzzycount}{n=#1}}} + +\defineconversion[fuzzy][\fuzzycount] + +%%%%%%% + +\setupMPvariables + [EnglishRule] + [height=1ex, + width=\the\localhsize, % without \the, problems in non e-tex + color=darkgray] + +\defineblank + [EnglishRule] + [medium] + +\startuniqueMPgraphic{EnglishRule}{height,width,color} + height = \MPvar{height} ; + x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ; + y1 = y3 = 0 ; y2 = -y4 = height/2 ; + fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ; +\stopuniqueMPgraphic + +\def\EnglishRule% + {\startlinecorrection[EnglishRule] + \setlocalhsize \noindent \reuseMPgraphic{EnglishRule} + \stoplinecorrection} + +%D The following macro returns a tight bound character +%D sequence. +%D +%D \useMPlibrary[txt] +%D +%D \startlinecorrection +%D \TightText{\ss\bf 123}{0cm}{3cm}{red} +%D \stoplinecorrection + +\def\TightText#1#2#3#4% + {\hbox % \ruledhbox + {\startMPcode + picture p ; p := image (graphictext "#1" withfillcolor red) ; + draw p xsized #2 ysized #3 withcolor \MPcolor{#4} ; + \stopMPcode}} + +\protect \endinput diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-txt.tex deleted file mode 100644 index 474253a40..000000000 --- a/tex/context/base/meta-txt.tex +++ /dev/null @@ -1,304 +0,0 @@ -%D \module -%D [ file=meta-txt, -%D version=2000.07.06, -%D title=\METAPOST\ Graphics, -%D subtitle=Text Tricks, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 In this library some handy text manipulations are -%D defined. Some can and will be improved as soon as the -%D \TEX||\METAPOST\ interface is stable. Some of the -%D solutions may look weird, which is entirely my fault, -%D since I implemented them in the process of getting grip -%D on this kind of manipulations. Undoubtly better -%D \METAPOST\ code is possible, but my way of learning -%D this kind of trickery happens to be by \quote {trial -%D and error} and \quote {look and feel} (as well as -%D identifying tricks in Hobby's code). - -% textext ipv btex ... etex - -% we need a proper prefix here - -\unprotect - -\startMPextensions - if unknown context_text: input mp-text; fi; -\stopMPextensions - -%%%%%%% - -% \def\newchar#1{\chardef#1=0 } - -\ifdefined\MPtoks \else \newtoks\MPtoks \fi -\ifdefined\MPbox \else \newbox \MPbox \fi - -\ifdefined\parwidth \else \newdimen\parwidth \fi -\ifdefined\parheight \else \newdimen\parheight \fi -\ifdefined\parvoffset \else \newdimen\parvoffset \fi -\ifdefined\parhoffset \else \newdimen\parhoffset \fi -\ifdefined\parlines \else \newcount\parlines \fi -\ifdefined\partoks \else \newtoks \partoks \fi -\ifdefined\shapetextbox \else \newbox \shapetextbox \fi - \newif \ifparseries -\ifdefined\parfirst \else \chardef \parfirst=0 \fi - -\def\startshapetext[#1]% - {\global\newcounter\currentshapetext - \global\setbox\shapetextbox\vbox\bgroup - \expanded{\switchtobodyfont[\@@shbodyfont]}% - \dontcomplain - \hsize\parwidth - \setuptolerance[\v!verytolerant,\v!stretch]% - \!!counta\zerocount - \!!toksa\emptytoks - \def\docommand##1% - {\setbox\scratchbox\hbox{\useMPgraphic{##1}}% - \global\chardef\parfirst\zerocount - \getMPdata % \readlocfile{\MPdatafile}{}{}% - \setshapecharacteristics - \advance\!!counta by \parlines - \expandafter\appendtoks\the\partoks\to\!!toksa}% - \processcommalist[#1]\docommand - \global\parseriestrue - \xdef\totalparlines{\the\!!counta}% - \global\partoks\!!toksa - %\ifx\partoks\emptytoks\else % safeguard - \expanded{\parshape \the\!!counta \the\!!toksa}% - %\fi - \setshapecharacteristics % extra dummy - \ifparseries\def\par{\endgraf\adaptparshape}\fi - \EveryPar{\begstrut}} - -\def\stopshapetext - {\endstrut - %\removebottomthings - \egroup - \global\newcounter\currentshapetext - \getshapecharacteristics} - -\def\adaptparshape% - {\def\docommand##1% - {\ifcase\!!counta - \expandafter\appendtoks\space##1 \to\!!toksa - \else - \advance\!!counta \minusone - \fi}% - \!!counta\prevgraf - \doglobal\decrement(\totalparlines,\!!counta)% - \multiply\!!counta \plustwo - \!!toksa\emptytoks - \expanded{\processseparatedlist[\the\partoks][\space]}\docommand - \global\partoks\!!toksa - %\ifx\partoks\emptytoks\else % safeguard - \expanded{\parshape\totalparlines\the\partoks}% - }%\fi} - -\def\getshapecharacteristics% - {\doglobal\increment\currentshapetext - \doifdefinedelse{parlines:\currentshapetext} - {\global\parlines \getvalue{parlines:\currentshapetext}% - \global\chardef\parfirst \getvalue{parfirst:\currentshapetext}% - \global\parvoffset \getvalue{parvoffset:\currentshapetext}% - \global\parhoffset \getvalue{parhoffset:\currentshapetext}% - \global\parwidth \getvalue{parwidth:\currentshapetext}% - \global\parheight \getvalue{parheight:\currentshapetext}} - {\global\parlines \plusone - \global\chardef\parfirst \zerocount - \global\parvoffset \zeropoint - \global\parhoffset \zeropoint - \global\parwidth \hsize - \global\parheight \vsize}} - -\def\setshapecharacteristics% - {\doglobal\increment\currentshapetext - \setxvalue{parlines:\currentshapetext }{\the\parlines}% - \setxvalue{parfirst:\currentshapetext }{\the\parfirst}% - \setxvalue{parvoffset:\currentshapetext}{\the\parvoffset}% - \setxvalue{parhoffset:\currentshapetext}{\the\parhoffset}% - \setxvalue{parwidth:\currentshapetext }{\the\parwidth}% - \setxvalue{parheight:\currentshapetext }{\the\parheight}} - -\def\getshapetext% option: unvbox - {\vbox\bgroup - \forgetall - \setbox\scratchbox\vbox to \parheight - {\expanded{\switchtobodyfont[\@@shbodyfont]}% evt strutheight en - \splittopskip\strutheight % lineheight opslaan - \vskip\parvoffset % scheelt switch en - \ifcase\parfirst\or\vskip\lineheight\fi % is ook veiliger - \hskip\parhoffset - \hbox{\vsplit\shapetextbox to \parlines\lineheight}}% - \wd\scratchbox\parwidth - \ht\scratchbox\parheight - \dp\scratchbox\zeropoint - \box\scratchbox - \getshapecharacteristics - \egroup} - -\def\setupshapetexts% - {\dodoubleempty\getparameters[\??sh]} - -\setupshapetexts% - [\c!bodyfont=] - -%%%%%%% rotfont nog definieren - -\doifundefined{RotFont}{\definefont[RotFont][RegularBold]} - -\def\processfollowingtoken#1% strut toegevoegd - {\appendtoks#1\to\MPtoks - \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}% - \startMPdrawing - n := n + 1 ; len[n] := \the\wd\MPbox ; - \stopMPdrawing - \startMPdrawing[-] - % pic[n] := textext{\RotFont\setstrut\strut#1} ; % btex \RotFont\setstrut\strut#1 etex ; - pic[n] := btex \RotFont\setstrut\strut#1 etex ; - pic[n] := pic[n] shifted - llcorner pic[n] ; - \stopMPdrawing} - -\startuseMPgraphic{followtokens} - % we default to nothing -\stopuseMPgraphic - -\def\followtokens#1% - {\vbox\bgroup - \forgetall - \dontcomplain - \startMPenvironment - \doifundefined{RotFont}{\definefont[RotFont][RegularBold]} - \stopMPenvironment - \MPtoks\emptytoks - \resetMPdrawing - \startMPdrawing - \includeMPgraphic{followtokens} ; - picture pic[] ; numeric len[], n ; n := 0 ; - \stopMPdrawing - \handletokens#1\with\processfollowingtoken - \startMPdrawing - if unknown RotPath : path RotPath ; RotPath := origin ; fi ; - if unknown RotColor : color RotColor ; RotColor := black ; fi ; - if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ; - if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ; - numeric al, at, pl, wid, pos ; pair ap, ad ; - al := arclength RotPath ; - if al=0 : - al := len[n] + ExtraRot ; - RotPath := origin -- (al,0) ; - fi ; - if al1 : (n-1) else : 1 fi) ; - if TraceRot : - draw RotPath withpen pencircle scaled 1pt withcolor blue ; - fi ; - for i=1 upto n : - wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ; - pos := len[i]-wid/2 + (i-1)*pl ; - at := arctime pos of RotPath ; - ap := point at of RotPath ; - ad := direction at of RotPath ; - draw pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap - withcolor RotColor ; - if TraceRot : - draw boundingbox - pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap - withpen pencircle scaled .25pt withcolor red ; - draw ap - withpen pencircle scaled .50pt withcolor green ; - fi ; - endfor ; - \stopMPdrawing - \MPdrawingdonetrue - \getMPdrawing - \resetMPdrawing - \egroup} - -% \followtokens -% {This is just a dummy text, kerned by T{\kern -% -.1667em\lower .5ex\hbox {E}}{\kern -.125emX} and typeset -% in a circle using {\setMFPfont M}{\setMFPfont -% E}{\setMFPfont T}{\setMFPfont A}{\setMFPfont -% P}{\setMFPfont O}{\setMFPfont S}{\setMFPfont T}.\quad} - -\startuseMPgraphic{fuzzycount} - begingroup - save height, span, drift, d, cp ; - height := 3/ 5 * \baselinedistance ; - span := 1/ 3 * height ; - drift := 1/10 * height ; - pickup pencircle scaled (1/12 * height) ; - def d = (uniformdeviate drift) enddef ; - for i := 1 upto \MPvar{n} : - draw - if (i mod 5)=0 : ((-d-4.5span,d)--(+d-0.5span,height-d)) - else : ((-d,+d)--(+d,height-d)) fi - shifted (span*i,d-drift) ; - endfor; - picture cp ; cp := currentpicture ; % for readability - setbounds currentpicture to - (llcorner cp shifted (0,-ypart llcorner cp) -- - lrcorner cp shifted (0,-ypart lrcorner cp) -- - urcorner cp -- ulcorner cp -- cycle) ; - endgroup ; -\stopuseMPgraphic - -\setupMPvariables - [fuzzycount] - [n=10] - -\def\fuzzycount#1% - {{\tx\useMPgraphic{fuzzycount}{n=#1}}} - -\defineconversion[fuzzy][\fuzzycount] - -%%%%%%% - -\setupMPvariables - [EnglishRule] - [height=1ex, - width=\the\localhsize, % without \the, problems in non e-tex - color=darkgray] - -\defineblank - [EnglishRule] - [medium] - -\startuniqueMPgraphic{EnglishRule}{height,width,color} - height = \MPvar{height} ; - x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ; - y1 = y3 = 0 ; y2 = -y4 = height/2 ; - fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ; -\stopuniqueMPgraphic - -\def\EnglishRule% - {\startlinecorrection[EnglishRule] - \setlocalhsize \noindent \reuseMPgraphic{EnglishRule} - \stoplinecorrection} - -%D The following macro returns a tight bound character -%D sequence. -%D -%D \useMPlibrary[txt] -%D -%D \startlinecorrection -%D \TightText{\ss\bf 123}{0cm}{3cm}{red} -%D \stoplinecorrection - -\def\TightText#1#2#3#4% - {\hbox % \ruledhbox - {\startMPcode - picture p ; p := image (graphictext "#1" withfillcolor red) ; - draw p xsized #2 ysized #3 withcolor \MPcolor{#4} ; - \stopMPcode}} - -\protect \endinput diff --git a/tex/context/base/metatex.tex b/tex/context/base/metatex.tex index f9753cf83..cb965dc48 100644 --- a/tex/context/base/metatex.tex +++ b/tex/context/base/metatex.tex @@ -42,7 +42,7 @@ \def\loadcorefile#1{\normalinput#1.tex \relax} \def\loadmarkfile#1{\normalinput#1.mkiv\relax} -\loadcorefile{syst-ini} +\loadmarkfile{syst-ini} \ifnum\luatexversion<60 % also change message \writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.60!} @@ -51,7 +51,7 @@ \newtoks\metatexversiontoks \metatexversiontoks\expandafter{\metatexversion} % at the lua end -\loadcorefile{syst-pln} % plain tex initializations of internal registers (no further code) +\loadmarkfile{syst-pln} % plain tex initializations of internal registers (no further code) \loadmarkfile{syst-mes} \loadmarkfile{luat-cod} % @@ -61,10 +61,10 @@ % needs stripping: \loadmarkfile{catc-ini} % catcode table management -\loadcorefile{catc-act} % active character definition mechanisms -\loadcorefile{catc-def} % some generic catcode tables -\loadcorefile{catc-ctx} % a couple of context specific tables but expected by later modules -\loadcorefile{catc-sym} % some definitions related to \letter +\loadmarkfile{catc-act} % active character definition mechanisms +\loadmarkfile{catc-def} % some generic catcode tables +\loadmarkfile{catc-ctx} % a couple of context specific tables but expected by later modules +\loadmarkfile{catc-sym} % some definitions related to \letter % helpers, maybe less diff --git a/tex/context/base/page-app.mkiv b/tex/context/base/page-app.mkiv index 7dd71cf2a..9fade501b 100644 --- a/tex/context/base/page-app.mkiv +++ b/tex/context/base/page-app.mkiv @@ -13,8 +13,7 @@ \writestatus{loading}{ConTeXt Page Macros / Applications} -%D The fitting page code is moved from \type {meta-fig} to -%D here. +%D This needs an update with a proper define and inheritance. \unprotect @@ -35,7 +34,6 @@ \c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint, \c!header=\!!zeropoint,\c!footer=\!!zeropoint] - \def\dostartfittingpage[#1][#2]% {\page % this is kind of tricky! there can be preceding page refs \autostarttext @@ -85,7 +83,7 @@ \c!height=\fittinght]% \setuplayout [\v!page]% - \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]% + \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!pagestate=\getvalue{\currentfittingpage\c!pagestate}]% \centerbox{\box\scratchbox}% \stopmakeup \stoplocallayout @@ -111,6 +109,7 @@ \setupTEXpage [\c!scale=1000, + \c!pagestate=, \c!strut=\v!no, \c!align=\v!normal, % needed, else problems ! \c!offset=\v!overlay, diff --git a/tex/context/base/page-lay.mkii b/tex/context/base/page-lay.mkii index 8da9ba852..0bf375102 100644 --- a/tex/context/base/page-lay.mkii +++ b/tex/context/base/page-lay.mkii @@ -1150,11 +1150,11 @@ %D \showsetup{showsetups} %D %showsetup{showmargins} -\fetchruntimecommand \showprint {page-run.mkii} -\fetchruntimecommand \showframe {page-run.mkii} -\fetchruntimecommand \showlayout {page-run.mkii} -\fetchruntimecommand \showsetups {page-run.mkii} -\fetchruntimecommand \showmargins {page-run.mkii} +\fetchruntimecommand \showprint {page-run} +\fetchruntimecommand \showframe {page-run} +\fetchruntimecommand \showlayout {page-run} +\fetchruntimecommand \showsetups {page-run} +\fetchruntimecommand \showmargins {page-run} %D The default dimensions are quite old and will not change. %D The funny fractions were introduced when we went from fixed diff --git a/tex/context/base/page-lay.mkiv b/tex/context/base/page-lay.mkiv index 4944712bb..261bf849d 100644 --- a/tex/context/base/page-lay.mkiv +++ b/tex/context/base/page-lay.mkiv @@ -1172,11 +1172,11 @@ %D \showsetup{showsetups} %D %showsetup{showmargins} -\fetchruntimecommand \showprint {page-run.mkiv} -\fetchruntimecommand \showframe {page-run.mkiv} -\fetchruntimecommand \showlayout {page-run.mkiv} -\fetchruntimecommand \showsetups {page-run.mkiv} -\fetchruntimecommand \showmargins {page-run.mkiv} +\fetchruntimecommand \showprint {page-run} +\fetchruntimecommand \showframe {page-run} +\fetchruntimecommand \showlayout {page-run} +\fetchruntimecommand \showsetups {page-run} +\fetchruntimecommand \showmargins {page-run} %D The default dimensions are quite old and will not change. %D The funny fractions were introduced when we went from fixed diff --git a/tex/context/base/s-inf-01.mkiv b/tex/context/base/s-inf-01.mkiv index 80c40fa40..dc55735fe 100644 --- a/tex/context/base/s-inf-01.mkiv +++ b/tex/context/base/s-inf-01.mkiv @@ -26,54 +26,60 @@ local skip = { "prag%-.*%.tex", "docs%-.*.tex", "list%-.*%.tex", "test%-.*%.tex", "demo%-.*%.tex", "opti%-.*%.tex", "chrt%-.*%.tex", ".*%-old", ".*%-obs", ".*%-tst", "supp%-.*%.tex", - "colo%-pan.tex", + "colo%-pan.tex", ".*test.*" } local types = { "tex", "mkii", "mkiv", "mkvi", "lua" } + local patterns = { + "^([a-z][a-z][a-z][a-z])%-[a-z0-9%-]+%.[a-z]+", + "^([xms])%-[a-z0-9%-]+%.[a-z]+", + } local function collect(list,suffix,n) - local path = file.dirname(resolvers.find_file("context.tex"),".") + local path = file.dirname(resolvers.find_file("context.mkiv"),".") local pattern = path .. "/*." .. suffix local texfiles = dir.glob(pattern) for _, name in ipairs(texfiles) do local base = file.basename(name) - local category = match(base,"^([a-z][a-z][a-z][a-z])%-[a-z0-9]+%.[a-z]+") - if category and lfs.isfile(name) then - local okay = true - for s=1,#skip do - if find(base,skip[s]) then - okay = false - break - end - end - if okay then - local lm, sm, cm = list[category], size[category], comp[category] - if not lm then - lm, sm, cm = { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 } - list[category], size[category], comp[category] = lm, sm, cm - end - lm[n] = lm[n] + 1 - local done = true - for o=1,#omit do - if find(base,omit[o]) then - done = false + for p=1,#patterns do + local category = match(base,patterns[p]) + if category and lfs.isfile(name) then + local okay = true + for s=1,#skip do + if find(base,skip[s]) then + okay = false break end end - local data = io.loaddata(name) - if suffix == "lua" then - data = gsub(data,"%-%-%[%[.-%]%]%-%-","") - data = gsub(data,"%-%-.-[\n\r]","") - else - data = gsub(data,"%%.-[\n\r]","") - end - data = gsub(data,"%s","") - sm[n+5] = sm[n+5] + #data - if done then - sm[n] = sm[n] + #data - else - cm[n] = cm[n] + 1 + if okay then + local lm, sm, cm = list[category], size[category], comp[category] + if not lm then + lm, sm, cm = { 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0 } + list[category], size[category], comp[category] = lm, sm, cm + end + lm[n] = lm[n] + 1 + local done = true + for o=1,#omit do + if find(base,omit[o]) then + done = false + break + end + end + local data = io.loaddata(name) + if suffix == "lua" then + data = gsub(data,"%-%-%[%[.-%]%]%-%-","") + data = gsub(data,"%-%-.-[\n\r]","") + else + data = gsub(data,"%%.-[\n\r]","") + end + data = gsub(data,"%s","") + sm[n+5] = sm[n+5] + #data + if done then + sm[n] = sm[n] + #data + else + cm[n] = cm[n] + 1 + end end end end @@ -106,7 +112,7 @@ function document.context_state_1(what) local max, what, norm = prepare(what) - context.starttabulate { "|Tc|T|T|T|T|T|" } + context.starttabulate { "|Tl|T|T|T|T|T|" } context.NC() context(category) context.NC() diff --git a/tex/context/base/scrn-int.mkiv b/tex/context/base/scrn-int.mkiv index eea71debc..f819789e9 100644 --- a/tex/context/base/scrn-int.mkiv +++ b/tex/context/base/scrn-int.mkiv @@ -411,15 +411,18 @@ \def\douseattachment[#1][#2][#3][#4]% tag title newname filename {\iffourthargument - \ctxlua{interactions.attachments.register{ label="#1", title="#2", newname="#3", filename="#4" }}% + \dodouseattachment{#1}{#2}{#3}{#4}% \else\ifthirdargument - \ctxlua{interactions.attachments.register{ label="#1", title="#2", newname="#2", filename="#3" }}% + \dodouseattachment{#1}{#2}{#2}{#3}% \else\ifsecondargument - \ctxlua{interactions.attachments.register{ label="#1", title="#2", newname="#2", filename="#2" }}% + \dodouseattachment{#1}{#2}{#2}{#2}% \else - \ctxlua{interactions.attachments.register{ label="#1", title="#1", newname="#1", filename="#1" }}% + \dodouseattachment{#1}{#1}{#1}{#1}% \fi\fi\fi} +\def\dodouseattachment#1#2#3#4% tag title newname filename + {\ctxlua{interactions.attachments.register{label="#1",title="#2",newname="#3",filename="#4"}}} + \def\attachment {\dodoubleempty\doattachment} diff --git a/tex/context/base/supp-fil.lua b/tex/context/base/supp-fil.lua index 7f573c038..4370e1163 100644 --- a/tex/context/base/supp-fil.lua +++ b/tex/context/base/supp-fil.lua @@ -145,14 +145,18 @@ openers.fix = openers.file loaders.fix = loaders.file openers.set = openers.file loaders.set = loaders.file openers.any = openers.file loaders.any = loaders.file -function commands.doreadfile(scheme,path,name) -- better do a split and then pass table +function finders.doreadfile(scheme,path,name) -- better do a split and then pass table local fullname if url.hasscheme(name) then fullname = name else fullname = ((path == "") and format("%s:///%s",scheme,name)) or format("%s:///%s/%s",scheme,path,name) end - context(resolvers.findtexfile(fullname)) -- can be more direct + return resolvers.findtexfile(fullname) or "" -- can be more direct +end + +function commands.doreadfile(scheme,path,name) + context(finders.doreadfile(scheme,path,name)) end -- modules can have a specific suffix or can specify one @@ -294,6 +298,31 @@ function commands.usemodules(prefix,askedname,truename) modstatus[hashname] = status end +local loaded = { } + +function commands.uselibrary(name,patterns,action,failure) + local files = utilities.parsers.settings_to_array(name) + local done = false + for i=1,#files do + local filename = files[i] + if not loaded[filename] then + loaded[filename] = true + for i=1,#patterns do + local filename = format(patterns[i],filename) + -- local foundname = resolvers.find_file(filename) or "" + local foundname = finders.doreadfile("any",".",filename) + if foundname ~= "" then + action(name,foundname) + done = true + end + end + end + end + if not done then + failure(name) + end +end + statistics.register("loaded tex modules", function() if next(modstatus) then local t, f, nt, nf = { }, { }, 0, 0 diff --git a/tex/context/base/symb-ini.mkii b/tex/context/base/symb-ini.mkii index d8adc94e6..1df1fe688 100644 --- a/tex/context/base/symb-ini.mkii +++ b/tex/context/base/symb-ini.mkii @@ -255,7 +255,7 @@ %D %D \showsetup{showsymbolset} -\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run.mkii} +\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run} %D \macros %D {usesymbols} diff --git a/tex/context/base/symb-ini.mkiv b/tex/context/base/symb-ini.mkiv index de1e11396..bbefe9930 100644 --- a/tex/context/base/symb-ini.mkiv +++ b/tex/context/base/symb-ini.mkiv @@ -248,7 +248,7 @@ %D %D \showsetup{showsymbolset} -\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run.mkiv} +\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run} %D \macros %D {usesymbols} diff --git a/tex/context/base/syst-ini.mkii b/tex/context/base/syst-ini.mkii new file mode 100644 index 000000000..c2c3e1947 --- /dev/null +++ b/tex/context/base/syst-ini.mkii @@ -0,0 +1,923 @@ +%D \module +%D [ file=syst-ini, +%D version=2008.11.04, % 2001.11.16, % 1999.03.17, % an oldie: 1995.10.10 +%D title=\CONTEXT\ System Macros, +%D subtitle=Bootstrapping \TEX, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D We used to load plain \TEX\ in a special way, but redefining +%D a couple of primitives so that for instance font loading was +%D ignored. For those interested, this loader is found in +%D \type {syst-tex.tex}. Some of the comment's are Don Knuth's +%D and more of it can be found in the plain \TEX\ format. + +%D Characters can have special states, that can be triggered +%D by setting their category coded. Some are preset, others +%D are to be set as soon as possible, otherwise we cannot +%D define any useful macros. + +%catcode`\^^@ = 9 % ascii null is ignored +%catcode`\\ = 0 % backslash is TeX escape character + +\catcode`\{ = 1 % left brace is begin-group character +\catcode`\} = 2 % right brace is end-group character +\catcode`\$ = 3 % dollar sign is math shift +\catcode`\& = 4 % ampersand is alignment tab +\catcode`\# = 6 % hash mark is macro parameter character +\catcode`\^ = 7 % circumflex and uparrow are for superscripts +\catcode`\_ = 8 % underline and downarrow are for subscripts +\catcode`\^^I = 10 % ascii tab is a blank space + +%catcode`\^^M = 5 % ascii return is end-line +%catcode`\% = 14 % percent sign is comment character +%catcode`\ = 10 % ascii space is blank space +%catcode`\^^? = 15 % ascii delete is invalid + +\catcode`\~ = 13 % tilde is active +\catcode`\^^L = 13 % ascii form-feed + +%catcode`\A = 11 +%....... +%catcode`\Z = 11 + +%catcode`\a = 11 +%....... +%catcode`\z = 11 + +\chardef\activecatcode = 13 % later this will become a counter + +\def ^^L{\par} +\def\^^M{\ } % control = control +\def\^^I{\ } % same for + +%D In \CONTEXT, we simply ignore end||of||file tokens: + +\catcode`\^^Z=9 + +%D It makes sense to know what engine we're running so let's +%D try to deduce it. + +\chardef\unknownengine = 0 +\chardef\pdftexengine = 1 +\chardef\xetexengine = 2 +\chardef\luatexengine = 3 + +\ifx\directlua\undefined + \ifx\XeTeXversion\undefined + \ifx\pdftexversion\undefined + \let\texengine\unknownengine + \else + \let\texengine\pdftexengine + \fi + \else + \let\texengine\xetexengine + \fi +\else + \let\texengine\luatexengine +\fi + +\ifnum\texengine=\unknownengine + \immediate\write16{>>>} + \immediate\write16{>>> only pdftex, xetex and luatex are supported} + \immediate\write16{>>>} + \let\dump\relax + \expandafter\end +\fi + +% todo: pdfsave pdfrestore pdfcolor... don't initialize them + +\ifnum\texengine=\luatexengine + \directlua 0 { % this info is stored in the format + lua.name[0] = "main ctx instance" + local extraprimitives = tex.extraprimitives + local enableprimitives = tex.enableprimitives + local core = extraprimitives('core') + local btex = extraprimitives('tex') + local etex = extraprimitives('etex') + local pdftex = extraprimitives('pdftex') + local luatex = extraprimitives('luatex') + local omega = { + "textdir", "pagedir", "mathdir", "pardir", "bodydir", + "leftghost", "rightghost", "localleftbox", "localrightbox", + "localinterlinepenalty", "localbrokenpenalty", + } + local aleph = { + "boxdir", "pagebottomoffset", "pagerightoffset", + } + for _, subset in next, { etex, pdftex, luatex, omega, aleph } do + enableprimitives('',subset) + end + for _, subset in next, { core, btex, etex, pdftex, luatex, omega, aleph } do + enableprimitives('normal',subset) + end + } +\fi + +%D \ETEX\ has a not so handy way of telling you the version number, +%D i.e. the revision number has a period in it: + +\long\def\gobbleoneargument#1{} % will be defined later on anyway + +\mathchardef\etexversion = + \numexpr\eTeXversion*100+\expandafter\gobbleoneargument\eTeXrevision\relax + +%D First we define a simplified version of the \CONTEXT\ +%D protection mechanism. + +\def\unprotect{\catcode`@=11 } +\def\protect {\catcode`@=12 } + +\unprotect + +%D Some pretty important definitions: + +\let\bgroup={ +\let\egroup=} + +%D Allocation of registers is done slightly different than in plain +%D \TEX. First of all we use different reserved counters. We also +%D don't implement a family handler because users are not supposed +%D to implement their own math. We reserve the lowest 31 registers +%D for scratch purposes. Keep in mind that in the core engine +%D some registers are reserved: counters 0 upto 9, and counter 255. +%D +%D As with plain \TEX\ we recommend that macro designers always use +%D \type {\global} assignments with respect to registers numbered 1, +%D 3, 5 \unknown\ 31, and always non||\type {\global} assignments +%D with respect to registers 0, 2, 4, \unknown\ 30. This will prevent +%D \quote {save stack buildup} that might otherwise occur. +%D +%D We reserve some registers for special (management) purposes: + +% 0 - 20 : scratch +% 21 - 127 : internal +% 128 - 254 : inserts +% 255 : page +% 256 - : user + +\countdef \minallocatedregister = 52 \minallocatedregister = 256 +\countdef \maxallocatedregister = 53 \maxallocatedregister = 32767 +\countdef \minallocatediochannel = 54 \minallocatediochannel = -1 +\countdef \maxallocatediochannel = 55 \maxallocatediochannel = 16 +\countdef \minallocatedlanguage = 56 \minallocatedlanguage = 0 +\countdef \maxallocatedlanguage = 57 \maxallocatedlanguage = 255 +\countdef \maxallocatedinsert = 58 \maxallocatedinsert = 254 +\countdef \minallocatedinsert = 59 \minallocatedinsert = 128 +\countdef \minallocatedfamily = 60 \minallocatedfamily = 128 +\countdef \maxallocatedfamily = 61 \maxallocatedfamily = 255 + +\countdef \lastallocatedcount = 32 \lastallocatedcount = \minallocatedregister +\countdef \lastallocateddimen = 33 \lastallocateddimen = \minallocatedregister +\countdef \lastallocatedskip = 34 \lastallocatedskip = \minallocatedregister +\countdef \lastallocatedmuskip = 35 \lastallocatedmuskip = \minallocatedregister +\countdef \lastallocatedbox = 36 \lastallocatedbox = \minallocatedregister +\countdef \lastallocatedtoks = 37 \lastallocatedtoks = \minallocatedregister +\countdef \lastallocatedread = 38 \lastallocatedread = \minallocatediochannel +\countdef \lastallocatedwrite = 39 \lastallocatedwrite = \minallocatediochannel +\countdef \lastallocatedmarks = 40 \lastallocatedmarks = \minallocatedregister +\countdef \lastallocatedlanguage = 41 \lastallocatedlanguage = \minallocatedlanguage % not used in context +\countdef \lastallocatedinsertion = 42 \lastallocatedinsertion = \minallocatedinsert +\countdef \lastallocatedfamily = 43 \lastallocatedfamily = \minallocatedfamily % not used in context +\countdef \lastallocatedattribute = 44 \lastallocatedattribute = \minallocatedregister + +\countdef \mincountervalue = 125 \mincountervalue = -"7FFFFFFF % beware, we use index 125 at the lua end +\countdef \maxcountervalue = 126 \maxcountervalue = "7FFFFFFF % beware, we use index 126 at the lua end + +%countdef \minusone = 127 \minusone = -1 +%chardef \zerocount = 0 +%chardef \plusone = 1 + +\countdef \zerocount = 120 \zerocount = 0 +\countdef \plusone = 121 \plusone = 1 +\countdef \minusone = 122 \minusone = -1 + +%chardef \normalpagebox = 255 +\countdef \normalpagebox = 127 \normalpagebox = 255 % hardcoded in pdftex/xetex + +% A few traditional allocations: + +\countdef \count@ = 255 % hm, used in \newif .. todo: replace it there +\dimendef \dimen@ = 0 +\dimendef \dimen@i = 1 % global only +\dimendef \dimen@ii = 2 + +%D So, effectively we start allocating from 256 and upwards. The +%D inserts sit in the range 128 upto 254. Page numbers use the +%D counters 0 upto 9 and the pagebox is 255. Users can use the +%D scratch registers upto 31 without problem but all others are +%D reserved. + +\def\wlog#1{} % \def\wlog{\immediate\write\minusone} % write on log file (only) + +%D The allocators share a common helper macro. + +\def\newcount {\allocateregister\lastallocatedcount \count \countdef \maxallocatedregister} +\def\newdimen {\allocateregister\lastallocateddimen \dimen \dimendef \maxallocatedregister} +\def\newskip {\allocateregister\lastallocatedskip \skip \skipdef \maxallocatedregister} +\def\newmuskip {\allocateregister\lastallocatedmuskip \muskip \muskipdef \maxallocatedregister} +\def\newbox {\allocateregister\lastallocatedbox \box \mathchardef\maxallocatedregister} +\def\newtoks {\allocateregister\lastallocatedtoks \toks \toksdef \maxallocatedregister} +\def\newread {\allocateregister\lastallocatedread \read \chardef \maxallocatediochannel} +\def\newwrite {\allocateregister\lastallocatedwrite \write \chardef \maxallocatediochannel} +\def\newmarks {\allocateregister\lastallocatedmarks \marks \mathchardef\maxallocatedregister} +\def\newinsert {\allocateregister\lastallocatedinsertion\insert \chardef \maxallocatedinsert} + +%D We don't need these in \CONTEXT: + +\def\newlanguage{\allocateregister\lastallocatedlanguage \language\chardef \maxallocatedlanguage} +\def\newfamily {\allocateregister\lastallocatedfamily \fam \chardef \maxallocatedfamily} + +\let\newfam\newfamily + +% Watch out, for the moment we disable the check for already being defined +% later we will revert this but first all chardefs must be replaced. + +\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1} +\def\setnewconstant#1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number + +% maybe setconstant with check + +% %D The next definitions are really needed (in \CONTEXT): + +%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}} +\newlinechar=10 \edef\outputnewlinechar{^^J} + +%D One reason to start high with allocation is that it permits us to +%D allocate consecutive ranges more easily, for instance in \MPLIB\ +%D we want to allocate a continuous range of boxes. It also permits us +%D to do a proper upward allocation for inserts. The current code +%D evolved from code that dealt with older engines but as all engines +%D now provide many registers we removed all traces. + +\def\writestatus#1#2{\immediate\write16{#1: #2}} \def\space { } + +\def\allocateregisteryes#1#2#3#4#5% last class method max name + {\ifnum#1<#4\relax + \global\advance#1\plusone + \global#3#5=#1\relax + \else + \writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}% + \fi} + +\def\allocateregisternop#1#2#3#4#5% last class method max name + {\writestatus{warning}{\string#2 \string#5 is already defined (\string\relax\space it first)}} + +\def\allocateregister#1#2#3#4#5% last class method max name + {\ifx#5\undefined + \expandafter\allocateregisteryes + \else\ifx#5\relax + \expandafter\expandafter\expandafter\allocateregisteryes + \else + \expandafter\expandafter\expandafter\allocateregisternop + \fi\fi + #1#2#3#4#5} + +%D Since the number of chars exceed 256 now, we can use \type +%D {\chardef} instead of the more limited \type {\mathchardef}. + +\ifnum\texengine>\pdftexengine + \def\newbox {\allocateregister\lastallocatedbox \box \chardef\maxallocatedregister} + \def\newmarks{\allocateregister\lastallocatedmarks\marks\chardef\maxallocatedregister} +\fi + +%D Attributes are something very \LUATEX. In \CONTEXT\ you are not +%D supposed to use the attributes directly but always allocate then +%D first. For instance attribute~0 is reserved for special purposes +%D (this might change). + +\ifnum\texengine=\luatexengine + \let\attributeunsetvalue\mincountervalue % used to be \minusone + \def\newattribute{\allocateregister\lastallocatedattribute\attribute\attributedef\maxallocatedregister} +\fi + +%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a +%D trick to force strings instead of tokens that take more memory. +%D It's a trick to trick to force strings. + +\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} + +%D \macros +%D {scratchcounter, +%D scratchdimen,scratchskip,scratchmuskip, +%D scratchbox, +%D scratchtoks} +%D +%D We now define a few scratch registers, so that successive +%D loads at least have some available. + +\newcount \scratchcounter \newcount \globalscratchcounter +\newdimen \scratchdimen \newdimen \globalscratchdimen +\newskip \scratchskip \newskip \globalscratchskip +\newmuskip \scratchmuskip \newmuskip \globalscratchmuskip +\newtoks \scratchtoks \newtoks \globalscratchtoks +\newbox \scratchbox \newbox \globalscratchbox + +\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree +\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree +\newdimen \scratchskipone \newdimen \scratchskiptwo \newdimen \scratchskipthree +\newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree +\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree +\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree + +%D More allocations: + +\newskip \zeroskip \zeroskip = 0pt plus 0pt minus 0pt +\newdimen\zeropoint \zeropoint = 0pt +\newdimen\onepoint \onepoint = 1pt +\newdimen\maxdimen \maxdimen = 16383.99999pt +\newdimen\onebasepoint \onebasepoint = 1bp +\newdimen\scaledpoint \scaledpoint = 1sp +\newdimen\thousandpoint\thousandpoint= 1000pt + +\let\points\onepoint + +\newtoks \emptytoks + +%D And even more: (todo: countdefs 60+) + +%newcount \minusone \minusone = -1 +\newcount \minustwo \minustwo = -2 +%chardef \zerocount = 0 +%chardef \plusone = 1 +\chardef \plustwo = 2 +\chardef \plusthree = 3 +\chardef \plusfour = 4 +\chardef \plusfive = 5 +\chardef \plussix = 6 +\chardef \plusseven = 7 +\chardef \pluseight = 8 +\chardef \plusnine = 9 +\chardef \plusten = 10 +\chardef \plussixteen = 16 +\chardef \plushundred = 100 +\chardef \pluscxxvii = 127 +\chardef \pluscxxviii = 128 +\chardef \pluscclv = 255 + +\ifnum\texengine=\luatexengine + \chardef \pluscclvi = 256 + \chardef \plusthousand = 1000 + \chardef \plustenthousand = 10000 + \chardef \plustwentythousand = 20000 + \chardef \medcard = 32768 + \chardef \maxcard = 65536 % pdftex has less mathchars +\else + \mathchardef\pluscclvi = 256 + \mathchardef\plusthousand = 1000 + \mathchardef\plustenthousand = 10000 + \mathchardef\plustwentythousand = 20000 + \newcount \medcard \medcard = 32768 % pdftex has less mathchars + \newcount \maxcard \maxcard = 65536 % pdftex has less mathchars +\fi + +%D We prefer the more readable variant than in plain +%D \TEX. User should only use \type {\emptybox}: + +\newbox\voidbox % public + +\let\normalhbox\hbox +\let\normalvbox\vbox + +\def\unvoidbox{\unhbox\voidbox} +\def\emptybox {\box \voidbox} % used in initializations so no attributes +\def\emptyvbox{\normalvbox{}} % no copy as we need to set attributes +\def\emptyhbox{\normalhbox{}} % no copy as we need to set attributes + +\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode + +%D Some expected plain variants follow. We don't reuse registers +%D because we don't want clashes. + +\newdimen\p@ \p@ \onepoint +\newcount\m@ne \m@ne \minusone +\newdimen\z@ \z@ \zeropoint +\let \@ne \plusone +\let \tw@ \plustwo +\let \thr@@ \plusthree +\let \sixt@@n \sixteen +\let \@cclv \pluscclv +\let \@cclvi \pluscclvi +\newbox \voidb@x +\newtoks \toks@ + +%D We define \type {\newif} a la plain \TEX, but will +%D redefine it later. As Knuth says: +%D +%D \startnarrower +%D And here's a different sort of allocation: for example, +%D +%D \starttyping +%D \newif\iffoo +%D \stoptyping +%D +%D creates \type {\footrue}, \type {\foofalse} to go +%D with \type {\iffoo}. +%D \stopnarrower + +\def\newif#1% + {\count@\escapechar + \escapechar\minusone + \expandafter\expandafter\expandafter\def\@if #1{true}{\let#1\iftrue }% + \expandafter\expandafter\expandafter\def\@if#1{false}{\let#1\iffalse}% + \@if#1{false}% the condition starts out false + \escapechar\count@} + +\def\@if#1#2% + {\csname\expandafter\if@\string#1#2\endcsname} + +\bgroup % `if' is required + + \uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}} + +\egroup + +%D Let's test this one: + +\newif\ifdone + +%D Potential primitive in \LUATEX: + +\ifdefined\htdp \else \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi + +%D \macros +%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment, +%D @@endofline,@@parameter,@@superscript,@@subscript, +%D @@ignore,@@space,@@letter,@@other,@@active,@@comment} +%D +%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of certain +%D characters. Because we are not that good at remembering numbers, +%D we introduce some symbolic names. + +%D As we now have catc-* files, we also have more readable names but +%D We will keep the following around for a while. + +\chardef\@@escape = 0 +\chardef\@@begingroup = 1 +\chardef\@@endgroup = 2 +\chardef\@@mathshift = 3 +\chardef\@@alignment = 4 +\chardef\@@endofline = 5 +\chardef\@@parameter = 6 +\chardef\@@superscript = 7 +\chardef\@@subscript = 8 +\chardef\@@ignore = 9 +\chardef\@@space = 10 +\chardef\@@letter = 11 +\chardef\@@other = 12 +\chardef\@@active = 13 +\chardef\@@comment = 14 + +%D Constants to be used with \type {\currentgrouptype}. + +\chardef\@@bottomlevelgroup = 0 +\chardef\@@simplegroup = 1 +\chardef\@@hboxgroup = 2 +\chardef\@@adjustedhboxgroup = 3 +\chardef\@@vboxgroup = 4 +\chardef\@@vtopgroup = 5 +\chardef\@@aligngroup = 6 +\chardef\@@noaligngroup = 7 +\chardef\@@outputgroup = 8 +\chardef\@@mathgroup = 9 +\chardef\@@discretionarygroup = 10 +\chardef\@@insertgroup = 11 +\chardef\@@vcentergroup = 12 +\chardef\@@mathchoicegroup = 13 +\chardef\@@semisimplegroup = 14 +\chardef\@@mathshiftgroup = 15 +\chardef\@@mathleftgroup = 16 + +\chardef\@@vadjustgroup = \@@insertgroup + +%D Constants to be used with \type {\interactionmode}. + +\chardef\@@batchmode = 0 +\chardef\@@nonstopmode = 1 +\chardef\@@scrollmode = 2 +\chardef\@@errorstopmode = 3 + +%D Constants to be used with \type {\lastnodetype}. The \type +%D {\lastnodetype} primitive is \ETEX\ compliant. The valid range is +%D still -1 .. 15 and glyph nodes have number 0 (used to be char +%D node) and ligature nodes are mapped to 7. That way macro packages +%D can use the same symbolic names as in traditional \ETEX. Keep in +%D mind that the internal node numbers are different and that there +%D are more node types that 15. + +\chardef\@@charnode = 0 +\chardef\@@hlistnode = 1 +\chardef\@@vlistnode = 2 +\chardef\@@rulenode = 3 +\chardef\@@insertnode = 4 +\chardef\@@marknode = 5 +\chardef\@@adjustnode = 6 +\chardef\@@ligaturenode = 7 +\chardef\@@discretionarynode = 8 +\chardef\@@whatsitnode = 9 +\chardef\@@mathnode = 10 +\chardef\@@gluenode = 11 +\chardef\@@kernnode = 12 +\chardef\@@penaltynode = 13 +\chardef\@@unsetnode = 14 +\chardef\@@mathsnode = 15 + +%D Constants to be used with \type {\currentiftype}. + +\chardef\@@charif = 1 +\chardef\@@catif = 2 +\chardef\@@numif = 3 +\chardef\@@dimif = 4 +\chardef\@@oddif = 5 +\chardef\@@vmodeif = 6 +\chardef\@@hmodeif = 7 +\chardef\@@mmodeif = 8 +\chardef\@@innerif = 9 +\chardef\@@voidif = 10 +\chardef\@@hboxif = 11 +\chardef\@@vboxif = 12 +\chardef\@@xif = 13 +\chardef\@@eofif = 14 +\chardef\@@trueif = 15 +\chardef\@@falseif = 16 +\chardef\@@caseif = 17 +\chardef\@@definedif = 18 +\chardef\@@csnameif = 19 +\chardef\@@fontcharif = 20 + +%D Of course we want even bigger log files, so we copied this +%D from the \ETEX\ source files. +%D +%D When watching such logs, beware of nasty side effects of +%D \type {\scantokens}, as in: +%D +%D \starttyping +%D \bgroup +%D \lccode`a=12\lowercase{\xdef\whatever{a}}\egroup +%D \def\whatever{test \whatever test} +%D \scantokens\expandafter{\whatever} +%D \egroup +%D \stoptyping +%D +%D In \LUATEX\ we have ways around this. + +\def\tracingall + {\tracingonline \plusone + \tracingcommands \plusthree + \tracingstats \plustwo + \tracingpages \plusone + \tracingoutput \plusone + \tracinglostchars \plustwo + \tracingmacros \plustwo + \tracingparagraphs\plusone + \tracingrestores \plusone + \showboxbreadth \maxdimen + \showboxdepth \maxdimen + \tracinggroups \plusone + \tracingifs \plusone + \tracingscantokens\plusone + \tracingnesting \plusone + \tracingassigns \plustwo + \errorstopmode} + +\def\loggingall + {\tracingall + \tracingonline \zerocount} + +\def\tracingnone + {\tracingassigns \zerocount + \tracingnesting \zerocount + \tracingscantokens\zerocount + \tracingifs \zerocount + \tracinggroups \zerocount + \showboxdepth \plusthree + \showboxbreadth \plusfive + \tracingrestores \zerocount + \tracingparagraphs\zerocount + \tracingmacros \zerocount + \tracinglostchars \plusone + \tracingoutput \zerocount + \tracingpages \zerocount + \tracingstats \zerocount + \tracingcommands \zerocount + \tracingonline \zerocount} + +%D Just for tracing purposes we set: + +\tracingstats\plusone + +%D Here we also save \type {\input}, more will be saved later. + +\ifdefined\normalinput \else \let\normalinput\input \fi + +%D We don't like outer commands, and we always want access +%D to the original \type {\input} primitive. + +\let\normalouter\outer \def\outer{} % no longer \relax + +%D To circumvent dependencies, we can postpone certain +%D initializations to dumping time, by appending them to the +%D \type {\everydump} token register. + +\ifdefined\normaldump \else \let\normaldump\dump \fi + +\newtoks\everydump + +\def\dump{\the\everydump\normaldump} + +%D The same applies for the startup actions. + +\ifdefined\normaleveryjob \else \let\normaleveryjob\everyjob \fi + +\let\everyjob\relax \newtoks\everyjob + +\normaleveryjob{\the\everyjob} + +\def\appendtotoks #1{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=} +\def\prependtotoks#1{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=} + +\def\doappendtotoks {\expandafter\expandafter\expandafter{\expandafter\the\expandafter\temp\the\scratchtoks}} +\def\doprependtotoks{\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratchtoks\the\temp}} + +%D \macros +%D {begcsname} +%D +%D Handy for \ETEX-only usage (avoids making \type {\relax}'s: + +\def\begcsname#1\endcsname{\ifcsname#1\endcsname\csname#1\endcsname\fi} + +%D Now come a few macros that might be needed in successive loading: + +\let\endgraf\par +\let\endline\cr + +\def\space{ } +\def\empty{} +\def\null {\hbox{}} + +%D The following two might be overloaded later on but some modules need +%D then earlier. These functionality is reflected in the name and will not +%D change. + +\bgroup + \catcode`\^^M=\activecatcode% + \gdef\obeylines{\catcode`\^^M\activecatcode \let^^M\par}% + \global\let^^M\par% +\egroup + +\bgroup + \gdef\obeyspaces{\catcode`\ \activecatcode}% + \obeyspaces\global\let =\space% +\egroup + +%D A constant: + +\let\endoflinetoken=^^M + +%D Also needed might be a simple loop structure and we borrow +%D plain \TEX's one as it is often expected to be present and +%D it is about the fastest you can get. Beware: this macro +%D does not support nested loops. We use a namespace prefix +%D \type {@@pln}. + +\long\def\loop#1\repeat{\long\def\@@plnbody{#1}\@@plniterate} + +%D The following makes \type {\loop} \unknown\ \type {\if} +%D \unknown\ \type {\repeat} skippable (clever trick): + +\let\repeat\fi % so both \loop and \repeat are reserved words! + +%D The original (no \type {@@pln} there): +%D +%D \starttyping +%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next} +%D \stoptyping +%D +%D A more efficient alternative: +%D +%D \starttyping +%D \def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi} +%D \stoptyping +%D +%D An even more efficient one: + +\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi} + +%D We don't define a real output routine yet but at least get rid +%D of pages: + +\output{\shipout\box\normalpagebox} + +%D Although we don't add pagenumbers yet we alias the default +%D register used for counting pages: + +\countdef\pageno=0 \pageno=1 % first page is number 1 + +%D Beside the raw counter \type {\pageno} the \type {\folio} +%D macro provides the value. + +\def\folio{\the\pageno} % kind of expected and therefore reserved + +%D The following registers are kind of standard and (for the moment) +%D we define them here. This might change. + +\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt +\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt +\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt + +\baselineskip = 12pt +\lineskip = 1pt +\lineskiplimit = 0pt + +%D Again a few kind-of-extensions the core: + +\newskip \hideskip \hideskip = -1000pt plus 1fill +\newskip \centering \centering = 0pt plus 1000pt minus 1000pt + +\def\hidewidth % for alignment entries that can stick out + {\hskip\hideskip} + +\def\ialign % initialized \halign + {\everycr{}% + \tabskip\zeroskip + \halign} + +\newcount \mscount + +\def\spanomit{\span\omit} % bypass error message + +\def\multispan#1% + {\omit + \mscount#1\relax + \loop + \ifnum\mscount>\plusone + \spanomit \advance\mscount\minusone + \repeat} + +%D The next section deals with selective definitions in +%D later modules. One can of course use the \type {\texengine} +%D number that we defined earlier instead. + +\bgroup \obeylines + \gdef\pickupSOMETEX#1% + {\expandafter\gdef\csname begin#1\endcsname{\bgroup\obeylines\dopickupSOMETEX{#1}}} + \gdef\dopickupSOMETEX#1#2 + % {\egroup\immediate\write16{special code for #1 -> [line \the\inputlineno] \detokenize{#2}}} + {\egroup} +\egroup + +\let\endTEX \relax \long\def\beginTEX #1\endTEX {} +\let\endETEX \relax \long\def\beginETEX #1\endETEX {} +\let\endXETEX \relax \long\def\beginXETEX #1\endXETEX {} +\let\endLUATEX\relax \long\def\beginLUATEX#1\endLUATEX{} +\let\endOLDTEX\relax \long\def\beginOLDTEX#1\endOLDTEX{} +\let\endNEWTEX\relax \long\def\beginNEWTEX#1\endNEWTEX{} + +\pickupSOMETEX{ETEX} + +\ifnum\texengine=\xetexengine + \pickupSOMETEX{XETEX} +\fi +\ifnum\texengine=\luatexengine + \pickupSOMETEX{LUATEX} +\fi +\ifnum\texengine<\xetexengine + \pickupSOMETEX{OLDTEX} +\else + \pickupSOMETEX{NEWTEX} +\fi + +%D \macros +%D {bindprimitive} +%D +%D We can remap primitives (which is needed because of changes in +%D for instance \PDFTEX). + +\def\bindprimitive#1 #2 % new old + {\ifcsname#1\endcsname \else \ifcsname#2\endcsname + \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname + \fi \fi} + +%D Because \XETEX\ also implements some \PDFTEX\ functionality, we take +%D care of this here instead of a dedicated module. Later modules need +%D to handle the undefined cases. + +%D These messy checks will disappear. + +% new after 1.10, watch the change in prefix + +\bindprimitive quitvmode ptexquitvmode +\bindprimitive noligatures ptexnoligatures +\bindprimitive setrandomseed ptexsetrandomseed +\bindprimitive uniformdeviate ptexuniformdeviate + +\bindprimitive quitvmode pdfquitvmode +\bindprimitive noligatures pdfnoligatures +\bindprimitive setrandomseed pdfsetrandomseed +\bindprimitive uniformdeviate pdfuniformdeviate + +\bindprimitive resettimer pdfresettimer +\bindprimitive elapsedtime pdfelapsedtime + +% new per 1.40 + +\bindprimitive ifprimitive ifpdfprimitive +\bindprimitive primitive pdfprimitive +\bindprimitive ifabsdim ifpdfabsdim +\bindprimitive ifabsnum ifpdfabsnum + +\ifnum\texengine=\xetexengine \else % this test might disappear some day + + \pdfminorversion \plusfive + + \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi + \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi + \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode \plusone + \ifdefined\pdfinclusioncopyfonts\else \newcount\pdfinclusioncopyfonts \fi \pdfinclusioncopyfonts\plusone + + \def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount} + \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine } + \def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree} + + \normalpdfcompression + + \let\normalsetrandomseed \setrandomseed + \let\normaluniformdeviate\uniformdeviate + +\fi + +%D Handy. + +\ifnum\texengine=\luatexengine + \ifdefined\suppresslongerror % for the moment test + \suppresslongerror\plusone + \fi +\fi + +%D Basic status stuff. + +\newif\ifproductionrun + +%D We need to make sure that we start up in \DVI\ mode, so, +%D after testing for running \PDFTEX, we default to \DVI. + +\ifx\pdftexversion\undefined \newcount\pdfoutput \fi \pdfoutput=0 + +%D For those who expect this \unknown + +\ifx\fmtname \undefined \def\fmtname {ConTeXt Minimized Plain TeX} \fi +\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi + +\let\normalfmtversion\fmtversion + +%D A few bonus macros: + +\def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax} +\def\dividonumber#1#2{\the\numexpr(#2-(#1/2))/#1\relax} + +\ifnum\texengine=\xetexengine + \edef\xetexversion {\numexpr\XeTeXversion*100+(\expandafter\gobbleoneargument\XeTeXrevision-5)/10\relax} + \edef\xetexrevision {\the\numexpr(\expandafter\gobbleoneargument\XeTeXrevision-50)/100\relax} +\fi + +\ifcase\texengine + \def\texenginename {impossible} + \edef\texengineversion{0} +\or + \def\texenginename {pdfTeX} + \edef\texengineversion{\dividonumber{100}\pdftexversion.\modulonumber{100}\pdftexversion.\pdftexrevision} +\or + \def\texenginename {XeTeX} + \edef\texengineversion{\dividonumber{100}\xetexversion .\modulonumber{100}\xetexversion .\xetexrevision} +\or + \def\texenginename {LuaTeX} + \edef\texengineversion{\dividonumber{100}\luatexversion.\modulonumber{100}\luatexversion.\luatexrevision} +\else + \def\texenginename {impossible} + \edef\texengineversion{0} +\fi + +%D While cleaning this code up a bit I was listening to Heather +%D Nova's \CD\ Redbird. The first song on that \CD\ ends with +%D a few lines suitable for ending this initialization module: +%D +%D \startlines +%D And there's so much I can do for you +%D Given time I know that I can prove +%D Now my world is opened up to you +%D Come inside +%D +%D Welcome to my life +%D Welcome to my world +%D Come inside +%D \stoplines +%D +%D So let's see what \TEX\ can do now that we've opened up +%D the basic machinery. + +\protect \endinput diff --git a/tex/context/base/syst-ini.mkiv b/tex/context/base/syst-ini.mkiv new file mode 100644 index 000000000..5f9162aa2 --- /dev/null +++ b/tex/context/base/syst-ini.mkiv @@ -0,0 +1,925 @@ +%D \module +%D [ file=syst-ini, +%D version=2008.11.04, % 2001.11.16, % 1999.03.17, % an oldie: 1995.10.10 +%D title=\CONTEXT\ System Macros, +%D subtitle=Bootstrapping \TEX, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D We used to load plain \TEX\ in a special way, but redefining +%D a couple of primitives so that for instance font loading was +%D ignored. For those interested, this loader is found in +%D \type {syst-tex.tex}. Some of the comment's are Don Knuth's +%D and more of it can be found in the plain \TEX\ format. + +%D Characters can have special states, that can be triggered +%D by setting their category coded. Some are preset, others +%D are to be set as soon as possible, otherwise we cannot +%D define any useful macros. + +%catcode`\^^@ = 9 % ascii null is ignored +%catcode`\\ = 0 % backslash is TeX escape character + +\catcode`\{ = 1 % left brace is begin-group character +\catcode`\} = 2 % right brace is end-group character +\catcode`\$ = 3 % dollar sign is math shift +\catcode`\& = 4 % ampersand is alignment tab +\catcode`\# = 6 % hash mark is macro parameter character +\catcode`\^ = 7 % circumflex and uparrow are for superscripts +\catcode`\_ = 8 % underline and downarrow are for subscripts +\catcode`\^^I = 10 % ascii tab is a blank space + +%catcode`\^^M = 5 % ascii return is end-line +%catcode`\% = 14 % percent sign is comment character +%catcode`\ = 10 % ascii space is blank space +%catcode`\^^? = 15 % ascii delete is invalid + +\catcode`\~ = 13 % tilde is active +\catcode`\^^L = 13 % ascii form-feed + +%catcode`\A = 11 +%....... +%catcode`\Z = 11 + +%catcode`\a = 11 +%....... +%catcode`\z = 11 + +\chardef\activecatcode = 13 % later this will become a counter + +\def ^^L{\par} +\def\^^M{\ } % control = control +\def\^^I{\ } % same for + +%D In \CONTEXT, we simply ignore end||of||file tokens: + +\catcode`\^^Z=9 + +%D It makes sense to know what engine we're running so let's +%D try to deduce it. + +\chardef\unknownengine = 0 +\chardef\pdftexengine = 1 +\chardef\xetexengine = 2 +\chardef\luatexengine = 3 + +\ifx\directlua\undefined + \ifx\XeTeXversion\undefined + \ifx\pdftexversion\undefined + \let\texengine\unknownengine + \else + \let\texengine\pdftexengine + \fi + \else + \let\texengine\xetexengine + \fi +\else + \let\texengine\luatexengine +\fi + +\ifnum\texengine=\luatexengine + % for historic reasons we keep some mkii code around +\else + \immediate\write16{>>>} + \immediate\write16{>>> only luatex is supported} + \immediate\write16{>>>} + \let\dump\relax + \expandafter\end +\fi + +% todo: pdfsave pdfrestore pdfcolor... don't initialize them + +\ifnum\texengine=\luatexengine + \directlua 0 { % this info is stored in the format + lua.name[0] = "main ctx instance" + local extraprimitives = tex.extraprimitives + local enableprimitives = tex.enableprimitives + local core = extraprimitives('core') + local btex = extraprimitives('tex') + local etex = extraprimitives('etex') + local pdftex = extraprimitives('pdftex') + local luatex = extraprimitives('luatex') + local omega = { + "textdir", "pagedir", "mathdir", "pardir", "bodydir", + "leftghost", "rightghost", "localleftbox", "localrightbox", + "localinterlinepenalty", "localbrokenpenalty", + } + local aleph = { + "boxdir", "pagebottomoffset", "pagerightoffset", + } + for _, subset in next, { etex, pdftex, luatex, omega, aleph } do + enableprimitives('',subset) + end + for _, subset in next, { core, btex, etex, pdftex, luatex, omega, aleph } do + enableprimitives('normal',subset) + end + } +\fi + +%D \ETEX\ has a not so handy way of telling you the version number, +%D i.e. the revision number has a period in it: + +\long\def\gobbleoneargument#1{} % will be defined later on anyway + +\mathchardef\etexversion = + \numexpr\eTeXversion*100+\expandafter\gobbleoneargument\eTeXrevision\relax + +%D First we define a simplified version of the \CONTEXT\ +%D protection mechanism. + +\def\unprotect{\catcode`@=11 } +\def\protect {\catcode`@=12 } + +\unprotect + +%D Some pretty important definitions: + +\let\bgroup={ +\let\egroup=} + +%D Allocation of registers is done slightly different than in plain +%D \TEX. First of all we use different reserved counters. We also +%D don't implement a family handler because users are not supposed +%D to implement their own math. We reserve the lowest 31 registers +%D for scratch purposes. Keep in mind that in the core engine +%D some registers are reserved: counters 0 upto 9, and counter 255. +%D +%D As with plain \TEX\ we recommend that macro designers always use +%D \type {\global} assignments with respect to registers numbered 1, +%D 3, 5 \unknown\ 31, and always non||\type {\global} assignments +%D with respect to registers 0, 2, 4, \unknown\ 30. This will prevent +%D \quote {save stack buildup} that might otherwise occur. +%D +%D We reserve some registers for special (management) purposes: + +% 0 - 20 : scratch +% 21 - 127 : internal +% 128 - 254 : inserts +% 255 : page +% 256 - : user + +\countdef \minallocatedregister = 52 \minallocatedregister = 256 +\countdef \maxallocatedregister = 53 \maxallocatedregister = 32767 +\countdef \minallocatediochannel = 54 \minallocatediochannel = -1 +\countdef \maxallocatediochannel = 55 \maxallocatediochannel = 16 +\countdef \minallocatedlanguage = 56 \minallocatedlanguage = 0 +\countdef \maxallocatedlanguage = 57 \maxallocatedlanguage = 255 +\countdef \maxallocatedinsert = 58 \maxallocatedinsert = 254 +\countdef \minallocatedinsert = 59 \minallocatedinsert = 128 +\countdef \minallocatedfamily = 60 \minallocatedfamily = 128 +\countdef \maxallocatedfamily = 61 \maxallocatedfamily = 255 + +\countdef \lastallocatedcount = 32 \lastallocatedcount = \minallocatedregister +\countdef \lastallocateddimen = 33 \lastallocateddimen = \minallocatedregister +\countdef \lastallocatedskip = 34 \lastallocatedskip = \minallocatedregister +\countdef \lastallocatedmuskip = 35 \lastallocatedmuskip = \minallocatedregister +\countdef \lastallocatedbox = 36 \lastallocatedbox = \minallocatedregister +\countdef \lastallocatedtoks = 37 \lastallocatedtoks = \minallocatedregister +\countdef \lastallocatedread = 38 \lastallocatedread = \minallocatediochannel +\countdef \lastallocatedwrite = 39 \lastallocatedwrite = \minallocatediochannel +\countdef \lastallocatedmarks = 40 \lastallocatedmarks = \minallocatedregister +\countdef \lastallocatedlanguage = 41 \lastallocatedlanguage = \minallocatedlanguage % not used in context +\countdef \lastallocatedinsertion = 42 \lastallocatedinsertion = \minallocatedinsert +\countdef \lastallocatedfamily = 43 \lastallocatedfamily = \minallocatedfamily % not used in context +\countdef \lastallocatedattribute = 44 \lastallocatedattribute = \minallocatedregister + +\countdef \mincountervalue = 125 \mincountervalue = -"7FFFFFFF % beware, we use index 125 at the lua end +\countdef \maxcountervalue = 126 \maxcountervalue = "7FFFFFFF % beware, we use index 126 at the lua end + +%countdef \minusone = 127 \minusone = -1 +%chardef \zerocount = 0 +%chardef \plusone = 1 + +\countdef \zerocount = 120 \zerocount = 0 +\countdef \plusone = 121 \plusone = 1 +\countdef \minusone = 122 \minusone = -1 + +%chardef \normalpagebox = 255 +\countdef \normalpagebox = 127 \normalpagebox = 255 % hardcoded in pdftex/xetex + +% A few traditional allocations: + +\countdef \count@ = 255 % hm, used in \newif .. todo: replace it there +\dimendef \dimen@ = 0 +\dimendef \dimen@i = 1 % global only +\dimendef \dimen@ii = 2 + +%D So, effectively we start allocating from 256 and upwards. The +%D inserts sit in the range 128 upto 254. Page numbers use the +%D counters 0 upto 9 and the pagebox is 255. Users can use the +%D scratch registers upto 31 without problem but all others are +%D reserved. + +\def\wlog#1{} % \def\wlog{\immediate\write\minusone} % write on log file (only) + +%D The allocators share a common helper macro. + +\def\newcount {\allocateregister\lastallocatedcount \count \countdef \maxallocatedregister} +\def\newdimen {\allocateregister\lastallocateddimen \dimen \dimendef \maxallocatedregister} +\def\newskip {\allocateregister\lastallocatedskip \skip \skipdef \maxallocatedregister} +\def\newmuskip {\allocateregister\lastallocatedmuskip \muskip \muskipdef \maxallocatedregister} +\def\newbox {\allocateregister\lastallocatedbox \box \mathchardef\maxallocatedregister} +\def\newtoks {\allocateregister\lastallocatedtoks \toks \toksdef \maxallocatedregister} +\def\newread {\allocateregister\lastallocatedread \read \chardef \maxallocatediochannel} +\def\newwrite {\allocateregister\lastallocatedwrite \write \chardef \maxallocatediochannel} +\def\newmarks {\allocateregister\lastallocatedmarks \marks \mathchardef\maxallocatedregister} +\def\newinsert {\allocateregister\lastallocatedinsertion\insert \chardef \maxallocatedinsert} + +%D We don't need these in \CONTEXT: + +\def\newlanguage{\allocateregister\lastallocatedlanguage \language\chardef \maxallocatedlanguage} +\def\newfamily {\allocateregister\lastallocatedfamily \fam \chardef \maxallocatedfamily} + +\let\newfam\newfamily + +% Watch out, for the moment we disable the check for already being defined +% later we will revert this but first all chardefs must be replaced. + +\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1} +\def\setnewconstant#1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number + +% maybe setconstant with check + +% %D The next definitions are really needed (in \CONTEXT): + +%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}} +\newlinechar=10 \edef\outputnewlinechar{^^J} + +%D One reason to start high with allocation is that it permits us to +%D allocate consecutive ranges more easily, for instance in \MPLIB\ +%D we want to allocate a continuous range of boxes. It also permits us +%D to do a proper upward allocation for inserts. The current code +%D evolved from code that dealt with older engines but as all engines +%D now provide many registers we removed all traces. + +\def\writestatus#1#2{\immediate\write16{#1: #2}} \def\space { } + +\def\allocateregisteryes#1#2#3#4#5% last class method max name + {\ifnum#1<#4\relax + \global\advance#1\plusone + \global#3#5=#1\relax + \else + \writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}% + \fi} + +\def\allocateregisternop#1#2#3#4#5% last class method max name + {\writestatus{warning}{\string#2 \string#5 is already defined (\string\relax\space it first)}} + +\def\allocateregister#1#2#3#4#5% last class method max name + {\ifx#5\undefined + \expandafter\allocateregisteryes + \else\ifx#5\relax + \expandafter\expandafter\expandafter\allocateregisteryes + \else + \expandafter\expandafter\expandafter\allocateregisternop + \fi\fi + #1#2#3#4#5} + +%D Since the number of chars exceed 256 now, we can use \type +%D {\chardef} instead of the more limited \type {\mathchardef}. + +\ifnum\texengine>\pdftexengine + \def\newbox {\allocateregister\lastallocatedbox \box \chardef\maxallocatedregister} + \def\newmarks{\allocateregister\lastallocatedmarks\marks\chardef\maxallocatedregister} +\fi + +%D Attributes are something very \LUATEX. In \CONTEXT\ you are not +%D supposed to use the attributes directly but always allocate then +%D first. For instance attribute~0 is reserved for special purposes +%D (this might change). + +\ifnum\texengine=\luatexengine + \let\attributeunsetvalue\mincountervalue % used to be \minusone + \def\newattribute{\allocateregister\lastallocatedattribute\attribute\attributedef\maxallocatedregister} +\fi + +%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a +%D trick to force strings instead of tokens that take more memory. +%D It's a trick to trick to force strings. + +\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} + +%D \macros +%D {scratchcounter, +%D scratchdimen,scratchskip,scratchmuskip, +%D scratchbox, +%D scratchtoks} +%D +%D We now define a few scratch registers, so that successive +%D loads at least have some available. + +\newcount \scratchcounter \newcount \globalscratchcounter +\newdimen \scratchdimen \newdimen \globalscratchdimen +\newskip \scratchskip \newskip \globalscratchskip +\newmuskip \scratchmuskip \newmuskip \globalscratchmuskip +\newtoks \scratchtoks \newtoks \globalscratchtoks +\newbox \scratchbox \newbox \globalscratchbox + +\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree +\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree +\newdimen \scratchskipone \newdimen \scratchskiptwo \newdimen \scratchskipthree +\newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree +\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree +\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree + +%D More allocations: + +\newskip \zeroskip \zeroskip = 0pt plus 0pt minus 0pt +\newdimen\zeropoint \zeropoint = 0pt +\newdimen\onepoint \onepoint = 1pt +\newdimen\maxdimen \maxdimen = 16383.99999pt +\newdimen\onebasepoint \onebasepoint = 1bp +\newdimen\scaledpoint \scaledpoint = 1sp +\newdimen\thousandpoint\thousandpoint= 1000pt + +\let\points\onepoint + +\newtoks \emptytoks + +%D And even more: (todo: countdefs 60+) + +%newcount \minusone \minusone = -1 +\newcount \minustwo \minustwo = -2 +%chardef \zerocount = 0 +%chardef \plusone = 1 +\chardef \plustwo = 2 +\chardef \plusthree = 3 +\chardef \plusfour = 4 +\chardef \plusfive = 5 +\chardef \plussix = 6 +\chardef \plusseven = 7 +\chardef \pluseight = 8 +\chardef \plusnine = 9 +\chardef \plusten = 10 +\chardef \plussixteen = 16 +\chardef \plushundred = 100 +\chardef \pluscxxvii = 127 +\chardef \pluscxxviii = 128 +\chardef \pluscclv = 255 + +\ifnum\texengine=\luatexengine + \chardef \pluscclvi = 256 + \chardef \plusthousand = 1000 + \chardef \plustenthousand = 10000 + \chardef \plustwentythousand = 20000 + \chardef \medcard = 32768 + \chardef \maxcard = 65536 % pdftex has less mathchars +\else + \mathchardef\pluscclvi = 256 + \mathchardef\plusthousand = 1000 + \mathchardef\plustenthousand = 10000 + \mathchardef\plustwentythousand = 20000 + \newcount \medcard \medcard = 32768 % pdftex has less mathchars + \newcount \maxcard \maxcard = 65536 % pdftex has less mathchars +\fi + +%D We prefer the more readable variant than in plain +%D \TEX. User should only use \type {\emptybox}: + +\newbox\voidbox % public + +\let\normalhbox\hbox +\let\normalvbox\vbox + +\def\unvoidbox{\unhbox\voidbox} +\def\emptybox {\box \voidbox} % used in initializations so no attributes +\def\emptyvbox{\normalvbox{}} % no copy as we need to set attributes +\def\emptyhbox{\normalhbox{}} % no copy as we need to set attributes + +\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode + +%D Some expected plain variants follow. We don't reuse registers +%D because we don't want clashes. + +\newdimen\p@ \p@ \onepoint +\newcount\m@ne \m@ne \minusone +\newdimen\z@ \z@ \zeropoint +\let \@ne \plusone +\let \tw@ \plustwo +\let \thr@@ \plusthree +\let \sixt@@n \sixteen +\let \@cclv \pluscclv +\let \@cclvi \pluscclvi +\newbox \voidb@x +\newtoks \toks@ + +%D We define \type {\newif} a la plain \TEX, but will +%D redefine it later. As Knuth says: +%D +%D \startnarrower +%D And here's a different sort of allocation: for example, +%D +%D \starttyping +%D \newif\iffoo +%D \stoptyping +%D +%D creates \type {\footrue}, \type {\foofalse} to go +%D with \type {\iffoo}. +%D \stopnarrower + +\def\newif#1% + {\count@\escapechar + \escapechar\minusone + \expandafter\expandafter\expandafter\def\@if #1{true}{\let#1\iftrue }% + \expandafter\expandafter\expandafter\def\@if#1{false}{\let#1\iffalse}% + \@if#1{false}% the condition starts out false + \escapechar\count@} + +\def\@if#1#2% + {\csname\expandafter\if@\string#1#2\endcsname} + +\bgroup % `if' is required + + \uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}} + +\egroup + +%D Let's test this one: + +\newif\ifdone + +%D Potential primitive in \LUATEX: + +\ifdefined\htdp \else \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi + +%D \macros +%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment, +%D @@endofline,@@parameter,@@superscript,@@subscript, +%D @@ignore,@@space,@@letter,@@other,@@active,@@comment} +%D +%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of certain +%D characters. Because we are not that good at remembering numbers, +%D we introduce some symbolic names. + +%D As we now have catc-* files, we also have more readable names but +%D We will keep the following around for a while. + +\chardef\@@escape = 0 +\chardef\@@begingroup = 1 +\chardef\@@endgroup = 2 +\chardef\@@mathshift = 3 +\chardef\@@alignment = 4 +\chardef\@@endofline = 5 +\chardef\@@parameter = 6 +\chardef\@@superscript = 7 +\chardef\@@subscript = 8 +\chardef\@@ignore = 9 +\chardef\@@space = 10 +\chardef\@@letter = 11 +\chardef\@@other = 12 +\chardef\@@active = 13 +\chardef\@@comment = 14 + +%D Constants to be used with \type {\currentgrouptype}. + +\chardef\@@bottomlevelgroup = 0 +\chardef\@@simplegroup = 1 +\chardef\@@hboxgroup = 2 +\chardef\@@adjustedhboxgroup = 3 +\chardef\@@vboxgroup = 4 +\chardef\@@vtopgroup = 5 +\chardef\@@aligngroup = 6 +\chardef\@@noaligngroup = 7 +\chardef\@@outputgroup = 8 +\chardef\@@mathgroup = 9 +\chardef\@@discretionarygroup = 10 +\chardef\@@insertgroup = 11 +\chardef\@@vcentergroup = 12 +\chardef\@@mathchoicegroup = 13 +\chardef\@@semisimplegroup = 14 +\chardef\@@mathshiftgroup = 15 +\chardef\@@mathleftgroup = 16 + +\chardef\@@vadjustgroup = \@@insertgroup + +%D Constants to be used with \type {\interactionmode}. + +\chardef\@@batchmode = 0 +\chardef\@@nonstopmode = 1 +\chardef\@@scrollmode = 2 +\chardef\@@errorstopmode = 3 + +%D Constants to be used with \type {\lastnodetype}. The \type +%D {\lastnodetype} primitive is \ETEX\ compliant. The valid range is +%D still -1 .. 15 and glyph nodes have number 0 (used to be char +%D node) and ligature nodes are mapped to 7. That way macro packages +%D can use the same symbolic names as in traditional \ETEX. Keep in +%D mind that the internal node numbers are different and that there +%D are more node types that 15. + +\chardef\@@charnode = 0 +\chardef\@@hlistnode = 1 +\chardef\@@vlistnode = 2 +\chardef\@@rulenode = 3 +\chardef\@@insertnode = 4 +\chardef\@@marknode = 5 +\chardef\@@adjustnode = 6 +\chardef\@@ligaturenode = 7 +\chardef\@@discretionarynode = 8 +\chardef\@@whatsitnode = 9 +\chardef\@@mathnode = 10 +\chardef\@@gluenode = 11 +\chardef\@@kernnode = 12 +\chardef\@@penaltynode = 13 +\chardef\@@unsetnode = 14 +\chardef\@@mathsnode = 15 + +%D Constants to be used with \type {\currentiftype}. + +\chardef\@@charif = 1 +\chardef\@@catif = 2 +\chardef\@@numif = 3 +\chardef\@@dimif = 4 +\chardef\@@oddif = 5 +\chardef\@@vmodeif = 6 +\chardef\@@hmodeif = 7 +\chardef\@@mmodeif = 8 +\chardef\@@innerif = 9 +\chardef\@@voidif = 10 +\chardef\@@hboxif = 11 +\chardef\@@vboxif = 12 +\chardef\@@xif = 13 +\chardef\@@eofif = 14 +\chardef\@@trueif = 15 +\chardef\@@falseif = 16 +\chardef\@@caseif = 17 +\chardef\@@definedif = 18 +\chardef\@@csnameif = 19 +\chardef\@@fontcharif = 20 + +%D Of course we want even bigger log files, so we copied this +%D from the \ETEX\ source files. +%D +%D When watching such logs, beware of nasty side effects of +%D \type {\scantokens}, as in: +%D +%D \starttyping +%D \bgroup +%D \lccode`a=12\lowercase{\xdef\whatever{a}}\egroup +%D \def\whatever{test \whatever test} +%D \scantokens\expandafter{\whatever} +%D \egroup +%D \stoptyping +%D +%D In \LUATEX\ we have ways around this. + +\def\tracingall + {\tracingonline \plusone + \tracingcommands \plusthree + \tracingstats \plustwo + \tracingpages \plusone + \tracingoutput \plusone + \tracinglostchars \plustwo + \tracingmacros \plustwo + \tracingparagraphs\plusone + \tracingrestores \plusone + \showboxbreadth \maxdimen + \showboxdepth \maxdimen + \tracinggroups \plusone + \tracingifs \plusone + \tracingscantokens\plusone + \tracingnesting \plusone + \tracingassigns \plustwo + \errorstopmode} + +\def\loggingall + {\tracingall + \tracingonline \zerocount} + +\def\tracingnone + {\tracingassigns \zerocount + \tracingnesting \zerocount + \tracingscantokens\zerocount + \tracingifs \zerocount + \tracinggroups \zerocount + \showboxdepth \plusthree + \showboxbreadth \plusfive + \tracingrestores \zerocount + \tracingparagraphs\zerocount + \tracingmacros \zerocount + \tracinglostchars \plusone + \tracingoutput \zerocount + \tracingpages \zerocount + \tracingstats \zerocount + \tracingcommands \zerocount + \tracingonline \zerocount} + +%D Just for tracing purposes we set: + +\tracingstats\plusone + +%D Here we also save \type {\input}, more will be saved later. + +\ifdefined\normalinput \else \let\normalinput\input \fi + +%D We don't like outer commands, and we always want access +%D to the original \type {\input} primitive. + +\let\normalouter\outer \def\outer{} % no longer \relax + +%D To circumvent dependencies, we can postpone certain +%D initializations to dumping time, by appending them to the +%D \type {\everydump} token register. + +\ifdefined\normaldump \else \let\normaldump\dump \fi + +\newtoks\everydump + +\def\dump{\the\everydump\normaldump} + +%D The same applies for the startup actions. + +\ifdefined\normaleveryjob \else \let\normaleveryjob\everyjob \fi + +\let\everyjob\relax \newtoks\everyjob + +\normaleveryjob{\the\everyjob} + +\def\appendtotoks #1{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=} +\def\prependtotoks#1{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=} + +\def\doappendtotoks {\expandafter\expandafter\expandafter{\expandafter\the\expandafter\temp\the\scratchtoks}} +\def\doprependtotoks{\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratchtoks\the\temp}} + +%D \macros +%D {begcsname} +%D +%D Handy for \ETEX-only usage (avoids making \type {\relax}'s: + +\def\begcsname#1\endcsname{\ifcsname#1\endcsname\csname#1\endcsname\fi} + +%D Now come a few macros that might be needed in successive loading: + +\let\endgraf\par +\let\endline\cr + +\def\space{ } +\def\empty{} +\def\null {\hbox{}} + +%D The following two might be overloaded later on but some modules need +%D then earlier. These functionality is reflected in the name and will not +%D change. + +\bgroup + \catcode`\^^M=\activecatcode% + \gdef\obeylines{\catcode`\^^M\activecatcode \let^^M\par}% + \global\let^^M\par% +\egroup + +\bgroup + \gdef\obeyspaces{\catcode`\ \activecatcode}% + \obeyspaces\global\let =\space% +\egroup + +%D A constant: + +\let\endoflinetoken=^^M + +%D Also needed might be a simple loop structure and we borrow +%D plain \TEX's one as it is often expected to be present and +%D it is about the fastest you can get. Beware: this macro +%D does not support nested loops. We use a namespace prefix +%D \type {@@pln}. + +\long\def\loop#1\repeat{\long\def\@@plnbody{#1}\@@plniterate} + +%D The following makes \type {\loop} \unknown\ \type {\if} +%D \unknown\ \type {\repeat} skippable (clever trick): + +\let\repeat\fi % so both \loop and \repeat are reserved words! + +%D The original (no \type {@@pln} there): +%D +%D \starttyping +%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next} +%D \stoptyping +%D +%D A more efficient alternative: +%D +%D \starttyping +%D \def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi} +%D \stoptyping +%D +%D An even more efficient one: + +\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi} + +%D We don't define a real output routine yet but at least get rid +%D of pages: + +\output{\shipout\box\normalpagebox} + +%D Although we don't add pagenumbers yet we alias the default +%D register used for counting pages: + +\countdef\pageno=0 \pageno=1 % first page is number 1 + +%D Beside the raw counter \type {\pageno} the \type {\folio} +%D macro provides the value. + +\def\folio{\the\pageno} % kind of expected and therefore reserved + +%D The following registers are kind of standard and (for the moment) +%D we define them here. This might change. + +\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt +\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt +\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt + +\baselineskip = 12pt +\lineskip = 1pt +\lineskiplimit = 0pt + +%D Again a few kind-of-extensions the core: + +\newskip \hideskip \hideskip = -1000pt plus 1fill +\newskip \centering \centering = 0pt plus 1000pt minus 1000pt + +\def\hidewidth % for alignment entries that can stick out + {\hskip\hideskip} + +\def\ialign % initialized \halign + {\everycr{}% + \tabskip\zeroskip + \halign} + +\newcount \mscount + +\def\spanomit{\span\omit} % bypass error message + +\def\multispan#1% + {\omit + \mscount#1\relax + \loop + \ifnum\mscount>\plusone + \spanomit \advance\mscount\minusone + \repeat} + +%D The next section deals with selective definitions in +%D later modules. One can of course use the \type {\texengine} +%D number that we defined earlier instead. + +\bgroup \obeylines + \gdef\pickupSOMETEX#1% + {\expandafter\gdef\csname begin#1\endcsname{\bgroup\obeylines\dopickupSOMETEX{#1}}} + \gdef\dopickupSOMETEX#1#2 + % {\egroup\immediate\write16{special code for #1 -> [line \the\inputlineno] \detokenize{#2}}} + {\egroup} +\egroup + +\let\endTEX \relax \long\def\beginTEX #1\endTEX {} +\let\endETEX \relax \long\def\beginETEX #1\endETEX {} +\let\endXETEX \relax \long\def\beginXETEX #1\endXETEX {} +\let\endLUATEX\relax \long\def\beginLUATEX#1\endLUATEX{} +\let\endOLDTEX\relax \long\def\beginOLDTEX#1\endOLDTEX{} +\let\endNEWTEX\relax \long\def\beginNEWTEX#1\endNEWTEX{} + +\pickupSOMETEX{ETEX} + +\ifnum\texengine=\xetexengine + \pickupSOMETEX{XETEX} +\fi +\ifnum\texengine=\luatexengine + \pickupSOMETEX{LUATEX} +\fi +\ifnum\texengine<\xetexengine + \pickupSOMETEX{OLDTEX} +\else + \pickupSOMETEX{NEWTEX} +\fi + +%D \macros +%D {bindprimitive} +%D +%D We can remap primitives (which is needed because of changes in +%D for instance \PDFTEX). + +\def\bindprimitive#1 #2 % new old + {\ifcsname#1\endcsname \else \ifcsname#2\endcsname + \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname + \fi \fi} + +%D Because \XETEX\ also implements some \PDFTEX\ functionality, we take +%D care of this here instead of a dedicated module. Later modules need +%D to handle the undefined cases. + +%D These messy checks will disappear. + +% new after 1.10, watch the change in prefix + +\bindprimitive quitvmode ptexquitvmode +\bindprimitive noligatures ptexnoligatures +\bindprimitive setrandomseed ptexsetrandomseed +\bindprimitive uniformdeviate ptexuniformdeviate + +\bindprimitive quitvmode pdfquitvmode +\bindprimitive noligatures pdfnoligatures +\bindprimitive setrandomseed pdfsetrandomseed +\bindprimitive uniformdeviate pdfuniformdeviate + +\bindprimitive resettimer pdfresettimer +\bindprimitive elapsedtime pdfelapsedtime + +% new per 1.40 + +\bindprimitive ifprimitive ifpdfprimitive +\bindprimitive primitive pdfprimitive +\bindprimitive ifabsdim ifpdfabsdim +\bindprimitive ifabsnum ifpdfabsnum + +\ifnum\texengine=\xetexengine \else % this test might disappear some day + + \pdfminorversion \plusfive + + \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi + \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi + \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode \plusone + \ifdefined\pdfinclusioncopyfonts\else \newcount\pdfinclusioncopyfonts \fi \pdfinclusioncopyfonts\plusone + + \def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount} + \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine } + \def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree} + + \normalpdfcompression + + \let\normalsetrandomseed \setrandomseed + \let\normaluniformdeviate\uniformdeviate + +\fi + +%D Handy. + +\ifnum\texengine=\luatexengine + \ifdefined\suppresslongerror % for the moment test + \suppresslongerror\plusone + \fi +\fi + +%D Basic status stuff. + +\newif\ifproductionrun + +%D We need to make sure that we start up in \DVI\ mode, so, +%D after testing for running \PDFTEX, we default to \DVI. + +\ifx\pdftexversion\undefined \newcount\pdfoutput \fi \pdfoutput=0 + +%D For those who expect this \unknown + +\ifx\fmtname \undefined \def\fmtname {ConTeXt Minimized Plain TeX} \fi +\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi + +\let\normalfmtversion\fmtversion + +%D A few bonus macros: + +\def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax} +\def\dividonumber#1#2{\the\numexpr(#2-(#1/2))/#1\relax} + +\ifnum\texengine=\xetexengine + \edef\xetexversion {\numexpr\XeTeXversion*100+(\expandafter\gobbleoneargument\XeTeXrevision-5)/10\relax} + \edef\xetexrevision {\the\numexpr(\expandafter\gobbleoneargument\XeTeXrevision-50)/100\relax} +\fi + +\ifcase\texengine + \def\texenginename {impossible} + \edef\texengineversion{0} +\or + \def\texenginename {pdfTeX} + \edef\texengineversion{\dividonumber{100}\pdftexversion.\modulonumber{100}\pdftexversion.\pdftexrevision} +\or + \def\texenginename {XeTeX} + \edef\texengineversion{\dividonumber{100}\xetexversion .\modulonumber{100}\xetexversion .\xetexrevision} +\or + \def\texenginename {LuaTeX} + \edef\texengineversion{\dividonumber{100}\luatexversion.\modulonumber{100}\luatexversion.\luatexrevision} +\else + \def\texenginename {impossible} + \edef\texengineversion{0} +\fi + +%D While cleaning this code up a bit I was listening to Heather +%D Nova's \CD\ Redbird. The first song on that \CD\ ends with +%D a few lines suitable for ending this initialization module: +%D +%D \startlines +%D And there's so much I can do for you +%D Given time I know that I can prove +%D Now my world is opened up to you +%D Come inside +%D +%D Welcome to my life +%D Welcome to my world +%D Come inside +%D \stoplines +%D +%D So let's see what \TEX\ can do now that we've opened up +%D the basic machinery. + +\protect \endinput diff --git a/tex/context/base/syst-ini.tex b/tex/context/base/syst-ini.tex deleted file mode 100644 index c2c3e1947..000000000 --- a/tex/context/base/syst-ini.tex +++ /dev/null @@ -1,923 +0,0 @@ -%D \module -%D [ file=syst-ini, -%D version=2008.11.04, % 2001.11.16, % 1999.03.17, % an oldie: 1995.10.10 -%D title=\CONTEXT\ System Macros, -%D subtitle=Bootstrapping \TEX, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D We used to load plain \TEX\ in a special way, but redefining -%D a couple of primitives so that for instance font loading was -%D ignored. For those interested, this loader is found in -%D \type {syst-tex.tex}. Some of the comment's are Don Knuth's -%D and more of it can be found in the plain \TEX\ format. - -%D Characters can have special states, that can be triggered -%D by setting their category coded. Some are preset, others -%D are to be set as soon as possible, otherwise we cannot -%D define any useful macros. - -%catcode`\^^@ = 9 % ascii null is ignored -%catcode`\\ = 0 % backslash is TeX escape character - -\catcode`\{ = 1 % left brace is begin-group character -\catcode`\} = 2 % right brace is end-group character -\catcode`\$ = 3 % dollar sign is math shift -\catcode`\& = 4 % ampersand is alignment tab -\catcode`\# = 6 % hash mark is macro parameter character -\catcode`\^ = 7 % circumflex and uparrow are for superscripts -\catcode`\_ = 8 % underline and downarrow are for subscripts -\catcode`\^^I = 10 % ascii tab is a blank space - -%catcode`\^^M = 5 % ascii return is end-line -%catcode`\% = 14 % percent sign is comment character -%catcode`\ = 10 % ascii space is blank space -%catcode`\^^? = 15 % ascii delete is invalid - -\catcode`\~ = 13 % tilde is active -\catcode`\^^L = 13 % ascii form-feed - -%catcode`\A = 11 -%....... -%catcode`\Z = 11 - -%catcode`\a = 11 -%....... -%catcode`\z = 11 - -\chardef\activecatcode = 13 % later this will become a counter - -\def ^^L{\par} -\def\^^M{\ } % control = control -\def\^^I{\ } % same for - -%D In \CONTEXT, we simply ignore end||of||file tokens: - -\catcode`\^^Z=9 - -%D It makes sense to know what engine we're running so let's -%D try to deduce it. - -\chardef\unknownengine = 0 -\chardef\pdftexengine = 1 -\chardef\xetexengine = 2 -\chardef\luatexengine = 3 - -\ifx\directlua\undefined - \ifx\XeTeXversion\undefined - \ifx\pdftexversion\undefined - \let\texengine\unknownengine - \else - \let\texengine\pdftexengine - \fi - \else - \let\texengine\xetexengine - \fi -\else - \let\texengine\luatexengine -\fi - -\ifnum\texengine=\unknownengine - \immediate\write16{>>>} - \immediate\write16{>>> only pdftex, xetex and luatex are supported} - \immediate\write16{>>>} - \let\dump\relax - \expandafter\end -\fi - -% todo: pdfsave pdfrestore pdfcolor... don't initialize them - -\ifnum\texengine=\luatexengine - \directlua 0 { % this info is stored in the format - lua.name[0] = "main ctx instance" - local extraprimitives = tex.extraprimitives - local enableprimitives = tex.enableprimitives - local core = extraprimitives('core') - local btex = extraprimitives('tex') - local etex = extraprimitives('etex') - local pdftex = extraprimitives('pdftex') - local luatex = extraprimitives('luatex') - local omega = { - "textdir", "pagedir", "mathdir", "pardir", "bodydir", - "leftghost", "rightghost", "localleftbox", "localrightbox", - "localinterlinepenalty", "localbrokenpenalty", - } - local aleph = { - "boxdir", "pagebottomoffset", "pagerightoffset", - } - for _, subset in next, { etex, pdftex, luatex, omega, aleph } do - enableprimitives('',subset) - end - for _, subset in next, { core, btex, etex, pdftex, luatex, omega, aleph } do - enableprimitives('normal',subset) - end - } -\fi - -%D \ETEX\ has a not so handy way of telling you the version number, -%D i.e. the revision number has a period in it: - -\long\def\gobbleoneargument#1{} % will be defined later on anyway - -\mathchardef\etexversion = - \numexpr\eTeXversion*100+\expandafter\gobbleoneargument\eTeXrevision\relax - -%D First we define a simplified version of the \CONTEXT\ -%D protection mechanism. - -\def\unprotect{\catcode`@=11 } -\def\protect {\catcode`@=12 } - -\unprotect - -%D Some pretty important definitions: - -\let\bgroup={ -\let\egroup=} - -%D Allocation of registers is done slightly different than in plain -%D \TEX. First of all we use different reserved counters. We also -%D don't implement a family handler because users are not supposed -%D to implement their own math. We reserve the lowest 31 registers -%D for scratch purposes. Keep in mind that in the core engine -%D some registers are reserved: counters 0 upto 9, and counter 255. -%D -%D As with plain \TEX\ we recommend that macro designers always use -%D \type {\global} assignments with respect to registers numbered 1, -%D 3, 5 \unknown\ 31, and always non||\type {\global} assignments -%D with respect to registers 0, 2, 4, \unknown\ 30. This will prevent -%D \quote {save stack buildup} that might otherwise occur. -%D -%D We reserve some registers for special (management) purposes: - -% 0 - 20 : scratch -% 21 - 127 : internal -% 128 - 254 : inserts -% 255 : page -% 256 - : user - -\countdef \minallocatedregister = 52 \minallocatedregister = 256 -\countdef \maxallocatedregister = 53 \maxallocatedregister = 32767 -\countdef \minallocatediochannel = 54 \minallocatediochannel = -1 -\countdef \maxallocatediochannel = 55 \maxallocatediochannel = 16 -\countdef \minallocatedlanguage = 56 \minallocatedlanguage = 0 -\countdef \maxallocatedlanguage = 57 \maxallocatedlanguage = 255 -\countdef \maxallocatedinsert = 58 \maxallocatedinsert = 254 -\countdef \minallocatedinsert = 59 \minallocatedinsert = 128 -\countdef \minallocatedfamily = 60 \minallocatedfamily = 128 -\countdef \maxallocatedfamily = 61 \maxallocatedfamily = 255 - -\countdef \lastallocatedcount = 32 \lastallocatedcount = \minallocatedregister -\countdef \lastallocateddimen = 33 \lastallocateddimen = \minallocatedregister -\countdef \lastallocatedskip = 34 \lastallocatedskip = \minallocatedregister -\countdef \lastallocatedmuskip = 35 \lastallocatedmuskip = \minallocatedregister -\countdef \lastallocatedbox = 36 \lastallocatedbox = \minallocatedregister -\countdef \lastallocatedtoks = 37 \lastallocatedtoks = \minallocatedregister -\countdef \lastallocatedread = 38 \lastallocatedread = \minallocatediochannel -\countdef \lastallocatedwrite = 39 \lastallocatedwrite = \minallocatediochannel -\countdef \lastallocatedmarks = 40 \lastallocatedmarks = \minallocatedregister -\countdef \lastallocatedlanguage = 41 \lastallocatedlanguage = \minallocatedlanguage % not used in context -\countdef \lastallocatedinsertion = 42 \lastallocatedinsertion = \minallocatedinsert -\countdef \lastallocatedfamily = 43 \lastallocatedfamily = \minallocatedfamily % not used in context -\countdef \lastallocatedattribute = 44 \lastallocatedattribute = \minallocatedregister - -\countdef \mincountervalue = 125 \mincountervalue = -"7FFFFFFF % beware, we use index 125 at the lua end -\countdef \maxcountervalue = 126 \maxcountervalue = "7FFFFFFF % beware, we use index 126 at the lua end - -%countdef \minusone = 127 \minusone = -1 -%chardef \zerocount = 0 -%chardef \plusone = 1 - -\countdef \zerocount = 120 \zerocount = 0 -\countdef \plusone = 121 \plusone = 1 -\countdef \minusone = 122 \minusone = -1 - -%chardef \normalpagebox = 255 -\countdef \normalpagebox = 127 \normalpagebox = 255 % hardcoded in pdftex/xetex - -% A few traditional allocations: - -\countdef \count@ = 255 % hm, used in \newif .. todo: replace it there -\dimendef \dimen@ = 0 -\dimendef \dimen@i = 1 % global only -\dimendef \dimen@ii = 2 - -%D So, effectively we start allocating from 256 and upwards. The -%D inserts sit in the range 128 upto 254. Page numbers use the -%D counters 0 upto 9 and the pagebox is 255. Users can use the -%D scratch registers upto 31 without problem but all others are -%D reserved. - -\def\wlog#1{} % \def\wlog{\immediate\write\minusone} % write on log file (only) - -%D The allocators share a common helper macro. - -\def\newcount {\allocateregister\lastallocatedcount \count \countdef \maxallocatedregister} -\def\newdimen {\allocateregister\lastallocateddimen \dimen \dimendef \maxallocatedregister} -\def\newskip {\allocateregister\lastallocatedskip \skip \skipdef \maxallocatedregister} -\def\newmuskip {\allocateregister\lastallocatedmuskip \muskip \muskipdef \maxallocatedregister} -\def\newbox {\allocateregister\lastallocatedbox \box \mathchardef\maxallocatedregister} -\def\newtoks {\allocateregister\lastallocatedtoks \toks \toksdef \maxallocatedregister} -\def\newread {\allocateregister\lastallocatedread \read \chardef \maxallocatediochannel} -\def\newwrite {\allocateregister\lastallocatedwrite \write \chardef \maxallocatediochannel} -\def\newmarks {\allocateregister\lastallocatedmarks \marks \mathchardef\maxallocatedregister} -\def\newinsert {\allocateregister\lastallocatedinsertion\insert \chardef \maxallocatedinsert} - -%D We don't need these in \CONTEXT: - -\def\newlanguage{\allocateregister\lastallocatedlanguage \language\chardef \maxallocatedlanguage} -\def\newfamily {\allocateregister\lastallocatedfamily \fam \chardef \maxallocatedfamily} - -\let\newfam\newfamily - -% Watch out, for the moment we disable the check for already being defined -% later we will revert this but first all chardefs must be replaced. - -\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1} -\def\setnewconstant#1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number - -% maybe setconstant with check - -% %D The next definitions are really needed (in \CONTEXT): - -%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}} -\newlinechar=10 \edef\outputnewlinechar{^^J} - -%D One reason to start high with allocation is that it permits us to -%D allocate consecutive ranges more easily, for instance in \MPLIB\ -%D we want to allocate a continuous range of boxes. It also permits us -%D to do a proper upward allocation for inserts. The current code -%D evolved from code that dealt with older engines but as all engines -%D now provide many registers we removed all traces. - -\def\writestatus#1#2{\immediate\write16{#1: #2}} \def\space { } - -\def\allocateregisteryes#1#2#3#4#5% last class method max name - {\ifnum#1<#4\relax - \global\advance#1\plusone - \global#3#5=#1\relax - \else - \writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}% - \fi} - -\def\allocateregisternop#1#2#3#4#5% last class method max name - {\writestatus{warning}{\string#2 \string#5 is already defined (\string\relax\space it first)}} - -\def\allocateregister#1#2#3#4#5% last class method max name - {\ifx#5\undefined - \expandafter\allocateregisteryes - \else\ifx#5\relax - \expandafter\expandafter\expandafter\allocateregisteryes - \else - \expandafter\expandafter\expandafter\allocateregisternop - \fi\fi - #1#2#3#4#5} - -%D Since the number of chars exceed 256 now, we can use \type -%D {\chardef} instead of the more limited \type {\mathchardef}. - -\ifnum\texengine>\pdftexengine - \def\newbox {\allocateregister\lastallocatedbox \box \chardef\maxallocatedregister} - \def\newmarks{\allocateregister\lastallocatedmarks\marks\chardef\maxallocatedregister} -\fi - -%D Attributes are something very \LUATEX. In \CONTEXT\ you are not -%D supposed to use the attributes directly but always allocate then -%D first. For instance attribute~0 is reserved for special purposes -%D (this might change). - -\ifnum\texengine=\luatexengine - \let\attributeunsetvalue\mincountervalue % used to be \minusone - \def\newattribute{\allocateregister\lastallocatedattribute\attribute\attributedef\maxallocatedregister} -\fi - -%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a -%D trick to force strings instead of tokens that take more memory. -%D It's a trick to trick to force strings. - -\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}} - -%D \macros -%D {scratchcounter, -%D scratchdimen,scratchskip,scratchmuskip, -%D scratchbox, -%D scratchtoks} -%D -%D We now define a few scratch registers, so that successive -%D loads at least have some available. - -\newcount \scratchcounter \newcount \globalscratchcounter -\newdimen \scratchdimen \newdimen \globalscratchdimen -\newskip \scratchskip \newskip \globalscratchskip -\newmuskip \scratchmuskip \newmuskip \globalscratchmuskip -\newtoks \scratchtoks \newtoks \globalscratchtoks -\newbox \scratchbox \newbox \globalscratchbox - -\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree -\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree -\newdimen \scratchskipone \newdimen \scratchskiptwo \newdimen \scratchskipthree -\newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree -\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree -\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree - -%D More allocations: - -\newskip \zeroskip \zeroskip = 0pt plus 0pt minus 0pt -\newdimen\zeropoint \zeropoint = 0pt -\newdimen\onepoint \onepoint = 1pt -\newdimen\maxdimen \maxdimen = 16383.99999pt -\newdimen\onebasepoint \onebasepoint = 1bp -\newdimen\scaledpoint \scaledpoint = 1sp -\newdimen\thousandpoint\thousandpoint= 1000pt - -\let\points\onepoint - -\newtoks \emptytoks - -%D And even more: (todo: countdefs 60+) - -%newcount \minusone \minusone = -1 -\newcount \minustwo \minustwo = -2 -%chardef \zerocount = 0 -%chardef \plusone = 1 -\chardef \plustwo = 2 -\chardef \plusthree = 3 -\chardef \plusfour = 4 -\chardef \plusfive = 5 -\chardef \plussix = 6 -\chardef \plusseven = 7 -\chardef \pluseight = 8 -\chardef \plusnine = 9 -\chardef \plusten = 10 -\chardef \plussixteen = 16 -\chardef \plushundred = 100 -\chardef \pluscxxvii = 127 -\chardef \pluscxxviii = 128 -\chardef \pluscclv = 255 - -\ifnum\texengine=\luatexengine - \chardef \pluscclvi = 256 - \chardef \plusthousand = 1000 - \chardef \plustenthousand = 10000 - \chardef \plustwentythousand = 20000 - \chardef \medcard = 32768 - \chardef \maxcard = 65536 % pdftex has less mathchars -\else - \mathchardef\pluscclvi = 256 - \mathchardef\plusthousand = 1000 - \mathchardef\plustenthousand = 10000 - \mathchardef\plustwentythousand = 20000 - \newcount \medcard \medcard = 32768 % pdftex has less mathchars - \newcount \maxcard \maxcard = 65536 % pdftex has less mathchars -\fi - -%D We prefer the more readable variant than in plain -%D \TEX. User should only use \type {\emptybox}: - -\newbox\voidbox % public - -\let\normalhbox\hbox -\let\normalvbox\vbox - -\def\unvoidbox{\unhbox\voidbox} -\def\emptybox {\box \voidbox} % used in initializations so no attributes -\def\emptyvbox{\normalvbox{}} % no copy as we need to set attributes -\def\emptyhbox{\normalhbox{}} % no copy as we need to set attributes - -\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode - -%D Some expected plain variants follow. We don't reuse registers -%D because we don't want clashes. - -\newdimen\p@ \p@ \onepoint -\newcount\m@ne \m@ne \minusone -\newdimen\z@ \z@ \zeropoint -\let \@ne \plusone -\let \tw@ \plustwo -\let \thr@@ \plusthree -\let \sixt@@n \sixteen -\let \@cclv \pluscclv -\let \@cclvi \pluscclvi -\newbox \voidb@x -\newtoks \toks@ - -%D We define \type {\newif} a la plain \TEX, but will -%D redefine it later. As Knuth says: -%D -%D \startnarrower -%D And here's a different sort of allocation: for example, -%D -%D \starttyping -%D \newif\iffoo -%D \stoptyping -%D -%D creates \type {\footrue}, \type {\foofalse} to go -%D with \type {\iffoo}. -%D \stopnarrower - -\def\newif#1% - {\count@\escapechar - \escapechar\minusone - \expandafter\expandafter\expandafter\def\@if #1{true}{\let#1\iftrue }% - \expandafter\expandafter\expandafter\def\@if#1{false}{\let#1\iffalse}% - \@if#1{false}% the condition starts out false - \escapechar\count@} - -\def\@if#1#2% - {\csname\expandafter\if@\string#1#2\endcsname} - -\bgroup % `if' is required - - \uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}} - -\egroup - -%D Let's test this one: - -\newif\ifdone - -%D Potential primitive in \LUATEX: - -\ifdefined\htdp \else \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi - -%D \macros -%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment, -%D @@endofline,@@parameter,@@superscript,@@subscript, -%D @@ignore,@@space,@@letter,@@other,@@active,@@comment} -%D -%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of certain -%D characters. Because we are not that good at remembering numbers, -%D we introduce some symbolic names. - -%D As we now have catc-* files, we also have more readable names but -%D We will keep the following around for a while. - -\chardef\@@escape = 0 -\chardef\@@begingroup = 1 -\chardef\@@endgroup = 2 -\chardef\@@mathshift = 3 -\chardef\@@alignment = 4 -\chardef\@@endofline = 5 -\chardef\@@parameter = 6 -\chardef\@@superscript = 7 -\chardef\@@subscript = 8 -\chardef\@@ignore = 9 -\chardef\@@space = 10 -\chardef\@@letter = 11 -\chardef\@@other = 12 -\chardef\@@active = 13 -\chardef\@@comment = 14 - -%D Constants to be used with \type {\currentgrouptype}. - -\chardef\@@bottomlevelgroup = 0 -\chardef\@@simplegroup = 1 -\chardef\@@hboxgroup = 2 -\chardef\@@adjustedhboxgroup = 3 -\chardef\@@vboxgroup = 4 -\chardef\@@vtopgroup = 5 -\chardef\@@aligngroup = 6 -\chardef\@@noaligngroup = 7 -\chardef\@@outputgroup = 8 -\chardef\@@mathgroup = 9 -\chardef\@@discretionarygroup = 10 -\chardef\@@insertgroup = 11 -\chardef\@@vcentergroup = 12 -\chardef\@@mathchoicegroup = 13 -\chardef\@@semisimplegroup = 14 -\chardef\@@mathshiftgroup = 15 -\chardef\@@mathleftgroup = 16 - -\chardef\@@vadjustgroup = \@@insertgroup - -%D Constants to be used with \type {\interactionmode}. - -\chardef\@@batchmode = 0 -\chardef\@@nonstopmode = 1 -\chardef\@@scrollmode = 2 -\chardef\@@errorstopmode = 3 - -%D Constants to be used with \type {\lastnodetype}. The \type -%D {\lastnodetype} primitive is \ETEX\ compliant. The valid range is -%D still -1 .. 15 and glyph nodes have number 0 (used to be char -%D node) and ligature nodes are mapped to 7. That way macro packages -%D can use the same symbolic names as in traditional \ETEX. Keep in -%D mind that the internal node numbers are different and that there -%D are more node types that 15. - -\chardef\@@charnode = 0 -\chardef\@@hlistnode = 1 -\chardef\@@vlistnode = 2 -\chardef\@@rulenode = 3 -\chardef\@@insertnode = 4 -\chardef\@@marknode = 5 -\chardef\@@adjustnode = 6 -\chardef\@@ligaturenode = 7 -\chardef\@@discretionarynode = 8 -\chardef\@@whatsitnode = 9 -\chardef\@@mathnode = 10 -\chardef\@@gluenode = 11 -\chardef\@@kernnode = 12 -\chardef\@@penaltynode = 13 -\chardef\@@unsetnode = 14 -\chardef\@@mathsnode = 15 - -%D Constants to be used with \type {\currentiftype}. - -\chardef\@@charif = 1 -\chardef\@@catif = 2 -\chardef\@@numif = 3 -\chardef\@@dimif = 4 -\chardef\@@oddif = 5 -\chardef\@@vmodeif = 6 -\chardef\@@hmodeif = 7 -\chardef\@@mmodeif = 8 -\chardef\@@innerif = 9 -\chardef\@@voidif = 10 -\chardef\@@hboxif = 11 -\chardef\@@vboxif = 12 -\chardef\@@xif = 13 -\chardef\@@eofif = 14 -\chardef\@@trueif = 15 -\chardef\@@falseif = 16 -\chardef\@@caseif = 17 -\chardef\@@definedif = 18 -\chardef\@@csnameif = 19 -\chardef\@@fontcharif = 20 - -%D Of course we want even bigger log files, so we copied this -%D from the \ETEX\ source files. -%D -%D When watching such logs, beware of nasty side effects of -%D \type {\scantokens}, as in: -%D -%D \starttyping -%D \bgroup -%D \lccode`a=12\lowercase{\xdef\whatever{a}}\egroup -%D \def\whatever{test \whatever test} -%D \scantokens\expandafter{\whatever} -%D \egroup -%D \stoptyping -%D -%D In \LUATEX\ we have ways around this. - -\def\tracingall - {\tracingonline \plusone - \tracingcommands \plusthree - \tracingstats \plustwo - \tracingpages \plusone - \tracingoutput \plusone - \tracinglostchars \plustwo - \tracingmacros \plustwo - \tracingparagraphs\plusone - \tracingrestores \plusone - \showboxbreadth \maxdimen - \showboxdepth \maxdimen - \tracinggroups \plusone - \tracingifs \plusone - \tracingscantokens\plusone - \tracingnesting \plusone - \tracingassigns \plustwo - \errorstopmode} - -\def\loggingall - {\tracingall - \tracingonline \zerocount} - -\def\tracingnone - {\tracingassigns \zerocount - \tracingnesting \zerocount - \tracingscantokens\zerocount - \tracingifs \zerocount - \tracinggroups \zerocount - \showboxdepth \plusthree - \showboxbreadth \plusfive - \tracingrestores \zerocount - \tracingparagraphs\zerocount - \tracingmacros \zerocount - \tracinglostchars \plusone - \tracingoutput \zerocount - \tracingpages \zerocount - \tracingstats \zerocount - \tracingcommands \zerocount - \tracingonline \zerocount} - -%D Just for tracing purposes we set: - -\tracingstats\plusone - -%D Here we also save \type {\input}, more will be saved later. - -\ifdefined\normalinput \else \let\normalinput\input \fi - -%D We don't like outer commands, and we always want access -%D to the original \type {\input} primitive. - -\let\normalouter\outer \def\outer{} % no longer \relax - -%D To circumvent dependencies, we can postpone certain -%D initializations to dumping time, by appending them to the -%D \type {\everydump} token register. - -\ifdefined\normaldump \else \let\normaldump\dump \fi - -\newtoks\everydump - -\def\dump{\the\everydump\normaldump} - -%D The same applies for the startup actions. - -\ifdefined\normaleveryjob \else \let\normaleveryjob\everyjob \fi - -\let\everyjob\relax \newtoks\everyjob - -\normaleveryjob{\the\everyjob} - -\def\appendtotoks #1{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=} -\def\prependtotoks#1{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=} - -\def\doappendtotoks {\expandafter\expandafter\expandafter{\expandafter\the\expandafter\temp\the\scratchtoks}} -\def\doprependtotoks{\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratchtoks\the\temp}} - -%D \macros -%D {begcsname} -%D -%D Handy for \ETEX-only usage (avoids making \type {\relax}'s: - -\def\begcsname#1\endcsname{\ifcsname#1\endcsname\csname#1\endcsname\fi} - -%D Now come a few macros that might be needed in successive loading: - -\let\endgraf\par -\let\endline\cr - -\def\space{ } -\def\empty{} -\def\null {\hbox{}} - -%D The following two might be overloaded later on but some modules need -%D then earlier. These functionality is reflected in the name and will not -%D change. - -\bgroup - \catcode`\^^M=\activecatcode% - \gdef\obeylines{\catcode`\^^M\activecatcode \let^^M\par}% - \global\let^^M\par% -\egroup - -\bgroup - \gdef\obeyspaces{\catcode`\ \activecatcode}% - \obeyspaces\global\let =\space% -\egroup - -%D A constant: - -\let\endoflinetoken=^^M - -%D Also needed might be a simple loop structure and we borrow -%D plain \TEX's one as it is often expected to be present and -%D it is about the fastest you can get. Beware: this macro -%D does not support nested loops. We use a namespace prefix -%D \type {@@pln}. - -\long\def\loop#1\repeat{\long\def\@@plnbody{#1}\@@plniterate} - -%D The following makes \type {\loop} \unknown\ \type {\if} -%D \unknown\ \type {\repeat} skippable (clever trick): - -\let\repeat\fi % so both \loop and \repeat are reserved words! - -%D The original (no \type {@@pln} there): -%D -%D \starttyping -%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next} -%D \stoptyping -%D -%D A more efficient alternative: -%D -%D \starttyping -%D \def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi} -%D \stoptyping -%D -%D An even more efficient one: - -\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi} - -%D We don't define a real output routine yet but at least get rid -%D of pages: - -\output{\shipout\box\normalpagebox} - -%D Although we don't add pagenumbers yet we alias the default -%D register used for counting pages: - -\countdef\pageno=0 \pageno=1 % first page is number 1 - -%D Beside the raw counter \type {\pageno} the \type {\folio} -%D macro provides the value. - -\def\folio{\the\pageno} % kind of expected and therefore reserved - -%D The following registers are kind of standard and (for the moment) -%D we define them here. This might change. - -\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt -\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt -\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt - -\baselineskip = 12pt -\lineskip = 1pt -\lineskiplimit = 0pt - -%D Again a few kind-of-extensions the core: - -\newskip \hideskip \hideskip = -1000pt plus 1fill -\newskip \centering \centering = 0pt plus 1000pt minus 1000pt - -\def\hidewidth % for alignment entries that can stick out - {\hskip\hideskip} - -\def\ialign % initialized \halign - {\everycr{}% - \tabskip\zeroskip - \halign} - -\newcount \mscount - -\def\spanomit{\span\omit} % bypass error message - -\def\multispan#1% - {\omit - \mscount#1\relax - \loop - \ifnum\mscount>\plusone - \spanomit \advance\mscount\minusone - \repeat} - -%D The next section deals with selective definitions in -%D later modules. One can of course use the \type {\texengine} -%D number that we defined earlier instead. - -\bgroup \obeylines - \gdef\pickupSOMETEX#1% - {\expandafter\gdef\csname begin#1\endcsname{\bgroup\obeylines\dopickupSOMETEX{#1}}} - \gdef\dopickupSOMETEX#1#2 - % {\egroup\immediate\write16{special code for #1 -> [line \the\inputlineno] \detokenize{#2}}} - {\egroup} -\egroup - -\let\endTEX \relax \long\def\beginTEX #1\endTEX {} -\let\endETEX \relax \long\def\beginETEX #1\endETEX {} -\let\endXETEX \relax \long\def\beginXETEX #1\endXETEX {} -\let\endLUATEX\relax \long\def\beginLUATEX#1\endLUATEX{} -\let\endOLDTEX\relax \long\def\beginOLDTEX#1\endOLDTEX{} -\let\endNEWTEX\relax \long\def\beginNEWTEX#1\endNEWTEX{} - -\pickupSOMETEX{ETEX} - -\ifnum\texengine=\xetexengine - \pickupSOMETEX{XETEX} -\fi -\ifnum\texengine=\luatexengine - \pickupSOMETEX{LUATEX} -\fi -\ifnum\texengine<\xetexengine - \pickupSOMETEX{OLDTEX} -\else - \pickupSOMETEX{NEWTEX} -\fi - -%D \macros -%D {bindprimitive} -%D -%D We can remap primitives (which is needed because of changes in -%D for instance \PDFTEX). - -\def\bindprimitive#1 #2 % new old - {\ifcsname#1\endcsname \else \ifcsname#2\endcsname - \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname - \fi \fi} - -%D Because \XETEX\ also implements some \PDFTEX\ functionality, we take -%D care of this here instead of a dedicated module. Later modules need -%D to handle the undefined cases. - -%D These messy checks will disappear. - -% new after 1.10, watch the change in prefix - -\bindprimitive quitvmode ptexquitvmode -\bindprimitive noligatures ptexnoligatures -\bindprimitive setrandomseed ptexsetrandomseed -\bindprimitive uniformdeviate ptexuniformdeviate - -\bindprimitive quitvmode pdfquitvmode -\bindprimitive noligatures pdfnoligatures -\bindprimitive setrandomseed pdfsetrandomseed -\bindprimitive uniformdeviate pdfuniformdeviate - -\bindprimitive resettimer pdfresettimer -\bindprimitive elapsedtime pdfelapsedtime - -% new per 1.40 - -\bindprimitive ifprimitive ifpdfprimitive -\bindprimitive primitive pdfprimitive -\bindprimitive ifabsdim ifpdfabsdim -\bindprimitive ifabsnum ifpdfabsnum - -\ifnum\texengine=\xetexengine \else % this test might disappear some day - - \pdfminorversion \plusfive - - \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi - \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi - \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode \plusone - \ifdefined\pdfinclusioncopyfonts\else \newcount\pdfinclusioncopyfonts \fi \pdfinclusioncopyfonts\plusone - - \def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount} - \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine } - \def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree} - - \normalpdfcompression - - \let\normalsetrandomseed \setrandomseed - \let\normaluniformdeviate\uniformdeviate - -\fi - -%D Handy. - -\ifnum\texengine=\luatexengine - \ifdefined\suppresslongerror % for the moment test - \suppresslongerror\plusone - \fi -\fi - -%D Basic status stuff. - -\newif\ifproductionrun - -%D We need to make sure that we start up in \DVI\ mode, so, -%D after testing for running \PDFTEX, we default to \DVI. - -\ifx\pdftexversion\undefined \newcount\pdfoutput \fi \pdfoutput=0 - -%D For those who expect this \unknown - -\ifx\fmtname \undefined \def\fmtname {ConTeXt Minimized Plain TeX} \fi -\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi - -\let\normalfmtversion\fmtversion - -%D A few bonus macros: - -\def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax} -\def\dividonumber#1#2{\the\numexpr(#2-(#1/2))/#1\relax} - -\ifnum\texengine=\xetexengine - \edef\xetexversion {\numexpr\XeTeXversion*100+(\expandafter\gobbleoneargument\XeTeXrevision-5)/10\relax} - \edef\xetexrevision {\the\numexpr(\expandafter\gobbleoneargument\XeTeXrevision-50)/100\relax} -\fi - -\ifcase\texengine - \def\texenginename {impossible} - \edef\texengineversion{0} -\or - \def\texenginename {pdfTeX} - \edef\texengineversion{\dividonumber{100}\pdftexversion.\modulonumber{100}\pdftexversion.\pdftexrevision} -\or - \def\texenginename {XeTeX} - \edef\texengineversion{\dividonumber{100}\xetexversion .\modulonumber{100}\xetexversion .\xetexrevision} -\or - \def\texenginename {LuaTeX} - \edef\texengineversion{\dividonumber{100}\luatexversion.\modulonumber{100}\luatexversion.\luatexrevision} -\else - \def\texenginename {impossible} - \edef\texengineversion{0} -\fi - -%D While cleaning this code up a bit I was listening to Heather -%D Nova's \CD\ Redbird. The first song on that \CD\ ends with -%D a few lines suitable for ending this initialization module: -%D -%D \startlines -%D And there's so much I can do for you -%D Given time I know that I can prove -%D Now my world is opened up to you -%D Come inside -%D -%D Welcome to my life -%D Welcome to my world -%D Come inside -%D \stoplines -%D -%D So let's see what \TEX\ can do now that we've opened up -%D the basic machinery. - -\protect \endinput diff --git a/tex/context/base/type-ini.lua b/tex/context/base/type-ini.lua new file mode 100644 index 000000000..668766f4e --- /dev/null +++ b/tex/context/base/type-ini.lua @@ -0,0 +1,33 @@ +if not modules then modules = { } end modules ['type-ini'] = { + version = 1.001, + comment = "companion to type-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +-- more code will move here + +local format, gsub = string.format, string.gsub +local find_file = resolvers.find_file + +local patterns = { "type-imp-%s.mkiv", "type-imp-%s.tex", "type-%s.mkiv", "type-%s.tex" } + +function commands.doprocesstypescriptfile(name) + name = gsub(name,"^type%-","") + for i=1,#patterns do + local filename = format(patterns[i],name) + -- local foundname = find_file(filename) or "" + local foundname = resolvers.finders.doreadfile("any",".",filename) + if foundname ~= "" then + context.startreadingfile() + context.pushendofline() + context.unprotect() + context.input(foundname) + context.protect() + context.popendofline() + context.stopreadingfile() + return + end + end +end diff --git a/tex/context/base/type-ini.mkii b/tex/context/base/type-ini.mkii index a9800d2e9..d15bb565b 100644 --- a/tex/context/base/type-ini.mkii +++ b/tex/context/base/type-ini.mkii @@ -719,7 +719,7 @@ \the\scratchtoks \fi} -\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkii} +\fetchruntimecommand \typetypescript {\f!typeprefix\s!run} % \usetypescript [berry] [ec] diff --git a/tex/context/base/type-ini.mkiv b/tex/context/base/type-ini.mkiv index bd3f5e6c9..64db2c698 100644 --- a/tex/context/base/type-ini.mkiv +++ b/tex/context/base/type-ini.mkiv @@ -13,6 +13,8 @@ \writestatus{loading}{ConTeXt Typescript Macros / Initialization} +\registerctxluafile{type-ini}{1.001} + %D The default fontclass is empty. We could demand always using fontclasses, %D and then make the calling macros simplier (always assume fontclass) but %D apart from downward compatibility issues, it would make global, class @@ -168,13 +170,7 @@ \expandafter\let\csname\??ts:\c!file:\currenttypefile\endcsname\loadedtypescripts} \def\doprocesstypescriptfile - {\startreadingfile - \pushendofline - \unprotect - \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}% - \protect - \popendofline - \stopreadingfile} + {\ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}} \def\usetypescriptonce {\dotripleempty\dousetypescriptonce} @@ -476,9 +472,10 @@ \fi \fi \fi \ifmmode\mr\else\tf\fi} % needed ? -\def\usetypefile[#1]% recurses on path ! - {\edef\currenttypefile{\f!typeprefix#1}% - \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}} +\def\usetypefile[#1]% recurses on path ! % no storage? obsolete? + %{\edef\currenttypefile{\f!typeprefix#1}% + {\edef\currenttypefile{#1}% + \ctxlua{commands.doprocesstypescriptfile("\currenttypefile")}} %D For Taco: %D @@ -515,7 +512,7 @@ \let\checkfontclass\gobbleoneargument -\fetchruntimecommand \typetypescript {\f!typeprefix\s!run.mkiv} % will become module +\fetchruntimecommand \typetypescript {\f!typeprefix\s!run} % will become module \protect \endinput diff --git a/tex/context/base/type-set.mkiv b/tex/context/base/type-set.mkiv index b09e4ac69..89dd68a8f 100644 --- a/tex/context/base/type-set.mkiv +++ b/tex/context/base/type-set.mkiv @@ -67,11 +67,11 @@ %definefontsynonym [SansCaps] [SansBold] \stopsetups -%usetypescriptfile[\f!typeprefix def] % preloaded in main context.mkiv file -%usetypescriptfile[\f!typeprefix lua] % preloaded in main context.mkiv file -%usetypescriptfile[\f!typeprefix tmf] % replaced by otf (mkiv) en one (mkii) -\usetypescriptfile[\f!typeprefix siz] -\usetypescriptfile[\f!typeprefix otf] -\usetypescriptfile[\f!typeprefix loc] +%usetypescriptfile[def] % preloaded in main context.mkiv file +%usetypescriptfile[lua] % preloaded in main context.mkiv file +%usetypescriptfile[tmf] % replaced by otf (mkiv) en one (mkii) +\usetypescriptfile[siz] +\usetypescriptfile[otf] +\usetypescriptfile[loc] \protect \endinput diff --git a/tex/context/base/unic-ini.mkii b/tex/context/base/unic-ini.mkii index 5f28ba555..7e358341d 100644 --- a/tex/context/base/unic-ini.mkii +++ b/tex/context/base/unic-ini.mkii @@ -761,8 +761,8 @@ %D Goodies: -\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run.mkii} -\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run.mkii} +\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run} +\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run} %D Well, let's at least preload a few familiar ones. Here we %D also load the \UTF\ regime. diff --git a/tex/context/base/v-default.lua b/tex/context/base/v-default.lua deleted file mode 100644 index 2e3707442..000000000 --- a/tex/context/base/v-default.lua +++ /dev/null @@ -1,42 +0,0 @@ -if not modules then modules = { } end modules ['v-default'] = { - version = 1.001, - comment = "companion to v-default.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local patterns, P, V = lpeg.patterns, lpeg.P, lpeg.V -local makepattern = visualizers.makepattern - -local handler = visualizers.newhandler() - -local grammar = { "visualizer", - - -- basic - - signal = makepattern(handler,"signal", visualizers.signalpattern), - emptyline = makepattern(handler,"emptyline",patterns.emptyline), - beginline = makepattern(handler,"beginline",patterns.beginline), - newline = makepattern(handler,"newline", patterns.newline), - space = makepattern(handler,"space", patterns.space), - default = makepattern(handler,"default", patterns.utf8char), - content = makepattern(handler,"default", patterns.somecontent), -- not too efficient - - -- handy - - -- line = V("newline") * V("emptyline")^0 * V("beginline"), - line = V("newline") * V("emptyline")^0 * V("beginline") + V("emptyline") + V("newline"), - whitespace = (V("space") + V("line"))^1, - optionalwhitespace = (V("space") + V("line"))^0, - - -- used - - pattern = V("line") + V("space") + V("signal") + V("content"), - visualizer = V("pattern")^1 - -} - -local parser = P(grammar) - -visualizers.register("default", { parser = parser, handler = handler, grammar = grammar }) diff --git a/tex/context/base/v-default.mkiv b/tex/context/base/v-default.mkiv deleted file mode 100644 index f9a821f0f..000000000 --- a/tex/context/base/v-default.mkiv +++ /dev/null @@ -1,43 +0,0 @@ -%D \module -%D [ file=v-default, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=Default, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-default.lua}{1.001} - -\unprotect - -\definestartstop - [DefaultSnippet] - [\c!before=\blank, - \c!after=\blank, - \c!style=\tt] - -% Name -% NamePrimitive -% NamePlain -% NameMetafun -% Group -% Boundary -% Special -% Comment -% Constructor -% Key -% Entity -% String -% Equal -% Cdata -% Instruction - -% Value -% Quote - -\protect \endinput diff --git a/tex/context/base/v-escaped.lua b/tex/context/base/v-escaped.lua deleted file mode 100644 index 060f48ea3..000000000 --- a/tex/context/base/v-escaped.lua +++ /dev/null @@ -1,14 +0,0 @@ -if not modules then modules = { } end modules ['v-escaped'] = { - version = 1.001, - comment = "companion to v-escaped.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -visualizers.registerescapepattern("/BTEX/ETEX","/BTEX","/ETEX") - -visualizers.register("escaped", { - parser = visualizers.escapepatterns["/BTEX/ETEX"], - handler = visualizers.newhandler(), -}) diff --git a/tex/context/base/v-escaped.mkiv b/tex/context/base/v-escaped.mkiv deleted file mode 100644 index 780d0b518..000000000 --- a/tex/context/base/v-escaped.mkiv +++ /dev/null @@ -1,18 +0,0 @@ -%D \module -%D [ file=v-escaped, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=Escaped, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-escaped.lua}{1.001} - -\unprotect - -\protect \endinput diff --git a/tex/context/base/v-lua.lua b/tex/context/base/v-lua.lua deleted file mode 100644 index abe8de211..000000000 --- a/tex/context/base/v-lua.lua +++ /dev/null @@ -1,208 +0,0 @@ -if not modules then modules = { } end modules ['v-lua'] = { - version = 1.001, - comment = "companion to v-lua.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - --- borrowed from scite --- --- depricated: --- --- gcinfo unpack getfenv setfenv loadlib --- table.maxn table.getn table.setn --- math.log10 math.mod math.modf math.fmod - -local format, tohash = string.format, table.tohash -local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns -local C, Cs, Cg, Cb, Cmt, Carg = lpeg.C, lpeg.Cs, lpeg.Cg, lpeg.Cb, lpeg.Cmt, lpeg.Carg - -local core = tohash { - "and", "break", "do", "else", "elseif", "end", "false", "for", "function", - "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", - "true", "until", "while" -} - -local base = tohash { - "assert", "collectgarbage", "dofile", "error", "loadfile", - "loadstring", "print", "rawget", "rawset", "require", "tonumber", - "tostring", "type", "_G", "getmetatable", "ipairs", "next", "pairs", - "pcall", "rawequal", "setmetatable", "xpcall", "module", "select", -} - -local libraries = { - coroutine = tohash { - "create", "resume", "status", "wrap", "yield", "running", - }, - package = tohash{ - "cpath", "loaded", "loadlib", "path", "config", "preload", "seeall", - }, - io = tohash{ - "close", "flush", "input", "lines", "open", "output", "read", "tmpfile", - "type", "write", "stdin", "stdout", "stderr", "popen", - }, - math = tohash{ - "abs", "acos", "asin", "atan", "atan2", "ceil", "cos", "deg", "exp", - "floor ", "ldexp", "log", "max", "min", "pi", "pow", "rad", "random", - "randomseed", "sin", "sqrt", "tan", "cosh", "sinh", "tanh", "huge", - }, - string = tohash{ - "byte", "char", "dump", "find", "len", "lower", "rep", "sub", "upper", - "format", "gfind", "gsub", "gmatch", "match", "reverse", - }, - table = tohash{ - "concat", "foreach", "foreachi", "sort", "insert", "remove", "pack", - "unpack", - }, - os = tohash{ - "clock", "date", "difftime", "execute", "exit", "getenv", "remove", - "rename", "setlocale", "time", "tmpname", - }, - lpeg = tohash{ - "print", "match", "locale", "type", "version", "setmaxstack", - "P", "R", "S", "C", "V", "Cs", "Ct", "Cs", "Cp", "Carg", - "Cg", "Cb", "Cmt", "Cf", "B", - }, - -- bit - -- debug -} - -local context = context -local verbatim = context.verbatim -local makepattern = visualizers.makepattern - -local LuaSnippet = context.LuaSnippet -local startLuaSnippet = context.startLuaSnippet -local stopLuaSnippet = context.stopLuaSnippet - -local LuaSnippetBoundary = verbatim.LuaSnippetBoundary -local LuaSnippetQuote = verbatim.LuaSnippetQuote -local LuaSnippetString = verbatim.LuaSnippetString -local LuaSnippetSpecial = verbatim.LuaSnippetSpecial -local LuaSnippetComment = verbatim.LuaSnippetComment -local LuaSnippetNameCore = verbatim.LuaSnippetNameCore -local LuaSnippetNameBase = verbatim.LuaSnippetNameBase -local LuaSnippetNameLibraries = verbatim.LuaSnippetNameLibraries -local LuaSnippetName = verbatim.LuaSnippetName - -local namespace - -local function visualizename_a(s) - if core[s] then - namespace = nil - LuaSnippetNameCore(s) - elseif base[s] then - namespace = nil - LuaSnippetNameBase(s) - else - namespace = libraries[s] - if namespace then - LuaSnippetNameLibraries(s) - else - LuaSnippetName(s) - end - end -end - -local function visualizename_b(s) - if namespace and namespace[s] then - namespace = nil - LuaSnippetNameLibraries(s) - else - LuaSnippetName(s) - end -end - -local function visualizename_c(s) - LuaSnippetName(s) -end - -local handler = visualizers.newhandler { - startinline = function() LuaSnippet(false,"{") end, - stopinline = function() context("}") end, - startdisplay = function() startLuaSnippet() end, - stopdisplay = function() stopLuaSnippet() end , - boundary = function(s) LuaSnippetBoundary(s) end, - special = function(s) LuaSnippetSpecial(s) end, - comment = function(s) LuaSnippetComment(s) end, - quote = function(s) LuaSnippetQuote(s) end, - string = function(s) LuaSnippetString(s) end, - period = function(s) verbatim(s) end, - name_a = visualizename_a, - name_b = visualizename_b, - name_c = visualizename_c, -} - -local comment = P("--") -local name = (patterns.letter + patterns.underscore) - * (patterns.letter + patterns.underscore + patterns.digit)^0 -local boundary = S('()[]{}') -local special = S("-+/*^%=#") + P("..") - --- The following longstring parser is taken from Roberto's documentation --- that can be found at http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html. - -local equals = P("=")^0 -local open = P("[") * Cg(equals, "init") * P("[") * P("\n")^-1 -- maybe better: patterns.newline^-1 -local close = P("]") * C(equals) * P("]") -local closeeq = Cmt(close * Cb("init"), function(s,i,a,b) return a == b end) -local longstring = open * Cs((P(1) - closeeq)^0) * close * Carg(1) - -local function long(content,equals,settings) - handler.boundary(format("[%s[",equals or "")) - visualizers.write(content,settings) -- unhandled - handler.boundary(format("]%s]",equals or "")) -end - -local grammar = visualizers.newgrammar("default", { "visualizer", - sstring = - makepattern(handler,"quote",patterns.dquote) - * (V("whitespace") + makepattern(handler,"string",1-patterns.dquote))^0 -- patterns.nodquote - * makepattern(handler,"quote",patterns.dquote), - dstring = - makepattern(handler,"quote",patterns.squote) - * (V("whitespace") + makepattern(handler,"string",1-patterns.squote))^0 -- patterns.nosquote - * makepattern(handler,"quote",patterns.squote), - longstring = - longstring / long, - comment = - makepattern(handler,"comment",comment) - * (V("space") + V("content"))^0, - longcomment = - makepattern(handler,"comment",comment) - * longstring / long, - name = - makepattern(handler,"name_a",name) - * ( V("optionalwhitespace") - * makepattern(handler,"default",patterns.period) - * V("optionalwhitespace") - * makepattern(handler,"name_b",name) - )^-1 - * ( V("optionalwhitespace") - * makepattern(handler,"default",patterns.period) - * V("optionalwhitespace") - * makepattern(handler,"name_c",name) - )^0, - - pattern = - V("longcomment") - + V("comment") - + V("longstring") - + V("dstring") - + V("sstring") - + V("name") - + makepattern(handler,"boundary",boundary) - + makepattern(handler,"special",special) - - + V("space") - + V("line") - + V("default"), - - visualizer = - V("pattern")^1 -} ) - -local parser = P(grammar) - -visualizers.register("lua", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/v-lua.mkiv b/tex/context/base/v-lua.mkiv deleted file mode 100644 index 4ed04f169..000000000 --- a/tex/context/base/v-lua.mkiv +++ /dev/null @@ -1,69 +0,0 @@ -%D \module -%D [ file=v-lua, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=\LUA, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-lua.lua}{1.001} - -\unprotect - -\definestartstop - [LuaSnippet] - [DefaultSnippet] - -\definestartstop - [LuaSnippetName] - [\c!color=, - \c!style=boldface] - -\definestartstop - [LuaSnippetNameCore] - [\c!color=darkgreen, - \c!style=boldface] - -\definestartstop - [LuaSnippetNameBase] - [\c!color=darkgreen, - \c!style=boldface] - -\definestartstop - [LuaSnippetNameLibraries] - [\c!color=darkgreen, - \c!style=boldface] - -\definestartstop - [LuaSnippetBoundary] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [LuaSnippetString] - [LuaSnippet] - -\definestartstop - [LuaSnippetQuote] - [LuaSnippetBoundary] - -\definestartstop - [LuaSnippetSpecial] - [\c!color=darkred, - \c!style=boldface] - -\definestartstop - [LuaSnippetComment] - [\c!color=darkyellow, - \c!style=boldface] - -\definetyping - [LUA] - [\c!option=lua] - -\protect \endinput diff --git a/tex/context/base/v-mp.lua b/tex/context/base/v-mp.lua deleted file mode 100644 index 7c356a5c8..000000000 --- a/tex/context/base/v-mp.lua +++ /dev/null @@ -1,176 +0,0 @@ -if not modules then modules = { } end modules ['v-mp'] = { - version = 1.001, - comment = "companion to v-mp.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns - -local primitives = table.tohash { - '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', 'mpprocset', - 'false', 'nullpicture', 'pencircle', 'true', - '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', - 'addto', 'clip', 'input', 'interim', 'let', 'newinternal', 'save', 'setbounds', - 'shipout', 'show', 'showdependencies', 'showtoken', 'showvariable', - 'special', - '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', 'forever', 'exitif', - 'forsuffixes', 'downto', 'upto', 'step', 'until', - 'charlist', 'extensible', 'fontdimen', 'headerbyte', 'kern', 'ligtable', - 'boundarychar', 'chardp', 'charext', 'charht', 'charic', 'charwd', 'designsize', - 'fontmaking', 'charexists', - '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', - 'extra_beginfig', 'extra_endfig', 'mpxbreak', - 'end', 'btex', 'etex', 'verbatimtex' -} - -local plain = table.tohash { - 'ahangle', 'ahlength', 'bboxmargin', 'defaultpen', 'defaultscale', - 'labeloffset', 'background', 'currentpen', 'currentpicture', 'cuttings', - 'defaultfont', 'extra_beginfig', 'extra_endfig', - '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', - 'abs', 'bbox', 'ceiling', 'center', 'cutafter', 'cutbefore', 'dir', - 'directionpoint', 'div', 'dotprod', 'intersectionpoint', 'inverse', 'mod', 'lft', - 'round', 'rt', 'unitvector', 'whatever', - 'cutdraw', 'draw', 'drawarrow', 'drawdblarrow', 'fill', 'filldraw', 'drawdot', - 'loggingall', 'pickup', 'tracingall', 'tracingnone', 'undraw', 'unfill', - 'unfilldraw', - 'buildcycle', 'dashpattern', 'decr', 'dotlabel', 'dotlabels', 'drawoptions', - 'incr', 'label', 'labels', 'max', 'min', 'thelabel', 'z', - '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' -} - -local metafun = table.tohash { - 'unitcircle', 'fulldiamond', 'unitdiamond', - 'halfcircle', 'quartercircle', - 'llcircle', 'lrcircle', 'urcircle', 'ulcircle', - 'tcircle', 'bcircle', 'lcircle', 'rcircle', - 'lltriangle', 'lrtriangle', 'urtriangle', 'ultriangle', - 'smoothed', 'cornered', 'superellipsed', 'randomized', 'squeezed', - 'punked', 'curved', 'unspiked', 'simplified', 'blownup', 'stretched', - 'paralled', 'enlonged', 'shortened', - 'enlarged', 'leftenlarged', 'topenlarged', 'rightenlarged', 'bottomenlarged', - 'llenlarged', 'lrenlarged', 'urenlarged', 'ulenlarged', - 'llmoved', 'lrmoved', 'urmoved', 'ulmoved', - 'boundingbox', 'innerboundingbox', 'outerboundingbox', - 'bottomboundary', 'leftboundary', 'topboundary', 'rightboundary', - 'xsized', 'ysized', 'xysized', - 'cmyk', 'transparent', 'withshade', 'spotcolor', - 'drawfill', 'undrawfill', - 'inverted', 'uncolored', 'softened', 'grayed', - 'textext', 'graphictext', - 'loadfigure', 'externalfigure' -} - -local context = context -local verbatim = context.verbatim -local makepattern = visualizers.makepattern - -local MetapostSnippet = context.MetapostSnippet -local startMetapostSnippet = context.startMetapostSnippet -local stopMetapostSnippet = context.stopMetapostSnippet - -local MetapostSnippetConstructor = verbatim.MetapostSnippetConstructor -local MetapostSnippetBoundary = verbatim.MetapostSnippetBoundary -local MetapostSnippetSpecial = verbatim.MetapostSnippetSpecial -local MetapostSnippetComment = verbatim.MetapostSnippetComment -local MetapostSnippetNamePrimitive = verbatim.MetapostSnippetNamePrimitive -local MetapostSnippetNamePlain = verbatim.MetapostSnippetNamePlain -local MetapostSnippetNameMetafun = verbatim.MetapostSnippetNameMetafun -local MetapostSnippetName = verbatim.MetapostSnippetName - -local function visualizename(s) - if primitives[s] then - MetapostSnippetNamePrimitive(s) - elseif plain[s] then - MetapostSnippetNamePlain(s) - elseif metafun[s] then - MetapostSnippetNameMetafun(s) - else - MetapostSnippetName(s) - end -end - -local handler = visualizers.newhandler { - startinline = function() MetapostSnippet(false,"{") end, - stopinline = function() context("}") end, - startdisplay = function() startMetapostSnippet() end, - stopdisplay = function() stopMetapostSnippet() end , - constructor = function(s) MetapostSnippetConstructor(s) end, - boundary = function(s) MetapostSnippetBoundary(s) end, - special = function(s) MetapostSnippetSpecial(s) end, - comment = function(s) MetapostSnippetComment(s) end, - string = function(s) MetapostSnippetString(s) end, - quote = function(s) MetapostSnippetQuote(s) end, - name = visualizename, -} - -local comment = S("%") -local name = (patterns.letter + S("_"))^1 -local constructor = S("$@#") -local boundary = S('()[]:=<>;"') -local special = S("-+/*|`!?^&%.,") - -local grammar = visualizers.newgrammar("default", { "visualizer", - - comment = makepattern(handler,"comment",comment) - * (V("space") + V("content"))^0, - dstring = makepattern(handler,"quote",patterns.dquote) - * makepattern(handler,"string",patterns.nodquote) - * makepattern(handler,"quote",patterns.dquote), - name = makepattern(handler,"name",name), - constructor = makepattern(handler,"constructor",constructor), - boundary = makepattern(handler,"boundary",boundary), - special = makepattern(handler,"special",special), - - pattern = - V("comment") + V("dstring") + V("name") + V("constructor") + V("boundary") + V("special") - + V("newline") * V("emptyline")^0 * V("beginline") - + V("space") - + V("default"), - - visualizer = - V("pattern")^1 - -} ) - -local parser = P(grammar) - -visualizers.register("mp", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/v-mp.mkiv b/tex/context/base/v-mp.mkiv deleted file mode 100644 index 30eb23f8b..000000000 --- a/tex/context/base/v-mp.mkiv +++ /dev/null @@ -1,76 +0,0 @@ -%D \module -%D [ file=v-mp, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=\METAPOST, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-mp.lua}{1.001} - -\unprotect - -\definestartstop - [MetapostSnippet] - [DefaultSnippet] - -\definestartstop - [MetapostSnippetName] - [\c!color=darkgreen, - \c!style=boldface] - -\definestartstop - [MetapostSnippetNamePrimitive] - [\c!color=darkgreen, - \c!style=swapface] - -\definestartstop - [MetapostSnippetNamePlain] - [\c!color=darkblue, - \c!color=darkgreen, - \c!style=swapface] - -\definestartstop - [MetapostSnippetNameMetafun] - [\c!color=darkred, - \c!color=darkgreen, - \c!style=swapface] - -\definestartstop - [MetapostSnippetConstructor] - [\c!color=darkred, - \c!style=boldface] - -\definestartstop - [MetapostSnippetBoundary] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [MetapostSnippetQuote] - [MetapostSnippetBoundary] - -\definestartstop - [MetapostSnippetSpecial] - [\c!color=darkyellow, - \c!style=boldface] - -\definestartstop - [MetapostSnippetString] - [MetapostSnippet] - -\definestartstop - [MetapostSnippetComment] - [\c!color=darkyellow, - \c!style=boldface] - -\definetyping - [MP] - [\c!option=mp] - -\protect \endinput diff --git a/tex/context/base/v-nested.lua b/tex/context/base/v-nested.lua deleted file mode 100644 index e37e1bb58..000000000 --- a/tex/context/base/v-nested.lua +++ /dev/null @@ -1,80 +0,0 @@ -if not modules then modules = { } end modules ['v-nested'] = { - version = 1.001, - comment = "companion to v-nested.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local lpegmatch, patterns = lpeg.match, lpeg.patterns -local P, V, Carg = lpeg.P, lpeg.V, lpeg.Carg - -local context = context -local verbatim = context.verbatim -local variables = interfaces.variables - -local makepattern = visualizers.makepattern -local getvisualizer = visualizers.getvisualizer - -local nested = nil - -local donestedtypingstart = context.donestedtypingstart -local donestedtypingstop = context.donestedtypingstop - -local v_none = variables.none -local v_slanted = variables.slanted - -local handler = visualizers.newhandler { - initialize = function(settings) - local option = settings and settings.option - if not option or option == "" then - nested = nil - elseif option == v_slanted then - nested = nil - elseif option == v_none then - nested = nil - else - nested = getvisualizer(option,"direct") - end - end, - open = function() - donestedtypingstart() - end, - close = function() - donestedtypingstop() - end, - content = function(s) - if nested then - nested(s) - else - verbatim(s) - end - end, -} - -local open = P("<<") -local close = P(">>") -local rest = (1 - open - close - patterns.space - patterns.newline)^1 - -local grammar = visualizers.newgrammar("default", { - - initialize = patterns.beginofstring * Carg(1) / handler.initialize, - - open = makepattern(handler,"open",open), - close = makepattern(handler,"close",close), - rest = makepattern(handler,"content",rest), - - nested = V("open") * (V("pattern")^0) * V("close"), - pattern = V("line") + V("space") + V("nested") + V("rest"), - - visualizer = V("initialize") * (V("pattern")^1) - -} ) - -local parser = P(grammar) - -visualizers.register("nested", { parser = parser, handler = handler, grammar = grammar } ) - --- lpeg.match(parser,[[<>tf<>tf>>]]) context.par() --- lpeg.match(parser,[[<>sl>>tf>>]]) context.par() --- lpeg.match(parser,[[sl<>tf>>sl]]) context.par() diff --git a/tex/context/base/v-nested.mkiv b/tex/context/base/v-nested.mkiv deleted file mode 100644 index e1d582d81..000000000 --- a/tex/context/base/v-nested.mkiv +++ /dev/null @@ -1,21 +0,0 @@ -%D \module -%D [ file=v-nested, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=Nested, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-nested.lua}{1.001} - -\unprotect - -\unexpanded\def\donestedtypingstart{\bgroup\swaptypeface{}} -\unexpanded\def\donestedtypingstop {\egroup{}} - -\protect \endinput diff --git a/tex/context/base/v-parsed-xml.lua b/tex/context/base/v-parsed-xml.lua deleted file mode 100644 index 530060b57..000000000 --- a/tex/context/base/v-parsed-xml.lua +++ /dev/null @@ -1,101 +0,0 @@ -if not modules then modules = { } end modules ['v-parsed-xml'] = { - version = 1.001, - comment = "companion to v-parsed-xml.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local format = string.format - -local context = context -local verbatim = context.verbatim - -local write = visualizers.write -local writespace = visualizers.writespace -local writeargument = visualizers.writeargument - -local ParsedXmlSnippetKey = context.ParsedXmlSnippetKey -local ParsedXmlSnippetValue = context.ParsedXmlSnippetValue - -local ParsedXmlSnippetElement = verbatim.ParsedXmlSnippetElement -local ParsedXmlSnippetInstruction = verbatim.ParsedXmlSnippetInstruction -local ParsedXmlSnippetComment = verbatim.ParsedXmlSnippetComment -local ParsedXmlSnippetCdata = verbatim.ParsedXmlSnippetCdata -local ParsedXmlSnippetDoctype = verbatim.ParsedXmlSnippetDoctype - -local startParsedXmlSnippet = context.startParsedXmlSnippet -local stopParsedXmlSnippet = context.stopParsedXmlSnippet - -local parsedxmlhandler = xml.newhandlers { -- todo: treat spaces and tabs - name = "parsedxml", - handle = function(...) - print("error:",...) -- we need a handler as fallback, even if not used - end, - functions = { - ["@el@"] = function(e,handler) - local at = e.at - if at and next(at) then - ParsedXmlSnippetElement(format("<%s",e.tg)) - for k, v in next, at do - writespace() - ParsedXmlSnippetKey() - writeargument(k) - verbatim("=") - ParsedXmlSnippetValue() - writeargument(format("%q",k)) - end - ParsedXmlSnippetElement(">") - else - ParsedXmlSnippetElement(format("<%s>",e.tg)) - end - handler.serialize(e.dt,handler) - ParsedXmlSnippetElement(format("",e.tg)) - end, - ["@pi@"] = function(e,handler) - ParsedXmlSnippetInstruction("") - end , - ["@cm@"] = function(e,handler) - ParsedXmlSnippetComment("") - end, - ["@cd@"] = function(e,handler) - ParsedXmlSnippetCdata("") - end, - ["@dt@"] = function(e,handler) - ParsedXmlSnippetDoctype("") - end, - ["@tx@"] = function(s,handler) - write(s) - end, - } -} - -local function parsedxml(root,pattern) - if root then - if pattern then - root = xml.filter(root,pattern) - end - if root then - context.startParsedXmlSnippet() - xml.serialize(root,parsedxmlhandler) - context.stopParsedXmlSnippet() - end - end -end - -local function parser(str,settings) - parsedxml(xml.convert(str),settings and settings.pattern) -end - -visualizers.parsedxml = parsedxml -- for use at the lua end (maybe namespace needed) - -visualizers.register("parsed-xml", { parser = parser } ) - diff --git a/tex/context/base/v-parsed-xml.mkiv b/tex/context/base/v-parsed-xml.mkiv deleted file mode 100644 index b99328be7..000000000 --- a/tex/context/base/v-parsed-xml.mkiv +++ /dev/null @@ -1,70 +0,0 @@ -%D \module -%D [ file=v-parsed-xml, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=Parsed \XML, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% todo: color specific elements - -\registerctxluafile{v-parsed-xml.lua}{1.001} - -\unprotect - -\definestartstop - [ParsedXmlSnippet] - [%\c!before=\blank, - %\c!after=\blank, - \c!style=\tt] - -\definestartstop - [ParsedXmlSnippetDocType] - [\c!style=boldface, - \c!color=darkgreen] - -\definestartstop - [ParsedXmlSnippetElement] - [\c!style=boldface, - \c!color=darkblue] - -\definestartstop - [ParsedXmlSnippetInstruction] - [\c!style=boldface, - \c!color=darkgreen] - -\definestartstop - [ParsedXmlSnippetCdata] - [\c!style=boldface, - \c!color=darkgreen] - -\definestartstop - [ParsedXmlSnippetComment] - [\c!style=boldface, - \c!color=darkgreen] - -\definestartstop - [ParsedXmlSnippetKey] - [\c!style=boldface, - \c!color=darkred] - -% \definestartstop -% [ParsedXmlSnippetQuote] -% [\c!style=, -% \c!color=] - -\definestartstop - [ParsedXmlSnippetValue] - [\c!style=, - \c!color=] - -\definetyping - [PARSEDXML] - [option=parsed-xml] - -\protect \endinput diff --git a/tex/context/base/v-tex.lua b/tex/context/base/v-tex.lua deleted file mode 100644 index 1973017f3..000000000 --- a/tex/context/base/v-tex.lua +++ /dev/null @@ -1,130 +0,0 @@ -if not modules then modules = { } end modules ['v-tex'] = { - version = 1.001, - comment = "companion to v-tex.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns - -local context = context -local verbatim = context.verbatim -local makepattern = visualizers.makepattern -local makenested = visualizers.makenested -local getvisualizer = visualizers.getvisualizer - -local TexSnippet = context.TexSnippet -local startTexSnippet = context.startTexSnippet -local stopTexSnippet = context.stopTexSnippet - -local TexSnippetName = verbatim.TexSnippetName -local TexSnippetGroup = verbatim.TexSnippetGroup -local TexSnippetBoundary = verbatim.TexSnippetBoundary -local TexSnippetSpecial = verbatim.TexSnippetSpecial -local TexSnippetComment = verbatim.TexSnippetComment - -local handler = visualizers.newhandler { - startinline = function() TexSnippet(false,"{") end, - stopinline = function() context("}") end, - startdisplay = function() startTexSnippet() end, - stopdisplay = function() stopTexSnippet() end , - name = function(s) TexSnippetName(s) end, - group = function(s) TexSnippetGroup(s) end, - boundary = function(s) TexSnippetBoundary(s) end, - special = function(s) TexSnippetSpecial(s) end, - comment = function(s) TexSnippetComment(s) end, -} - --- todo: unicode letters in control sequences (slow as we need to test the nature) - -local comment = S("%") -local name = P("\\") * (patterns.letter + S("@!?"))^1 -local escape = P("\\") * (patterns.anything - patterns.newline)^-1 -- else we get \n -local group = S("${}") -local boundary = S('[]()<>#="') -local special = S("/^_-&+'`|") - -local p_comment = makepattern(handler,"comment",comment) - * (V("space") + V("content"))^0 -local p_name = makepattern(handler,"name",name) -local p_escape = makepattern(handler,"name",escape) -local p_group = makepattern(handler,"group",group) -local p_boundary = makepattern(handler,"boundary",boundary) -local p_special = makepattern(handler,"special",special) -local p_somespace = V("newline") * V("emptyline")^0 * V("beginline") - + V("space") - ---~ local pattern = visualizers.pattern - -local grammar = visualizers.newgrammar("default", { "visualizer", - - comment = p_comment, - name = p_name, - escape = p_escape, - group = p_group, - boundary = p_boundary, - special = p_special, - somespace = p_somespace, - - pattern = V("comment") - + V("name") + V("escape") + V("group") + V("boundary") + V("special") - + V("newline") * V("emptyline")^0 * V("beginline") - + V("space") - + V("default"), - - visualizer = V("pattern")^1 - -} ) - -local parser = P(grammar) - -visualizers.register("tex", { parser = parser, handler = handler, grammar = grammar } ) - -local function makecommand(handler,how,start,left,right) - local c, l, r, f = P(start), P(left), P(right), how - local n = ( P { l * ((1 - (l + r)) + V(1))^0 * r } + P(1-r) )^0 - if type(how) == "string" then - f = function(s) getvisualizer(how,"direct")(s) end - end - return makepattern(handler,"name",c) - * V("somespace")^0 - * makepattern(handler,"group",l) - * (n/f) - * makepattern(handler,"group",r) -end - -local grammar = visualizers.newgrammar("default", { "visualizer", - - comment = p_comment, - name = p_name, - escape = p_escape, - group = p_group, - boundary = p_boundary, - special = p_special, - somespace = p_somespace, - - mpcode = makenested(handler,"mp","\\startMPcode","\\stopMPcode") - + makenested(handler,"mp","\\startMPgraphic","\\stopMPgraphic") - + makenested(handler,"mp","\\startuseMPgraphic","\\stopuseMPgraphic") - + makenested(handler,"mp","\\startreusableMPgraphic","\\stopreusableMPgraphic") - + makenested(handler,"mp","\\startuniqueMPgraphic","\\stopuniqueMPgraphic") - + makenested(handler,"mp","\\startMPpage","\\stopMPpage"), - - luacode = makenested (handler,"lua","\\startluacode","\\stopluacode") - + makecommand(handler,"lua","\\ctxlua","{","}"), - - pattern = V("comment") - + V("mpcode") + V("luacode") - + V("name") + V("escape") + V("group") + V("boundary") + V("special") - + V("newline") * V("emptyline")^0 * V("beginline") - + V("space") - + V("default"), - - visualizer = V("pattern")^1 - -} ) - -local parser = P(grammar) - -visualizers.register("context", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/v-tex.mkiv b/tex/context/base/v-tex.mkiv deleted file mode 100644 index 5cd5753bb..000000000 --- a/tex/context/base/v-tex.mkiv +++ /dev/null @@ -1,51 +0,0 @@ -%D \module -%D [ file=v-tex, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=\TEX, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-tex.lua}{1.001} - -\unprotect - -\definestartstop - [TexSnippet] - [DefaultSnippet] - -\definestartstop - [TexSnippetName] - [\c!color=darkgreen, - \c!style=boldface] - -\definestartstop - [TexSnippetGroup] - [\c!color=darkred, - \c!style=boldface] - -\definestartstop - [TexSnippetBoundary] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [TexSnippetSpecial] - [\c!color=darkyellow, - \c!style=boldface] - -\definestartstop - [TexSnippetComment] - [\c!color=darkyellow, - \c!style=boldface] - -\definetyping - [TEX] - [\c!option=tex] - -\protect \endinput diff --git a/tex/context/base/v-xml.lua b/tex/context/base/v-xml.lua deleted file mode 100644 index bf6945e26..000000000 --- a/tex/context/base/v-xml.lua +++ /dev/null @@ -1,133 +0,0 @@ -if not modules then modules = { } end modules ['v-xml'] = { - version = 1.001, - comment = "companion to v-xml.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -local P, S, V, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.patterns - -local context = context -local verbatim = context.verbatim -local makepattern = visualizers.makepattern - -local XmlSnippet = context.XmlSnippet -local startXmlSnippet = context.startXmlSnippet -local stopXmlSnippet = context.stopXmlSnippet - -local XmlSnippetName = verbatim.XmlSnippetName -local XmlSnippetKey = verbatim.XmlSnippetKey -local XmlSnippetBoundary = verbatim.XmlSnippetBoundary -local XmlSnippetString = verbatim.XmlSnippetString -local XmlSnippetEqual = verbatim.XmlSnippetEqual -local XmlSnippetEntity = verbatim.XmlSnippetEntity -local XmlSnippetComment = verbatim.XmlSnippetComment -local XmlSnippetCdata = verbatim.XmlSnippetCdata - -local handler = visualizers.newhandler { - startinline = function() XmlSnippet(false,"{") end, - stopinline = function() context("}") end, - startdisplay = function() startXmlSnippet() end, - stopdisplay = function() stopXmlSnippet () end, - name = function(s) XmlSnippetName(s) end, - key = function(s) XmlSnippetKey(s) end, - boundary = function(s) XmlSnippetBoundary(s) end, - string = function(s) XmlSnippetString(s) end, - equal = function(s) XmlSnippetEqual(s) end, - entity = function(s) XmlSnippetEntity(s) end, - comment = function(s) XmlSnippetComment(s) end, - cdata = function(s) XmlSnippetCdata(s) end, -} - -local comment = P("--") -local name = (patterns.letter + patterns.digit + S('_-.'))^1 -local entity = P("&") * (1-P(";"))^1 * P(";") -local openbegin = P("<") -local openend = P("") + P(">") -local closeend = P(">") -local opencomment = P("") -local openinstruction = P("") -local opencdata = P("") - -local grammar = visualizers.newgrammar("default", { "visualizer", - sstring = - makepattern(handler,"string",patterns.dquote) - * (V("whitespace") + makepattern(handler,"default",1-patterns.dquote))^0 - * makepattern(handler,"string",patterns.dquote), - dstring = - makepattern(handler,"string",patterns.squote) - * (V("whitespace") + makepattern(handler,"default",1-patterns.squote))^0 - * makepattern(handler,"string",patterns.squote), - entity = - makepattern(handler,"entity",entity), - name = - makepattern(handler,"name",name) - * ( - makepattern(handler,"default",patterns.colon) - * makepattern(handler,"name",name) - )^0, - key = - makepattern(handler,"key",name) - * ( - makepattern(handler,"default",patterns.colon) - * makepattern(handler,"key",name) - )^0, - attributes = ( - V("optionalwhitespace") - * V("key") - * V("optionalwhitespace") - * makepattern(handler,"equal",patterns.equal) - * V("optionalwhitespace") - * (V("dstring") + V("sstring")) - * V("optionalwhitespace") - )^0, - open = - makepattern(handler,"boundary",openbegin) - * V("name") - * V("optionalwhitespace") - * V("attributes") - * makepattern(handler,"boundary",closebegin), - close = - makepattern(handler,"boundary",openend) - * V("name") - * V("optionalwhitespace") - * makepattern(handler,"boundary",closeend), - comment = - makepattern(handler,"boundary",opencomment) - * (V("whitespace") + makepattern(handler,"comment",(1-closecomment)))^0 -- slow - * makepattern(handler,"boundary",closecomment), - cdata = - makepattern(handler,"boundary",opencdata) - * (V("whitespace") + makepattern(handler,"comment",(1-closecdata)))^0 -- slow - * makepattern(handler,"boundary",closecdata), - instruction = - makepattern(handler,"boundary",openinstruction) - * V("name") - * V("optionalwhitespace") - * V("attributes") - * V("optionalwhitespace") - * makepattern(handler,"boundary",closeinstruction), - - pattern = - V("comment") - + V("instruction") - + V("cdata") - + V("close") - + V("open") - + V("entity") - + V("space") - + V("line") - + V("default"), - - visualizer = - V("pattern")^1 -} ) - -local parser = P(grammar) - -visualizers.register("xml", { parser = parser, handler = handler, grammar = grammar } ) diff --git a/tex/context/base/v-xml.mkiv b/tex/context/base/v-xml.mkiv deleted file mode 100644 index 3cc9244f2..000000000 --- a/tex/context/base/v-xml.mkiv +++ /dev/null @@ -1,71 +0,0 @@ -%D \module -%D [ file=v-xml, -%D version=2010.10.19, -%D title=\CONTEXT\ Visualizer Macros, -%D subtitle=\XML, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright=PRAGMA-ADE] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\registerctxluafile{v-xml.lua}{1.001} - -\unprotect - -\definestartstop - [XmlSnippet] - [DefaultSnippet] - -\definestartstop - [XmlSnippetName] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [XmlSnippetKey] - [\c!color=darkgreen, - \c!style=boldface] - -\definestartstop - [XmlSnippetBoundary] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [XmlSnippetEntity] - [\c!color=darkred, - \c!style=boldface] - -\definestartstop - [XmlSnippetString] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [XmlSnippetEqual] - [\c!color=darkblue, - \c!style=boldface] - -\definestartstop - [XmlSnippetComment] - [\c!color=darkyellow, - \c!style=boldface] - -\definestartstop - [XmlSnippetCdata] - [\c!color=darkyellow, - \c!style=boldface] - -\definestartstop - [XmlSnippetInstruction] - [\c!color=darkyellow, - \c!style=boldface] - -\definetyping - [XML] - [\c!option=xml] - -\protect \endinput diff --git a/tex/context/base/x-fo.mkii b/tex/context/base/x-fo.mkii index b2b0b59f9..83cfe2433 100644 --- a/tex/context/base/x-fo.mkii +++ b/tex/context/base/x-fo.mkii @@ -28,8 +28,6 @@ \useXMLfilter[prs,run] -% \input xtag-run - \unprotect % syst-new.tex diff --git a/tex/context/base/x-res-01.mkiv b/tex/context/base/x-res-01.mkiv index dc14e7054..b82d60484 100644 --- a/tex/context/base/x-res-01.mkiv +++ b/tex/context/base/x-res-01.mkiv @@ -18,10 +18,10 @@ %D style to a database by saying: %D %D \starttyping -%D texexec --pdf --use=fig-make yourfile.xml +%D context --input=d-res-01.xml auto:x-res-01.mkiv %D \stoptyping %D -%D The following modes are supported: +%D The following modes are supported (not all yet in mkiv): %D %D \starttabulate[|lT|l|] %D \NC letter \NC map the preview on letter size \NC \NR @@ -36,122 +36,20 @@ %D The resulting file has the following characteristics: %D %D \startitemize[packed] -%D \item the document is split into three sections: first each -%D figure is shown at its own page, then an overview of -%D figures is shown with some data alongside, and -%D finally an index and table of contents shows up -%D \item there is no title page, which means that one can -%D access a figure by page number without offset -%D \item the document is opened at the first overview page, -%D that is, when the viewer supports it -%D \item the graphic is shown 3~times: on a page of its own, -%D scaled to a fixed dimension, and relative to a4 or -%D letter paper size -%D \item the labels can be accessed in an index and list at -%D the end of the document +%D \startitem the document is split into three sections: first each +%D figure is shown at its own page, then an overview of figures is +%D shown with some data alongside, and finally an index and table of +%D contents shows up \stopitem +%D \startitem there is no title page, which means that one can access +%D a figure by page number without offset \stopitem +%D \startitem the document is opened at the first overview page, that +%D is, when the viewer supports it \stopitem +%D \startitem the graphic is shown 3~times: on a page of its own, +%D scaled to a fixed dimension, and relative to a4 or letter paper +%D size \stopitem +%D \startitem the labels can be accessed in an index and list at the +%D end of the document \stopitem %D \stopitemize -%D -%D We use named destinations, which means that one can -%D access a figure by name from an external application. - -\usemodule[res-00] - -\autoXMLnamespace[rl] - -\setupoutput[pdftex] \overcomePDFspacefalse - -\setjobfullname {xml} % default suffix - -\doifnothing {\jobfullname} {\end} -\doiffileelse {\jobfullname} {} {\end} - -\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}] -\setupattachments [symbol=attachment] -\useattachment [datafile] [\jobname.xml] - -\def\StartDescription - {\bgroup} - -\def\StopDescription - {\subject {Figure collection} - \starttabulate[|lBe|p|] - \doifXMLdataelse{rl:organization} - {\NC organization \NC \XMLflush{rl:organization} \NC \NR}{} - \doifXMLdataelse{rl:project} - {\NC project \NC \XMLflush{rl:project} \NC \NR}{} - \doifXMLdataelse{rl:product} - {\NC product \NC \XMLflush{rl:product} \NC \NR}{} - \doifXMLdataelse{rl:comment} - {\NC comment \NC \XMLflush{rl:comment} \NC \NR}{} - \NC specification \NC \attachment[datafile] \NC \NR - \stoptabulate - \blank[2*big] - \egroup} - - -\def\localexternalfigurereplacement#1#2#3% hack, no reuse of dummies (yet), todo: pass objname - {\doifelsenothing{\XMLflush{rl:label}} - {\edef\FigureName{\XMLflush{rl:label}}} - {\edef\FigureName{\XMLflush{rl:file}}}% - \doifobjectfoundelse{rl}\FigureName - {} - {\setobject{rl}\FigureName\vbox{\normalexternalfigurereplacement{#1}{#2}{#3}}}% - \getobject{rl}\FigureName} - -\startmode[dummy] - - \useMPlibrary[dum] - - \def\StartFigureA - {\bgroup - \XMLassign{rl:file}{dummy}} - - \let\normalexternalfigurereplacement\externalfigurereplacement - \let\externalfigurereplacement \localexternalfigurereplacement - -\stopmode - -\startnotmode[dummy] - - \def\StartFigureA - {\bgroup - \XMLassign{rl:file}{unknown}} - -\stopnotmode - -\startbuffer[unknown] - \framed - [width=\XMLpar{rl:dummy}{width}{12cm}, - height=\XMLpar{rl:dummy}{height}{8cm}, - background=color, - backgroundcolor=gray, - foregroundcolor=darkred, - align={lohi,middle}, % normal, - frame=off] - {\bf \XMLflush{rl:dummy}} -\stopbuffer - -\useexternalfigure[unknown][unknown][type=buffer,object=no] - -\defineoverlay[page][\overlaybutton{Description}] - -% \def\externalfigurereplacement#1#2#3% -% {\getbuffer[rl-unknown]} - -\def\StopFigureA - {\doglobal\increment\CurrentPage - \setupbackgrounds[page][background=page] - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% - \expanded{\pagereference[\XMLflush{rl:file}]}} - {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% - \expanded{\pagereference[\XMLflush{rl:label}]}} - \pagefigure[\XMLflush{rl:file}] - \setupbackgrounds[page][background=] - \egroup} - -\def\StartFigureB - {\StartFigureA} \defineregister [figureindex] @@ -159,58 +57,14 @@ \setupregister [figureindex] - [ownnumber=yes, - criterium=text, - interaction=text, - indicator=no] - -\definelist - [figurelist] - -\setuplist - [figurelist] [criterium=text, + interaction=text, pagenumber=no, - width=2em, - interaction=all] - -\setupcolors - [state=start] + indicator=no] \setuptolerance [verytolerant] -% Ulgy: - -\startmode[letter] % downward compatible - \enablemode[previewpage-letter] -\stopmode - -\startnotmode[previewpage-letter,previewpage-S6] - \enablemode[previewpage-A4] -\stopnotmode - -\startsetups[paper] -\startmode[previewpage-A4] - \framed - [width=210mm,height=297mm,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLflush{rl:file}][reset=yes]} -\stopmode -\startmode[previewpage-letter] - \framed - [width=8.5in,height=11in,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLflush{rl:file}][reset=yes]} -\stopmode -\startmode[previewpage-S6] - \framed - [width=600pt,height=450pt,offset=overlay,frame=off, - background=color,backgroundcolor=white] - {\externalfigure[\XMLflush{rl:file}][reset=yes]} -\stopmode -\stopsetups - \setupbuttons [offset=10pt, width=broad, @@ -218,103 +72,15 @@ rulethickness=1pt, framecolor=darkred] -\definecolor[XMLRLcolor][white] - -\def\StopFigureB - {\doglobal\increment\CurrentPage - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\definereference[Figure][\XMLflush{rl:file}]}% - \expanded{\definereference[GridPg][grid:\XMLflush{rl:file}]}} - {\expanded{\definereference[Figure][\XMLflush{rl:label}]}% - \expanded{\definereference[GridPg][grid:\XMLflush{rl:label}]}}% - \button - {\hbox to \hsize - {\forgetall \dontcomplain - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\pagereference[about:\XMLflush{rl:file}]}} - {\expanded{\pagereference[about:\XMLflush{rl:label}]}}% - % moved here, because descriptions may be absent - \ifnum\CurrentPage=1 \pagereference[begin]\fi - % - \expanded{\writetolist[figurelist]{\CurrentPage}{\XMLflush{rl:label}}}% - \expanded{\figureindex{\CurrentPage}{\XMLflush{rl:label}}}% - \startnotmode[compact]% - \vbox to 100pt - {\hsize30pt - \vskip5pt - \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% - \vfill}% - \advance\hsize by -30pt - \stopnotmode - \startmode[compact]% - \advance\hsize by -10pt - \hskip10pt - \stopmode - \button % \framed - [width=150pt,height=100pt,offset=10pt,frame=off, - background=color,backgroundcolor=white,color=] - {\externalfigure - [\XMLflush{rl:file}] - %[maxheight=80pt,frame=off,maxwidth=130pt,factor=max]}% - [factor=max]}% - [GridPg]% - \let\FigWid\figurenaturalwidth - \let\FigHei\figurenaturalheight - \advance\hsize by -150pt - \hskip10pt - \advance\hsize by -10pt - \vbox to 100pt - {\hsize40pt - %\externalfigure - % [paper] - % [type=buffer,frame=on, - % framecolor=darkred,rulethickness=.5pt, - % width=40pt,object=no] - \framed - [offset=overlay, - framecolor=darkred, - rulethickness=.5pt] - {\scale[width=40pt]{\setups[paper]}}% - \startmode[compact]% - \vfill - \hbox to \hsize{\hss\strut\bf\CurrentPage\hss}% - \stopmode - \vfill}% - \advance\hsize by -40pt - \hskip10pt - \advance\hsize by -10pt - \vbox to 100pt - {\blank[disable] - \starttabulate[|Bel|p|] - \NC file \NC \XMLflush{rl:file} \NC \NR - \doifXMLdata{rl:label} - {\NC label \NC \XMLflush{rl:label} \NC \NR} - \NC w$\times$h \NC \FigWid$\times$\FigHei \NC \NR - \doifXMLdata{rl:copyright} - {\NC copyright \NC \XMLflush{rl:copyright} \NC \NR} - \doifXMLdata{rl:status} - {\doifelse{\XMLflush{rl:status}}{obsolete} - {\NC status \NC \dontleavehmode \color[darkred]{\bf\XMLflush{rl:status}} \NC \NR} - {\NC status \NC \XMLflush{rl:status} \NC \NR}} - \doifXMLdata{rl:comment} - {\NC comment \NC \XMLflush{rl:comment} \NC \NR} - \stoptabulate - \vfill}}}% - [Figure] - \vskip10pt - \egroup} - -\def\StartFigureC - {\StartFigureA} - -\def\StopFigureC - {\doglobal\increment\NumberOfFigures - \egroup} - \setuplayout - [topspace=15pt,backspace=15pt, - header=0pt,footer=0pt,bottom=20pt,bottomdistance=10pt, - width=middle,height=fit] + [topspace=15pt, + backspace=15pt, + header=0pt, + footer=0pt, + bottom=20pt, + bottomdistance=10pt, + width=middle, + height=fit] \setupbackgrounds [page] @@ -325,9 +91,6 @@ [width=max, height=max] -\setupcolors - [state=start] - \setupinteraction [style=, color=, @@ -338,9 +101,6 @@ [section] [style=bfb] -% \setupbodyfont -% [pos] - \setupinteractionmenu [bottom] [left=\hfill, @@ -352,40 +112,16 @@ foregroundcolor=white] \startinteractionmenu[bottom] - \but [begin] begin \\ - \but [index] index \\ - \but [list] list \\ - \but [CloseDocument] close \\ - \but [PreviousJump] go back \\ + \but [begin] begin \\ + \but [index] index \\ + \but [list] list \\ + \but [CloseDocument] close \\ + \but [PreviousJump] go back \\ \stopinteractionmenu \setupinteraction [openaction=begin] -\defineXMLenvironment [rl:figurelibrary] \StartLibrary \StopLibrary -\defineXMLenvironment [rl:library] \StartLibrary \StopLibrary - -\starttext - -\def\StartLibrary{\mainlanguage[\XMLpar{rl:library}{language}{en}]} -\def\StopLibrary {} - -\defineXMLignore [rl:description] -\defineXMLenvironment [rl:figure] \StartFigureC \StopFigureC - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} - -\increment\NumberOfFigures - -\defineXMLignore [rl:description] -\defineXMLenvironment [rl:figure] \StartFigureA \StopFigureA - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} - \setuppapersize [S6][S6] @@ -396,92 +132,297 @@ \setupinteraction [menu=on] -\defineXMLenvironment [rl:description] \StartDescription \StopDescription -\defineXMLenvironment [rl:figure] \StartFigureB \StopFigureB - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} \page - -\subject [list] {List of figures} - -\placelist[figurelist] \page - -\subject [index] {Index of figures} - -\startcolumns -\placeregister[figureindex] -\stopcolumns - -\doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} - -\startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} - numeric gdx, gdy, lbx, lby ; - if \MPvar{type}=1 : - gdx := \MPvar{dy} ; - gdy := \MPvar{dx} ; - else : - gdx := OverlayWidth /\MPvar{nx} ; - gdy := OverlayHeight/\MPvar{ny} ; - fi ; - lbx := gdx ; - lby := gdy ; - defaultfont := "\truefontname{Mono}" ; - defaultscale := .5 ; - numeric pen ; pen := .25pt ; - def MyGrid text t = - draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; - draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; - enddef ; - pickup pencircle scaled pen ; - MyGrid withcolor white ; - MyGrid dashed evenly scaled pen ; - draw OverlayBox withcolor white ; - draw OverlayBox dashed evenly scaled pen ; - draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; - draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; - setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; -\stopuniqueMPgraphic - -\presetMPvariable[clipgrid][dx=10pt] -\presetMPvariable[clipgrid][dy=10pt] -\presetMPvariable[clipgrid][nx=10] -\presetMPvariable[clipgrid][ny=10] - -\startmode[clipgrid-distance] - \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] +\setupbodyfont + [tt,10pt] + +\definesymbol [attachment] [{\strut\bf\color[darkred]{\jobname.xml}}] +\setupattachments [symbol=attachment,alternative=] +\useattachment [datafile] [\inputfilename] + +\xmlloadonly{main}{\inputfilename}{} + +\mainlanguage[\xmlattributedef{main}{/rl:library}{language}{en}] + +\startxmlsetups xml:resource:asis + \startTEXpage[pagestate=start] + \xmldoifelsetext{#1}{/rl:label} { + \edef\CurrentLabel{\xmltext{#1}{rl:label}} + } { + \edef\CurrentLabel{\xmltext{#1}{rl:file}} + } + \pagereference [ + asis:\CurrentLabel + ] + \gotobox { + \externalfigure[\xmltext{#1}{/rl:file}] + }[% tricky no space before [ + data:\CurrentLabel + ] + \stopTEXpage +\stopxmlsetups + +\definemeasure[figure:width] [210mm] +\definemeasure[figure:height][297mm] + +\startmode[letter] + \enablemode[previewpage-letter] +\stopmode + +\startmode[previewpage-A4] + \definemeasure[figure:width] [210mm] + \definemeasure[figure:height][297mm] +\stopmode + +\startmode[previewpage-letter] + \definemeasure[figure:width] [8.5in] + \definemeasure[figure:height][11in] \stopmode -\startmode[clipgrid-steps] - \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] +\startmode[previewpage-S6] + \definemeasure[figure:width] [600pt] + \definemeasure[figure:height][450pt] \stopmode -\setupexternalfigures - [background={color,foreground,grid}, - backgroundcolor=white] - -\def\StartFigureD - {\StartFigureA} - -\def\StopFigureD - {\doglobal\increment\CurrentPage - \setupbackgrounds[page][background=page] - \startpagefigure[\XMLflush{rl:file}][offset=20pt]% - \doifelsenothing{\XMLflush{rl:label}} - {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% - \expanded{\pagereference[grid:\XMLflush{rl:file}]}} - {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% - \expanded{\pagereference[grid:\XMLflush{rl:label}]}} - \stoppagefigure - %\pagefigure[\XMLflush{rl:file}][offset=20pt] - \setupbackgrounds[page][background=] - \egroup} - -\defineXMLignore [rl:description] -\defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD - -\doglobal\newcounter\CurrentPage - -\processXMLfilegrouped{\jobfullname} \page +\startxmlsetups xml:resource:a + \button + [ + width=150pt, + height=100pt, + offset=10pt, + frame=off, + background=color, + backgroundcolor=white, + color= + ] + { + \externalfigure + [\xmltext{#1}{rl:file}] + [factor=max] + } + [ + grid:\CurrentLabel + ] +\stopxmlsetups + +\startxmlsetups xml:resource:b + \framed + [ + width=150pt, + height=100pt, + offset=10pt, + frame=off, + background=color, + backgroundcolor=white, + color= + ] + { + \externalfigure [ + \xmltext{#1}{rl:file} + ] [ + factor=max + ] + } +\stopxmlsetups + +\startxmlsetups xml:resource:data + + % using a layer makes more sense but we had this ... + + \xmldoifelsetext{#1}{/rl:label} { + \edef\CurrentLabel{\xmltext{#1}{rl:label}} + } { + \edef\CurrentLabel{\xmltext{#1}{rl:file}} + } + + \button { + \hbox to \hsize { + \forgetall + \dontcomplain + \pagereference[data:\CurrentLabel] + + %\ifnum\CurrentPage=1 \pagereference[begin]\fi + + \expanded{\figureindex{\xmltext{#1}{/rl:label}}} + + \vbox to 100pt { + \hsize30pt + \vskip5pt + \hbox to \hsize { + \hss + \strut + \bf + \at[asis:\CurrentLabel] + \hss + } + \vfill + } + \advance\hsize by -30pt + \doifmodeelse {clipgrid-distance,clipgrid-steps} { + \xmlsetup{#1}{xml:resource:a} + } { + \xmlsetup{#1}{xml:resource:b} + } + \edef\CurrentWidth {\the\dimexpr\figurenaturalwidth} + \edef\CurrentHeight{\the\dimexpr\figurenaturalheight} + \advance\hsize by -150pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt { + \hsize40pt + \framed [ + offset=overlay, + framecolor=darkred, + rulethickness=.5pt + ] { + \scale [ + width=40pt + ] { + \framed [ + width=\measure{figure:width}, + height=\measure{figure:height}, + offset=overlay, + frame=off, + background=color, + backgroundcolor=white + ] { + \externalfigure + [ + \xmltext{#1}{rl:file} + ] [ + reset=yes + ] + } + } + } + \vfill + } + \advance\hsize by -40pt + \hskip10pt + \advance\hsize by -10pt + \vbox to 100pt { + \blank[disable] + \starttabulate[|Bel|p|] + \NC file \NC \xmltext{#1}{/rl:file} \NC \NR + \xmldoif{#1}{/rl:label} {\NC label \NC \xmltext{#1}{/rl:label} \NC \NR} + \NC dimensions \NC \CurrentWidth\ * \CurrentHeight \NC \NR + \xmldoif{#1}{/rl:copyright} {\NC copyright \NC \xmltext{#1}{/rl:copyright} \NC \NR} + \xmldoif{#1}{/rl:status} {\NC status \NC \xmltext{#1}{/rl:status} \NC \NR} + \xmldoif{#1}{/rl:comment} {\NC comment \NC \xmltext{#1}{/rl:comment} \NC \NR} + \stoptabulate + \vfill + } + } + } [ + asis:\CurrentLabel + ] + + \vskip10pt + +\stopxmlsetups + +\startxmlsetups xml:description + + \starttabulate[|lBe|p|] + \xmldoif{#1}{/rl:organization} {\NC organization \NC \xmltext{#1}{/rl:organization} \NC \NR} + \xmldoif{#1}{/rl:project} {\NC project \NC \xmltext{#1}{/rl:project} \NC \NR} + \xmldoif{#1}{/rl:product} {\NC product \NC \xmltext{#1}{/rl:product} \NC \NR} + \xmldoif{#1}{/rl:comment} {\NC comment \NC \xmltext{#1}{/rl:comment} \NC \NR} + \NC specification \NC \attachment[datafile] \NC \NR + \stoptabulate + +\stopxmlsetups + +\starttext + + \xmlfilter{main}{/rl:library/rl:resource/command(xml:resource:asis)} + + \subject {Figure collection} + + \xmlfilter{main}{/rl:library/rl:description/command(xml:description)} + + \subject [list] {List of figures} + + \xmlfilter{main}{/rl:library/rl:resource/command(xml:resource:data)} + + \page + + \subject [index] {Index of figures} + + \startcolumns + \placeregister[figureindex] + \stopcolumns + +\stoptext + +% \doifmodeelse{clipgrid-distance,clipgrid-steps}{\page}{\stoptext} + +% \startuniqueMPgraphic{clipgrid}{dx,dy,nx,ny,type} +% numeric gdx, gdy, lbx, lby ; +% if \MPvar{type}=1 : +% gdx := \MPvar{dy} ; +% gdy := \MPvar{dx} ; +% else : +% gdx := OverlayWidth /\MPvar{nx} ; +% gdy := OverlayHeight/\MPvar{ny} ; +% fi ; +% lbx := gdx ; +% lby := gdy ; +% defaultfont := "\truefontname{Mono}" ; +% defaultscale := .5 ; +% numeric pen ; pen := .25pt ; +% def MyGrid text t = +% draw vlingrid (0,OverlayWidth ,gdy,OverlayWidth ,OverlayHeight) t ; +% draw hlingrid (0,OverlayHeight,gdx,OverlayHeight,OverlayWidth ) t ; +% enddef ; +% pickup pencircle scaled pen ; +% MyGrid withcolor white ; +% MyGrid dashed evenly scaled pen ; +% draw OverlayBox withcolor white ; +% draw OverlayBox dashed evenly scaled pen ; +% draw vlinlabel.bot(0,eps+OverlayWidth /lby,2,OverlayWidth ) ; +% draw hlinlabel.lft(0,eps+OverlayHeight/lbx,2,OverlayHeight) ; +% setbounds currentpicture to OverlayBox enlarged (2*EmWidth) ; +% \stopuniqueMPgraphic + +% \presetMPvariable[clipgrid][dx=10pt] +% \presetMPvariable[clipgrid][dy=10pt] +% \presetMPvariable[clipgrid][nx=10] +% \presetMPvariable[clipgrid][ny=10] + +% \startmode[clipgrid-distance] +% \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=1}] +% \stopmode + +% \startmode[clipgrid-steps] +% \defineoverlay[grid][\uniqueMPgraphic{clipgrid}{type=2}] +% \stopmode + +% \setupexternalfigures +% [background={color,foreground,grid}, +% backgroundcolor=white] + +% \def\StartFigureD +% {\StartFigureA} + +% \def\StopFigureD +% {\doglobal\increment\CurrentPage +% \setupbackgrounds[page][background=page] +% \startpagefigure[\XMLflush{rl:file}][offset=20pt]% +% \doifelsenothing{\XMLflush{rl:label}} +% {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}% +% \expanded{\pagereference[grid:\XMLflush{rl:file}]}} +% {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}% +% \expanded{\pagereference[grid:\XMLflush{rl:label}]}} +% \stoppagefigure +% %\pagefigure[\XMLflush{rl:file}][offset=20pt] +% \setupbackgrounds[page][background=] +% \egroup} + +% \defineXMLignore [rl:description] +% \defineXMLenvironment [rl:figure] \StartFigureD \StopFigureD + +% \doglobal\newcounter\CurrentPage + +% \processXMLfilegrouped{\jobfullname} \page \stoptext diff --git a/tex/context/base/x-res-50.mkiv b/tex/context/base/x-res-50.mkiv index b4c6b4560..87b63dd97 100644 --- a/tex/context/base/x-res-50.mkiv +++ b/tex/context/base/x-res-50.mkiv @@ -11,7 +11,9 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -%D TO BE REDONE! +%D The xml mapping has to be redone! + +\endinput %D This is a preliminary module, using a preliminary xml media format that %D looks as follows (record is embedded in resource library element): diff --git a/tex/context/base/x-set-01.mkii b/tex/context/base/x-set-01.mkii new file mode 100644 index 000000000..75e1d43e2 --- /dev/null +++ b/tex/context/base/x-set-01.mkii @@ -0,0 +1,79 @@ +%D \module +%D [ file=x-set-01, +%D version=2004.10.31, +%D remark=setupx.tex: 1998.07.20 and later, +%D title=\CONTEXT\ Setup Mappings, +%D subtitle=Macro Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D This file is obsolete. + +\endinput + +\unprotect + +\def\SETUPnamespace{xmlns:cd="http://www.pragma-ade.com/commands"} + +\bgroup \catcode`\<=\@@other + +\unexpanded\gdef\dostring#1#2#3% + {\immediate\write\scratchwrite{#1<#2cd:#3>}} + +\gdef\doline#1% + {\immediate\write\scratchwrite{#1}} + +\egroup + +\def\startsetupfile + {\immediate\openout\scratchwrite=keys-\currentlanguage.xml + \doline{\string} + \doline{} + \dostring{}{}{interface \SETUPnamespace\space name="context" language="\currentlanguage" version="\contextversion"}} + +\def\stopsetupfile + {\doline{} + \dostring{}{/}{interface} + \immediate\closeout\scratchwrite} + +\def\interfacecomponenttoxml#1#2#3% + {\doifelse{#3}\nointerfaceobject + {\dostring{\space\space\space\space}{}{#1 name="#2" value="#2"/}} + {\dostring{\space\space\space\space}{}{#1 name="#2" value="#3"/}}} + +\def\setinterfaceconstant{\interfacecomponenttoxml{constant}} +\def\setinterfacevariable{\interfacecomponenttoxml{variable}} +\def\setinterfaceelement {\interfacecomponenttoxml{element}} +\def\setinterfacecommand {\interfacecomponenttoxml{command}} + +\def\startinterfacexmlcomponent{\doline{}\dostring{\space\space}{}} % #1 +\def\stopinterfacexmlcomponent {\dostring{\space\space}{/}} % #1 + +\let\normalstartvariables\startvariables \let\normalstopvariables\stopvariables +\let\normalstartconstants\startconstants \let\normalstopconstants\stopconstants +\let\normalstartcommands \startcommands \let\normalstopcommands \stopcommands +\let\normalstartelements \startelements \let\normalstopelements \stopelements + +\def\startvariables{\startinterfacexmlcomponent{variables}\normalstartvariables} +\def\startconstants{\startinterfacexmlcomponent{constants}\normalstartconstants} +\def\startcommands {\startinterfacexmlcomponent{commands} \normalstartcommands } +\def\startelements {\startinterfacexmlcomponent{elements} \normalstartelements } + +\def\stopvariables{\stopinterfacexmlcomponent{variables}\normalstopvariables} +\def\stopconstants{\stopinterfacexmlcomponent{constants}\normalstopconstants} +\def\stopcommands {\stopinterfacexmlcomponent{commands} \normalstopcommands } +\def\stopelements {\stopinterfacexmlcomponent{elements} \normalstopelements } + +\protect + +\starttext + \startsetupfile + \input mult-con.tex + \input mult-com.tex + \stopsetupfile +\stoptext diff --git a/tex/context/base/x-set-01.tex b/tex/context/base/x-set-01.tex deleted file mode 100644 index 75e1d43e2..000000000 --- a/tex/context/base/x-set-01.tex +++ /dev/null @@ -1,79 +0,0 @@ -%D \module -%D [ file=x-set-01, -%D version=2004.10.31, -%D remark=setupx.tex: 1998.07.20 and later, -%D title=\CONTEXT\ Setup Mappings, -%D subtitle=Macro Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D This file is obsolete. - -\endinput - -\unprotect - -\def\SETUPnamespace{xmlns:cd="http://www.pragma-ade.com/commands"} - -\bgroup \catcode`\<=\@@other - -\unexpanded\gdef\dostring#1#2#3% - {\immediate\write\scratchwrite{#1<#2cd:#3>}} - -\gdef\doline#1% - {\immediate\write\scratchwrite{#1}} - -\egroup - -\def\startsetupfile - {\immediate\openout\scratchwrite=keys-\currentlanguage.xml - \doline{\string} - \doline{} - \dostring{}{}{interface \SETUPnamespace\space name="context" language="\currentlanguage" version="\contextversion"}} - -\def\stopsetupfile - {\doline{} - \dostring{}{/}{interface} - \immediate\closeout\scratchwrite} - -\def\interfacecomponenttoxml#1#2#3% - {\doifelse{#3}\nointerfaceobject - {\dostring{\space\space\space\space}{}{#1 name="#2" value="#2"/}} - {\dostring{\space\space\space\space}{}{#1 name="#2" value="#3"/}}} - -\def\setinterfaceconstant{\interfacecomponenttoxml{constant}} -\def\setinterfacevariable{\interfacecomponenttoxml{variable}} -\def\setinterfaceelement {\interfacecomponenttoxml{element}} -\def\setinterfacecommand {\interfacecomponenttoxml{command}} - -\def\startinterfacexmlcomponent{\doline{}\dostring{\space\space}{}} % #1 -\def\stopinterfacexmlcomponent {\dostring{\space\space}{/}} % #1 - -\let\normalstartvariables\startvariables \let\normalstopvariables\stopvariables -\let\normalstartconstants\startconstants \let\normalstopconstants\stopconstants -\let\normalstartcommands \startcommands \let\normalstopcommands \stopcommands -\let\normalstartelements \startelements \let\normalstopelements \stopelements - -\def\startvariables{\startinterfacexmlcomponent{variables}\normalstartvariables} -\def\startconstants{\startinterfacexmlcomponent{constants}\normalstartconstants} -\def\startcommands {\startinterfacexmlcomponent{commands} \normalstartcommands } -\def\startelements {\startinterfacexmlcomponent{elements} \normalstartelements } - -\def\stopvariables{\stopinterfacexmlcomponent{variables}\normalstopvariables} -\def\stopconstants{\stopinterfacexmlcomponent{constants}\normalstopconstants} -\def\stopcommands {\stopinterfacexmlcomponent{commands} \normalstopcommands } -\def\stopelements {\stopinterfacexmlcomponent{elements} \normalstopelements } - -\protect - -\starttext - \startsetupfile - \input mult-con.tex - \input mult-com.tex - \stopsetupfile -\stoptext diff --git a/tex/context/base/x-set-02.mkii b/tex/context/base/x-set-02.mkii new file mode 100644 index 000000000..bb0b7583c --- /dev/null +++ b/tex/context/base/x-set-02.mkii @@ -0,0 +1,30 @@ +%D \module +%D [ file=x-set-02, +%D version=2004.10.31, +%D remark=setupx.tex: 1998.07.20 and later, +%D title=\CONTEXT\ Setup Mappings, +%D subtitle=Macro Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\unprotect \bgroup \catcode`\<=\@@other + +\def\setinterfacecomponent#1#2#3% + {\setgvalue{\string<#1\string:#2\string>}{#3}} + +\gdef\getinterfacecomponent#1#2% + {\executeifdefined{\string<#1\string:#2\string>}{#2}} + +\def\setinterfaceconstant{\setinterfacecomponent{constant}} % constant +\def\setinterfacevariable{\setinterfacecomponent{variable}} % variable +\def\setinterfaceelement {\setinterfacecomponent{string}} % element +\def\setinterfacecommand {\setinterfacecomponent{string}} % command + +\input mult-\userinterfacetag + +\egroup \protect \endinput diff --git a/tex/context/base/x-set-02.tex b/tex/context/base/x-set-02.tex deleted file mode 100644 index bb0b7583c..000000000 --- a/tex/context/base/x-set-02.tex +++ /dev/null @@ -1,30 +0,0 @@ -%D \module -%D [ file=x-set-02, -%D version=2004.10.31, -%D remark=setupx.tex: 1998.07.20 and later, -%D title=\CONTEXT\ Setup Mappings, -%D subtitle=Macro Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\unprotect \bgroup \catcode`\<=\@@other - -\def\setinterfacecomponent#1#2#3% - {\setgvalue{\string<#1\string:#2\string>}{#3}} - -\gdef\getinterfacecomponent#1#2% - {\executeifdefined{\string<#1\string:#2\string>}{#2}} - -\def\setinterfaceconstant{\setinterfacecomponent{constant}} % constant -\def\setinterfacevariable{\setinterfacecomponent{variable}} % variable -\def\setinterfaceelement {\setinterfacecomponent{string}} % element -\def\setinterfacecommand {\setinterfacecomponent{string}} % command - -\input mult-\userinterfacetag - -\egroup \protect \endinput diff --git a/tex/context/base/x-set-11.mkii b/tex/context/base/x-set-11.mkii index 450382a95..3207ef5f9 100644 --- a/tex/context/base/x-set-11.mkii +++ b/tex/context/base/x-set-11.mkii @@ -16,7 +16,271 @@ % % texmfstart texexec --int=nl --pdf --global --result=setup-nl x-set-12 -\usemodule[set-99] % interface messages +\startmessages dutch library: setup + title: setup + formula: formule + number: getal + list: lijst + dimension: maat + mark: markering + reference: verwijzing + command: commando + file: file + name: naam + identifier: naam + text: tekst + section: sectie + singular: naam enkelvoud + plural: naam meervoud + matrix: n*m + see: zie + inherits: erft van + 1: de karakters < en > zijn globaal actief! + 2: -- wordt verwerkt + 3: -- is niet gedefinieerd + 4: -- wordt nogmaals verwerkt + optional: optioneel + displaymath: formule + index: ingang + math: formule + nothing: leeg + file: file + position: positie + reference: verwijzing + csname: naam + destination: bestemming + triplet: triplet + word: woord + content: tekst +\stopmessages + +\startmessages english library: setup + title: setup + formula: formula + number: number + list: list + dimension: dimension + mark: mark + reference: reference + command: command + file: file + name: name + identifier: identifier + text: text + section: section + singular: singular name + plural: plural name + matrix: n*m + see: see + inherits: inherits from + 1: the characters < and > are globally active! + 2: -- is processed + 3: -- is undefined + 4: -- is processed again + optional: optional + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages german library: setup + title: Setup + formula: Formel + number: Nummer + list: Liste + dimension: Dimension + mark: Beschriftung + reference: Referenz + command: Befehl + file: Datei + name: Name + identifier: Name + text: Text + section: Abschnitt + singular: singular + plural: plural + matrix: n*m + see: siehe + inherits: inherits from + 1: Die Zeichen < und > gelten global! + 2: -- wird verarbeitet + 3: -- ist undefiniert + 4: -- ist mehrmals verarbeitet + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages czech library: setup + title: setup + formula: rovnice + number: cislo + list: seznam + dimension: dimenze + mark: znacka + reference: reference + command: prikaz + file: soubor + name: jmeno + identifier: jmeno + text: text + section: sekce + singular: jmeno v singularu + plural: jmeno v pluralu + matrix: n*m + see: viz + inherits: inherits from + 1: znaky < a > jsou globalne aktivni! + 2: -- je zpracovano + 3: -- je nedefinovano + 4: -- je zpracovano znovu + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages italian library: setup + title: setup + formula: formula + number: number + list: list + dimension: dimension + mark: mark + reference: reference + command: command + file: file + name: name + identifier: name + text: text + section: section + singular: singular name + plural: plural name + matrix: n*m + see: see + inherits: inherits from + 1: the characters < and > are globally active! + 2: -- is processed + 3: -- is undefined + 4: -- is processed again + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages romanian library: setup + title: setari + formula: formula + number: numar + list: lista + dimension: dimensiune + mark: marcaj + reference: referinta + command: comanda + file: fisier + name: nume + identifier: nume + text: text + section: sectiune + singular: nume singular + plural: nume pluram + matrix: n*m + see: vezi + inherits: inherits from + 1: caracterele < si > sunt active global! + 2: este procesat -- + 3: -- este nedefinit + 4: -- este procesat din nou + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages french library: setup + title: réglage + formula: formule + number: numéro + list: liste + dimension: dimension + mark: marquage + reference: reference + command: commande + file: fichier + name: nom + identifier: identificateur + text: texte + section: section + singular: nom singulier + plural: nom pluriel + matrix: n*m + see: vois + inherits: herite de + 1: les caractères < et > sont globalement actifs ! + 2: -- est traité + 3: -- n'est pas défini + 4: -- est traité de nouveau + optional: optionel + displaymath: formule + index: entrée + math: formule + nothing: vide + file: fichier + position: position + reference: réference + csname: nom + destination: destination + triplet: triplet + word: mot + content: texte +\stopmessages \unprotect diff --git a/tex/context/base/x-set-11.mkiv b/tex/context/base/x-set-11.mkiv index f445459ee..4db75ef06 100644 --- a/tex/context/base/x-set-11.mkiv +++ b/tex/context/base/x-set-11.mkiv @@ -34,7 +34,271 @@ % % register, interaction -\usemodule[set-99] % interface messages +\startmessages dutch library: setup + title: setup + formula: formule + number: getal + list: lijst + dimension: maat + mark: markering + reference: verwijzing + command: commando + file: file + name: naam + identifier: naam + text: tekst + section: sectie + singular: naam enkelvoud + plural: naam meervoud + matrix: n*m + see: zie + inherits: erft van + 1: de karakters < en > zijn globaal actief! + 2: -- wordt verwerkt + 3: -- is niet gedefinieerd + 4: -- wordt nogmaals verwerkt + optional: optioneel + displaymath: formule + index: ingang + math: formule + nothing: leeg + file: file + position: positie + reference: verwijzing + csname: naam + destination: bestemming + triplet: triplet + word: woord + content: tekst +\stopmessages + +\startmessages english library: setup + title: setup + formula: formula + number: number + list: list + dimension: dimension + mark: mark + reference: reference + command: command + file: file + name: name + identifier: identifier + text: text + section: section + singular: singular name + plural: plural name + matrix: n*m + see: see + inherits: inherits from + 1: the characters < and > are globally active! + 2: -- is processed + 3: -- is undefined + 4: -- is processed again + optional: optional + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages german library: setup + title: Setup + formula: Formel + number: Nummer + list: Liste + dimension: Dimension + mark: Beschriftung + reference: Referenz + command: Befehl + file: Datei + name: Name + identifier: Name + text: Text + section: Abschnitt + singular: singular + plural: plural + matrix: n*m + see: siehe + inherits: inherits from + 1: Die Zeichen < und > gelten global! + 2: -- wird verarbeitet + 3: -- ist undefiniert + 4: -- ist mehrmals verarbeitet + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages czech library: setup + title: setup + formula: rovnice + number: cislo + list: seznam + dimension: dimenze + mark: znacka + reference: reference + command: prikaz + file: soubor + name: jmeno + identifier: jmeno + text: text + section: sekce + singular: jmeno v singularu + plural: jmeno v pluralu + matrix: n*m + see: viz + inherits: inherits from + 1: znaky < a > jsou globalne aktivni! + 2: -- je zpracovano + 3: -- je nedefinovano + 4: -- je zpracovano znovu + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages italian library: setup + title: setup + formula: formula + number: number + list: list + dimension: dimension + mark: mark + reference: reference + command: command + file: file + name: name + identifier: name + text: text + section: section + singular: singular name + plural: plural name + matrix: n*m + see: see + inherits: inherits from + 1: the characters < and > are globally active! + 2: -- is processed + 3: -- is undefined + 4: -- is processed again + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages romanian library: setup + title: setari + formula: formula + number: numar + list: lista + dimension: dimensiune + mark: marcaj + reference: referinta + command: comanda + file: fisier + name: nume + identifier: nume + text: text + section: sectiune + singular: nume singular + plural: nume pluram + matrix: n*m + see: vezi + inherits: inherits from + 1: caracterele < si > sunt active global! + 2: este procesat -- + 3: -- este nedefinit + 4: -- este procesat din nou + optional: optioneel + displaymath: formula + index: entry + math: formula + nothing: empty + file: file + position: position + reference: reference + csname: name + destination: destination + triplet: triplet + word: word + content: text +\stopmessages + +\startmessages french library: setup + title: réglage + formula: formule + number: numéro + list: liste + dimension: dimension + mark: marquage + reference: reference + command: commande + file: fichier + name: nom + identifier: identificateur + text: texte + section: section + singular: nom singulier + plural: nom pluriel + matrix: n*m + see: vois + inherits: herite de + 1: les caractères < et > sont globalement actifs ! + 2: -- est traité + 3: -- n'est pas défini + 4: -- est traité de nouveau + optional: optionel + displaymath: formule + index: entrée + math: formule + nothing: vide + file: fichier + position: position + reference: réference + csname: nom + destination: destination + triplet: triplet + word: mot + content: texte +\stopmessages \unprotect diff --git a/tex/context/base/x-set-12.mkii b/tex/context/base/x-set-12.mkii new file mode 100644 index 000000000..d79901433 --- /dev/null +++ b/tex/context/base/x-set-12.mkii @@ -0,0 +1,258 @@ +%D \module +%D [ file=x-set-12, +%D version=2004.10.31, +%D remark=setupx.tex: 1998.07.20 and later, +%D title=\CONTEXT\ Setup Definitions, +%D subtitle=Macro Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\usemodule[set-11] + +\unprotect + +% \starttext +% \setup{installlanguage} +% \placesetup +% \stoptext + +\definecolor[TitleColor][r=.375,g=.125,b=.125] +\definecolor[TitleColor][r=.125,g=.375,b=.125] +\definecolor[TitleColor][r=.125,g=.125,b=.375] +\definecolor[TitleColor][r=.375,g=.375,b=.125] +\definecolor[TitleColor][r=.375,g=.125,b=.375] +\definecolor[TitleColor][r=.125,g=.375,b=.375] + +\definecolor[TitleColor][r=.25,g=.20,b=.15] +\definecolor[TitleColor][r=.25,g=.15,b=.20] +\definecolor[TitleColor][r=.20,g=.15,b=.25] +\definecolor[TitleColor][r=.20,g=.25,b=.15] +\definecolor[TitleColor][r=.15,g=.20,b=.25] +\definecolor[TitleColor][r=.15,g=.25,b=.20] + +\startinterface english \loadsetups[cont-en.xml] \stopinterface +\startinterface dutch \loadsetups[cont-nl.xml] \stopinterface +\startinterface german \loadsetups[cont-de.xml] \stopinterface +\startinterface french \loadsetups[cont-fr.xml] \stopinterface +\startinterface italian \loadsetups[cont-it.xml] \stopinterface +\startinterface czech \loadsetups[cont-cs.xml] \stopinterface +\startinterface romanian \loadsetups[cont-ro.xml] \stopinterface + +\startinterface dutch \definecolor[LocalColor][r=.75,g=.25,b=.25] \stopinterface +\startinterface english \definecolor[LocalColor][r=.25,g=.75,b=.25] \stopinterface +\startinterface german \definecolor[LocalColor][r=.25,g=.25,b=.75] \stopinterface +\startinterface french \definecolor[LocalColor][r=.75,g=.75,b=.25] \stopinterface +\startinterface czech \definecolor[LocalColor][r=.75,g=.25,b=.75] \stopinterface +\startinterface italian \definecolor[LocalColor][r=.25,g=.75,b=.75] \stopinterface +\startinterface romanian \definecolor[LocalColor][r=.5,g=.4,b=.3] \stopinterface +% \definecolor[LocalColor][r=.5,g=.3,b=.4] +% \definecolor[LocalColor][r=.4,g=.3,b=.5] +% \definecolor[LocalColor][r=.4,g=.5,b=.3] +% \definecolor[LocalColor][r=.3,g=.4,b=.5] +% \definecolor[LocalColor][r=.3,g=.5,b=.4] + +\startinterface english \definecolor[TitleColor][r=.375,g=.125,b=.125] \stopinterface +\startinterface dutch \definecolor[TitleColor][r=.125,g=.375,b=.125] \stopinterface +\startinterface german \definecolor[TitleColor][r=.125,g=.125,b=.375] \stopinterface +\startinterface french \definecolor[TitleColor][r=.375,g=.375,b=.125] \stopinterface +\startinterface italian \definecolor[TitleColor][r=.375,g=.125,b=.375] \stopinterface +\startinterface czech \definecolor[TitleColor][r=.125,g=.375,b=.375] \stopinterface +\startinterface romanian \definecolor[TitleColor][r=.25,g=.20,b=.15] \stopinterface +% \definecolor[TitleColor][r=.25,g=.15,b=.20] +% \definecolor[TitleColor][r=.20,g=.15,b=.25] +% \definecolor[TitleColor][r=.20,g=.25,b=.15] +% \definecolor[TitleColor][r=.15,g=.20,b=.25] +% \definecolor[TitleColor][r=.15,g=.25,b=.20] + +\definecolor [lightgray] [s=.9] +\definecolor [darkgray] [s=.1] + +\usetypescript[palatino] +\setupbodyfont[palatino,9pt] + +\setupcolors + [\c!state=\v!start] + +\defineoverlay + [cover] + [\hbox to \paperwidth{\hss\reuseMPgraphic{cover+back}}] + +\defineoverlay + [back] + [\hbox to \paperwidth{\reuseMPgraphic{cover+back}\hss}] + +\startreusableMPgraphic{cover+back} + numeric h, w ; path p, q, r ; color f, d ; pair s ; + h := OverlayHeight ; w := 2*OverlayWidth ; + r := unitsquare xyscaled (w,h) ; + fill r withcolor \MPcolor{lightgray} ; + set_grid(w,h,w/8,w/16) ; + forever : + s := center r randomized (w,h) ; + if new_on_grid(xpart s, ypart s) : + s := (dx,dy) ; + p := fullsquare xyscaled(w/4,w/8) ; + q := (-4w,ypart ulcorner p) -- + .5[ulcorner p, urcorner p] -- + (4w,ypart urcorner p) ; + q := q shifted (0,-w/24) ; + p := p randomized (w/40,w/40) ; + q := q randomized (0,w/100) ; + q := q cutafter (p cutafter point 3 of p) ; + q := q cutbefore (p cutbefore point 3 of p) ; + d := .5[\MPcolor{LocalColor},\MPcolor{lightgray}] randomized (.5,.9) ; + f := \MPcolor{lightgray} randomized (.5,.9) ; + pickup pencircle scaled (w/100) ; + fill p shifted s withcolor f ; + draw p shifted s withcolor d ; + draw q shifted s withcolor d ; + fi ; + exitif grid_full ; + endfor ; + setbounds currentpicture to r ; +\stopreusableMPgraphic + +\definelayout + [titlepage] + [\c!backspace=1cm, + \c!topspace=1cm, + \c!width=\v!middle, + \c!height=\v!middle, + \c!header=0pt, + \c!footer=0pt] + +\setuplayout + [\c!backspace=2cm, + \c!topspace=1.5cm, + \c!header=0cm, + \c!footer=0cm, + \c!width=\v!middle, + \c!height=\v!middle] + +\setuppagenumbering + [\c!alternative=\v!doublesided] + +\setupsetup + [\c!criterium=\v!all, + \c!reference=0] + +\setupframedtexts + [setuptext] + [\c!frame=\v!on, + \c!rulethickness=1pt, + \c!framecolor=TitleColor] + +\setupunderbar + [\c!rulethickness=1pt, + \c!rulecolor=TitleColor] + +\starttext + +\setupbackgrounds + [\v!rightpage] + [\c!background=cover] + +\setuplayout + [titlepage] + +\startsetups text:commands + \startinterface dutch \strut commando's \par \stopinterface + \startinterface english \strut commands \par \stopinterface + \startinterface german \strut befehle \par \stopinterface + \startinterface french \strut commandes \par \stopinterface + \startinterface czech \strut p\v{r}ikazy \par \stopinterface + \startinterface italian \strut comandi \par \stopinterface + \startinterface romanian \strut comenzile \par \stopinterface +\stopsetups + +\startsetups text:uppercase + \startinterface dutch NL\stopinterface + \startinterface english EN\stopinterface + \startinterface german DE\stopinterface + \startinterface french FR\stopinterface + \startinterface czech CS\stopinterface + \startinterface italian IT\stopinterface + \startinterface romanian RO\stopinterface +\stopsetups + +\startsetups text:lowercase + \startinterface dutch \strut nl / nederlands \par \stopinterface + \startinterface english \strut en / english \par \stopinterface + \startinterface german \strut de / deutsch \par \stopinterface + \startinterface french \strut fr / fran\c{c}ais \par \stopinterface + \startinterface czech \strut cs / \v{c}esk\'y \par \stopinterface + \startinterface italian \strut it / italiano \par \stopinterface + \startinterface romanian \strut ro / rom\^{a}n\u{a} \par \stopinterface +\stopsetups + +\startmakeup[\v!standard] + \dontcomplain + \setupalign[\v!left] + \startcolor[TitleColor] + \definedfont[RegularBold at 100pt]\setstrut + \strut Con\TeX t \par + \definedfont[RegularBold at 50pt]\setstrut + \setups[text:commands] + \vfill + \definedfont[RegularBold at 150pt]\setstrut + \setups[text:uppercase] + \stopcolor +\stopmakeup + +\setuplayout % needed ? + +\setupbackgrounds + [\v!rightpage] + [\c!background=] + +\startmakeup[\v!standard] + \dontcomplain + \startcolor[TitleColor] + \definedfont[RegularBold at 100pt]\setstrut + \setupalign[\v!left] + \strut Con\TeX t \par + \definedfont[RegularBold at 50pt]\setstrut + \setups[text:commands] + \vfill + \definedfont[RegularBold at 24pt]\setupinterlinespace + \setups[text:lowercase] + \par \strut \currentdate \par + \stopcolor +\stopmakeup + +\protect + +\placeeverysetup + +\unprotect + +\page[\v!yes,\v!blank,\v!right,\v!left] + +\setuplayout + [titlepage] + +\setupbackgrounds + [\v!leftpage] + [\c!background=back] + +\startmakeup[\v!standard][\c!page=] + \dontcomplain + \startcolor[TitleColor] + \definedfont[RegularBold at 24pt]\setupinterlinespace + \setupalign[\v!left] + \vfill + PRAGMA ADE \par + Ridderstraat 27 \par + 8061GH Hasselt NL \par + www.pragma-ade.com \par + \stopcolor +\stopmakeup + +\protect + +\stoptext diff --git a/tex/context/base/x-set-12.mkiv b/tex/context/base/x-set-12.mkiv new file mode 100644 index 000000000..d79901433 --- /dev/null +++ b/tex/context/base/x-set-12.mkiv @@ -0,0 +1,258 @@ +%D \module +%D [ file=x-set-12, +%D version=2004.10.31, +%D remark=setupx.tex: 1998.07.20 and later, +%D title=\CONTEXT\ Setup Definitions, +%D subtitle=Macro Definitions, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\usemodule[set-11] + +\unprotect + +% \starttext +% \setup{installlanguage} +% \placesetup +% \stoptext + +\definecolor[TitleColor][r=.375,g=.125,b=.125] +\definecolor[TitleColor][r=.125,g=.375,b=.125] +\definecolor[TitleColor][r=.125,g=.125,b=.375] +\definecolor[TitleColor][r=.375,g=.375,b=.125] +\definecolor[TitleColor][r=.375,g=.125,b=.375] +\definecolor[TitleColor][r=.125,g=.375,b=.375] + +\definecolor[TitleColor][r=.25,g=.20,b=.15] +\definecolor[TitleColor][r=.25,g=.15,b=.20] +\definecolor[TitleColor][r=.20,g=.15,b=.25] +\definecolor[TitleColor][r=.20,g=.25,b=.15] +\definecolor[TitleColor][r=.15,g=.20,b=.25] +\definecolor[TitleColor][r=.15,g=.25,b=.20] + +\startinterface english \loadsetups[cont-en.xml] \stopinterface +\startinterface dutch \loadsetups[cont-nl.xml] \stopinterface +\startinterface german \loadsetups[cont-de.xml] \stopinterface +\startinterface french \loadsetups[cont-fr.xml] \stopinterface +\startinterface italian \loadsetups[cont-it.xml] \stopinterface +\startinterface czech \loadsetups[cont-cs.xml] \stopinterface +\startinterface romanian \loadsetups[cont-ro.xml] \stopinterface + +\startinterface dutch \definecolor[LocalColor][r=.75,g=.25,b=.25] \stopinterface +\startinterface english \definecolor[LocalColor][r=.25,g=.75,b=.25] \stopinterface +\startinterface german \definecolor[LocalColor][r=.25,g=.25,b=.75] \stopinterface +\startinterface french \definecolor[LocalColor][r=.75,g=.75,b=.25] \stopinterface +\startinterface czech \definecolor[LocalColor][r=.75,g=.25,b=.75] \stopinterface +\startinterface italian \definecolor[LocalColor][r=.25,g=.75,b=.75] \stopinterface +\startinterface romanian \definecolor[LocalColor][r=.5,g=.4,b=.3] \stopinterface +% \definecolor[LocalColor][r=.5,g=.3,b=.4] +% \definecolor[LocalColor][r=.4,g=.3,b=.5] +% \definecolor[LocalColor][r=.4,g=.5,b=.3] +% \definecolor[LocalColor][r=.3,g=.4,b=.5] +% \definecolor[LocalColor][r=.3,g=.5,b=.4] + +\startinterface english \definecolor[TitleColor][r=.375,g=.125,b=.125] \stopinterface +\startinterface dutch \definecolor[TitleColor][r=.125,g=.375,b=.125] \stopinterface +\startinterface german \definecolor[TitleColor][r=.125,g=.125,b=.375] \stopinterface +\startinterface french \definecolor[TitleColor][r=.375,g=.375,b=.125] \stopinterface +\startinterface italian \definecolor[TitleColor][r=.375,g=.125,b=.375] \stopinterface +\startinterface czech \definecolor[TitleColor][r=.125,g=.375,b=.375] \stopinterface +\startinterface romanian \definecolor[TitleColor][r=.25,g=.20,b=.15] \stopinterface +% \definecolor[TitleColor][r=.25,g=.15,b=.20] +% \definecolor[TitleColor][r=.20,g=.15,b=.25] +% \definecolor[TitleColor][r=.20,g=.25,b=.15] +% \definecolor[TitleColor][r=.15,g=.20,b=.25] +% \definecolor[TitleColor][r=.15,g=.25,b=.20] + +\definecolor [lightgray] [s=.9] +\definecolor [darkgray] [s=.1] + +\usetypescript[palatino] +\setupbodyfont[palatino,9pt] + +\setupcolors + [\c!state=\v!start] + +\defineoverlay + [cover] + [\hbox to \paperwidth{\hss\reuseMPgraphic{cover+back}}] + +\defineoverlay + [back] + [\hbox to \paperwidth{\reuseMPgraphic{cover+back}\hss}] + +\startreusableMPgraphic{cover+back} + numeric h, w ; path p, q, r ; color f, d ; pair s ; + h := OverlayHeight ; w := 2*OverlayWidth ; + r := unitsquare xyscaled (w,h) ; + fill r withcolor \MPcolor{lightgray} ; + set_grid(w,h,w/8,w/16) ; + forever : + s := center r randomized (w,h) ; + if new_on_grid(xpart s, ypart s) : + s := (dx,dy) ; + p := fullsquare xyscaled(w/4,w/8) ; + q := (-4w,ypart ulcorner p) -- + .5[ulcorner p, urcorner p] -- + (4w,ypart urcorner p) ; + q := q shifted (0,-w/24) ; + p := p randomized (w/40,w/40) ; + q := q randomized (0,w/100) ; + q := q cutafter (p cutafter point 3 of p) ; + q := q cutbefore (p cutbefore point 3 of p) ; + d := .5[\MPcolor{LocalColor},\MPcolor{lightgray}] randomized (.5,.9) ; + f := \MPcolor{lightgray} randomized (.5,.9) ; + pickup pencircle scaled (w/100) ; + fill p shifted s withcolor f ; + draw p shifted s withcolor d ; + draw q shifted s withcolor d ; + fi ; + exitif grid_full ; + endfor ; + setbounds currentpicture to r ; +\stopreusableMPgraphic + +\definelayout + [titlepage] + [\c!backspace=1cm, + \c!topspace=1cm, + \c!width=\v!middle, + \c!height=\v!middle, + \c!header=0pt, + \c!footer=0pt] + +\setuplayout + [\c!backspace=2cm, + \c!topspace=1.5cm, + \c!header=0cm, + \c!footer=0cm, + \c!width=\v!middle, + \c!height=\v!middle] + +\setuppagenumbering + [\c!alternative=\v!doublesided] + +\setupsetup + [\c!criterium=\v!all, + \c!reference=0] + +\setupframedtexts + [setuptext] + [\c!frame=\v!on, + \c!rulethickness=1pt, + \c!framecolor=TitleColor] + +\setupunderbar + [\c!rulethickness=1pt, + \c!rulecolor=TitleColor] + +\starttext + +\setupbackgrounds + [\v!rightpage] + [\c!background=cover] + +\setuplayout + [titlepage] + +\startsetups text:commands + \startinterface dutch \strut commando's \par \stopinterface + \startinterface english \strut commands \par \stopinterface + \startinterface german \strut befehle \par \stopinterface + \startinterface french \strut commandes \par \stopinterface + \startinterface czech \strut p\v{r}ikazy \par \stopinterface + \startinterface italian \strut comandi \par \stopinterface + \startinterface romanian \strut comenzile \par \stopinterface +\stopsetups + +\startsetups text:uppercase + \startinterface dutch NL\stopinterface + \startinterface english EN\stopinterface + \startinterface german DE\stopinterface + \startinterface french FR\stopinterface + \startinterface czech CS\stopinterface + \startinterface italian IT\stopinterface + \startinterface romanian RO\stopinterface +\stopsetups + +\startsetups text:lowercase + \startinterface dutch \strut nl / nederlands \par \stopinterface + \startinterface english \strut en / english \par \stopinterface + \startinterface german \strut de / deutsch \par \stopinterface + \startinterface french \strut fr / fran\c{c}ais \par \stopinterface + \startinterface czech \strut cs / \v{c}esk\'y \par \stopinterface + \startinterface italian \strut it / italiano \par \stopinterface + \startinterface romanian \strut ro / rom\^{a}n\u{a} \par \stopinterface +\stopsetups + +\startmakeup[\v!standard] + \dontcomplain + \setupalign[\v!left] + \startcolor[TitleColor] + \definedfont[RegularBold at 100pt]\setstrut + \strut Con\TeX t \par + \definedfont[RegularBold at 50pt]\setstrut + \setups[text:commands] + \vfill + \definedfont[RegularBold at 150pt]\setstrut + \setups[text:uppercase] + \stopcolor +\stopmakeup + +\setuplayout % needed ? + +\setupbackgrounds + [\v!rightpage] + [\c!background=] + +\startmakeup[\v!standard] + \dontcomplain + \startcolor[TitleColor] + \definedfont[RegularBold at 100pt]\setstrut + \setupalign[\v!left] + \strut Con\TeX t \par + \definedfont[RegularBold at 50pt]\setstrut + \setups[text:commands] + \vfill + \definedfont[RegularBold at 24pt]\setupinterlinespace + \setups[text:lowercase] + \par \strut \currentdate \par + \stopcolor +\stopmakeup + +\protect + +\placeeverysetup + +\unprotect + +\page[\v!yes,\v!blank,\v!right,\v!left] + +\setuplayout + [titlepage] + +\setupbackgrounds + [\v!leftpage] + [\c!background=back] + +\startmakeup[\v!standard][\c!page=] + \dontcomplain + \startcolor[TitleColor] + \definedfont[RegularBold at 24pt]\setupinterlinespace + \setupalign[\v!left] + \vfill + PRAGMA ADE \par + Ridderstraat 27 \par + 8061GH Hasselt NL \par + www.pragma-ade.com \par + \stopcolor +\stopmakeup + +\protect + +\stoptext diff --git a/tex/context/base/x-set-12.tex b/tex/context/base/x-set-12.tex deleted file mode 100644 index d79901433..000000000 --- a/tex/context/base/x-set-12.tex +++ /dev/null @@ -1,258 +0,0 @@ -%D \module -%D [ file=x-set-12, -%D version=2004.10.31, -%D remark=setupx.tex: 1998.07.20 and later, -%D title=\CONTEXT\ Setup Definitions, -%D subtitle=Macro Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\usemodule[set-11] - -\unprotect - -% \starttext -% \setup{installlanguage} -% \placesetup -% \stoptext - -\definecolor[TitleColor][r=.375,g=.125,b=.125] -\definecolor[TitleColor][r=.125,g=.375,b=.125] -\definecolor[TitleColor][r=.125,g=.125,b=.375] -\definecolor[TitleColor][r=.375,g=.375,b=.125] -\definecolor[TitleColor][r=.375,g=.125,b=.375] -\definecolor[TitleColor][r=.125,g=.375,b=.375] - -\definecolor[TitleColor][r=.25,g=.20,b=.15] -\definecolor[TitleColor][r=.25,g=.15,b=.20] -\definecolor[TitleColor][r=.20,g=.15,b=.25] -\definecolor[TitleColor][r=.20,g=.25,b=.15] -\definecolor[TitleColor][r=.15,g=.20,b=.25] -\definecolor[TitleColor][r=.15,g=.25,b=.20] - -\startinterface english \loadsetups[cont-en.xml] \stopinterface -\startinterface dutch \loadsetups[cont-nl.xml] \stopinterface -\startinterface german \loadsetups[cont-de.xml] \stopinterface -\startinterface french \loadsetups[cont-fr.xml] \stopinterface -\startinterface italian \loadsetups[cont-it.xml] \stopinterface -\startinterface czech \loadsetups[cont-cs.xml] \stopinterface -\startinterface romanian \loadsetups[cont-ro.xml] \stopinterface - -\startinterface dutch \definecolor[LocalColor][r=.75,g=.25,b=.25] \stopinterface -\startinterface english \definecolor[LocalColor][r=.25,g=.75,b=.25] \stopinterface -\startinterface german \definecolor[LocalColor][r=.25,g=.25,b=.75] \stopinterface -\startinterface french \definecolor[LocalColor][r=.75,g=.75,b=.25] \stopinterface -\startinterface czech \definecolor[LocalColor][r=.75,g=.25,b=.75] \stopinterface -\startinterface italian \definecolor[LocalColor][r=.25,g=.75,b=.75] \stopinterface -\startinterface romanian \definecolor[LocalColor][r=.5,g=.4,b=.3] \stopinterface -% \definecolor[LocalColor][r=.5,g=.3,b=.4] -% \definecolor[LocalColor][r=.4,g=.3,b=.5] -% \definecolor[LocalColor][r=.4,g=.5,b=.3] -% \definecolor[LocalColor][r=.3,g=.4,b=.5] -% \definecolor[LocalColor][r=.3,g=.5,b=.4] - -\startinterface english \definecolor[TitleColor][r=.375,g=.125,b=.125] \stopinterface -\startinterface dutch \definecolor[TitleColor][r=.125,g=.375,b=.125] \stopinterface -\startinterface german \definecolor[TitleColor][r=.125,g=.125,b=.375] \stopinterface -\startinterface french \definecolor[TitleColor][r=.375,g=.375,b=.125] \stopinterface -\startinterface italian \definecolor[TitleColor][r=.375,g=.125,b=.375] \stopinterface -\startinterface czech \definecolor[TitleColor][r=.125,g=.375,b=.375] \stopinterface -\startinterface romanian \definecolor[TitleColor][r=.25,g=.20,b=.15] \stopinterface -% \definecolor[TitleColor][r=.25,g=.15,b=.20] -% \definecolor[TitleColor][r=.20,g=.15,b=.25] -% \definecolor[TitleColor][r=.20,g=.25,b=.15] -% \definecolor[TitleColor][r=.15,g=.20,b=.25] -% \definecolor[TitleColor][r=.15,g=.25,b=.20] - -\definecolor [lightgray] [s=.9] -\definecolor [darkgray] [s=.1] - -\usetypescript[palatino] -\setupbodyfont[palatino,9pt] - -\setupcolors - [\c!state=\v!start] - -\defineoverlay - [cover] - [\hbox to \paperwidth{\hss\reuseMPgraphic{cover+back}}] - -\defineoverlay - [back] - [\hbox to \paperwidth{\reuseMPgraphic{cover+back}\hss}] - -\startreusableMPgraphic{cover+back} - numeric h, w ; path p, q, r ; color f, d ; pair s ; - h := OverlayHeight ; w := 2*OverlayWidth ; - r := unitsquare xyscaled (w,h) ; - fill r withcolor \MPcolor{lightgray} ; - set_grid(w,h,w/8,w/16) ; - forever : - s := center r randomized (w,h) ; - if new_on_grid(xpart s, ypart s) : - s := (dx,dy) ; - p := fullsquare xyscaled(w/4,w/8) ; - q := (-4w,ypart ulcorner p) -- - .5[ulcorner p, urcorner p] -- - (4w,ypart urcorner p) ; - q := q shifted (0,-w/24) ; - p := p randomized (w/40,w/40) ; - q := q randomized (0,w/100) ; - q := q cutafter (p cutafter point 3 of p) ; - q := q cutbefore (p cutbefore point 3 of p) ; - d := .5[\MPcolor{LocalColor},\MPcolor{lightgray}] randomized (.5,.9) ; - f := \MPcolor{lightgray} randomized (.5,.9) ; - pickup pencircle scaled (w/100) ; - fill p shifted s withcolor f ; - draw p shifted s withcolor d ; - draw q shifted s withcolor d ; - fi ; - exitif grid_full ; - endfor ; - setbounds currentpicture to r ; -\stopreusableMPgraphic - -\definelayout - [titlepage] - [\c!backspace=1cm, - \c!topspace=1cm, - \c!width=\v!middle, - \c!height=\v!middle, - \c!header=0pt, - \c!footer=0pt] - -\setuplayout - [\c!backspace=2cm, - \c!topspace=1.5cm, - \c!header=0cm, - \c!footer=0cm, - \c!width=\v!middle, - \c!height=\v!middle] - -\setuppagenumbering - [\c!alternative=\v!doublesided] - -\setupsetup - [\c!criterium=\v!all, - \c!reference=0] - -\setupframedtexts - [setuptext] - [\c!frame=\v!on, - \c!rulethickness=1pt, - \c!framecolor=TitleColor] - -\setupunderbar - [\c!rulethickness=1pt, - \c!rulecolor=TitleColor] - -\starttext - -\setupbackgrounds - [\v!rightpage] - [\c!background=cover] - -\setuplayout - [titlepage] - -\startsetups text:commands - \startinterface dutch \strut commando's \par \stopinterface - \startinterface english \strut commands \par \stopinterface - \startinterface german \strut befehle \par \stopinterface - \startinterface french \strut commandes \par \stopinterface - \startinterface czech \strut p\v{r}ikazy \par \stopinterface - \startinterface italian \strut comandi \par \stopinterface - \startinterface romanian \strut comenzile \par \stopinterface -\stopsetups - -\startsetups text:uppercase - \startinterface dutch NL\stopinterface - \startinterface english EN\stopinterface - \startinterface german DE\stopinterface - \startinterface french FR\stopinterface - \startinterface czech CS\stopinterface - \startinterface italian IT\stopinterface - \startinterface romanian RO\stopinterface -\stopsetups - -\startsetups text:lowercase - \startinterface dutch \strut nl / nederlands \par \stopinterface - \startinterface english \strut en / english \par \stopinterface - \startinterface german \strut de / deutsch \par \stopinterface - \startinterface french \strut fr / fran\c{c}ais \par \stopinterface - \startinterface czech \strut cs / \v{c}esk\'y \par \stopinterface - \startinterface italian \strut it / italiano \par \stopinterface - \startinterface romanian \strut ro / rom\^{a}n\u{a} \par \stopinterface -\stopsetups - -\startmakeup[\v!standard] - \dontcomplain - \setupalign[\v!left] - \startcolor[TitleColor] - \definedfont[RegularBold at 100pt]\setstrut - \strut Con\TeX t \par - \definedfont[RegularBold at 50pt]\setstrut - \setups[text:commands] - \vfill - \definedfont[RegularBold at 150pt]\setstrut - \setups[text:uppercase] - \stopcolor -\stopmakeup - -\setuplayout % needed ? - -\setupbackgrounds - [\v!rightpage] - [\c!background=] - -\startmakeup[\v!standard] - \dontcomplain - \startcolor[TitleColor] - \definedfont[RegularBold at 100pt]\setstrut - \setupalign[\v!left] - \strut Con\TeX t \par - \definedfont[RegularBold at 50pt]\setstrut - \setups[text:commands] - \vfill - \definedfont[RegularBold at 24pt]\setupinterlinespace - \setups[text:lowercase] - \par \strut \currentdate \par - \stopcolor -\stopmakeup - -\protect - -\placeeverysetup - -\unprotect - -\page[\v!yes,\v!blank,\v!right,\v!left] - -\setuplayout - [titlepage] - -\setupbackgrounds - [\v!leftpage] - [\c!background=back] - -\startmakeup[\v!standard][\c!page=] - \dontcomplain - \startcolor[TitleColor] - \definedfont[RegularBold at 24pt]\setupinterlinespace - \setupalign[\v!left] - \vfill - PRAGMA ADE \par - Ridderstraat 27 \par - 8061GH Hasselt NL \par - www.pragma-ade.com \par - \stopcolor -\stopmakeup - -\protect - -\stoptext diff --git a/tex/context/base/x-set-99.tex b/tex/context/base/x-set-99.tex deleted file mode 100644 index 64d2b1db3..000000000 --- a/tex/context/base/x-set-99.tex +++ /dev/null @@ -1,283 +0,0 @@ -%D \module -%D [ file=x-set-99, -%D version=2004.10.31, -%D remark=setupx.tex: 1998.07.20 and later, -%D title=\CONTEXT\ Setup Definitions, -%D subtitle=Macro Definitions, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% shared list - -\startmessages dutch library: setup - title: setup - formula: formule - number: getal - list: lijst - dimension: maat - mark: markering - reference: verwijzing - command: commando - file: file - name: naam - identifier: naam - text: tekst - section: sectie - singular: naam enkelvoud - plural: naam meervoud - matrix: n*m - see: zie - inherits: erft van - 1: de karakters < en > zijn globaal actief! - 2: -- wordt verwerkt - 3: -- is niet gedefinieerd - 4: -- wordt nogmaals verwerkt - optional: optioneel - displaymath: formule - index: ingang - math: formule - nothing: leeg - file: file - position: positie - reference: verwijzing - csname: naam - destination: bestemming - triplet: triplet - word: woord - content: tekst -\stopmessages - -\startmessages english library: setup - title: setup - formula: formula - number: number - list: list - dimension: dimension - mark: mark - reference: reference - command: command - file: file - name: name - identifier: identifier - text: text - section: section - singular: singular name - plural: plural name - matrix: n*m - see: see - inherits: inherits from - 1: the characters < and > are globally active! - 2: -- is processed - 3: -- is undefined - 4: -- is processed again - optional: optional - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: name - destination: destination - triplet: triplet - word: word - content: text -\stopmessages - -\startmessages german library: setup - title: Setup - formula: Formel - number: Nummer - list: Liste - dimension: Dimension - mark: Beschriftung - reference: Referenz - command: Befehl - file: Datei - name: Name - identifier: Name - text: Text - section: Abschnitt - singular: singular - plural: plural - matrix: n*m - see: siehe - inherits: inherits from - 1: Die Zeichen < und > gelten global! - 2: -- wird verarbeitet - 3: -- ist undefiniert - 4: -- ist mehrmals verarbeitet - optional: optioneel - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: name - destination: destination - triplet: triplet - word: word - content: text -\stopmessages - -\startmessages czech library: setup - title: setup - formula: rovnice - number: cislo - list: seznam - dimension: dimenze - mark: znacka - reference: reference - command: prikaz - file: soubor - name: jmeno - identifier: jmeno - text: text - section: sekce - singular: jmeno v singularu - plural: jmeno v pluralu - matrix: n*m - see: viz - inherits: inherits from - 1: znaky < a > jsou globalne aktivni! - 2: -- je zpracovano - 3: -- je nedefinovano - 4: -- je zpracovano znovu - optional: optioneel - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: name - destination: destination - triplet: triplet - word: word - content: text -\stopmessages - -\startmessages italian library: setup - title: setup - formula: formula - number: number - list: list - dimension: dimension - mark: mark - reference: reference - command: command - file: file - name: name - identifier: name - text: text - section: section - singular: singular name - plural: plural name - matrix: n*m - see: see - inherits: inherits from - 1: the characters < and > are globally active! - 2: -- is processed - 3: -- is undefined - 4: -- is processed again - optional: optioneel - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: name - destination: destination - triplet: triplet - word: word - content: text -\stopmessages - -\startmessages romanian library: setup - title: setari - formula: formula - number: numar - list: lista - dimension: dimensiune - mark: marcaj - reference: referinta - command: comanda - file: fisier - name: nume - identifier: nume - text: text - section: sectiune - singular: nume singular - plural: nume pluram - matrix: n*m - see: vezi - inherits: inherits from - 1: caracterele < si > sunt active global! - 2: este procesat -- - 3: -- este nedefinit - 4: -- este procesat din nou - optional: optioneel - displaymath: formula - index: entry - math: formula - nothing: empty - file: file - position: position - reference: reference - csname: name - destination: destination - triplet: triplet - word: word - content: text -\stopmessages - -\startmessages french library: setup - title: réglage - formula: formule - number: numéro - list: liste - dimension: dimension - mark: marquage - reference: reference - command: commande - file: fichier - name: nom - identifier: identificateur - text: texte - section: section - singular: nom singulier - plural: nom pluriel - matrix: n*m - see: vois - inherits: herite de - 1: les caractères < et > sont globalement actifs ! - 2: -- est traité - 3: -- n'est pas défini - 4: -- est traité de nouveau - optional: optionel - displaymath: formule - index: entrée - math: formule - nothing: vide - file: fichier - position: position - reference: réference - csname: nom - destination: destination - triplet: triplet - word: mot - content: texte -\stopmessages - -\endinput diff --git a/tex/context/base/x-xtag.mkiv b/tex/context/base/x-xtag.mkiv index 560e1b702..be593300c 100644 --- a/tex/context/base/x-xtag.mkiv +++ b/tex/context/base/x-xtag.mkiv @@ -16,13 +16,15 @@ \ifdefined\XMLbanner \endinput \fi +\writestatus{xtag}{this module is obsolete, use the mkiv-xml features or use mkii instead} + \loadmarkfile{catc-xml} -\loadcorefile{xtag-ini} -\loadcorefile{xtag-ext} -\loadcorefile{xtag-exp} -\loadcorefile{xtag-pre} % has old encoding code -\loadcorefile{xtag-xsd} % will go away (stub anyway) -\loadcorefile{xtag-rng} % will go away (stub anyway) +\loadcorefile{xtag-ini.mkii} +\loadcorefile{xtag-ext.mkii} +\loadcorefile{xtag-exp.mkii} +\loadcorefile{xtag-pre.mkii} % has old encoding code +\loadcorefile{xtag-xsd.mkii} % will go away (stub anyway) +\loadcorefile{xtag-rng.mkii} % will go away (stub anyway) \endinput diff --git a/tex/context/base/xtag-cml.mkii b/tex/context/base/xtag-cml.mkii new file mode 100644 index 000000000..6da7fd26f --- /dev/null +++ b/tex/context/base/xtag-cml.mkii @@ -0,0 +1,228 @@ +% see mathml, == \defineXMLdirective [mathml] \setupMMLappearance + +% will be rewritten avoiding the mapper + +\useXMLfilter[map] + +\unprotect + +\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]} + +\defineXMLdirective [chemml] \setupCMLappearance + +\defineXMLargument [chem] \doXMLchem +\defineXMLargument [ichem] \doXMLichem +\defineXMLargument [dchem] \doXMLdchem + +\unexpanded\def\doXMLchem {\ifhmode\@EA\doXMLichem\else\@EA\doXMLdchem\fi} +\unexpanded\def\doXMLichem{\XMLremapdata[cml]{$\rm}{$}} +\unexpanded\def\doXMLdchem{\XMLremapdata[cml]{\dostartformula{}\rm}{\dostopformula}} + +\startXMLmapping [cml] + +\remapXMLsequence [molecule] [CPA] \doCMLmolecule +\remapXMLsequence [ion] [CPA] \doCMLion +\remapXMLsequence [atom] [CPA] \doCMLatom + +\setupCMLappearance [ion] [\c!alternative=\v!a] + +\let\CMLtopcaption\empty +\let\CMLbotcaption\empty + +\def\someCMLtext#1% + {\ifx\CMLtopcaption\empty + \setbox0\null + \else + \setbox0\hbox{\txx\setstrut\strut\ignorespaces\CMLtopcaption\unskip}% + \fi + \setbox2\hbox{\ignorespaces\strut#1\unskip}% + \ifx\CMLbotcaption\empty + \setbox4\null + \else + \setbox4\hbox{\txx\setstrut\strut\ignorespaces\CMLbotcaption\unskip}% + \fi + \scratchdimen=\wd2\advance\scratchdimen-.5em + \ifdim\wd0>\scratchdimen + \setbox0\hbox spread .5em{\hss\box0\hss}% + \fi + \ifdim\wd4>\scratchdimen + \setbox4\hbox spread .5em{\hss\box4\hss}% + \fi + \setbox6=\vbox + {\offinterlineskip\halign{\hss##\hss\cr\copy0\cr\copy2\cr\copy4\cr}}% + \hbox{\lower\ht4\hbox{\lower\dp2\box6}}} + +\def\CMLscript#1% + {$\scriptscriptstyle\ignorespaces#1\unskip$} + +\def\doifnotXMLzero#1#2#3% + {\ifcase\XMLpar{#1}{#2}{0}\else#3{\XMLpar{#1}{#2}{0}}\fi} + +\newcounter\currentCMLatom +\newcounter\nofCMLatoms + +\def\doCMLmolecule#1#2% + {\resetCMLcaption + \processXMLRchild{caption}{#2}% + \someCMLtext + {\bgroup + \newcounter\currentCMLatom + \newcounter\nofCMLatoms + \getXMLarguments{cml-m}{n="0" #1}% + \doifnotXMLzero{cml-m}{n}\firstofoneargument + \ignorespaces + \processXMLRchild{atom,ion,bond/,singlebond/,doublebond/,triplebond/}{#2}% + \unskip + \egroup}% + \ignorespaces} + +\def\doCMLion#1#2% + {\resetCMLcaption + \processXMLRchild{caption}{#2}% + \someCMLtext + {\bgroup + \newcounter\currentCMLatom + \newcounter\nofCMLatoms + \getXMLarguments{cml-i}{n="0" charge="0" #1}% + \doifnotXMLzero{cml-i}{n}\firstofoneargument + \doifelse\@@CMLionalternative\v!b + {[\ignorespaces + \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}% + \unskip]% + \high{\doifnotXMLzero{cml-i}{charge}\CMLscript}} + {\countXMLRchild{atom}{\ignorespaces#2\unskip}% + \let\nofCMLatoms\nofXMLRchildren + \ignorespaces + \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}% + \unskip}% + \egroup}% + \ignorespaces} + +\def\doCMLatom#1#2% + {\getXMLarguments{cml-a}{n="0" weight="0" protons="0" charge="0" #1}% + \increment\currentCMLatom + \resetCMLcaption + \someCMLtext + {\bgroup + \lohi + {\doifnotXMLzero{cml-a}{protons}\CMLscript} + {\doifnotXMLzero{cml-a}{weight}\CMLscript}% + \ignorespaces#2\unskip + \lohi + {\doifnotXMLzero{cml-a}{n}\CMLscript} + {\ifnum\nofCMLatoms=\currentCMLatom\relax + \doifnotXMLzero{cml-i}{charge}\CMLscript + \else + \doifnotXMLzero{cml-a}{charge}\CMLscript + \fi}% + \egroup}% + \ignorespaces} + +\remapXMLsequence [reaction] [CPA] \doCMLreaction + +\let\someCMLsymbol\gobbleoneargument +\let\someCMLarrow \gobblethreearguments + +\def\doCMLreaction#1#2% + {\begingroup + \let\someCMLsymbol\dosomeCMLsymbol + \let\someCMLarrow \dosomeCMLarrow + #2% + \endgroup} + +\remapXMLsequence [plus] [CPA] \doCMLplus +\remapXMLsingular [plus] [CPA] \doCMLplus +\remapXMLsequence [minus] [CPA] \doCMLminus +\remapXMLsingular [minus] [CPA] \doCMLminus +\remapXMLsequence [equal] [CPA] \doCMLequal +\remapXMLsingular [equal] [CPA] \doCMLequal + +\def\doCMLplus #1#2{\someCMLsymbol{+}} +\def\doCMLminus#1#2{\someCMLsymbol{-}} +\def\doCMLequal#1#2{\someCMLsymbol{=}} + +\def\dosomeCMLsymbol#1% + {\quad\mathop{#1}\quad} + +\remapXMLsequence [gives] [CPA] \doCMLgives +\remapXMLsingular [gives] [CPA] \doCMLgives +\remapXMLsequence [equilibrium] [CPA] \doCMLequilibrium +\remapXMLsingular [equilibrium] [CPA] \doCMLequilibrium +\remapXMLsequence [mesomeric] [CPA] \doCMLmesomeric +\remapXMLsingular [mesomeric] [CPA] \doCMLmesomeric + +\def\doCMLgives #1#2{\resetCMLcaption#2\someCMLgives } +\def\doCMLequilibrium#1#2{\resetCMLcaption#2\someCMLequilibrium} +\def\doCMLmesomeric #1#2{\resetCMLcaption#2\someCMLmesomeric } + +\def\dosomeCMLarrow#1% + {\quad + \someCMLtext + {$\vcenter{\offinterlineskip\halign{##\cr\hskip3em\cr#1\cr}}$}% + \quad} + +\def\someCMLgives + {\someCMLarrow{\rightarrowfill}} + +\def\someCMLequilibrium + {\someCMLarrow{\rightarrowfill\cr\noalign{\nointerlineskip}\leftarrowfill}} + +\def\someCMLmesomeric + {\someCMLarrow{$\leftarrow\hskip-1em$\rightarrowfill}} + +\remapXMLsequence [cml] [caption] [CPA] \doCMLcaption + +\let\CMLtopcaption\empty +\let\CMLbotcaption\empty + +\def\dodoCMLcaption#1#2% + {\def\CMLbotcaption{#2}% + \def\doCMLcaption##1##2% + {\def\CMLtopcaption{##2}% + \let\doCMLcaption\gobbletwoarguments}} + +\def\resetCMLcaption + {\let\CMLtopcaption\empty + \let\CMLbotcaption\empty + \let\doCMLcaption\dodoCMLcaption} + +\resetCMLcaption + +\remapXMLsingular [bond] [CPA] \doCMLbond +\remapXMLsingular [singlebond] [CPA] \doCMLsinglebond +\remapXMLsingular [doublebond] [CPA] \doCMLdoublebond +\remapXMLsingular [triplebond] [CPA] \doCMLtriplebond + +\def\doCMLbond#1#2% + {\getXMLarguments{cml-b}{n="0" #1}% + \ifcase\XMLpar{cml-b}{n}{0}\relax + \doCMLsinglebond + \or + \doCMLdoublebond + \or + \doCMLtriplebond + \fi} + +\def\someCMLbond + {\hrule \!!width \hsize \!!height .1ex} % .4pt + +\def\dosomeCMLbond#1#2#3% + {{\setbox\scratchbox=\hbox{$M$}% + \vbox to \ht\scratchbox + {\hsize\wd\scratchbox + \vskip.1\wd\scratchbox + #1\vfill#2\vfill#3% + \vskip.1\wd\scratchbox}}} + +\def\doCMLsinglebond + {\dosomeCMLbond\relax\someCMLbond\relax} + +\def\doCMLdoublebond + {\dosomeCMLbond\someCMLbond\relax\someCMLbond} + +\def\doCMLtriplebond + {\dosomeCMLbond\someCMLbond\someCMLbond\someCMLbond} + +\stopXMLmapping + +\protect \endinput diff --git a/tex/context/base/xtag-cml.tex b/tex/context/base/xtag-cml.tex deleted file mode 100644 index 6da7fd26f..000000000 --- a/tex/context/base/xtag-cml.tex +++ /dev/null @@ -1,228 +0,0 @@ -% see mathml, == \defineXMLdirective [mathml] \setupMMLappearance - -% will be rewritten avoiding the mapper - -\useXMLfilter[map] - -\unprotect - -\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]} - -\defineXMLdirective [chemml] \setupCMLappearance - -\defineXMLargument [chem] \doXMLchem -\defineXMLargument [ichem] \doXMLichem -\defineXMLargument [dchem] \doXMLdchem - -\unexpanded\def\doXMLchem {\ifhmode\@EA\doXMLichem\else\@EA\doXMLdchem\fi} -\unexpanded\def\doXMLichem{\XMLremapdata[cml]{$\rm}{$}} -\unexpanded\def\doXMLdchem{\XMLremapdata[cml]{\dostartformula{}\rm}{\dostopformula}} - -\startXMLmapping [cml] - -\remapXMLsequence [molecule] [CPA] \doCMLmolecule -\remapXMLsequence [ion] [CPA] \doCMLion -\remapXMLsequence [atom] [CPA] \doCMLatom - -\setupCMLappearance [ion] [\c!alternative=\v!a] - -\let\CMLtopcaption\empty -\let\CMLbotcaption\empty - -\def\someCMLtext#1% - {\ifx\CMLtopcaption\empty - \setbox0\null - \else - \setbox0\hbox{\txx\setstrut\strut\ignorespaces\CMLtopcaption\unskip}% - \fi - \setbox2\hbox{\ignorespaces\strut#1\unskip}% - \ifx\CMLbotcaption\empty - \setbox4\null - \else - \setbox4\hbox{\txx\setstrut\strut\ignorespaces\CMLbotcaption\unskip}% - \fi - \scratchdimen=\wd2\advance\scratchdimen-.5em - \ifdim\wd0>\scratchdimen - \setbox0\hbox spread .5em{\hss\box0\hss}% - \fi - \ifdim\wd4>\scratchdimen - \setbox4\hbox spread .5em{\hss\box4\hss}% - \fi - \setbox6=\vbox - {\offinterlineskip\halign{\hss##\hss\cr\copy0\cr\copy2\cr\copy4\cr}}% - \hbox{\lower\ht4\hbox{\lower\dp2\box6}}} - -\def\CMLscript#1% - {$\scriptscriptstyle\ignorespaces#1\unskip$} - -\def\doifnotXMLzero#1#2#3% - {\ifcase\XMLpar{#1}{#2}{0}\else#3{\XMLpar{#1}{#2}{0}}\fi} - -\newcounter\currentCMLatom -\newcounter\nofCMLatoms - -\def\doCMLmolecule#1#2% - {\resetCMLcaption - \processXMLRchild{caption}{#2}% - \someCMLtext - {\bgroup - \newcounter\currentCMLatom - \newcounter\nofCMLatoms - \getXMLarguments{cml-m}{n="0" #1}% - \doifnotXMLzero{cml-m}{n}\firstofoneargument - \ignorespaces - \processXMLRchild{atom,ion,bond/,singlebond/,doublebond/,triplebond/}{#2}% - \unskip - \egroup}% - \ignorespaces} - -\def\doCMLion#1#2% - {\resetCMLcaption - \processXMLRchild{caption}{#2}% - \someCMLtext - {\bgroup - \newcounter\currentCMLatom - \newcounter\nofCMLatoms - \getXMLarguments{cml-i}{n="0" charge="0" #1}% - \doifnotXMLzero{cml-i}{n}\firstofoneargument - \doifelse\@@CMLionalternative\v!b - {[\ignorespaces - \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}% - \unskip]% - \high{\doifnotXMLzero{cml-i}{charge}\CMLscript}} - {\countXMLRchild{atom}{\ignorespaces#2\unskip}% - \let\nofCMLatoms\nofXMLRchildren - \ignorespaces - \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}% - \unskip}% - \egroup}% - \ignorespaces} - -\def\doCMLatom#1#2% - {\getXMLarguments{cml-a}{n="0" weight="0" protons="0" charge="0" #1}% - \increment\currentCMLatom - \resetCMLcaption - \someCMLtext - {\bgroup - \lohi - {\doifnotXMLzero{cml-a}{protons}\CMLscript} - {\doifnotXMLzero{cml-a}{weight}\CMLscript}% - \ignorespaces#2\unskip - \lohi - {\doifnotXMLzero{cml-a}{n}\CMLscript} - {\ifnum\nofCMLatoms=\currentCMLatom\relax - \doifnotXMLzero{cml-i}{charge}\CMLscript - \else - \doifnotXMLzero{cml-a}{charge}\CMLscript - \fi}% - \egroup}% - \ignorespaces} - -\remapXMLsequence [reaction] [CPA] \doCMLreaction - -\let\someCMLsymbol\gobbleoneargument -\let\someCMLarrow \gobblethreearguments - -\def\doCMLreaction#1#2% - {\begingroup - \let\someCMLsymbol\dosomeCMLsymbol - \let\someCMLarrow \dosomeCMLarrow - #2% - \endgroup} - -\remapXMLsequence [plus] [CPA] \doCMLplus -\remapXMLsingular [plus] [CPA] \doCMLplus -\remapXMLsequence [minus] [CPA] \doCMLminus -\remapXMLsingular [minus] [CPA] \doCMLminus -\remapXMLsequence [equal] [CPA] \doCMLequal -\remapXMLsingular [equal] [CPA] \doCMLequal - -\def\doCMLplus #1#2{\someCMLsymbol{+}} -\def\doCMLminus#1#2{\someCMLsymbol{-}} -\def\doCMLequal#1#2{\someCMLsymbol{=}} - -\def\dosomeCMLsymbol#1% - {\quad\mathop{#1}\quad} - -\remapXMLsequence [gives] [CPA] \doCMLgives -\remapXMLsingular [gives] [CPA] \doCMLgives -\remapXMLsequence [equilibrium] [CPA] \doCMLequilibrium -\remapXMLsingular [equilibrium] [CPA] \doCMLequilibrium -\remapXMLsequence [mesomeric] [CPA] \doCMLmesomeric -\remapXMLsingular [mesomeric] [CPA] \doCMLmesomeric - -\def\doCMLgives #1#2{\resetCMLcaption#2\someCMLgives } -\def\doCMLequilibrium#1#2{\resetCMLcaption#2\someCMLequilibrium} -\def\doCMLmesomeric #1#2{\resetCMLcaption#2\someCMLmesomeric } - -\def\dosomeCMLarrow#1% - {\quad - \someCMLtext - {$\vcenter{\offinterlineskip\halign{##\cr\hskip3em\cr#1\cr}}$}% - \quad} - -\def\someCMLgives - {\someCMLarrow{\rightarrowfill}} - -\def\someCMLequilibrium - {\someCMLarrow{\rightarrowfill\cr\noalign{\nointerlineskip}\leftarrowfill}} - -\def\someCMLmesomeric - {\someCMLarrow{$\leftarrow\hskip-1em$\rightarrowfill}} - -\remapXMLsequence [cml] [caption] [CPA] \doCMLcaption - -\let\CMLtopcaption\empty -\let\CMLbotcaption\empty - -\def\dodoCMLcaption#1#2% - {\def\CMLbotcaption{#2}% - \def\doCMLcaption##1##2% - {\def\CMLtopcaption{##2}% - \let\doCMLcaption\gobbletwoarguments}} - -\def\resetCMLcaption - {\let\CMLtopcaption\empty - \let\CMLbotcaption\empty - \let\doCMLcaption\dodoCMLcaption} - -\resetCMLcaption - -\remapXMLsingular [bond] [CPA] \doCMLbond -\remapXMLsingular [singlebond] [CPA] \doCMLsinglebond -\remapXMLsingular [doublebond] [CPA] \doCMLdoublebond -\remapXMLsingular [triplebond] [CPA] \doCMLtriplebond - -\def\doCMLbond#1#2% - {\getXMLarguments{cml-b}{n="0" #1}% - \ifcase\XMLpar{cml-b}{n}{0}\relax - \doCMLsinglebond - \or - \doCMLdoublebond - \or - \doCMLtriplebond - \fi} - -\def\someCMLbond - {\hrule \!!width \hsize \!!height .1ex} % .4pt - -\def\dosomeCMLbond#1#2#3% - {{\setbox\scratchbox=\hbox{$M$}% - \vbox to \ht\scratchbox - {\hsize\wd\scratchbox - \vskip.1\wd\scratchbox - #1\vfill#2\vfill#3% - \vskip.1\wd\scratchbox}}} - -\def\doCMLsinglebond - {\dosomeCMLbond\relax\someCMLbond\relax} - -\def\doCMLdoublebond - {\dosomeCMLbond\someCMLbond\relax\someCMLbond} - -\def\doCMLtriplebond - {\dosomeCMLbond\someCMLbond\someCMLbond\someCMLbond} - -\stopXMLmapping - -\protect \endinput diff --git a/tex/context/base/xtag-ent.mkii b/tex/context/base/xtag-ent.mkii new file mode 100644 index 000000000..f4c3e4b06 --- /dev/null +++ b/tex/context/base/xtag-ent.mkii @@ -0,0 +1,117 @@ +%D \module +%D [ file=xtag-ent, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=A bunch of Entities, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% We need this for French and Hungarian. + +\defineXMLentity [colon] {\directdiscretionary{:}} +\defineXMLentity [semicolon] {\directdiscretionary{;}} +\defineXMLentity [questionmark] {\directdiscretionary{?}} +\defineXMLentity [exclamationmark] {\directdiscretionary{!}} + +% These will fall back to the raw encoding vector + +\defineXMLentity [Aacute] {\Aacute} +\defineXMLentity [aacute] {\aacute} +\defineXMLentity [Cacute] {\Cacute} % unofficial +\defineXMLentity [cacute] {\cacute} % unofficial +\defineXMLentity [Eacute] {\Eacute} +\defineXMLentity [eacute] {\eacute} +\defineXMLentity [Iacute] {\Iacute} +\defineXMLentity [iacute] {\iacute} +\defineXMLentity [Oacute] {\Oacute} +\defineXMLentity [oacute] {\oacute} +\defineXMLentity [Uacute] {\Uacute} +\defineXMLentity [uacute] {\uacute} +\defineXMLentity [Yacute] {\Yacute} +\defineXMLentity [yacute] {\yacute} +\defineXMLentity [Nacute] {\Nacute} +\defineXMLentity [nacute] {\nacute} + +\defineXMLentity [Ccedil] {\Ccedilla} +\defineXMLentity [ccedil] {\ccedilla} + +\defineXMLentity [AElig] {\AEligature} +\defineXMLentity [aelig] {\aeligature} + +\defineXMLentity [Agrave] {\Agrave} +\defineXMLentity [agrave] {\agrave} +\defineXMLentity [Egrave] {\Egrave} +\defineXMLentity [egrave] {\egrave} +\defineXMLentity [Igrave] {\Igrave} +\defineXMLentity [igrave] {\igrave} +\defineXMLentity [Ograve] {\Ograve} +\defineXMLentity [ograve] {\ograve} +\defineXMLentity [Ugrave] {\Ugrave} +\defineXMLentity [ugrave] {\ugrave} + +\defineXMLentity [THORN] {\Thorn} +\defineXMLentity [thorn] {\thorn} + +\defineXMLentity [Aring] {\Aring} +\defineXMLentity [aring] {\aring} + +\defineXMLentity [Oslash] {\Oslash} % stroke +\defineXMLentity [oslash] {\oslash} +\defineXMLentity [Lslash] {\Lslash} % unofficial +\defineXMLentity [lslash] {\lslash} % unofficial + +\defineXMLentity [eth] {\eth} % ? +\defineXMLentity [ETH] {\Eth} % ? + +\defineXMLentity [Atilde] {\Atilde} +\defineXMLentity [atilde] {\atilde} +\defineXMLentity [Etilde] {\Etilde} +\defineXMLentity [etilde] {\etilde} +\defineXMLentity [Itilde] {\Itilde} +\defineXMLentity [itilde] {\itilde} +\defineXMLentity [Ntilde] {\Ntilde} +\defineXMLentity [ntilde] {\ntilde} +\defineXMLentity [Otilde] {\Otilde} +\defineXMLentity [otilde] {\otilde} +\defineXMLentity [Utilde] {\Utilde} +\defineXMLentity [utilde] {\utilde} + +\defineXMLentity [Auml] {\Adiaeresis} +\defineXMLentity [auml] {\adiaeresis} +\defineXMLentity [Euml] {\Ediaeresis} +\defineXMLentity [euml] {\ediaeresis} +\defineXMLentity [Iuml] {\Idiaeresis} +\defineXMLentity [iuml] {\idiaeresis} +\defineXMLentity [Ouml] {\Odiaeresis} +\defineXMLentity [ouml] {\odiaeresis} +\defineXMLentity [Uuml] {\Udiaeresis} +\defineXMLentity [uuml] {\udiaeresis} +\defineXMLentity [Yuml] {\Ydiaeresis} +\defineXMLentity [yuml] {\ydiaeresis} + +\defineXMLentity [szlig] {\Ssharp} + +\defineXMLentity [Acirc] {\Acircumflex} +\defineXMLentity [acirc] {\acircumflex} +\defineXMLentity [Ecirc] {\Ecircumflex} +\defineXMLentity [ecirc] {\ecircumflex} +\defineXMLentity [Icirc] {\Icircumflex} +\defineXMLentity [icirc] {\icircumflex} +\defineXMLentity [Ocirc] {\Ocircumflex} +\defineXMLentity [ocirc] {\ocircumflex} +\defineXMLentity [Ucirc] {\Ucircumflex} +\defineXMLentity [ucirc] {\ucircumflex} + +\defineXMLentity [ccaron] {\ccaron} % unofficial +\defineXMLentity [rcaron] {\rcaron} % unofficial +\defineXMLentity [scaron] {\scaron} % unofficial +\defineXMLentity [zcaron] {\zcaron} % unofficial + +\defineXMLentity [dots] {\unknown} +\defineXMLentity [amp] {\&} +\defineXMLentity [nbsp] {\nonbreakablespace} diff --git a/tex/context/base/xtag-ent.tex b/tex/context/base/xtag-ent.tex deleted file mode 100644 index f4c3e4b06..000000000 --- a/tex/context/base/xtag-ent.tex +++ /dev/null @@ -1,117 +0,0 @@ -%D \module -%D [ file=xtag-ent, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=A bunch of Entities, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% We need this for French and Hungarian. - -\defineXMLentity [colon] {\directdiscretionary{:}} -\defineXMLentity [semicolon] {\directdiscretionary{;}} -\defineXMLentity [questionmark] {\directdiscretionary{?}} -\defineXMLentity [exclamationmark] {\directdiscretionary{!}} - -% These will fall back to the raw encoding vector - -\defineXMLentity [Aacute] {\Aacute} -\defineXMLentity [aacute] {\aacute} -\defineXMLentity [Cacute] {\Cacute} % unofficial -\defineXMLentity [cacute] {\cacute} % unofficial -\defineXMLentity [Eacute] {\Eacute} -\defineXMLentity [eacute] {\eacute} -\defineXMLentity [Iacute] {\Iacute} -\defineXMLentity [iacute] {\iacute} -\defineXMLentity [Oacute] {\Oacute} -\defineXMLentity [oacute] {\oacute} -\defineXMLentity [Uacute] {\Uacute} -\defineXMLentity [uacute] {\uacute} -\defineXMLentity [Yacute] {\Yacute} -\defineXMLentity [yacute] {\yacute} -\defineXMLentity [Nacute] {\Nacute} -\defineXMLentity [nacute] {\nacute} - -\defineXMLentity [Ccedil] {\Ccedilla} -\defineXMLentity [ccedil] {\ccedilla} - -\defineXMLentity [AElig] {\AEligature} -\defineXMLentity [aelig] {\aeligature} - -\defineXMLentity [Agrave] {\Agrave} -\defineXMLentity [agrave] {\agrave} -\defineXMLentity [Egrave] {\Egrave} -\defineXMLentity [egrave] {\egrave} -\defineXMLentity [Igrave] {\Igrave} -\defineXMLentity [igrave] {\igrave} -\defineXMLentity [Ograve] {\Ograve} -\defineXMLentity [ograve] {\ograve} -\defineXMLentity [Ugrave] {\Ugrave} -\defineXMLentity [ugrave] {\ugrave} - -\defineXMLentity [THORN] {\Thorn} -\defineXMLentity [thorn] {\thorn} - -\defineXMLentity [Aring] {\Aring} -\defineXMLentity [aring] {\aring} - -\defineXMLentity [Oslash] {\Oslash} % stroke -\defineXMLentity [oslash] {\oslash} -\defineXMLentity [Lslash] {\Lslash} % unofficial -\defineXMLentity [lslash] {\lslash} % unofficial - -\defineXMLentity [eth] {\eth} % ? -\defineXMLentity [ETH] {\Eth} % ? - -\defineXMLentity [Atilde] {\Atilde} -\defineXMLentity [atilde] {\atilde} -\defineXMLentity [Etilde] {\Etilde} -\defineXMLentity [etilde] {\etilde} -\defineXMLentity [Itilde] {\Itilde} -\defineXMLentity [itilde] {\itilde} -\defineXMLentity [Ntilde] {\Ntilde} -\defineXMLentity [ntilde] {\ntilde} -\defineXMLentity [Otilde] {\Otilde} -\defineXMLentity [otilde] {\otilde} -\defineXMLentity [Utilde] {\Utilde} -\defineXMLentity [utilde] {\utilde} - -\defineXMLentity [Auml] {\Adiaeresis} -\defineXMLentity [auml] {\adiaeresis} -\defineXMLentity [Euml] {\Ediaeresis} -\defineXMLentity [euml] {\ediaeresis} -\defineXMLentity [Iuml] {\Idiaeresis} -\defineXMLentity [iuml] {\idiaeresis} -\defineXMLentity [Ouml] {\Odiaeresis} -\defineXMLentity [ouml] {\odiaeresis} -\defineXMLentity [Uuml] {\Udiaeresis} -\defineXMLentity [uuml] {\udiaeresis} -\defineXMLentity [Yuml] {\Ydiaeresis} -\defineXMLentity [yuml] {\ydiaeresis} - -\defineXMLentity [szlig] {\Ssharp} - -\defineXMLentity [Acirc] {\Acircumflex} -\defineXMLentity [acirc] {\acircumflex} -\defineXMLentity [Ecirc] {\Ecircumflex} -\defineXMLentity [ecirc] {\ecircumflex} -\defineXMLentity [Icirc] {\Icircumflex} -\defineXMLentity [icirc] {\icircumflex} -\defineXMLentity [Ocirc] {\Ocircumflex} -\defineXMLentity [ocirc] {\ocircumflex} -\defineXMLentity [Ucirc] {\Ucircumflex} -\defineXMLentity [ucirc] {\ucircumflex} - -\defineXMLentity [ccaron] {\ccaron} % unofficial -\defineXMLentity [rcaron] {\rcaron} % unofficial -\defineXMLentity [scaron] {\scaron} % unofficial -\defineXMLentity [zcaron] {\zcaron} % unofficial - -\defineXMLentity [dots] {\unknown} -\defineXMLentity [amp] {\&} -\defineXMLentity [nbsp] {\nonbreakablespace} diff --git a/tex/context/base/xtag-exp.mkii b/tex/context/base/xtag-exp.mkii new file mode 100644 index 000000000..337b49348 --- /dev/null +++ b/tex/context/base/xtag-exp.mkii @@ -0,0 +1,88 @@ +%D \module +%D [ file=xtag-exp, +%D version=2001.08.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Expansion, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Expansion} + +\unprotect + +%D Files + +\newcounter\XMLfilenesting \let\restoreXMLelements\relax + +\def\startXMLreading + {\increment \XMLfilenesting \relax + \ifcase\XMLfilenesting\or + \ifprocessingXML + \let\restoreXMLelements\relax + \else + \let\restoreXMLelements\disableXMLelements + \enableXMLelements + \fi + \fi} + +\def\stopXMLreading + {\ifcase\XMLfilenesting\or + \restoreXMLelements + \let\restoreXMLelements\relax + \fi + \decrement \XMLfilenesting \relax} + +\ifnum\texengine=\luatexengine + \def\enableXMLfiledata + {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change + \appendtoks \forcefileexpansiontrue \to \everyenableXML + \let\enableXMLfiledata\relax} +\else + \def\enableXMLfiledata + {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change + \appendtoks \startXMLreading \to \everybeforeutilityread + \appendtoks \stopXMLreading \to \everyafterutilityread + \appendtoks \forcefileexpansiontrue \to \everyenableXML + \let\enableXMLfiledata\relax} +\fi + +\setupXMLprocessing[\c!state=\v!start] + +\appendtoks + \ifproductionrun \enableXMLfiledata \fi +\to \aftersetupXMLprocessing + +%D Here we overload the mark handler. + +\ifnum\texengine=\luatexengine \else + + \def\XMLexpanded#1% + {\bgroup + \honorunexpanded + \dontexpandencoding + \xdef\@@globalexpanded{\noexpand#1}% why \noexpand? + \egroup + \@@globalexpanded} + + \let\normalsetnormalmark\setnormalmark + + \long\def\setnormalmark#1% overloaded + {\ifprocessingXML + \expandafter\setXMLexpandedmark + \else + \expandafter\normalsetnormalmark + \fi#1} + + \def\setXMLexpandedmark#1#2% using a tok prevents unwanted expansion in mark + {\XMLexpanded{\scratchtoks{\enableXMLelements#2}}% + \setxvalue{\@@crk\string#1}{\the\scratchtoks}% + \normalmarks#1{\the\scratchtoks}} + +\fi + +\protect \endinput diff --git a/tex/context/base/xtag-exp.tex b/tex/context/base/xtag-exp.tex deleted file mode 100644 index 337b49348..000000000 --- a/tex/context/base/xtag-exp.tex +++ /dev/null @@ -1,88 +0,0 @@ -%D \module -%D [ file=xtag-exp, -%D version=2001.08.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Expansion, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Expansion} - -\unprotect - -%D Files - -\newcounter\XMLfilenesting \let\restoreXMLelements\relax - -\def\startXMLreading - {\increment \XMLfilenesting \relax - \ifcase\XMLfilenesting\or - \ifprocessingXML - \let\restoreXMLelements\relax - \else - \let\restoreXMLelements\disableXMLelements - \enableXMLelements - \fi - \fi} - -\def\stopXMLreading - {\ifcase\XMLfilenesting\or - \restoreXMLelements - \let\restoreXMLelements\relax - \fi - \decrement \XMLfilenesting \relax} - -\ifnum\texengine=\luatexengine - \def\enableXMLfiledata - {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change - \appendtoks \forcefileexpansiontrue \to \everyenableXML - \let\enableXMLfiledata\relax} -\else - \def\enableXMLfiledata - {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change - \appendtoks \startXMLreading \to \everybeforeutilityread - \appendtoks \stopXMLreading \to \everyafterutilityread - \appendtoks \forcefileexpansiontrue \to \everyenableXML - \let\enableXMLfiledata\relax} -\fi - -\setupXMLprocessing[\c!state=\v!start] - -\appendtoks - \ifproductionrun \enableXMLfiledata \fi -\to \aftersetupXMLprocessing - -%D Here we overload the mark handler. - -\ifnum\texengine=\luatexengine \else - - \def\XMLexpanded#1% - {\bgroup - \honorunexpanded - \dontexpandencoding - \xdef\@@globalexpanded{\noexpand#1}% why \noexpand? - \egroup - \@@globalexpanded} - - \let\normalsetnormalmark\setnormalmark - - \long\def\setnormalmark#1% overloaded - {\ifprocessingXML - \expandafter\setXMLexpandedmark - \else - \expandafter\normalsetnormalmark - \fi#1} - - \def\setXMLexpandedmark#1#2% using a tok prevents unwanted expansion in mark - {\XMLexpanded{\scratchtoks{\enableXMLelements#2}}% - \setxvalue{\@@crk\string#1}{\the\scratchtoks}% - \normalmarks#1{\the\scratchtoks}} - -\fi - -\protect \endinput diff --git a/tex/context/base/xtag-ext.mkii b/tex/context/base/xtag-ext.mkii new file mode 100644 index 000000000..9a132c677 --- /dev/null +++ b/tex/context/base/xtag-ext.mkii @@ -0,0 +1,439 @@ +%D \module +%D [ file=xtag-ext, +%D version=2001.03.21, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Extra Macros, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Extras} + +\unprotect + +%D \macros +%D {startXMLmapping} +%D +%D You can define macros within a namespace, so that they +%D will not conflict (don't confuse this with \XML\ +%D namespaces.) +%D +%D \starttyping +%D \startXMLmapping [tag] | [-] [tag] | [+] [tag] +%D definitions +%D \stopXMLmapping +%D \stoptyping +%D +%D When a \type {[+]} is specified, the mappings will +%D nest. + +\def\resetXMLmapping + {\let\@@XMLelement\normal@@XMLelement + \let\@@XMLmapping\empty} + +\resetXMLmapping + +\def\startXMLmapping + {\dodoubleempty\dostartXMLmapping} + +% \def\dostartXMLmapping[#1][#2]% sneller maken +% {\pushmacro\@@XMLelement +% \pushmacro\@@XMLmapping +% \ifsecondargument +% \doifelse{#1}{-} +% {\donostartXMLmapping{#2}} +% {\doifelse{#1}{+} +% {\dodostartXMLmapping{#2}} +% {\donostartXMLmapping{#2}}}% +% \else +% \donostartXMLmapping{#1}% +% \fi +% \unprotect} + +\def\dostartXMLmapping[#1#2][#3]% + {\pushmacro\@@XMLelement + \pushmacro\@@XMLmapping + \ifsecondargument + \if\noexpand#1-% + \@EA\donostartXMLmapping + \else\if\noexpand#1+% + \@EAEAEA\dodostartXMLmapping + \else + \@EAEAEA\donostartXMLmapping + \fi\fi{#3}% + \else + \donostartXMLmapping{#1#2}% + \fi + \unprotect} + +\def\donostartXMLmapping#1% + {\let\@@XMLprevelement\@@XMLelement + \edef\@@XMLmapping{#1}% + \edef\@@XMLelement{\normal@@XMLelement+#1}} + +\def\dodostartXMLmapping#1% + {\let\@@XMLprevelement\@@XMLelement + \edef\@@XMLmapping{\@@XMLmapping+#1}% + \edef\@@XMLelement{\@@XMLelement+#1}} + +\def\stopXMLmapping + {\protect + \popmacro\@@XMLmapping + \popmacro\@@XMLelement} + +%D \macros +%D {startXMLmappinggroup} +%D +%D Imagine something: +%D +%D \starttyping +%D \defineXMLenvironment [something] +%D {\startXMLmapping[whatever]} +%D {\stopXMLmapping} +%D \stoptyping +%D +%D Here the \type {\stopXMLmapping} will never be reached +%D because we are in a mapping. Therefore we need: + +\def\startXMLmappinggroup + {\dodoubleempty\dostartXMLmappinggroup} + +\def\dostartXMLmappinggroup[#1][#2]% + {\bgroup + \letcscsname\savedXMLmeaning\csname\@@XMLelement:/\currentXMLelement\endcsname + \dostartXMLmapping[#1][#2]% do ! else wrong ! + \letcsnamecs\csname\@@XMLelement:/\currentXMLelement\endcsname\savedXMLmeaning} + +\def\stopXMLmappinggroup + {\stopXMLmapping + \egroup} + +%D Context Directives: + +\def\@@CTXML{@@CTXML} + +\def\defineXMLdirective + {\dodoubleempty\dodefineXMLdirective} + +\long\def\dodefineXMLdirective[#1][#2]#3% + {\defineXMLprocessor[context-#1-directive]{\dohandleXMLdirective{#1}{#3}}% + \ifsecondargument + \long\setvalue{\@@CTXML-#1-#2}{#3}% + \fi} + +\def\dohandleXMLdirective#1#2#3% + {\dodohandleXMLdirective#3 @ @ @\end{#1}{#2}} + +%\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6% +% {\doifdefinedelse{\@@CTXML-#5-#1} +% {\getvalue{\@@CTXML-#5-#1}[#2=#3]} +% {#6[#1][#2=#3]}} + +\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6% + {\executeifdefined{\@@CTXML-#5-#1}{#6[#1]}[#2=#3]} + +% \defineXMLdirective [mathml] \setupMMLappearance % [#1][#2=#3] +% \defineXMLdirective [flowchart] [shapes] \setupFLOWshapes % [#2=#3] +% \defineXMLdirective [flowchart] [lines] \setupFLOWlines % [#2=#3] + +\defineXMLprocessor [context-begin-group] {\bgroup\gobbleoneargument} +\defineXMLprocessor [context-end-group] {\egroup\gobbleoneargument} + +% \def\XMLnspart#1:#2\empty{#1} % call ...:\empty\empty +% \def\XMLidpart#1:#2#3\empty{\ifx#2\empty#1\else\XMLidpart#2#3\empty\empty\fi} + +% trial macros (used in setupx), to be sped up ! + +\bgroup \catcode`\<=\active + +\gdef\saveXMLasdata#1#2% name raw data + {\dodoglobal\setevalue{\@@XMLsave:#1}{#2}} % \edef! + +\gdef\saveXMLdata#1#2% name data-name ; definitely no \edef + {\dodoglobal\copycsname\@@XMLsave:#1\endcsname\csname\@@XMLdata:#2\endcsname} + +% \gdef\saveXMLdatainelement#1#2#3% name element data +% {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion +% {<#2 \currentXMLarguments>\XMLflush{#3}}} +% +% \gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after +% {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion +% {<#2 #3 \currentXMLarguments>#4\XMLflush{#5}#6}} +% +% better (no expansion): + +\newtoks\XMLdatatoks + +\gdef\saveXMLdatainelement#1#2#3% name element data + {\XMLdatatoks\@EAEAEA{\csname\@@XMLdata:#3\endcsname}% no check + \dodoglobal\setevalue{\@@XMLsave:#1}{<#2 \currentXMLarguments>\the\XMLdatatoks}} + +\gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after + {\XMLdatatoks\@EAEAEA{\csname\@@XMLdata:#5\endcsname}% no check + \dodoglobal\setevalue{\@@XMLsave:#1}{<#2 #3 \currentXMLarguments>#4\the\XMLdatatoks#6}} + +\gdef\gsaveXMLasdata {\doglobal\saveXMLasdata} +\gdef\gsaveXMLdata {\doglobal\saveXMLdata} +\gdef\gsaveXMLdatainelement{\doglobal\saveXMLdatainelement} +\gdef\gsaveXMLdatastructure{\doglobal\saveXMLdatastructure} + +\gdef\doifelseXMLelement#1% + {\doifdefinedelse{\@@XMLsave:#1}} + +\gdef\doifelseXMLelementcontent#1% + {\ifcsname\@@XMLsave:#1\endcsname + \bgroup + \@EA\defconvertedcommand\@EA\ascii\csname\@@XMLsave:#1\endcsname + \setbox\scratchbox\hbox{\ignorespaces\ascii\unskip\unskip\unskip}% + \ifdim\wd\scratchbox>\zeropoint + \egroup\@EAEAEA\firstoftwoarguments + \else + \egroup\@EAEAEA\secondoftwoarguments + \fi + \else + \@EA\secondoftwoarguments + \fi} + +\gdef\doifelseXMLelementequals#1#2% + {\ifcsname\@@XMLsave:#1\endcsname + \bgroup + \@EA\defconvertedcommand\@EA\asciia\csname\@@XMLsave:#1\endcsname + \defconvertedargument\asciib{#2}% + \ifx\asciia\asciib + \egroup\@EAEAEA\firstoftwoarguments + \else + \egroup\@EAEAEA\secondoftwoarguments + \fi + \else + \@EA\secondoftwoarguments + \fi} + +\gdef\doifXMLtextelse#1% new + {\doiftextelse{\simplifyXMLelements#1}} + +\gdef\doifXMLtext#1#2% new + {\doiftextelse{\simplifyXMLelements#1}{#2}\donothing} + +\gdef\convertXMLelement#1\to#2% + {\ifcsname\@@XMLsave:#1\endcsname + \@EA\defconvertedcommand\@EA#2\csname\@@XMLsave:#1\endcsname + \else + \let#2\ascii + \fi} + +\gdef\flushXMLelement#1% + {\csname + \@@XMLsave:\ifcsname\@@XMLsave:#1\endcsname#1\else\@@XMLsave\fi + \endcsname} + +\gdef\defXMLelement#1#2% + {\@EA\let\@EA#1\csname + \@@XMLsave:\ifcsname\@@XMLsave:#2\endcsname#2\else\@@XMLsave\fi + \endcsname} + +\letgvalueempty{\@@XMLsave:\@@XMLsave} + +\gdef\showXMLelement#1% + {\showvalue{\@@XMLsave:#1}} + +\gdef\eraseXMLelement#1% + {\dodoglobal\letbeundefined{\@@XMLsave:#1}} + +\gdef\geraseXMLelement + {\doglobal\eraseXMLelement} + +\gdef\processXMLelement#1% + {\bgroup + \enableXMLelements + \getvalue{\@@XMLsave:#1}% + \egroup} + +\gdef\texXMLelement#1% + {\begingroup +% \setnormalcatcodes + \disableXML + \scantokens\@EA\@EA\@EA{\csname\@@XMLsave:#1\endcsname}% + \endgroup} + +\gdef\reduceXMLescapeentities + {\setXMLentity{amp}{\string&}% + \setXMLentity{lt}{\string<}% + \setXMLentity{gt}{\string>}% + \setXMLentity{quot}{\string'}% + \setXMLentity{dquot}{\string"}} + +\gdef\reduceXMLelement#1\to#2% + {\ifcsname\@@XMLsave:#1\endcsname + \bgroup + \reduceXMLescapetokens + \reduceXMLescapeentities + \expanded{\egroup\noexpand\def\noexpand#2{\csname\@@XMLsave:#1\endcsname}}% + \else + \let#2\empty + \fi} + +\egroup + +% \defineXMLcommand +% [whatever] +% [test=unknown] +% {\XMLop{test}} +% +% \startXMLdata +% +% \stopXMLdata +% +% \defineXMLcommand +% [whatever] +% [test=unknown] +% {\defXMLtex\SomethingTex{\XMLop{test}}% +% \SomethingTex} +% +% \startXMLdata +% +% \stopXMLdata + +\def\defXMLtex#1#2% the appended space will go away when + {\begingroup % \scantokens is fixed + \disableXML + \everyeof{\noexpand}% br's hack + \edef\ascii{#2}% + \edef\ascii{\scantokens\expandafter{\ascii}}% space appended + \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{\ascii}} + +\def\potentialXMLentity#1% + {\doifXMLentityelse{#1}{\getXMLentity{#1}}{#1}} + +% \def\XMLnoschema{standalone='yes'} + +\def\writtenXMLelement #1#2{<#1>#2} +\def\writtenXMLstart #1{<#1>} +\def\writtenXMLend #1{} +\def\writtenXMLempty #1{<#1/>} +\def\writtenXMLelementcs#1#2{\ifx#2\empty\else<#1>#2\fi} +\def\writtenXMLemptycs #1#2{\ifx#2\empty<#1/>\else<#1>#2\fi} + +%D This one can be used to get sound tuo files. +%D +%D \starttyping +%D \setuphead[chapter][expansion=xml] +%D % \setuplist[chapter][textcommand=\enableXML] +%D +%D \enableregime[utf] \autoXMLentitiestrue +%D \stoptyping +%D +%D with: +%D +%D \starttyping +%D test ë test &ediaeresis; test ediaeresis +%D \stoptyping +%D +%D This gives: +%D +%D \starttyping +%D test ë test ediaeresis test ediaeresis +%D \stoptyping + +\def\XMLprocessingparameter#1% + {\csname\??xp#1\endcsname} + +\appendtoks + \defineXMLargument[\XMLprocessingparameter\c!escape]\getXMLentity +\to \aftersetupXMLprocessing + +\setupXMLprocessing + [\c!escape=e] + +\bgroup \catcode`\<=\active + +\long\gdef\defexpandedxmlargument#1#2#3% + {\begingroup + \let\uppercase\firstofoneargument + \def\getXMLhexcharacter##1{\numbertoutp{"##1}}% maps to private if needed + \def\getXMLdeccharacter##1{\numbertoutp {##1}}% maps to private if needed + \def\getXMLentity##1{##1}% + \def<{\noexpand<}% + \ifcase\xmlexpandmode + \or + % 1 = default + \or + % 2 = keep utf + \keeputfcharacters % new, needed for chinese and such + \fi + \let\uchar\relax + \let\unicodechar\relax + \xdef\@@globalexpanded{#3}% + \endgroup + #1#2\@@globalexpanded} + +\egroup + +% test.xml: test % test +% +% \starttext +% \enableregime[utf] \chardef\XMLtokensreduction=0 +% \setuphead[chapter][expansion=xml] +% \defineXMLargument[test]{\chapter} +% \placelist[chapter][criterium=text] +% \processXMLfilegrouped{test.xml} +% \stoptext + +% obsolete in mkiv + +\chardef\xmlexpandmode\plusone + +\def\defexpandedxmlargumentcmd {\chardef\xmlexpandmode\plusone\defexpandedxmlargument\defconvertedcommand} +\def\defexpandedxmlargumentutf {\chardef\xmlexpandmode\plustwo\defexpandedxmlargument\defconvertedcommand} +\def\gdefexpandedxmlargumentcmd{\chardef\xmlexpandmode\plusone\defexpandedxmlargument\gdefconvertedcommand} +\def\gdefexpandedxmlargumentutf{\chardef\xmlexpandmode\plustwo\defexpandedxmlargument\gdefconvertedcommand} + +\installexpander {xml} \defexpandedxmlargumentcmd \gdefexpandedxmlargumentcmd +\installexpander {xml:cmd} \defexpandedxmlargumentcmd \gdefexpandedxmlargumentcmd +\installexpander {xml:utf} \defexpandedxmlargumentutf \gdefexpandedxmlargumentutf + +\def\XMLtexmath#1{\begingroup\setnormalcatcodes\scantokens{\mathematics{#1}\ignorespaces}\endgroup} + +% \defineXMLargument[tm]{\XMLtexmath} +% +% \startbuffer[test] +% Sometimes it makes sense to use simple math, as in: e=mc^2. +% \stopbuffer +% +% \processXMLbuffer[test] + +%D Undocumented ... + +\def\defineXMLstore {\doquadrupleargument\dodefineXMLstore[\saveXMLasdata]} +\def\defineXMLgstore{\doquadrupleargument\dodefineXMLstore[\gsaveXMLasdata]} + +\def\dodefineXMLstore[#1][#2][#3][#4]% element attribute prefix % will become faster + {\defineXMLargument[#2][#3=\s!dummy]{#1{#4:\XMLop{#3}}}} + +\def\countXMLchildren[#1]#2% + {\startnointerference + \doglobal\newcounter\nofXMLchildren + \defineXMLargument[#1]{\doglobal\increment\nofXMLchildren}% + \startXMLignore + #2% + \stopXMLignore + \stopnointerference} + +% Typical \MKII. We will not explore this route any further as in \MKIV\ we +% have better ways. + +\prependtoks \setnormalcatcodes \to \everyTEXinputmode +\appendtoks \processingXMLfalse \to \everyTEXinputmode + +\let\normalenableXML\enableXML % some day we move the normal \enableXML into the toks + +\prependtoks \normalenableXML \to \everyXMLinputmode +\appendtoks \processingXMLtrue \to \everyXMLinputmode + +\unexpanded\def\enableXML {\setinputmode[XML]} % \enableXML is used in edef's and marks +\unexpanded\def\disableXML{\setinputmode[TEX]} + +\protect \endinput diff --git a/tex/context/base/xtag-ext.tex b/tex/context/base/xtag-ext.tex deleted file mode 100644 index 9a132c677..000000000 --- a/tex/context/base/xtag-ext.tex +++ /dev/null @@ -1,439 +0,0 @@ -%D \module -%D [ file=xtag-ext, -%D version=2001.03.21, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Extra Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Extras} - -\unprotect - -%D \macros -%D {startXMLmapping} -%D -%D You can define macros within a namespace, so that they -%D will not conflict (don't confuse this with \XML\ -%D namespaces.) -%D -%D \starttyping -%D \startXMLmapping [tag] | [-] [tag] | [+] [tag] -%D definitions -%D \stopXMLmapping -%D \stoptyping -%D -%D When a \type {[+]} is specified, the mappings will -%D nest. - -\def\resetXMLmapping - {\let\@@XMLelement\normal@@XMLelement - \let\@@XMLmapping\empty} - -\resetXMLmapping - -\def\startXMLmapping - {\dodoubleempty\dostartXMLmapping} - -% \def\dostartXMLmapping[#1][#2]% sneller maken -% {\pushmacro\@@XMLelement -% \pushmacro\@@XMLmapping -% \ifsecondargument -% \doifelse{#1}{-} -% {\donostartXMLmapping{#2}} -% {\doifelse{#1}{+} -% {\dodostartXMLmapping{#2}} -% {\donostartXMLmapping{#2}}}% -% \else -% \donostartXMLmapping{#1}% -% \fi -% \unprotect} - -\def\dostartXMLmapping[#1#2][#3]% - {\pushmacro\@@XMLelement - \pushmacro\@@XMLmapping - \ifsecondargument - \if\noexpand#1-% - \@EA\donostartXMLmapping - \else\if\noexpand#1+% - \@EAEAEA\dodostartXMLmapping - \else - \@EAEAEA\donostartXMLmapping - \fi\fi{#3}% - \else - \donostartXMLmapping{#1#2}% - \fi - \unprotect} - -\def\donostartXMLmapping#1% - {\let\@@XMLprevelement\@@XMLelement - \edef\@@XMLmapping{#1}% - \edef\@@XMLelement{\normal@@XMLelement+#1}} - -\def\dodostartXMLmapping#1% - {\let\@@XMLprevelement\@@XMLelement - \edef\@@XMLmapping{\@@XMLmapping+#1}% - \edef\@@XMLelement{\@@XMLelement+#1}} - -\def\stopXMLmapping - {\protect - \popmacro\@@XMLmapping - \popmacro\@@XMLelement} - -%D \macros -%D {startXMLmappinggroup} -%D -%D Imagine something: -%D -%D \starttyping -%D \defineXMLenvironment [something] -%D {\startXMLmapping[whatever]} -%D {\stopXMLmapping} -%D \stoptyping -%D -%D Here the \type {\stopXMLmapping} will never be reached -%D because we are in a mapping. Therefore we need: - -\def\startXMLmappinggroup - {\dodoubleempty\dostartXMLmappinggroup} - -\def\dostartXMLmappinggroup[#1][#2]% - {\bgroup - \letcscsname\savedXMLmeaning\csname\@@XMLelement:/\currentXMLelement\endcsname - \dostartXMLmapping[#1][#2]% do ! else wrong ! - \letcsnamecs\csname\@@XMLelement:/\currentXMLelement\endcsname\savedXMLmeaning} - -\def\stopXMLmappinggroup - {\stopXMLmapping - \egroup} - -%D Context Directives: - -\def\@@CTXML{@@CTXML} - -\def\defineXMLdirective - {\dodoubleempty\dodefineXMLdirective} - -\long\def\dodefineXMLdirective[#1][#2]#3% - {\defineXMLprocessor[context-#1-directive]{\dohandleXMLdirective{#1}{#3}}% - \ifsecondargument - \long\setvalue{\@@CTXML-#1-#2}{#3}% - \fi} - -\def\dohandleXMLdirective#1#2#3% - {\dodohandleXMLdirective#3 @ @ @\end{#1}{#2}} - -%\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6% -% {\doifdefinedelse{\@@CTXML-#5-#1} -% {\getvalue{\@@CTXML-#5-#1}[#2=#3]} -% {#6[#1][#2=#3]}} - -\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6% - {\executeifdefined{\@@CTXML-#5-#1}{#6[#1]}[#2=#3]} - -% \defineXMLdirective [mathml] \setupMMLappearance % [#1][#2=#3] -% \defineXMLdirective [flowchart] [shapes] \setupFLOWshapes % [#2=#3] -% \defineXMLdirective [flowchart] [lines] \setupFLOWlines % [#2=#3] - -\defineXMLprocessor [context-begin-group] {\bgroup\gobbleoneargument} -\defineXMLprocessor [context-end-group] {\egroup\gobbleoneargument} - -% \def\XMLnspart#1:#2\empty{#1} % call ...:\empty\empty -% \def\XMLidpart#1:#2#3\empty{\ifx#2\empty#1\else\XMLidpart#2#3\empty\empty\fi} - -% trial macros (used in setupx), to be sped up ! - -\bgroup \catcode`\<=\active - -\gdef\saveXMLasdata#1#2% name raw data - {\dodoglobal\setevalue{\@@XMLsave:#1}{#2}} % \edef! - -\gdef\saveXMLdata#1#2% name data-name ; definitely no \edef - {\dodoglobal\copycsname\@@XMLsave:#1\endcsname\csname\@@XMLdata:#2\endcsname} - -% \gdef\saveXMLdatainelement#1#2#3% name element data -% {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion -% {<#2 \currentXMLarguments>\XMLflush{#3}}} -% -% \gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after -% {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion -% {<#2 #3 \currentXMLarguments>#4\XMLflush{#5}#6}} -% -% better (no expansion): - -\newtoks\XMLdatatoks - -\gdef\saveXMLdatainelement#1#2#3% name element data - {\XMLdatatoks\@EAEAEA{\csname\@@XMLdata:#3\endcsname}% no check - \dodoglobal\setevalue{\@@XMLsave:#1}{<#2 \currentXMLarguments>\the\XMLdatatoks}} - -\gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after - {\XMLdatatoks\@EAEAEA{\csname\@@XMLdata:#5\endcsname}% no check - \dodoglobal\setevalue{\@@XMLsave:#1}{<#2 #3 \currentXMLarguments>#4\the\XMLdatatoks#6}} - -\gdef\gsaveXMLasdata {\doglobal\saveXMLasdata} -\gdef\gsaveXMLdata {\doglobal\saveXMLdata} -\gdef\gsaveXMLdatainelement{\doglobal\saveXMLdatainelement} -\gdef\gsaveXMLdatastructure{\doglobal\saveXMLdatastructure} - -\gdef\doifelseXMLelement#1% - {\doifdefinedelse{\@@XMLsave:#1}} - -\gdef\doifelseXMLelementcontent#1% - {\ifcsname\@@XMLsave:#1\endcsname - \bgroup - \@EA\defconvertedcommand\@EA\ascii\csname\@@XMLsave:#1\endcsname - \setbox\scratchbox\hbox{\ignorespaces\ascii\unskip\unskip\unskip}% - \ifdim\wd\scratchbox>\zeropoint - \egroup\@EAEAEA\firstoftwoarguments - \else - \egroup\@EAEAEA\secondoftwoarguments - \fi - \else - \@EA\secondoftwoarguments - \fi} - -\gdef\doifelseXMLelementequals#1#2% - {\ifcsname\@@XMLsave:#1\endcsname - \bgroup - \@EA\defconvertedcommand\@EA\asciia\csname\@@XMLsave:#1\endcsname - \defconvertedargument\asciib{#2}% - \ifx\asciia\asciib - \egroup\@EAEAEA\firstoftwoarguments - \else - \egroup\@EAEAEA\secondoftwoarguments - \fi - \else - \@EA\secondoftwoarguments - \fi} - -\gdef\doifXMLtextelse#1% new - {\doiftextelse{\simplifyXMLelements#1}} - -\gdef\doifXMLtext#1#2% new - {\doiftextelse{\simplifyXMLelements#1}{#2}\donothing} - -\gdef\convertXMLelement#1\to#2% - {\ifcsname\@@XMLsave:#1\endcsname - \@EA\defconvertedcommand\@EA#2\csname\@@XMLsave:#1\endcsname - \else - \let#2\ascii - \fi} - -\gdef\flushXMLelement#1% - {\csname - \@@XMLsave:\ifcsname\@@XMLsave:#1\endcsname#1\else\@@XMLsave\fi - \endcsname} - -\gdef\defXMLelement#1#2% - {\@EA\let\@EA#1\csname - \@@XMLsave:\ifcsname\@@XMLsave:#2\endcsname#2\else\@@XMLsave\fi - \endcsname} - -\letgvalueempty{\@@XMLsave:\@@XMLsave} - -\gdef\showXMLelement#1% - {\showvalue{\@@XMLsave:#1}} - -\gdef\eraseXMLelement#1% - {\dodoglobal\letbeundefined{\@@XMLsave:#1}} - -\gdef\geraseXMLelement - {\doglobal\eraseXMLelement} - -\gdef\processXMLelement#1% - {\bgroup - \enableXMLelements - \getvalue{\@@XMLsave:#1}% - \egroup} - -\gdef\texXMLelement#1% - {\begingroup -% \setnormalcatcodes - \disableXML - \scantokens\@EA\@EA\@EA{\csname\@@XMLsave:#1\endcsname}% - \endgroup} - -\gdef\reduceXMLescapeentities - {\setXMLentity{amp}{\string&}% - \setXMLentity{lt}{\string<}% - \setXMLentity{gt}{\string>}% - \setXMLentity{quot}{\string'}% - \setXMLentity{dquot}{\string"}} - -\gdef\reduceXMLelement#1\to#2% - {\ifcsname\@@XMLsave:#1\endcsname - \bgroup - \reduceXMLescapetokens - \reduceXMLescapeentities - \expanded{\egroup\noexpand\def\noexpand#2{\csname\@@XMLsave:#1\endcsname}}% - \else - \let#2\empty - \fi} - -\egroup - -% \defineXMLcommand -% [whatever] -% [test=unknown] -% {\XMLop{test}} -% -% \startXMLdata -% -% \stopXMLdata -% -% \defineXMLcommand -% [whatever] -% [test=unknown] -% {\defXMLtex\SomethingTex{\XMLop{test}}% -% \SomethingTex} -% -% \startXMLdata -% -% \stopXMLdata - -\def\defXMLtex#1#2% the appended space will go away when - {\begingroup % \scantokens is fixed - \disableXML - \everyeof{\noexpand}% br's hack - \edef\ascii{#2}% - \edef\ascii{\scantokens\expandafter{\ascii}}% space appended - \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{\ascii}} - -\def\potentialXMLentity#1% - {\doifXMLentityelse{#1}{\getXMLentity{#1}}{#1}} - -% \def\XMLnoschema{standalone='yes'} - -\def\writtenXMLelement #1#2{<#1>#2} -\def\writtenXMLstart #1{<#1>} -\def\writtenXMLend #1{} -\def\writtenXMLempty #1{<#1/>} -\def\writtenXMLelementcs#1#2{\ifx#2\empty\else<#1>#2\fi} -\def\writtenXMLemptycs #1#2{\ifx#2\empty<#1/>\else<#1>#2\fi} - -%D This one can be used to get sound tuo files. -%D -%D \starttyping -%D \setuphead[chapter][expansion=xml] -%D % \setuplist[chapter][textcommand=\enableXML] -%D -%D \enableregime[utf] \autoXMLentitiestrue -%D \stoptyping -%D -%D with: -%D -%D \starttyping -%D test ë test &ediaeresis; test ediaeresis -%D \stoptyping -%D -%D This gives: -%D -%D \starttyping -%D test ë test ediaeresis test ediaeresis -%D \stoptyping - -\def\XMLprocessingparameter#1% - {\csname\??xp#1\endcsname} - -\appendtoks - \defineXMLargument[\XMLprocessingparameter\c!escape]\getXMLentity -\to \aftersetupXMLprocessing - -\setupXMLprocessing - [\c!escape=e] - -\bgroup \catcode`\<=\active - -\long\gdef\defexpandedxmlargument#1#2#3% - {\begingroup - \let\uppercase\firstofoneargument - \def\getXMLhexcharacter##1{\numbertoutp{"##1}}% maps to private if needed - \def\getXMLdeccharacter##1{\numbertoutp {##1}}% maps to private if needed - \def\getXMLentity##1{##1}% - \def<{\noexpand<}% - \ifcase\xmlexpandmode - \or - % 1 = default - \or - % 2 = keep utf - \keeputfcharacters % new, needed for chinese and such - \fi - \let\uchar\relax - \let\unicodechar\relax - \xdef\@@globalexpanded{#3}% - \endgroup - #1#2\@@globalexpanded} - -\egroup - -% test.xml: test % test -% -% \starttext -% \enableregime[utf] \chardef\XMLtokensreduction=0 -% \setuphead[chapter][expansion=xml] -% \defineXMLargument[test]{\chapter} -% \placelist[chapter][criterium=text] -% \processXMLfilegrouped{test.xml} -% \stoptext - -% obsolete in mkiv - -\chardef\xmlexpandmode\plusone - -\def\defexpandedxmlargumentcmd {\chardef\xmlexpandmode\plusone\defexpandedxmlargument\defconvertedcommand} -\def\defexpandedxmlargumentutf {\chardef\xmlexpandmode\plustwo\defexpandedxmlargument\defconvertedcommand} -\def\gdefexpandedxmlargumentcmd{\chardef\xmlexpandmode\plusone\defexpandedxmlargument\gdefconvertedcommand} -\def\gdefexpandedxmlargumentutf{\chardef\xmlexpandmode\plustwo\defexpandedxmlargument\gdefconvertedcommand} - -\installexpander {xml} \defexpandedxmlargumentcmd \gdefexpandedxmlargumentcmd -\installexpander {xml:cmd} \defexpandedxmlargumentcmd \gdefexpandedxmlargumentcmd -\installexpander {xml:utf} \defexpandedxmlargumentutf \gdefexpandedxmlargumentutf - -\def\XMLtexmath#1{\begingroup\setnormalcatcodes\scantokens{\mathematics{#1}\ignorespaces}\endgroup} - -% \defineXMLargument[tm]{\XMLtexmath} -% -% \startbuffer[test] -% Sometimes it makes sense to use simple math, as in: e=mc^2. -% \stopbuffer -% -% \processXMLbuffer[test] - -%D Undocumented ... - -\def\defineXMLstore {\doquadrupleargument\dodefineXMLstore[\saveXMLasdata]} -\def\defineXMLgstore{\doquadrupleargument\dodefineXMLstore[\gsaveXMLasdata]} - -\def\dodefineXMLstore[#1][#2][#3][#4]% element attribute prefix % will become faster - {\defineXMLargument[#2][#3=\s!dummy]{#1{#4:\XMLop{#3}}}} - -\def\countXMLchildren[#1]#2% - {\startnointerference - \doglobal\newcounter\nofXMLchildren - \defineXMLargument[#1]{\doglobal\increment\nofXMLchildren}% - \startXMLignore - #2% - \stopXMLignore - \stopnointerference} - -% Typical \MKII. We will not explore this route any further as in \MKIV\ we -% have better ways. - -\prependtoks \setnormalcatcodes \to \everyTEXinputmode -\appendtoks \processingXMLfalse \to \everyTEXinputmode - -\let\normalenableXML\enableXML % some day we move the normal \enableXML into the toks - -\prependtoks \normalenableXML \to \everyXMLinputmode -\appendtoks \processingXMLtrue \to \everyXMLinputmode - -\unexpanded\def\enableXML {\setinputmode[XML]} % \enableXML is used in edef's and marks -\unexpanded\def\disableXML{\setinputmode[TEX]} - -\protect \endinput diff --git a/tex/context/base/xtag-hyp.mkii b/tex/context/base/xtag-hyp.mkii new file mode 100644 index 000000000..e4e048e2b --- /dev/null +++ b/tex/context/base/xtag-hyp.mkii @@ -0,0 +1,69 @@ +%D \module +%D [ file=xtag-hyp, +%D version=2003.11.24, +%D title=\CONTEXT\ XML MAcros, +%D subtitle=Hyphenation, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Hyphenation} + +%D This filter is kind of obsolete, since \UTF\ is not +%D limited to \XML. So, here we only enable \UTF\ support. + +\ifnum\texengine=\luatexengine + \defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding] + {\startnointerference + \defineXMLargument [hyphenation] \hyphenation + \language[\XMLop{language}]} + {\stopnointerference} +\else + \defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding] + {\startnointerference + \defineXMLargument [hyphenation] \hyphenation + \language[\XMLop{language}]% + \enableregime[\XMLop{regime}]% + \enableencoding[\XMLop{encoding}]} + {\stopnointerference} +\fi + +\defineXMLsingular [hyphenate] + {\-} + +\defineXMLgrouped [language] [code=\currentlanguage,scope=local] + {\doifelse{\XMLop{scope}}{global}\mainlanguage\language[\XMLop{code}]} + +\defineXMLsingular [language] [code=\currentlanguage] + {\doifelse{\XMLop{scope}}{global}\mainlanguage\language[\XMLop{code}]} + +\defineXMLsingular [compound] [token=-] + {\expanded{\directdiscretionary{\XMLop{token}}}} + +\endinput + +% \mainlanguage[nl] \setupbodyfont[pos] \useXMLfilter[utf,hyp] +% +% \starttext +% +% \hyphenatedword{pati\ediaeresis nten} +% \hyphenatedword{pati\ediaeresis ntenorganisatie} +% \hyphenatedword{pati\ediaeresis ntenplatform} +% +% \startXMLdata +% +% pa-tiën-ten +% pa-tiën-ten-or-ga-ni-sa-tie +% pa-tiën-ten-plat-form +% +% \stopXMLdata +% +% \hyphenatedword{pati\ediaeresis nten} +% \hyphenatedword{pati\ediaeresis ntenorganisatie} +% \hyphenatedword{pati\ediaeresis ntenplatform} +% +% \stoptext diff --git a/tex/context/base/xtag-hyp.tex b/tex/context/base/xtag-hyp.tex deleted file mode 100644 index e4e048e2b..000000000 --- a/tex/context/base/xtag-hyp.tex +++ /dev/null @@ -1,69 +0,0 @@ -%D \module -%D [ file=xtag-hyp, -%D version=2003.11.24, -%D title=\CONTEXT\ XML MAcros, -%D subtitle=Hyphenation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Hyphenation} - -%D This filter is kind of obsolete, since \UTF\ is not -%D limited to \XML. So, here we only enable \UTF\ support. - -\ifnum\texengine=\luatexengine - \defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding] - {\startnointerference - \defineXMLargument [hyphenation] \hyphenation - \language[\XMLop{language}]} - {\stopnointerference} -\else - \defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding] - {\startnointerference - \defineXMLargument [hyphenation] \hyphenation - \language[\XMLop{language}]% - \enableregime[\XMLop{regime}]% - \enableencoding[\XMLop{encoding}]} - {\stopnointerference} -\fi - -\defineXMLsingular [hyphenate] - {\-} - -\defineXMLgrouped [language] [code=\currentlanguage,scope=local] - {\doifelse{\XMLop{scope}}{global}\mainlanguage\language[\XMLop{code}]} - -\defineXMLsingular [language] [code=\currentlanguage] - {\doifelse{\XMLop{scope}}{global}\mainlanguage\language[\XMLop{code}]} - -\defineXMLsingular [compound] [token=-] - {\expanded{\directdiscretionary{\XMLop{token}}}} - -\endinput - -% \mainlanguage[nl] \setupbodyfont[pos] \useXMLfilter[utf,hyp] -% -% \starttext -% -% \hyphenatedword{pati\ediaeresis nten} -% \hyphenatedword{pati\ediaeresis ntenorganisatie} -% \hyphenatedword{pati\ediaeresis ntenplatform} -% -% \startXMLdata -% -% pa-tiën-ten -% pa-tiën-ten-or-ga-ni-sa-tie -% pa-tiën-ten-plat-form -% -% \stopXMLdata -% -% \hyphenatedword{pati\ediaeresis nten} -% \hyphenatedword{pati\ediaeresis ntenorganisatie} -% \hyphenatedword{pati\ediaeresis ntenplatform} -% -% \stoptext diff --git a/tex/context/base/xtag-ini.mkii b/tex/context/base/xtag-ini.mkii new file mode 100644 index 000000000..85b481419 --- /dev/null +++ b/tex/context/base/xtag-ini.mkii @@ -0,0 +1,3023 @@ +%D \module +%D [ file=xtag-ini, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Initialization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Initialization} + +%D Beware: don't rely on \longempty things, since this may +%D change! + +%D \macros +%D {defineinputmode,setinputmode} +%D +%D For old times sake we still support: + +\unexpanded\def\defineinputmode[#1]{\expandafter\newtoks\csname every#1inputmode\endcsname} +\unexpanded\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks} + +\defineinputmode [TEX] +\defineinputmode [XML] + +\setinputmode [TEX] + +%D Finally we make sure that the compound handler keeps doingits job. + +\ifx\normalcompound\undefined \let\normalcompound=| \fi + +\appendtoks \catcode`|=\activecatcode \let|\normalcompound \to \everyTEXinputmode +\appendtoks \catcode`|=\lettercatcode \to \everyXMLinputmode + +%D This module is highly optimized for speed, which sometimes +%D leads to rather unreadable code. Sorry for this. + +\bgroup \obeylines + +\gdef\startXMLdefinitions% keep % + {\bgroup\obeylines\dostartXMLdefinitions} + +\gdef\dostartXMLdefinitions #1 + {\egroup\doifsomething{#1}{\writestatus{XML}{loading #1 support}}} + +\global\let\stopXMLdefinitions\relax + +\egroup + +% todo: XMLfullsave == also attributes +% csnames +% XMLelse -> elseXML + +%D Remark: some hard coded character things will be replaced +%D by named glyphs as soon as the upgraded encoding modules +%D are released. At that moment, unicode support will be +%D provided in accordance with the normal support in \CONTEXT. + +%D Like it or not, this module deals with angle bracketed +%D input. Processing \XML\ alike input in \CONTEXT\ has been +%D possible since 1995, and till 2000 several methods ran in +%D parallel. These were implemented in modules like the semi +%D public \type {m-sgml}. +%D +%D There is not one optimal solution for processing \XML\ data. +%D The oldest method was based on a very simple preprocessor +%D written in \MODULA\ and later \PERL: \type {} was +%D converted into \type {\begSGML[command]} and optional +%D parameters were passed. +%D +%D A second method uses a \PERL\ or \XSL\ transformation +%D script that produces \CONTEXT\ commands. This method is +%D much slower, mainly because the whole document is read into +%D memory and a document tree is to be build. The advantage is +%D that processing of the resulting document is fast. +%D +%D The third method uses a basic parser written in the \TEX\ +%D language, and apart from a few pitfalls, this method is +%D clean and efficient, but not always robust. Because errors +%D in the input are not catched on forehand, processing in +%D \TEX\ may fail due to errors. But, given that a document +%D can be validated on forehand, this is no big problem. +%D +%D Each method has its advantage, but especially the third +%D method puts some demands on \CONTEXT, since no interference +%D between the parser and the core commands may occur. What +%D method is used, depends on the situation. +%D +%D All three methods introduce some problems in interfacing to +%D core \CONTEXT\ functionality. This is due to the fact that +%D sometimes we want to typeset content directly, while in +%D other cases we just want to pick up data for later usage, +%D either or not using delimited arguments. And, when moving +%D data around, there is always the expansion problem to deal +%D with. +%D +%D As can be expected, we have to map begin and end tags onto +%D \CONTEXT's start- and stopcommands. This is the easy part. +%D When we have to pass the content of an element to a macro +%D as argument, we need to do a delimited grab. Such mappings +%D are not that hard to implement and were part of \type +%D {m-sgml.tex} already. New in this core module is nested +%D grabbing. Also new here is the support for namespaces and +%D extensive attribute handling. On the other hand, recursive +%D traceback of attributes is no longer supported. Because +%D this feature was not really used, we can hereby safely we +%D declare the \type {m-sgml.tex} module obsolete. +%D +%D In order to be able to incorporate \XML\ style definitions +%D into basic \TEX\ styles, we will provide some basic +%D functionality in the core itself. Some of the functionality +%D can be set up with this general command. We use a token +%D list register to handle post||setup actions. This permits +%D us to extend this command. + +\unprotect + +\newtoks\aftersetupXMLprocessing + +\def\setupXMLprocessing + {\dosingleargument\dosetupXMLprocessing} + +\def\dosetupXMLprocessing[#1]% + {\getparameters[\??xp][#1]\the\aftersetupXMLprocessing} + +\def\XMLprocessingparameter#1% + {\csname\??xp#1\endcsname} + +\protect + +%D Formally an \XML\ file starts with an unique sequence +%D \type {} + +%D We will be dealing with elements, which means that we have +%D to take care of \type {} and \type {}, but +%D also with \type {} and \type {}. In some cases +%D the upper and lowercase alternatives need to be dealt with, +%D although this is not realy needed since XML is case +%D sensitive. +%D +%D We also have to handle entities, like \type {&you;} and +%D \type {&me;}. These are quite easy to deal with and need to +%D be hooked into the encoding and abbreviation mechanisms. +%D +%D And then there are the parameters to be taken care of. Here +%D we meet \type {key="value"} but also \type {key='eulav'} +%D and even the spacy \typ {key = "value"}. +%D +%D Since we have to handlers for each element and entity, we +%D will create a few namespaces. Special care has to be +%D given to preformated code. +%D +%D There are two namespace mechanisms in place: one for +%D \TEX, and one for \XML. The later mechanism permits +%D remapping and ignoring. + +\unprotect + +\def \@@XML {XML:} +\edef\@@XMLentity {\@@XML ent} % &crap; +\edef\@@XMLelement {\@@XML ele} % +\edef\@@XMLvariable {\@@XML var} % key="val" +\edef\@@XMLvalue {\@@XML val} % key="val" +\edef\@@XMLpars {\@@XML par} % +\edef\@@XMLdata {\@@XML dat} % mem buffer +\edef\@@XMLcode {\@@XML cod} % named mem buffers +\edef\@@XMLinstruction {\@@XML ins} % +\edef\@@XMLvariable {\@@XML c} % key="val" +\edef\@@XMLvalue {\@@XML d} % key="val" +\edef\@@XMLpars {\@@XML e} % +\edef\@@XMLdata {\@@XML f} % mem buffer +\edef\@@XMLcode {\@@XML g} % named mem buffers +\edef\@@XMLinstruction {\@@XML h} % =.@@other +% .catcode`."=.@@other +% .catcode`./=.@@other +% .catcode`.'=.@@other +% .catcode`.~=.@@other +% .catcode`.#=.@@other +% .let &=.doXMLentity +% .unexpanded.def=.@@other +% .unexpanded.def=.@@other +% .let<.relax * new +% .processingXMLfalse +% E +% +% .global.let<.relax * new +% .global.let&.relax * new +% +% .egroup +% +% \def\disableXML +% {\setnormalcatcodes\processingXMLfalse} + +\defcatcodecommand\xmlcatcodese `\& \doXMLentity +\defcatcodecommand\xmlcatcodese `\< \doXMLelement +\defcatcodecommand\xmlcatcodesr `\& \doXMLentity +\defcatcodecommand\xmlcatcodesr `\< \doXMLelement +\defcatcodecommand\xmlcatcodesn `\& \doXMLentity +\defcatcodecommand\xmlcatcodesn `\< \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 \let&\relax + +\xdef\entityhash {&\string#035;} +\xdef\entitydollar {&\string#036;} +\xdef\entitypercent {&\string#037;} +\xdef\entitybackslash {&\string#092;} +\xdef\entityhat {&\string#094;} +\xdef\entityunderscore{&\string#095;} +\xdef\entityleftbrace {&\string#123;} +\xdef\entityrightbrace{&\string#125;} +\xdef\entitybar {&\string#124;} + +\egroup + +\letcatcodecommand\xmlcatcodese `\# \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 < & + +\doifmodeelse {mkiv} { + + \def\mksetXMLtokensreduction % mkiv + {\setcatcodetable\xmlcatcodesn} + +} { + + \def\mksetXMLtokensreduction % mkii + {\ifcase\XMLtokensreduction + \setcatcodetable\xmlcatcodese \or + \setcatcodetable\xmlcatcodesr \else + \setcatcodetable\xmlcatcodesn + \fi} + +} + +\bgroup \catcode`\<=13 \catcode`\&=13 + +\gdef\enableXML + {\mksetXMLtokensreduction + \let&\doXMLentity + \unexpanded\def<{\doXMLelement}% + \processingXMLtrue + \the\everyenableXML} + +\gdef\disableXML + {\setcatcodetable\ctxcatcodes % maybe \texcatcodes + \processingXMLfalse} + +\gdef\enableXMLexpansion + {\def<{\doXMLelement}% + \let&\doXMLentity} + +\gdef\disableXMLexpansion + {\unexpanded\def<{\doXMLelement}% + \let&\doXMLentity} + +\unexpanded\gdef\enableXMLelements + {\catcode60=\@@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 +%D equivalent: +%D +%D \starttyping +%D +%D \stoptyping +%D +%D Empty elements can have arguments too. Conforming the +%D standard, each key must have a value. These are separated +%D by an \type {=} sign and the value is delimited by either +%D \type {"} or \type {'}. There may be spaces around the +%D equal sign. +%D +%D \starttyping +%D +%D \stoptyping +%D +%D Officially the following definition is not valid: +%D +%D \starttyping +%D some text +%D \stoptyping +%D +%D Although we can handle both cases independently, this is +%D seldom needed. +%D +%D Processing instructions are identified by a~\type {?} and are +%D like empty elements. +%D +%D \starttyping +%D +%D \stoptyping +%D +%D Comment is formatted as follows. +%D +%D \starttyping +%D +%D \stoptyping +%D +%D Verbatim code inits purest form is called \type {CDATA} and +%D is embedded in the following ugly and therefore recognizable +%D way: +%D +%D \starttyping +%D +%D \stoptyping + +%D The parser is implemented as a multi||step macro. Because +%D \type {!} and \type {?} should be picked up correctly, we +%D need to define a few macros in unprotected mode! +%D +%D Because \XML\ is defined with some restrictions in mind, +%D parsing the elements is not that complicated. First we have +%D to determine if we're dealing with a comment or processing +%D instruction. We need a bit of grouping because we have to +%D mess up with catcodes. We probably have to treat a few +%D more catcode and first character cases. We need to use +%D \type {\begingroup} here, otherwise we get funny spaces in +%D math. + +%D Maybe I will remove grouping here and introduce \type +%D {\obeyXMLlines}. + +%D By using a few {\expandafter}'s we can avoid a \type {\next} +%D construction. We could speed the first char test up a bit +%D by using an installer and something \typ {\getvalue +%D {#1doXMLelement}} (todo). + +\protect % we need an normal ! ? + +% \long\def\doXMLelement#1% +% {\if#1!\expandafter \xparseXMLescape \else +% \if#1?\expandafter\expandafter\expandafter \xparseXMLprocess \else +% \expandafter\expandafter\expandafter \xparseXMLelement \fi\fi +% #1} + +\def\expandthree{\expandafter\expandafter\expandafter} + +\long\def\doXMLelement#1% + {\if#1!\expandafter \xparseXMLescape \else + \if#1?\expandthree \xparseXMLprocess \else + \expandthree \xparseXMLelement \fi\fi + #1} + +% does it end with ? or ?> + +\long\def\xparseXMLescape !#1 {\parseXMLescape{#1}} +\long\def\xparseXMLprocess ?#1 #2>{\parseXMLprocess{#1}{#2}} +\long\def\xparseXMLelement #1>{\parseXMLelement #1 >} + +%D The escape handler takes care of the fuzzy \type { parsing takes place in macros + {\executeifdefined{\@@XMLescape:#1}{\csname\@@XMLescape:\s!default\endcsname}} + +%D In our case, processing instructions are only needed if +%D we want specific \CONTEXT\ support. This may be useful in +%D applications where the data is generated by an +%D application. We will implement a \CONTEXT\ code handler +%D later. + +%D The processing instructions handler is implemented as +%D follows. + +\long\def\defineXMLprocessor[#1]#2% + {\long\setvalue{\@@XMLinstruction:#1}{#2}} + +% \def\parseXMLprocess#1#2% +% {\executeifdefined{\@@XMLinstruction:#1}\gobbleoneargument{#2}} + +%D Because we support \type {.. ?>} as well as \type {.. >} +%D end||of||pi situations, we need to clean up the ending +%D \type {?}. + +\protect + +\long\def\cleanupXMLprocess#1% + {\docleanupXMLprocess#1 ? \relax} + +\long\def\docleanupXMLprocess#1? #2\relax + {\def\currentXMLprocess{#1}} + +\unprotect + +\def\parseXMLprocess#1#2% + {\cleanupXMLprocess{#2}% + \defconvertedcommand\ascii{#1}% + %\writestatus{xml-process}{\ascii} + \expanded + {\executeifdefined + {\@@XMLinstruction:\ascii} + \noexpand\gobbleoneargument + {\expandafter\noexpand\currentXMLprocess}}} + +%D One never knows: + +\let\normalparseXMLescape \parseXMLescape +\let\normalparseXMLelement\parseXMLelement +\let\normalparseXMLprocess\parseXMLprocess + +%D Next we will implement the normal element handler. This +%D piece of code is complicated by the fact that we need to +%D handle namespaces. + +\let\currentXMLarguments \empty +\let\currentXMLelement \empty % name +\let\currentXMLidentifier\empty % name or name/ +\let\currentXMLnamespace \empty % the (remapped) namespace +\let\originalXMLnamespace\empty % the unremapped namespace +\let\rawXMLidentifier \empty + +\def\rawXMLnamespace + {\ifx\currentXMLnamespace\empty\else\currentXMLnamespace:\fi} + +\def\rawXMLelement{\rawXMLnamespace\rawXMLidentifier} + +%D The following token list register provided the user a hook +%D for extensions. + +\newtoks\everyXMLelement + +%D We try to keep track of the nature of an element. This +%D flag can be used for special purposes (as in the pretty +%D printing macros). + +\chardef\kindofXMLelement=0 + +\chardef\beginXMLtag=1 +\chardef\endXMLtag =2 +\chardef\emptyXMLtag=3 + +%D We do a rather hard coded scan for the namespace attribute. This +%D is needed because its value determines further namespace related +%D actions. + +\def\openXMLargument{ /} + +\long\def\parseXMLelement#1#2 #3>% + {\def\currentXMLarguments{#3}% including end / + \if#1/% + \chardef\kindofXMLelement\endXMLtag + \def\currentXMLelement{#2}% + \else + \docleanupXMLelement#1#2/\empty\relax + \fi + \ifx\currentXMLarguments\openXMLargument + \chardef\kindofXMLelement\emptyXMLtag + \fi + \@EA\splitoffXMLnamespace\currentXMLelement::\relax + \ifcase\kindofXMLelement + % can't happen + \or + % begintag or emptytag with arguments or space before / + \the\everyXMLelement % only for begin/empty tag ! + \ifx\currentXMLarguments\empty \else + \dogetXMLarguments\rawXMLelement#3>% + \fi + \or + % no arguments + \or + % empty element without arguments (but possible presets) + \the\everyXMLelement + \fi + \ifcase\kindofXMLelement\or + \let \currentXMLidentifier \rawXMLidentifier + \edef\currentXMLfullidentifier {\rawXMLelement }% + \or + \edef\currentXMLidentifier {/\rawXMLidentifier }% + \edef\currentXMLfullidentifier{/\rawXMLelement }% + \or + \edef\currentXMLidentifier {\rawXMLidentifier/}% + \edef\currentXMLfullidentifier {\rawXMLelement /}% + \fi + \iftraceXMLelements\traceXMLelement\fi + \executeXMLelement} + +\long\def\docleanupXMLelement#1/#2#3\relax + {\def\currentXMLelement{#1}% watch out: \empty == begin or empty tag + \chardef\kindofXMLelement\ifx#2\empty\beginXMLtag\else\emptyXMLtag\fi} + +\def\@@traceXMLelement + {\originalXMLfullidentifier + \ifx\originalXMLfullidentifier\currentXMLfullidentifier\else + \space=>\space\currentXMLfullidentifier + \fi + \ifx\currentXMLarguments\empty\else + \space\string|\space\currentXMLarguments + \fi} + +\long\def\traceXMLelement + {\edef\originalXMLfullidentifier{\someXMLelementID\currentXMLelement}% + \cleanupXMLarguments\writestatus{xml-element}{\@@traceXMLelement}} + +%D We split off the namespace part, construct the +%D identifier, and remap the namespace if needed. + +\def\splitoffXMLnamespace#1:#2:#3\relax + {\def\rawXMLidentifier{#2}% + \ifx\rawXMLidentifier\empty + \let\currentXMLnamespace\empty + \edef\rawXMLidentifier{#1}% + \else + \edef\currentXMLnamespace{#1}% + \fi + \let\originalXMLnamespace\currentXMLnamespace + \checkXMLnamespace\rawXMLidentifier} + +\def\xsplitoffXMLnamespace% fast resplit + {\ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname + \csname\@@XMLnamespace:\currentXMLnamespace\endcsname + \fi} + +%D We will implement this macro later. + +\let\checkXMLnamespace\gobbleoneargument % see below + +%D The namespace attribute checking is part of the element +%D parser, since the value of \type {xmlns} may influence other +%D namespace mapping. + +\def\@@XMLns{xmlns} + +\def\checkXMLnamespaceattr#1% xmlns:\@@XMLname="\XMLns" + {\edef\XMLns{#1}% + \ifx\XMLns\empty \else + \ifcsname\@@XMLurlspace:\XMLns\endcsname + % get remapped namespace (from url) + % \edef\XMLns{\csname\@@XMLurlspace:\XMLns\endcsname}% + \@EA\let\@EA\XMLns\csname\@@XMLurlspace:\XMLns\endcsname + % remap this one + \ifx\@@XMLname\empty + % not watertight since no implicit grouping + \xautoXMLnamespace\XMLns + \else + \xremapXMLnamespace\@@XMLname\XMLns + % redo namespace remapping of self if needed + \ifx\XMLns\currentXMLnamespace + % i'm still not sure if this is ok + \else + \xsplitoffXMLnamespace + \fi + \fi + \fi + \fi} + +%D Although not really needed, we clean up the arguments. + +% \long\def\cleanupXMLarguments +% {\ifnum\kindofXMLelement=\emptyXMLtag +% \ifx\currentXMLarguments\empty \else +% \@EA\docleanupXMLarguments\currentXMLarguments/\empty +% \fi +% \fi} +% +% \long\def\docleanupXMLarguments#1/#2\empty +% {\edef\currentXMLarguments{#1}} +% +% we need to be ...="/" .... /> safe + +\long\def\cleanupXMLarguments + {\ifnum\kindofXMLelement=\emptyXMLtag + \ifx\currentXMLarguments\empty \else + \@EA\docleanupXMLarguments\currentXMLarguments/ \relax + \fi + \else\ifnum\kindofXMLelement=\beginXMLtag + \ifx\currentXMLarguments\space + \let\currentXMLarguments\empty + \fi + \fi\fi} + +% \long\def\docleanupXMLarguments#1/ #2\relax % space added earlier +% {\edef\currentXMLarguments{#1}} +% +% \startbuffer +% +% \stopbuffer +% +% \showXMLbuffer +% +% No \type {\edef} in the following, else \showXMLbuffer fails: + +\long\def\docleanupXMLarguments#1/ #2\relax % space added earlier + {\def\currentXMLarguments{#1}} % no \edef, goes wrong in \showXML + +\def\executeXMLelementA % no fallback + {\ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname + \csname\@@XMLelement:\currentXMLfullidentifier\endcsname + \fi} + +\def\executeXMLelementB % default fallback + {\csname \@@XMLelement:% + \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname + \currentXMLfullidentifier + \else + \defaultXMLelementID % was \s!default + \fi + \endcsname} + +\def\executeXMLelementC % no namespace of default fallback + {\csname \@@XMLelement:% + \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname + \currentXMLfullidentifier + \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname + \currentXMLidentifier + \else + \defaultXMLelementID % was \s!default + \fi\fi + \endcsname} + +\def\executeXMLelementD + {\csname + \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname + \@@XMLelement:\currentXMLfullidentifier + \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname + \@@XMLelement:\currentXMLidentifier + \else + \executeXMLelementDD % less skipping and thereby faster + \fi\fi + \endcsname} + +\def\executeXMLelementDD % now forget about tex mapping + {\ifcsname\normal@@XMLelement:\currentXMLfullidentifier\endcsname + \normal@@XMLelement:\currentXMLfullidentifier + \else\ifcsname\normal@@XMLelement:\currentXMLidentifier\endcsname + \normal@@XMLelement:\currentXMLidentifier + \else + \normal@@XMLelement:\defaultXMLelementID % was \@@XMLelement:\s!default + \fi\fi} + +\def\setXMLfallbackmode#1% + {\ifcase#1\relax + \let\executeXMLelement \executeXMLelementA + \let\automateXMLnamespace\automateXMLnamespaceA + \or % 1 + \let\executeXMLelement \executeXMLelementB + \let\automateXMLnamespace\automateXMLnamespaceB + \or % 2 + \let\executeXMLelement \executeXMLelementC + \let\automateXMLnamespace\automateXMLnamespaceC + \or % 3 + \let\executeXMLelement \executeXMLelementD + \let\automateXMLnamespace\automateXMLnamespaceD + \fi} + +\setXMLfallbackmode3 % was 2 + +%D An example of fall back modes is given below. + +%D The automated namespace stuff is new and yet undocumented +%D (see resource libraries for usage). + +\def\xautoXMLnamespace#1% fast internal one + {\ifcsname\@@XMLnamespace-#1\endcsname\else + \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces + \fi + \@EA\edef\csname\@@XMLnamespace-#1\endcsname + {\noexpand\edef\noexpand\@axmlns@{#1}% quicker #1 -> \#1 + \noexpand\doautoXMLnamespace\noexpand\@axmlns@}} + +\def\doautoXMLnamespace#1% \done is set before list + {\ifdone\else\automateXMLnamespace#1\fi} + +\def\automateXMLnamespaceA#1% + {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname + \let\currentXMLnamespace#1% + \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname + \let\currentXMLnamespace#1% + \fi\fi} + +\let\automateXMLnamespaceB\automateXMLnamespaceA +\let\automateXMLnamespaceC\automateXMLnamespaceA + +\def\automateXMLnamespaceD#1% + {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname + \let\currentXMLnamespace#1% + \else\ifcsname\normal@@XMLelement:#1:\checkedXMLnamespace\endcsname + \let\currentXMLnamespace#1% + \else + \automateXMLnamespaceDD#1% + \fi\fi} + +\def\automateXMLnamespaceDD#1% + {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname + \let\currentXMLnamespace#1% + \else\ifcsname\normal@@XMLelement:#1:\checkedXMLnamespace/\endcsname + \let\currentXMLnamespace#1% + \fi\fi} + +%D Later we will implement the error handler, here we handle +%D the default case. + +\def\someXMLelementID#1% + {\ifnum\kindofXMLelement=\endXMLtag /\fi + #1% + \ifnum\kindofXMLelement=\emptyXMLtag/\fi} + +\def\defaultXMLelementID + {\someXMLelementID\s!default} + +%D It is possible to keep track of nesting automatically, +%D but this would kind of prohibit things like \type +%D {\ignorespaces}. In the future we may provide an +%D automatic depth tracking as an alternative (exclusive) +%D mode of operation combined with space grabbing. + +\def\beginXMLelement + {\global\advance\XMLdepth\plusone + \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement + }%\writestatus{XML TRACE}{[begin] [\the\XMLdepth] [\XMLself]}} + +\def\endXMLelement + {%\writestatus{XML TRACE}{[end] [\the\XMLdepth] [\XMLself]}% + \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\undefined + \global\advance\XMLdepth\minusone} + +% 0 = nothing +% 1 = unknown +% 2 = current element + +\chardef\XMLancestormode=2 % never change this one globally + +% \def\XMLancestor#1% +% {\ifnum\numexpr(\XMLdepth-#1)>0 +% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname +% \else +% \ifcase\XMLancestormode\or\s!unknown\or\currentXMLelement\fi +% \fi} + +\def\XMLancestor#1% + {\ifnum\numexpr\XMLdepth-#1\relax>\zerocount + \csname\@@XMLdepth:\the\numexpr\XMLdepth-#1\relax\endcsname + \else + \ifcase\XMLancestormode\or\s!unknown\or\currentXMLelement\fi + \fi} + +% \def\XMLpureancestor#1% +% {\ifnum\numexpr(\XMLdepth-#1)>0 +% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname +% \fi} + +\def\XMLpureancestor#1% + {\ifcase\numexpr\XMLdepth-#1\relax\or + \csname\@@XMLdepth:\the\numexpr\XMLdepth-#1\relax\endcsname + \fi} + +\def\XMLparent {\XMLancestor \plusone } +\def\XMLself {\XMLancestor \zerocount} +\def\XMLpureparent{\XMLpureancestor\plusone } +\def\XMLpureself {\XMLpureancestor\zerocount} + +% \def\XMLpureancestor#1% +% {\csname +% \ifnum\numexpr(\XMLdepth-#1)>\zerocount +% \@@XMLdepth:\the\numexpr(\XMLdepth-#1)% +% \else +% \s!empty +% \fi +% \endcsname} + +\def\XMLpureparent + {\XMLpureancestor\plusone} + +% probleem: depth is vast en dus ook ancestor + +% \XMLinh{...} will backtrack definitions (given that the elements +% use begin/end, the backtracking stops when a non-empty value is +% encountered; maybe we will add some keyword (inherit) some day + +\def\XMLinhpar#1#2% + {\@EA\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty + \@EA\pXMLinh + \else + \csname\@@XMLvariable:#1:#2\endcsname + \@EA\gobbletwoarguments + \fi\XMLdepth{#2}} + +\def\XMLinh + {\XMLinhpar\currentXMLelement} + +% \def\pXMLinh#1% +% {\@EA\ppXMLinh\@EA{\the\numexpr(#1-\plusone)}} + +\def\pXMLinh#1% + {\@EA\ppXMLinh\@EA{\the\numexpr#1-\plusone\relax}} + +\def\ppXMLinh#1#2% + {\@EA\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty + \ifnum#1>\plusone + \@EAEAEA\pXMLinh + \else + \@EAEAEA\gobbletwoarguments + \fi + \else + \csname\@@XMLvariable:#1:#2\endcsname + \@EA\gobbletwoarguments + \fi{#1}{#2}} + +% better +% +% \def\XMLpureancestor#1% +% {\ifcsname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname +% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname +% \fi} + +% replaces macro in xtag-ini: ! ! ! + +\def\edefXMLop#1#2% \macro{att} + {\edef#1% + {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#2\endcsname + \@@XMLvariable:\ownXMLelement:#2\else\s!empty + \fi\endcsname}} + +\def\edefXMLinh#1#2% \macro{att} + {\edef#1{\XMLinh{#2}}} + +\def\edefXMLinhpar#1#2#3% \macro{tag}{att} + {\edef#1{\XMLinhpar{#2}{#3}}} + +% \def\doifXMLopdef#1#2% \macro{att} +% {\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname +% \@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#1\endcsname +% \expandafter\firstofoneargument +% \else +% \expandafter\gobbleoneargument +% \fi} + +\fetchruntimecommand \tracebackXMLattribute {\f!xtagprefix\s!run} +\fetchruntimecommand \showXMLinh {\f!xtagprefix\s!run} + +% \defineXMLenvironment[one] +% {\beginXMLelement} +% {\endXMLelement} +% +% \defineXMLenvironment[two] +% {\beginXMLelement +% \starttabulatie +% \NC ancestor 1 \NC \XMLancestor{1} \NC \NR +% \NC ancestor 2 \NC \XMLancestor{2} \NC \NR +% \NC ancestor 3 \NC \XMLancestor{3} \NC \NR +% \NC ancestor 4 \NC \XMLancestor{4} \NC \NR +% \stoptabulatie} +% {\endXMLelement} +% +% \startbuffer +% +% \stopbuffer +% +% {fallback A: \setXMLfallbackmode 0 \processXMLbuffer}\par +% {fallback B: \setXMLfallbackmode 1 \processXMLbuffer}\par +% {fallback C: \setXMLfallbackmode 2 \processXMLbuffer}\par + +% todo: split #1 into raws en reconstruct, set current etc, push and pop +% +% \def\beginXMLelement +% {\dosingleempty\dobeginXMLelement} +% +% \def\dobeginXMLelement[#1]% +% {\global\advance\XMLdepth 1 +% \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement +% \global\@EA\edef\csname\@@XMLdopth:\the\XMLdepth\endcsname{\ownXMLelement}% +% \iffirstargument\edef\ownXMLelement{#1}\fi} +% +% \def\endXMLelement +% {\@EA\let\@EA\ownXMLelement\csname\@@XMLdopth:\the\XMLdepth\endcsname +% \global\advance\XMLdepth -1 } + +%D \defineXMLenvironment[one] +%D {\beginXMLelement} +%D {\endXMLelement} +%D +%D \defineXMLenvironment[two] +%D {\beginXMLelement +%D \starttabulate +%D \NC parent 1 \NC \XMLancestor{1} \NC \NR +%D \NC parent 2 \NC \XMLancestor{2} \NC \NR +%D \NC parent 3 \NC \XMLancestor{3} \NC \NR +%D \NC parent 4 \NC \XMLancestor{4} \NC \NR +%D \stoptabulate} +%D {\endXMLelement} +%D +%D \startbuffer +%D +%D \stopbuffer +%D +%D fallback A: \setXMLfallbackmode0 \processXMLbuffer +%D fallback B: \setXMLfallbackmode1 \processXMLbuffer +%D fallback C: \setXMLfallbackmode2 \processXMLbuffer + +%D Here we do the namespace (re)mapping. More examples are +%D provided in the manual. +%D +%D \starttyping +%D \supportXMLnamespace [test] % needed to get a namespace working +%D \skipXMLnamespace [test] % slow +%D \ignoreXMLnamespace [test] % faster +%D \defineXMLenvironment [rubish:itemize] {[} {]} +%D \defineXMLenvironment [rubish:item] {(} {)} +%D \remapXMLnamespace [crap] [rubish] +%D \remapXMLnamespace [con] [context] +%D \remapXMLurlspace [http://www.pragma-ade.com/dtd/context] [context] +%D \autoXMLnamespace [context] % fallback +%D \autoXMLnamespace [whatever] % second fall back +%D \stoptyping + +\newtoks\autoXMLnamespaces + +%D The automatically mapped namespaces (the fallbacks so to +%D day) are collected in a token list. + +\let\checkedXMLnamespace\empty + +\def\checkXMLnamespace#1% + {\edef\checkedXMLnamespace{#1}% + \ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname + \csname\@@XMLnamespace:\currentXMLnamespace\endcsname + % forced namespace + \else\ifcsname\@@XMLelement:\currentXMLelement\endcsname + % natural element + \else\ifcsname\@@XMLelement:\currentXMLelement/\endcsname + % natural element + \else + % locate fallback + \donefalse\the\autoXMLnamespaces + \fi\fi\fi} + +\def\skipXMLnamespace[#1]% + {\letvalue{\@@XMLnamespace:#1}\doXMLskipnamespace} + +\def\doXMLskipnamespace + {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname + {\getXMLgroupedignore\checkedXMLnamespace}} + +\def\hideXMLnamespace[#1]% + {\letvalue{\@@XMLnamespace:#1}\doXMLhidenamespace} + +\def\doXMLhidenamespace + {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname + {\redoXMLignore\checkedXMLnamespace}} + +\def\ignoreXMLnamespace[#1]% + {\letvalue{\@@XMLnamespace:#1}\doXMLignorenamespace} + +\def\doXMLignorenamespace % \let binnen def + {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname + {\@EA\redoXMLignore\@EA{\checkedXMLnamespace}}} % EA ? + +\def\remapXMLnamespace + {\dodoubleargument\doremapXMLnamespace} + +\def\doremapXMLnamespace[#1][#2]% + {\ifsecondargument + \setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#2}}% + \else + \letvalue{\@@XMLnamespace:#1}\relax + \fi} + +\def\supportXMLnamespace% + {\dosingleargument\dosupportXMLnamespace} + +\def\dosupportXMLnamespace[#1]% + {\setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#1}}} + +\def\xremapXMLnamespace#1#2% fast internal one + {\@EA\edef\csname\@@XMLnamespace:#1\endcsname + {\def\noexpand\currentXMLnamespace{#2}}} + +\def\autoXMLnamespace[#1]% + {\xautoXMLnamespace{#1}} + +\def\xautoXMLnamespace#1% fast internal one + {\ifcsname\@@XMLnamespace-#1\endcsname\else + \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces + \fi + \@EA\edef\csname\@@XMLnamespace-#1\endcsname + {\noexpand\doautoXMLnamespace{#1}}} + +\def\doautoXMLnamespace#1% \done is set before list + {\ifdone\else + \ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname + \def\currentXMLnamespace{#1}% + \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname + \def\currentXMLnamespace{#1}% + \fi\fi + \fi} + +\def\resetXMLnamespace[#1]% + {\letvalue{\@@XMLnamespace-#1}\gobbleoneargument + \letvalue{\@@XMLnamespace:#1}\gobbleoneargument} + +\def\remapXMLurlspace + {\dodoubleargument\doremapXMLurlspace} + +\def\doremapXMLurlspace[#1][#2]% + {\setvalue{\@@XMLurlspace:#1}{#2}} + +%D Entities needs a bit more work, as well as a connection +%D with the encoding handlers. + +% we need to be able to do: +% +% \defineXMLentity[amp] {\FunnyAmp} \def\FunnyAmp#1;{\getXMLentity{#1}} +% +% \defineXMLentity [pound] {(why not use euro's?)} +% +% \startXMLdata +% test &pound; test +% \stopXMLdata +% +% so we need an ifless implementation +% +% also .. this should work: +% +% \defineXMLentity[ctx-var-textwidth] {\textwidth} +% +% \defineXMLcommand[test][width=\textwidth] +% {\the\dimexpr\XMLop{width}\relax} +% +% \startXMLdata +% +% +% \stopXMLdata + +% \eacute -> simplified -> e (via raw encoding) +% -> raw -> eacute (via handler) +% +% naming sucks + +\newif\ifXMLrawentities % proper fallback +\newif\ifXMLsimpleentities % last resort + +\def\simpleXMLencoding{raw} + +\ifnum\texengine=\luatexengine + \def\simplifyXMLentities + {\XMLsimpleentitiestrue} +\else + \def\simplifyXMLentities + {\fastenableencoding\simpleXMLencoding + \XMLsimpleentitiestrue} +\fi + +\def\defineXMLentity + {\dodoubleempty\dodefineXMLentity} + +\def\dodefineXMLentity[#1][#2]#3% + {\ifsecondargument + \defineXMLentities[#1]{#2}{#3}% + \else + \dododefineXMLentity{#1}{#3}% + \fi} + +\def\defineXMLentities[#1]#2#3% + {\dododefineXMLentity{#1}{\ifXMLsimpleentities#2\else#3\fi}} + +\def\dododefineXMLentity#1#2% + {\unspaceargument#1\to\ascii % #1 can be {[} or so + \long\setvalue{\@@XMLentity:\@EA\firstofoneargument\ascii}{#2}} + +\def\setXMLentity#1% fast one + {\long\@EA\def\csname\@@XMLentity:#1\endcsname} + +%D May this wile become dodo (more in tune with rest); +%D beware: also remapped in xtag-map. + +\def\doXMLentity#1#2;% interesting: # is now ## + {\if\string#1\letterhash + \@EA\parseXMLcharacter + \else\ifXMLrawentities + \@EAEAEA\firstofoneargument + \else + \@EAEAEA\executeXMLentity + \fi\fi{#1#2}} + +%D Here we need to get rid of the double hash and act upon the +%D number. Proper hex/oct number support can be implemented by +%D redefining \type {\executeXMLcharacter}. + +% \def\parseXMLcharacter#1% gobble the ##x +% {\@EA\executeXMLcharacter\@EA{\gobblethreearguments#1}} +% +% single hash now +% +% \def\parseXMLcharacter#1% +% {\@EA\executeXMLcharacter\@EA{\gobbleoneargument#1}} +% +% \def\executeXMLcharacter#1% can be overloaded +% {\ifnum"#1<256 +% \@EA\getXMLcharacter +% \else\ifXMLrawentities +% \@EAEAEA\firstofoneargument +% \else +% \@EAEAEA\unknownXMLcharacter +% \fi\fi{\number"#1}} +% +% \unexpanded\def\getXMLcharacter#1{\rawcharacter{#1}} + +\def\parseXMLcharacter#1% + {\@EA\executeXMLcharacter\gobbleoneargument#1\empty\relax} + +\def\executeXMLcharacter#1#2\relax + {\if#1x% + \@EA\noexecuteXMLhexcharacter + \else + \@EA\doexecuteXMLdeccharacter + \fi#1#2\relax} + +\def\noexecuteXMLhexcharacter x#1\relax + {\uppercase{\doexecuteXMLhexcharacter#1\relax}} + +% \unexpanded\def\getXMLcharacter#1% +% {\ifXMLrawentities +% \@EA\firstofoneargument +% \else\ifcsname\@@XMLentity:#1\endcsname +% \@EAEAEA\getXMLentity +% \else +% \@EAEAEA\unicodechar % was: \rawcharacter +% \fi\fi{#1}} +% +% \def\doexecuteXMLhexcharacter#1\relax{\getXMLcharacter{"#1}} +% \def\doexecuteXMLdeccharacter#1\relax{\getXMLcharacter {#1}} +% +% if we want to support x in entity overloading, we prefer: + +\unexpanded\def\getXMLdeccharacter#1% + {\ifXMLrawentities + \@EA\rawXMLdecentity + \else\ifcsname\@@XMLentity:#1\endcsname + \@EAEAEA\getXMLdecentity + \else + \@EAEAEA\unicodechar + \fi\fi{#1}} + +\unexpanded\def\getXMLhexcharacter#1% + {\ifXMLrawentities + \@EA\rawXMLhexentity + \else\ifcsname\@@XMLentity:x#1\endcsname + \@EAEAEA\getXMLhexentity + \else + \@EAEAEA\unicodehexchar + \fi\fi{#1}} + +\def\unicodehexchar#1{\unicodechar{"#1}} + +\let\getXMLcharacter\getXMLdeccharacter + +\def\getXMLdecentity#1{\getXMLentity {#1}} +\def\getXMLhexentity#1{\getXMLentity{x#1}} + +\def\rawXMLdecentity#1{#1} +\def\rawXMLhexentity#1{x#1} + +\def\doexecuteXMLhexcharacter#1\relax{\getXMLhexcharacter{#1}} +\def\doexecuteXMLdeccharacter#1\relax{\getXMLdeccharacter{#1}} + +% \defineXMLentity[8218] {Adam} +% \defineXMLentity[x007D]{Eve} +% +% \startbuffer +% @ ‘ ‚ “ ” „• +% & +% $ { }   … +% \stopbuffer +% +% \typebuffer \processXMLbuffer + +% left overs + +\def\unknownXMLcharacter#1{[#1]} + +\ifx\unicodechar\undefined\let\unicodechar\rawcharacter\fi % brrrr + +% \useXMLfilter[ent] +% +% \defineXMLsingular[test]{{\simplifyXMLentities\XMLpar{test}{bla}{}}} +% +% \startXMLdata +% +% \stopXMLdata +% +% \defineXMLentity[45]{|it works|} % {|-|} +% +% \startXMLdata +% text-.text +% textEFtext +% \stopXMLdata + +%D May be this will change a bit ... + +\def\executeXMLentity#1% named one + {\getXMLentity{#1}} + +%\def\expandedXMLentity#1% +% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi} +% +%\unexpanded\def\getXMLentity#1% +% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi} +% +%\def\expandedXMLentity#1% +% {\csname\@@XMLentity:#1\endcsname} +% +%\unexpanded\def\getXMLentity#1% +% {\csname\@@XMLentity:#1\endcsname} + +\doifundefined{autoXMLentitiestrue}{\expandafter\newif\csname ifautoXMLentities\endcsname} % fall back on context commands + +\def\expandedXMLentity#1% + {\ifcsname\@@XMLentity:#1\endcsname \@EA \execXMLentity + \else\ifautoXMLentities \@EAEAEA \autoXMLentity + \else \@EAEAEA \crapXMLentity + \fi\fi{#1}} + +\def\execXMLentity#1{\csname\@@XMLentity:#1\endcsname} +\def\crapXMLentity#1{\inframed[\c!offset=.1ex]{\tttf#1}} +\def\autoXMLentity#1{\ifcsname#1\endcsname\csname#1\endcsname\fi} + +\unexpanded\def\getXMLentity{\expandedXMLentity} + +%\def\doifXMLentityelse#1#2#3% +% {\ifcsname\@@XMLentity:#1\endcsname#2\else#3\fi} + +\def\doifXMLentityelse#1% + {\ifcsname\@@XMLentity:#1\endcsname + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +% \letvalue{1@2}\firstoftwoarguments +% \letvalue{2@2}\secondoftwoarguments +% +% \def\doifXMLentityelse#1% +% {\csname\ifcsname\@@XMLentity:#1\endcsname1\else2\fi @2\endcsname} + +% see \defineXML... commands: +% +% [key=val] => \presetXMLarguments{element} => default key/vals +% [blabla] => \theXMLarguments{blabla} => user key/vals +% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals +% \theXMLarguments{blabla} => user key/vals +% +% stored in case of [blabla] else set as \XMLpar +% +% see m-steps for an example of usage + +\let\@@XMLmapmap\empty +\newif\ifXMLnamespace + +\long\def\getXMLarguments#1#2% + {\XMLnamespacefalse + \dogetXMLarguments{#1}#2>} + +\let\dosetXMLattributeA\gobbleoneargument + +\def\dosetXMLattributeB#1% + {\ifx\@@XMLspac\originalXMLnamespace + \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname{#1}% + % maybe some day global handling here as well + \fi} + +\def\dosetXMLattributeC + {\@EA\def\csname\@@XMLvariable:\@@XMLclass\ifx\@@XMLspac + \originalXMLnamespace\else:\@@XMLspac\fi:\@@XMLname\endcsname} + +\def\dosetXMLattributeD + {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\ifx\@@XMLspac + \originalXMLnamespace\currentXMLnamespace\else\@@XMLspac\fi:\@@XMLname\endcsname} + +\def\setXMLattributemode#1% + {\ifcase#1\relax + \let\dosetXMLattribute\dosetXMLattributeA + \or + \let\dosetXMLattribute\dosetXMLattributeB + \or + \let\dosetXMLattribute\dosetXMLattributeC + \or + \let\dosetXMLattribute\dosetXMLattributeD + \fi} + +\setXMLattributemode{2} % a reasonable default + +\let\@@XMLspac\empty % argumentnamespace + +\long\def\dogetXMLarguments#1% + {\XMLtoks\emptytoks + \ifcsname\@@XMLmap:#1\endcsname + \let\dodosetXMLargument\dodosetXMLargumentB + \else + \def\@@XMLclass{#1}% + \let\dodosetXMLargument\dodosetXMLargumentA + \fi + \let\dodoparseXMLarguments\doparseXMLarguments + \doparseXMLarguments} + +% \long\def\doparseXMLarguments#1% space goes ok +% {\if#1>% +% \let\dodoparseXMLarguments\empty +% \else\if#1=% +% \edef\@@XMLname{\the\XMLtoks}% +% \XMLtoks\emptytoks +% \else\if#1"% +% \let\dodoparseXMLarguments\dodoparseXMLargumentsD +% \else\if#1'% +% \let\dodoparseXMLarguments\dodoparseXMLargumentsS +% \else\if#1:% +% \XMLnamespacetrue +% \edef\@@XMLspac{\the\XMLtoks}% +% \XMLtoks\emptytoks +% \else\if#1/% +% \chardef\kindofXMLelement\emptyXMLtag +% \else +% \XMLtoks\@EA{\the\XMLtoks#1}% +% \fi\fi\fi\fi\fi\fi +% \dodoparseXMLarguments} +% +% The next speed optimization is suggested by Taco. Since we +% are dealing with validated code, we can grab larger chunks. +% +% \long\def\doparseXMLarguments#1% space goes ok +% {\if#1>% +% \let\dodoparseXMLarguments\empty +% \else\if#1/% +% \chardef\kindofXMLelement\emptyXMLtag +% \else +% \XMLtoks{#1}% +% \let\dodoparseXMLarguments\dodoparseXMLargumentsX +% \fi\fi +% \dodoparseXMLarguments} +% +% we can get rid of one more assignment + +\long\def\doparseXMLarguments#1% space goes ok + {\if#1>% + %\let\dodoparseXMLarguments\empty + \expandafter\gobbleoneargument % speedup + \else\if#1/% + \chardef\kindofXMLelement\emptyXMLtag + \else + \XMLtoks{#1}% + \let\dodoparseXMLarguments\dodoparseXMLargumentsX + \fi\fi + \dodoparseXMLarguments} + +% slightly faster: +% +% \long\def\doparseXMLarguments#1% space goes ok +% {\if#1>% +% \@EA\gobbleoneargument +% \else\if#1/% +% \chardef\kindofXMLelement\emptyXMLtag +% \@EAEAEA\gobbletwoarguments +% \else +% \@EAEAEA\dodoparseXMLargumentsX +% \fi\fi#1} +% +% \def\dodoparseXMLargumentsX#1=#2% +% {\def\@@XMLname{#1}% +% \getXMLNSSSS#1:\relax +% \if#2"% +% \expandafter\dodoparseXMLargumentsD +% \else +% \expandafter\dodoparseXMLargumentsS +% \fi} + +\def\dodoparseXMLargumentsX#1=#2% + {\edef\@@XMLname{\the\XMLtoks#1}% + \@EA\getXMLNSSSS\@@XMLname:\relax + \XMLtoks\emptytoks + \if#2"% + \let\dodoparseXMLarguments\dodoparseXMLargumentsD + \else + \let\dodoparseXMLarguments\dodoparseXMLargumentsS + \fi + \dodoparseXMLarguments} + +\def\gobbleuntilcolon#1:{#1} + +\def\getXMLNSSSS#1:#2\relax + {\def\!!stringa{#2}% + \ifx\!!stringa\empty \else + \XMLnamespacetrue + \edef\@@XMLname{\gobbleuntilcolon#2}% + \edef\@@XMLspac{#1}% + \fi} + +% ok ? +% +% \def\dodoparseXMLargumentsX#1=#2% +% {\edef\@@XMLname{\the\XMLtoks#1}% +% \@EA\getXMLNSSSS\@@XMLname:\relax +% \XMLtoks\emptytoks +% \if#2"% +% \@EA\dodoparseXMLargumentsD +% \else +% \@EA\dodoparseXMLargumentsS +% \fi} + +% Storing \type {#1} in a macro in order to minimize the +% amount of data passed as argument does not improve +% performance, so we keep the readable form. + +\def\dodoparseXMLargumentsD#1"{\dosetXMLargument{#1}} +\def\dodoparseXMLargumentsS#1'{\dosetXMLargument{#1}} + +% the readable version +% +% \def\dosetXMLargument#1% +% {\ifXMLnamespace +% \ifx\@@XMLspac\@@XMLns +% \checkXMLnamespaceattr{#1}% xmlns:\@@XMLname="#1" +% \else +% \dosetXMLattribute{#1}% some:\@@XMLname="#1" +% \fi +% \XMLnamespacefalse +% \else\ifx\@@XMLname\@@XMLns +% \checkXMLnamespaceattr{#1}% xmlns="#1" +% \else +% \dodosetXMLargument{#1}% +% \fi\fi +% \let\dodoparseXMLarguments\doparseXMLarguments +% \dodoparseXMLarguments} +% +% the ugly alternative + +% \def\dosetXMLargument#1% ugly alternative +% {\ifXMLnamespace +% \XMLnamespacefalse +% \ifx\@@XMLspac\@@XMLns +% \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1" +% \else +% \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1" +% \fi +% \else\ifx\@@XMLname\@@XMLns +% \@EAEAEA\checkXMLnamespaceattr % xmlns="#1" +% \else +% \@EAEAEA\dodosetXMLargument +% \fi\fi{#1}% +% \let\dodoparseXMLarguments\doparseXMLarguments +% \dodoparseXMLarguments} + +\def\dosetXMLargument#1% ugly alternative + {\ifXMLnamespace + \XMLnamespacefalse + \ifx\@@XMLspac\@@XMLns + \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1" + \else + \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1" + \fi + \else\ifx\@@XMLname\@@XMLns + \@EAEAEA\checkXMLnamespaceattr % xmlns="#1" + \else + \@EAEAEA\dodosetXMLargument + \fi\fi{#1}% + \dodocopyXMLargument + \let\dodoparseXMLarguments\doparseXMLarguments + \dodoparseXMLarguments} + +\let\dodocopyXMLargument\relax + +% \def\dododocopyXMLargument +% {\@EA\let\csname\@@XMLvariable:\the\numexpr(\XMLdepth+1):\@@XMLname\@EA\endcsname +% \csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname} + +\def\dododocopyXMLargument + {\@EA\let\csname\@@XMLvariable:\the\numexpr\XMLdepth+\plusone\relax:\@@XMLname\@EA\endcsname + \csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname} + +\def\copyXMLargumentindeed + {\let\dodocopyXMLargument\dododocopyXMLargument + \let\copyXMLargumentindeed\relax} + +\def\dodosetXMLargumentA + {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname} + +% \def\dodosetXMLargumentB#1% +% {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname +% {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else +% \csname\@@XMLmap:\@@XMLmapmap\endcsname,% +% \fi +% \@@XMLname=#1}} + +\def\dodosetXMLargumentB#1% + {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname + {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else + \csname\@@XMLmap:\@@XMLmapmap\endcsname,% + \fi + \@@XMLname={#1}}} % {} is needed for aa='bb,cc' + +\appendtoks + \resetXMLarguments{\rawXMLnamespace\rawXMLidentifier}% +\to \everyXMLelement + +\def\resetXMLarguments#1% + {\ifcsname\@@XMLmap:#1\endcsname + \@EA\let\@EA\@@XMLmapmap\csname\@@XMLmap:#1\endcsname + \@EA\let\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty + \fi} + +\def\theXMLarguments#1% + {\ifcsname\@@XMLmap:#1\endcsname\csname\@@XMLmap:#1\endcsname\fi} + +\def\doexpandXMLvalue#1#2% + {\ifcsname#2\endcsname + \bgroup + \enableXMLexpansion + \let\getXMLentity\expandedXMLentity + #1% simplify maps entities back to _ and alike + \expanded{\global\globalscratchtoks{\csname#2\endcsname}}% + \egroup + \@EA\edef\csname#2\endcsname{\the\globalscratchtoks}% + \fi} + +\def\expandXMLvalue {\doexpandXMLvalue\relax} +\def\simplifyXMLvalue{\doexpandXMLvalue\XMLsimpleentitiestrue} + +\def\expandTEXpar #1#2{\expandXMLvalue{#1\interfaced{#2}}} +\def\expandXMLpar #1#2{\expandXMLvalue{\@@XMLvariable:#1:#2}} +\def\expandXMLarguments #1{\expandXMLvalue{\@@XMLmap:#1}} + +\def\simplifyTEXpar #1#2{\simplifyXMLvalue{#1\interfaced{#2}}} +\def\simplifyXMLpar #1#2{\simplifyXMLvalue{\@@XMLvariable:#1:#2}} +\def\simplifyXMLarguments#1{\simplifyXMLvalue{\@@XMLmap:#1}} + +%D \startbuffer[tex] +%D \defineXMLsingular [fx:root] +%D {\XMLNSpar{fx:root}{xml}{lang}{} +%D \XMLpar{fx:root}{xml:lang}{} +%D \starttabulate[||||] +%D \HL +%D \NC \bf mode \NC \bf call \NC \bf result \NC\NR +%D \HL +%D \NC 0\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR +%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR +%D \HL +%D \NC 1\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR +%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR +%D \HL +%D \NC 2\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR +%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR +%D \HL +%D \NC 3\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR +%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC rubish\NC\NR +%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR +%D \HL +%D \stoptabulate} +%D +%D \remapXMLurlspace [http://www.w3.org/1999/XSL/Format] [fx] +%D \stopbuffer +%D +%D \startbuffer[xml] +%D +%D \stopbuffer +%D +%D \typebuffer[tex] \processTEXbuffer[tex] +%D \typebuffer[xml] \processXMLbuffer[xml] + +%D The previous macros were the basic parser and their working +%D is left to the imagination of the reader. These macros +%D will be improved over time. We use rather low level +%D definitions so that the mappings will run as fast as +%D possible. + +\bgroup \catcode`<=\@@active + +\long\gdef\dododefineXMLsingular#1#2% + {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}} + +\long\gdef\dododefineXMLcommand#1#2% + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}} + +\long\gdef\dododefineXMLgrouped#1#2% + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\groupedcommand{#2}\donothing\bgroup}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\egroup + \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} + +\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1 + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLargument{#1}{#2}} + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}} + +\long\gdef\redoXMLargument#1#2% potential optimization: globalnext + {\long\@EA\gdef\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}% + \next} + +\long\gdef\dododefineXMLignore#1% + {\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLignore{#1}} + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} + +\long\gdef\redoXMLignore#1% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{}% + \next} + +\long\gdef\dododefineXMLpickup#1#2#3% + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLpickup{#1}{#2}{#3}} + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}} + +\long\gdef\redoXMLpickup#1#2#3% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2##1#3}% + \next} + +\long\gdef\dododefineXMLenvironment#1#2#3% + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}% + \long\@EA\def\csname\@@XMLelement:/#1\endcsname{#3}% + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}} + +\long\gdef\dododefineXMLsave#1% + {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty + \long\@EA\def\csname\@@XMLelement:#1\endcsname {\redoXMLsave{#1}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} + +\long\gdef\dododefineXMLsavecontent#1#2% + {\long\@EA\def\csname\@@XMLdata:#1\endcsname{#2}% + \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLsave{#1}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} + +\long\gdef\redoXMLsave#1% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% + {\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}% + \next} + +\long\gdef\dododefineXMLgsave#1% + {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty + \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} + +\long\gdef\dododefineXMLgsavecontent#1#2% + {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{#2}% + \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} + +\long\gdef\redoXMLgsave#1% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% + {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}}% + \next} + +\long\gdef\dododefineXMLenvironmentsave#1#2#3% + {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty + \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentsave{#1}{#2}{#3}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}} + +% maybe \globalnext + +\long\gdef\redoXMLenvironmentsave#1#2#3% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% + {#2\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}#3}% + \next} + +\long\gdef\dododefineXMLenvironmentgsave#1#2#3% + {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty + \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentgsave{#1}{#2}{#3}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}} + +\long\gdef\redoXMLenvironmentgsave#1#2#3% + {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% + {#2\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}#3}% + \next} + +\long\gdef\dododefineXMLprocess#1% + {\@EA\let\csname\@@XMLelement:#1\endcsname\donothing + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} + +\long\gdef\dododefineXMLnestedenvironment#1#2#3% + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedenvironment{#1}{#2}{#3}}% + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}} + +\long\gdef\dododefineXMLnestedargument#1#2% + {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedargument{#1}{#2}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}} + +\long\gdef\dododefineXMLnestedsave#1% + {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty + \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedsave{#1}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} + +\long\unexpanded\gdef\getXMLgroupednestedsave#1% + {\collectXMLgroupedtrue + \long\def\dodogetgrouped{\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}}% + \getXMLgrouped{#1}} + +\long\gdef\dododefineXMLnestedenvironmentsave#1#2#3% + {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty + \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedenvironmentsave{#1}{#2}{#3}}% + \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing + \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}} + +\long\unexpanded\gdef\getXMLgroupednestedenvironmentsave#1#2#3% + {\collectXMLgroupedtrue + \long\def\dodogetgrouped{#2\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}#3}% + \getXMLgrouped{#1}} + +\egroup + +%D The high level definition macros. + +\def\defineXMLsingular {\dotripleempty\dodefineXMLsingular} +\def\defineXMLcommand {\dotripleempty\dodefineXMLcommand} +\def\defineXMLgrouped {\dotripleempty\dodefineXMLgrouped} +\def\defineXMLargument {\dotripleempty\dodefineXMLargument} +\def\defineXMLignore {\dotripleempty\dodefineXMLignore} +\def\defineXMLpickup {\dotripleempty\dodefineXMLpickup} +\def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment} +\def\defineXMLsave {\dotripleempty\dodefineXMLsave} +\def\defineXMLsavecontent {\dotripleempty\dodefineXMLsavecontent} +\def\defineXMLgsave {\dotripleempty\dodefineXMLgsave} +\def\defineXMLgsavecontent {\dotripleempty\dodefineXMLgsavecontent} +\def\defineXMLenvironmentsave {\dotripleempty\dodefineXMLenvironmentsave} +\def\defineXMLenvironmentgsave {\dotripleempty\dodefineXMLenvironmentgsave} +\def\defineXMLprocess {\dotripleempty\dodefineXMLprocess} +\def\defineXMLnested {\dotripleempty\dodefineXMLnestedenvironment} +\def\defineXMLnestedenvironment {\dotripleempty\dodefineXMLnestedenvironment} +\def\defineXMLnestedargument {\dotripleempty\dodefineXMLnestedargument} +\def\defineXMLnestedsave {\dotripleempty\dodefineXMLnestedsave} +\def\defineXMLnestedenvironmentsave{\dotripleempty\dodefineXMLnestedenvironmentsave} + +%D We can nill definitions with: + +\def\resetXMLelement[#1]{\dododefineXMLprocess{#1}} + +%D This is equivalent to: +%D +%D \starttyping +%D \def\resetXMLelement[#1]% handy in case only singular +%D {\@EA\let\csname\@@XMLelement:#1\endcsname \donothing +%D \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing +%D \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} +%D \stoptyping + +% push is (not yet) a real push, so: + +\def\defineXMLpush {\dotripleempty\dodefineXMLsave} +\def\defineXMLenvironmentpush{\dotripleempty\dodefineXMLenvironmentsave} + +% goes for all types + +\long\def\dodefineXMLsingular[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLsingular{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLcommand[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLcommand{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLgrouped[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLgrouped{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLargument[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLargument{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLignore[#1][#2][#3]% + {\defineXMLmethod\dododefineXMLignore{#1}{#2}{#3}{}{}} + +\long\def\dodefineXMLpickup[#1][#2][#3]#4#5% + {\defineXMLmethod\dododefineXMLpickup{#1}{#2}{#3}{#4}{#5}} + +\long\def\dodefineXMLenvironment[#1][#2][#3]#4#5% + {\defineXMLmethod\dododefineXMLenvironment{#1}{#2}{#3}{#4}{#5}} + +\long\def\dodefineXMLsave[#1][#2][#3]% + {\defineXMLmethod\dododefineXMLsave{#1}{#2}{#3}{}{}} + +\long\def\dodefineXMLsavecontent[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLsavecontent{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLgsave[#1][#2][#3]% + {\defineXMLmethod\dododefineXMLgsave{#1}{#2}{#3}{}{}} + +\long\def\dodefineXMLgsavecontent[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLgsavecontent{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLenvironmentsave[#1][#2][#3]#4#5% + {\defineXMLmethod\dododefineXMLenvironmentsave{#1}{#2}{#3}{#4}{#5}} + +\long\def\dodefineXMLenvironmentgsave[#1][#2][#3]#4#5% + {\defineXMLmethod\dododefineXMLenvironmentgsave{#1}{#2}{#3}{#4}{#5}} + +\long\def\dodefineXMLprocess[#1][#2][#3]% + {\defineXMLmethod\dododefineXMLprocess{#1}{#2}{#3}{}{}} + +\long\def\dodefineXMLnestedenvironment[#1][#2][#3]#4#5% + {\defineXMLmethod\dododefineXMLnestedenvironment{#1}{#2}{#3}{#4}{#5}} + +\long\def\dodefineXMLnestedargument[#1][#2][#3]#4% + {\defineXMLmethod\dododefineXMLnestedargument{#1}{#2}{#3}{#4}{}} + +\long\def\dodefineXMLnestedsave[#1][#2][#3]% + {\defineXMLmethod\dododefineXMLnestedsave{#1}{#2}{#3}{}{}} + +\long\def\dodefineXMLnestedenvironmentsave[#1][#2][#3]#4#5% + {\defineXMLmethod\dododefineXMLnestedenvironmentsave{#1}{#2}{#3}{#4}{#5}} + +% [key=val] => \presetXMLarguments{element} => default key/vals +% [blabla] => \theXMLarguments{blabla} => user key/vals +% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals +% \theXMLarguments{blabla} => user key/vals + +% command element [map] [parlst] begin end + +\long\def\defineXMLmethod#1#2#3#4#5#6% + {\ifsecondargument + \setXMLarguments{#2}{#3}{#4}% + \else + \resetXMLarguments{#2}% new + \fi + #1{#2}{#5}{#6}} + +%D Arguments (attributes) \unknown + +% \long\def\setXMLarguments#1#2#3% element [tag] settings +% {\doifassignmentelse{#2} +% {\long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}} +% {\long\setvalue{\@@XMLmap :#1}{#2}% later we can init vars by this name +% \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}} + +\long\def\setXMLarguments#1#2#3% element [tag] settings + {\doifassignmentelse{#2} % ROOM FOR OPTIMIZATION + {\letbeundefined{\@@XMLmap:#1}% + \long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}} + {\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name + \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}} + +\def\presetXMLarguments#1% + {\csname\@@XMLpars:\rawXMLnamespace#1\endcsname} % == \getvalue{} + +\prependtoks + \presetXMLarguments\rawXMLidentifier +\to \everyXMLelement + +%D We now overload the previously defined argument setter by one +%D that is faster when definitions are surrounded by +%D +%D \starttyping +%D \startXMLcompiling ... \stopXMLcompiling +%D \stoptyping +%D +%D This method is twice as fast on (for instance) 100K calls to +%D an empty element with 10 arguments. + +% \long\def\prepareXMLargument#1#2#3% +% {\scratchtoks\expandafter{\the\scratchtoks\@EA\def\csname#1#2\endcsname{#3}}} + +% \long\def\prepareXMLargument#1#2#3% +% {\scratchtoks\@EA\@EA\@EA{\@EA\the\@EA\scratchtoks\@EA\def\csname\@@XMLvariable:#1:#2\endcsname{#3}}} + +% \let\@@globalprefix\empty + +% \long\def\prepareXMLargument#1#2#3% +% {\expanded{\scratchtoks +% {\the\scratchtoks +% \def\@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname{#3}% +% \noexpand\@EA\let\noexpand\csname\@@XMLvariable:\noexpand\the\numexpr(\XMLdepth+1):#2\endcsname +% \@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname}}} + +\long\def\prepareXMLargument#1#2#3% + {\expanded{\scratchtoks + {\the\scratchtoks + \def\@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname{#3}% + \noexpand\@EA\let\noexpand\csname\@@XMLvariable:\noexpand\the\numexpr\XMLdepth+\plusone\relax:#2\endcsname + \@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname}}} + +\long\def\setXMLargumentsN#1#2#3% element [tag] settings + {\doifassignmentelse{#2} + {\letbeundefined{\@@XMLmap:#1}% + \long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}} + {\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name + \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}} + +\long\def\setXMLargumentsP#1#2#3% element settings empty (we cannot test for assignment) + {\letbeundefined{\@@XMLmap:#1}% + \bgroup + %def\XMLinheritance{\noexpand\XMLinheritance} + \def\XMLop##1{\noexpand\XMLpar{#1}{##1}{}}% + \def\XMLpar{\noexpand\XMLpar}% + \def\XMLanc{\noexpand\XMLanc}% + \def\XMLinh{\noexpand\XMLinh}% + \xdef\!!XMLattr{[#1][#2]}% + \scratchtoks\emptytoks + \@EA\dogetparameters\@EA\prepareXMLargument\!!XMLattr + \xdef\globalnext{\the\scratchtoks}% + \egroup + \letvalue{\@@XMLpars:#1}\globalnext + \globallet\globalnext\relax} + +\def\defineXMLattributeset{\dodoubleargument\dodefineXMLattributeset} +\def\extendXMLattributeset{\dodoubleargument\doextendXMLattributeset} + +\def\dodefineXMLattributeset[#1][#2]{\setvalue {\@@XMLpars::#1}{#2}} +\def\doextendXMLattributeset[#1][#2]{\appendvalue{\@@XMLpars::#1}{,#2}} + +\def\XMLattributeset #1{\executeifdefined{\@@XMLpars::#1}\empty} +%def\XMLinheritance #1{\executeifdefined{\@@XMLpars:#1}\empty} +\def\showXMLattributes#1{\showvalue{\@@XMLpars:#1}} + +\chardef\@@precompile\zerocount + +\def\setXMLarguments + {\ifcase\@@precompile + \expandafter\setXMLargumentsN + \else + \expandafter\setXMLargumentsP + \fi} + +\def\startXMLcompiling + {\dosingleargument\dostartXMLcompiling} + +% \def\dostartXMLcompiling[#1]% +% {\iffirstargument +% \copyXMLargumentindeed % when needed, from now on -) +% \def\@@globalprefix{#1}% +% \fi +% \chardef\@@precompile\plusone} + +\def\dostartXMLcompiling[#1]% + {\doif{#1}\v!inherit + \copyXMLargumentindeed + \chardef\@@precompile\plusone} + +\def\stopXMLcompiling + {\chardef\@@precompile\zerocount} % no \let\@@globalprefix\empty + +%D Interesting what kind of things are needed \unknown + +\appendtoks + \ifdefined\disablelanguagespecifics\disablelanguagespecifics\fi +\to \everyenableXML + +\long\def\longempty{} +\long\def\longspace{ } + +% \def\doifelseXMLdata#1% always empty at start [gets a long assignment] +% {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty +% \expandafter\secondoftwoarguments +% \else +% \expandafter\firstoftwoarguments +% \fi} +% +% \def\doifXMLdata#1% always empty at start [gets a long assignment] +% {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty +% \expandafter\gobbleoneargument +% \else +% \expandafter\firstofoneargument +% \fi} +% +% \let\doifXMLdataelse\doifelseXMLdata + +\def\doifelseXMLdata#1% always empty at start [gets a long assignment] + {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty + \expandafter\secondoftwoarguments + \else + \expandafter\firstoftwoarguments + \fi} + +\def\doifXMLdata#1% always empty at start [gets a long assignment] + {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty + \expandafter\gobbleoneargument + \else + \expandafter\firstofoneargument + \fi} + +\let\doifXMLdataelse\doifelseXMLdata + +\def\doifelseXMLempty#1% + {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty + \expandafter\firstoftwoarguments + \else\@EA\ifx\csname\@@XMLdata:#1\endcsname\longspace + \expandthree\firstoftwoarguments + \else + \expandthree\secondoftwoarguments + \fi\fi} + +% test case: +% +% \defineXMLenvironmentsave[test] +% {} +% {\message{[\XMLflush{test}]} +% \message{\doifelseXMLdata {test}{}{no }data} +% \message{/} +% \message{\doifelseXMLempty{test}{}{not }empty} +% \wait} +% +% \startXMLdata +% xxx +% +% +% +% +% x +% \stopXMLdata + +% \def\XMLflush#1% one level +% {\csname\@@XMLdata:#1\endcsname} + +% evt meer van dit gedoe en alle \longempty's vervangen + +\def\XMLflush#1% one level + {\csname\ifcsname\@@XMLdata:#1\endcsname\@@XMLdata:#1\else\s!empty\fi\endcsname} + +%D \starttyping +%D \defineXMLenvironmentsave[formula]{}{$\XMLtexdata{formula}$} +%D +%D \startXMLdata +%D t+3+x+t\neq m\alpha\frac\theta\hbar +%D \stopXMLdata +%D \stoptyping + +\def\XMLtexdata#1% + {\begingroup + \disableXML + \scantokens\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}% + \endgroup} + +\def\XMLflushdata#1% see m-steps for usage + {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else + %\@EAEAEA\XMLdata\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}% + \@EA\XMLdata\csname\@@XMLdata:#1\endcsname + \fi} + +\def\XMLflushasis#1% + {\detokenize\@EAEAEA{\csname\@@XMLdata:#1\endcsname}} + +\let\XMLpop \XMLflush +\let\XMLpopdata\XMLflushdata + +\def\XMLappend#1#2% let to empty expands to nothing -) + {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\csname\@@XMLdata:#1\endcsname#2}} + +\def\XMLprepend#1#2% let to empty expands to nothing -) + {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{#2\csname\@@XMLdata:#1\endcsname}} + +\def\XMLerase#1% + {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty} + +\def\XMLassign#1% + {\long\@EA\def\csname\@@XMLdata:#1\endcsname} + +\def\dontparseXMLelement#1>{} + +\def\simplifyXMLelements{\let\parseXMLelement\dontparseXMLelement} + +\def\defXMLstring#1#2% + {\bgroup + \enableXMLexpansion + \simplifyXMLelements + \let\getXMLentity\firstofoneargument + \XMLrawentitiestrue + \utfunicodetracer\plusseven % new + \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}% + \egroup + \defconvertedcommand#1\@@XML@@string} + +% this has to expand nicely: +% +% ]> +% +% so keep the following as is! + +\def\defXMLclean#1#2% + {\bgroup + \enableXMLexpansion + \simplifyXMLelements + \simplifyXMLentities + \utfunicodetracer\plusseven % new + \let\getXMLentity\expandedXMLentity % should this go in \simplify ? + \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}% + \egroup + \defconvertedcommand#1\@@XML@@string} + +\def\defXMLpar#1#2#3% to be documented + {\@EA\def\@EA#1\csname\ifcsname\@@XMLvariable:#2:#3\endcsname\@@XMLvariable:#2:#3\else\s!empty\fi\endcsname} + +\def\setvalueXMLpar#1#2#3% to be documented + {\@EA\let\csname#1\@EA\endcsname\csname\ifcsname\@@XMLvariable:#2:#3\endcsname\@@XMLvariable:#2:#3\else\s!empty\fi\endcsname} + +\def\XMLshow#1% + {\showvalue{\@@XMLdata:#1}} + +\def\XMLunspace#1% kan sneller + {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else + \long\@EA\edef\csname\@@XMLdata:#1\endcsname + {\@EAEAEA\dounspaced\csname\@@XMLdata:#1\endcsname\end}% + \fi} + +\chardef\asciispacecode=32 + +\def\defXMLlowerclean#1% lowercase ! evt tzt upper too + {\bgroup + \lccode`\#\asciispacecode + \lccode`\$\asciispacecode + \lccode`\%\asciispacecode + \lccode`\\\asciispacecode + \lccode`\^\asciispacecode + \lccode`\_\asciispacecode + \lccode`\{\asciispacecode + \lccode`\}\asciispacecode + \lccode`\|\asciispacecode + \lccode`\~\asciispacecode + \@EA\lowercase\@EA{\@EA\xdef\@EA#1\@EA{#1}}% + \egroup} + +\def\processXMLparelse#1#2#3#4% + {\processaction + [\XMLpar{#1}{#2}{}] + [#3,\s!unknown=>{#4},\s!default={#4}]} + +%D We can pick up key|/|value pairs, but we still need a way +%D to process these. + +% bugged +% +% \def\mapXMLvalue#1#2#3% td align center -> middle +% {\setvalue{\@@XMLvalue:#1:#2:#3}} + +\def\mapXMLvalue#1#2#3% td:align center -> middle + {\setvalue{\@@XMLvalue:#1:#2}{#3}} % keep #3 to grab spaces + +\def\XMLvar#1#2#3% td align center + {\ifcsname\@@XMLvariable:#1:#2\endcsname + \XMLval{#1}{#2}{\csname\@@XMLvariable:#1:#2\endcsname}% + \else + \XMLval{#1}{#2}{#3}% evt inline code + \fi} + +% \def\XMLvar#1#2#3% td align center +% {\XMLval{#1}{#2}{\ifcsname\@@XMLvariable:#1:#2\endcsname +% \csname\@@XMLvariable:#1:#2\endcsname\else#3\fi}} + +% \def\XMLval#1#2#3% td:align value default +% {\ifcsname\@@XMLvalue:#1:#2\endcsname +% \csname\@@XMLvalue:#1:#2\endcsname +% \else +% #3% +% \fi} +% +% The next one permits commands instead of strings in #3 + +\def\XMLval#1#2% #1=td:align #2=value #3=default + {\ifcsname\@@XMLvalue:#1:#2\endcsname + \@EA\firstoftwoarguments + \else + \@EA\secondoftwoarguments + \fi + {\csname\@@XMLvalue:#1:#2\endcsname}} + +\def\XMLpar#1#2#3% + {\ifcsname\@@XMLvariable:#1:#2\endcsname + \csname\@@XMLvariable:#1:#2\endcsname + \else + #3% + \fi} + +\def\XMLNSpar#1#2#3#4% element namespace name default + {\ifcsname\@@XMLvariable:#1:#2:#3\endcsname + \csname\@@XMLvariable:#1:#2:#3\endcsname + \else + #4% + \fi} + +% \def\setXMLpar#1#2% +% {\@EA\def\csname\@@XMLvariable:#1:#2\endcsname} + +\def\letXMLpar #1#2{\@EA \let\csname\@@XMLvariable:#1:#2\endcsname} +\def\setXMLpar #1#2{\@EA \def\csname\@@XMLvariable:#1:#2\endcsname} +\def\setXMLepar#1#2{\@EA\edef\csname\@@XMLvariable:#1:#2\endcsname} + +% ancestor arguments: +% +% \defineXMLenvironment +% [fo:root] +% [test=unset] +% {\beginXMLelement} +% {\endXMLelement} +% +% \defineXMLenvironment +% [fo:block-container] +% [test=oeps] +% {\beginXMLelement} +% {\endXMLelement} +% +% \defineXMLenvironment +% [fo:block] +% {\beginXMLelement +% \begingroup} +% {\endgroup +% \XMLanc{test}{} +% \endXMLelement} +% +% \startXMLdata +% +% second: +% unset: +% deep:nested:outer: +% last: +% +% \stopXMLdata +% +% \startXMLdata +% +% second: +% unset: +% deep:nested:outer: +% last: +% +% \stopXMLdata +% +% \startXMLdata +% +% second: +% unset: +% deep:nested:outer: +% last: +% +% \stopXMLdata + +% dit werkt alleen ok in niet ... situaties omdat anders +% de laatste b de attributen van de vorige heeft: + +\def\XMLanc#1% + {\ifcsname\@@XMLvariable:\currentXMLelement:#1\endcsname % \ownXMLelement + \csname\@@XMLvariable:\currentXMLelement:#1\endcsname % \ownXMLelement + \@EA\gobblethreearguments + \else + \@EA\pXMLanc + \fi\XMLdepth{#1}} + +% \def\pXMLanc#1% +% {\@EA\ppXMLanc\@EA{\the\numexpr(#1-\plusone)}} + +\def\pXMLanc#1% + {\@EA\ppXMLanc\@EA{\the\numexpr#1-\plusone\relax}} + +\def\ppXMLanc#1#2#3% + {\ifcsname\@@XMLdepth:#1\endcsname % is er altijd dus redundant + \ifcsname\@@XMLvariable:\csname\@@XMLdepth:#1\endcsname:#2\endcsname + \csname\@@XMLvariable:\csname\@@XMLdepth:#1\endcsname:#2\endcsname + \@EAEAEA\gobblethreearguments + \else + \@EAEAEA\pppXMLanc + \fi + \else + \@EA\pppXMLanc + \fi{#1}{#2}{#3}} + +\def\pppXMLanc#1% + {\ifnum#1>\zerocount + \@EA\pXMLanc + \else + \@EA\thirdofthreearguments + \fi{#1}} + +%D Experimental (not sure if this will stay): +%D +%D \starttyping +%D \startdefineXMLhandlers[one,two] +%D +%D \defineXMLenvironment[a=b,c=\XMLop{a}] +%D {}{} +%D +%D \stopdefineXMLhandlers +%D \stoptyping + +\long\def\startdefineXMLhandlers + {\bgroup\catcode\endoflineasciicode\spacecatcode + \dodoubleempty\dostartdefineXMLhandlers} + +\long\def\dostartdefineXMLhandlers[#1][#2]#3#4\stopdefineXMLhandlers % #2 is dummy + {\egroup + \long\def\dodefineXMLhandlers##1{#3[##1]#4}% + \processcommalist[#1]\dodefineXMLhandlers} + +\let\currentXMLhandler\s!unknown + +% \long\def\dostartdefineXMLhandlers[#1][#2]#3#4[#5]#6\stopdefineXMLhandlers % #2 is dummy +% {\egroup +% \pushmacro\XMLop +% \pushmacro\XMLpar +% \pushmacro\currentXMLhandler +% \long\def\dodefineXMLhandlers##1% +% {\edef\currentXMLhandler{##1}% +% \def\XMLop####1{\noexpand\XMLpar{##1}{####1}{}}% +% \def\XMLpar{\noexpand\XMLpar}% +% \def\XMLanc{\noexpand\XMLanc}% +% \edef\!!stringa{[##1][#5]}% +% \expandafter#3\!!stringa#6}% +% \processcommalist[#1]\dodefineXMLhandlers +% \popmacro\currentXMLhandler +% \popmacro\XMLpar +% \popmacro\XMLop} + +\long\def\dostartdefineXMLhandlers[#1][#2]#3#4[#5]#6\stopdefineXMLhandlers % #2 is dummy + {\egroup + \long\def\dodefineXMLhandlers##1% + {\bgroup + \edef\currentXMLhandler{##1}% + \def\XMLop####1{\noexpand\XMLpar{##1}{####1}{}}% + \def\XMLpar{\noexpand\XMLpar}% + \def\XMLanc{\noexpand\XMLanc}% + \def\XMLinh{\noexpand\XMLinh}% + \xdef\!!XMLattr{[##1][#5]}% + \egroup + \expandafter#3\!!XMLattr#6}% + \processcommalist[#1]\dodefineXMLhandlers} + +\def\XMLpav#1#2#3#4% + {\XMLval{#1}{\XMLpar{#2}{#3}{}}{#4}} + +%D A few weird ones: + +\def\TEXpar#1#2% + {\csname#1\interfaced{#2}\endcsname} + +\let\texXMLpar\TEXpar % soon obsolete + +\let\XMLtex\TEXpar + +% handy one + +\def\XMLtyp#1#2#3% + {\ifcsname\@@XMLvariable:#1:#2\endcsname + \@EA\defconvertedcommand\@EA\ascii\csname\@@XMLvariable:#1:#2\endcsname + \else + \defconvertedargument\ascii{#3}% + \fi + \ascii} + +\defineXMLsingular [begingroup] {\begingroup} +\defineXMLsingular [endgroup] {\endgroup} +\defineXMLsingular [gobblespacetokens] {\gobblespacetokens} +\defineXMLsingular [disableXML] {\disableXML} + +\long\def\XMLstr#1% + {{\enableXML\scantokens{#1}\unskip}} + +\long\def\XMLstr#1% test, does not work + {\ifprocessingXML + % \begingroup\enableXML\scantokens{#1}% + \scantokens{#1}% + \else + \begingroup\enableXML\scantokens{#1\ignorespaces}% + \fi} + +\def\XMLgetvariable#1#2% hooks into generic \getvariable and setvariables + {\expanded{\XMLstr{\getvariable{#1}{#2}}}} + +\long\def\XMLstrpar#1#2#3% test + {\ifcsname\@@XMLvariable:#1:#2\endcsname + \scantokens\@EAEAEA{\@EA\begingroup\@EA\enableXML + \csname\@@XMLvariable:#1:#2\endcsname}% + \else + \scantokens{\begingroup\enableXML#3}% + \fi} + +\def\doifXMLvarelse#1#2% geen etex, \relax too + {\ifcsname\@@XMLvariable:#1:#2\endcsname + \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty + \@EAEAEA\secondoftwoarguments + \else + \@EAEAEA\firstoftwoarguments + \fi + \else + \@EA\secondoftwoarguments + \fi} + +\def\doifXMLvar#1#2% geen etex, \relax too + {\ifcsname\@@XMLvariable:#1:#2\endcsname + \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty + \@EAEAEA\gobbleoneargument + \else + \@EAEAEA\firstofoneargument + \fi + \else + \@EA\gobbleoneargument + \fi} + +\def\doifXMLvalelse#1#2% geen etex, \relax too + {\ifcsname\@@XMLvalue:#1:#2\endcsname + \expandafter\ifx\csname\@@XMLvalue:#1:#2\endcsname\empty + \@EAEAEA\secondoftwoarguments + \else + \@EAEAEA\firstoftwoarguments + \fi + \else + \@EA\secondoftwoarguments + \fi} + +\let\doifXMLparelse\doifXMLvarelse +\let\doifXMLpar \doifXMLvar + +%D Used in x-fo: I really need to document this! + +\bgroup \catcode`\<=\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\defconvertedcommand\@EA#1\csname\@@XMLvariable:#2:#3\endcsname + \else + \defconvertedargument#1{#4}% + \fi} + +\def\XMLprocess#1% + {\begingroup\enableXML\XMLflush{#1}\endgroup} + +\bgroup \catcode`<=\@@active + +\long\gdef\ignoreuntilXMLelement#1<{<} +\long\gdef\grabuntilXMLelement #1<\to#2{\def#2{#1}<} + +\egroup + +%D Saves tokens and typing. + +\def\XMLownvar {\XMLvar {\rawXMLnamespace\rawXMLidentifier}} +\def\XMLownval {\XMLval {\rawXMLnamespace\rawXMLidentifier}} +\def\XMLownpar {\XMLpar {\rawXMLnamespace\rawXMLidentifier}} +\def\XMLownstrpar {\XMLstrpar {\rawXMLnamespace\rawXMLidentifier}} +\def\doifXMLownvarelse{\doifXMLvarelse{\rawXMLnamespace\rawXMLidentifier}} +\def\doifXMLownvalelse{\doifXMLvalelse{\rawXMLnamespace\rawXMLidentifier}} +\def\doifXMLownparelse{\doifXMLparelse{\rawXMLnamespace\rawXMLidentifier}} + +\def\letXMLpar #1#2{\@EA \let\csname\@@XMLvariable:#1:#2\endcsname} +\def\setXMLpar #1#2{\@EA \def\csname\@@XMLvariable:#1:#2\endcsname} +\def\setXMLepar#1#2{\@EA\edef\csname\@@XMLvariable:#1:#2\endcsname} + +\def\ownXMLelement{\rawXMLnamespace\rawXMLidentifier} + +\def\XMLop#1% ownpar + {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname + \@@XMLvariable:\ownXMLelement:#1\else\s!empty + \fi\endcsname} + +\def\XMLtp#1% texpar + {\csname\ifcsname\@@XMLmapmap\interfaced{#1}\endcsname + \@@XMLmapmap\interfaced{#1}\else\s!empty + \fi\endcsname} + +\def\doifelseXMLop#1{\doifelse{\XMLop{#1}}} +\def\doifXMLop #1{\doif {\XMLop{#1}}} +\def\doifnotXMLop #1{\doifnot {\XMLop{#1}}} + +\def\doifelsenothingXMLop#1{\doifelsenothing{\XMLop{#1}}} +\def\doifsomethingXMLop #1{\doifsomething {\XMLop{#1}}} +\def\doifnothingXMLop #1{\doifnothing {\XMLop{#1}}} + +\def\doifelseXMLtp#1{\doifelse{\XMLtp{#1}}} +\def\doifXMLtp #1{\doif {\XMLtp{#1}}} +\def\doifnotXMLtp #1{\doifnot {\XMLtp{#1}}} + +\def\doifelsenothingXMLtp#1{\doifelsenothing{\XMLtp{#1}}} +\def\doifsomethingXMLtp #1{\doifsomething {\XMLtp{#1}}} +\def\doifnothingXMLtp #1{\doifnothing {\XMLtp{#1}}} + +\def\XMLflushself{\csname\@@XMLdata:\ownXMLelement\endcsname} + +\def\showXMLdata#1{\showvalue{\@@XMLdata:#1}} + +\def\XMLta {\theXMLarguments\@@XMLmapmap} +\def\getXMLta {\expanded{\getparameters[\@@XMLmapmap][\XMLta]}} +\def\expandXMLta{\expandXMLarguments\@@XMLmapmap} +\def\expandXMLtp{\expandTEXpar\@@XMLmapmap} % #1 + +\def\getXMLparameters[#1]% faster than \rawgetparameters[#1][\theXMLar..] + {\ifcsname\@@XMLmap:#1\endcsname + \expanded{\rawgetparameters[#1][\csname\@@XMLmap:#1\endcsname]}% + \fi} + +\def\defXMLop#1#2{\@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#2\endcsname} +\def\defXMLtp#1#2{\@EA\let\@EA#1\csname\@@XMLmapmap\interfaced{#2}\endcsname} + +%D ... + +\def\protectXMLdata + {\catcode\tabasciicode \spacecatcode + \catcode\endoflineasciicode\spacecatcode + \catcode\formfeedasciicode \spacecatcode + \catcode\endoffileasciicode\spacecatcode + \catcode`\#\@@other} + +\long\def\startXMLcode + {\begingroup + \protectXMLdata + \dostartXMLcode} + +\long\def\dostartXMLcode[#1] #2 \stopXMLcode + {\@EA\gdef\csname\@@XMLcode:#1\endcsname{\startXMLdata#2\stopXMLdata}% + \endgroup} + +\def\getXMLcode[#1]% \expandXMLcode + {\csname\@@XMLcode:#1\endcsname} + +% \long\def\startXMLdata#1\stopXMLdata% +% {\begingroup\enableXML\scantokens{#1}\endgroup} +% +% \defineXMLentity[tex-backslash] {\catchXMLpar} +% +% \def\catchXMLpar#1#2#3 +% {\if#1p\if#2a\if#3r\ifmmode\else\endgraf\fi +% \else\texescape\fi\else\texescape\fi\else\texescape\fi} + +\long\def\startXMLdata + {\begingroup + \protectXMLdata + \dostartXMLdata} + +\long\def\dostartXMLdata#1\stopXMLdata % evt \everyeof{} + {\enableXML\scantokens{#1}% + \endgroup + \ifhmode\unskip\unskip\fi} + +% suboptimal: +% +% \unexpanded\def\XMLdata#1% % \unexpanded added 22/5/2001 +% {\begingroup +% \enableXML\scantokens{#1}\ifhmode\unskip\unskip\fi +% \endgroup} +% +% better but does not work in tables: +% +% \unexpanded\def\XMLdata#1% % grouping changed 20/5/2001 +% {\scantokens{\begingroup\enableXML#1\gobblespacetokens}} +% +% currently: + +\unexpanded\def\XMLdata % # safe + {\begingroup + \protectXMLdata + \doXMLdata} + +\def\doXMLdata#1% + {\enableXML + \scantokens{#1}% + \endgroup} + +%D + +\def\bXMLs{\ifignoreXMLspaces\ignorespaces\fi} +\def\eXMLs{\ifignoreXMLspaces\ifhmode\unskip\fi\fi} + +\protect + +% \defineXMLcommand{placeindex/} +% {\placeindex[criterium=all]} +% +% \defineXMLargument{index} +% {\index[\XMLvar{index}{key}{}]} + +%D Here we implement the handling of preformatted code. + +\unprotect + +\def\startXMLpreformatted#1% + {\startpacked + #1% + \fixedXMLfonttrue + \obeylines + \obeyspaces + \setbox\scratchbox=\hbox{x}% + \edef\obeyedspace{\noindent\noexpand\kern\the\wd\scratchbox}} + +\def\stopXMLpreformatted#1% + {\stoppacked} + +%D + +\def\XMLinput{\enableXML\input} \global\let\inputXML\XMLinput + +% options + +\def\processXMLfile #1{\enableXML\processfile{#1}} +\def\processXMLfilegrouped#1{{\enableXML\processfile{#1}\relax\ifmmode\else\par\fi}} + +%D \type +%D {processXMLbuffer} +%D +%D For illustrative purposes, we need to be able to reuse +%D definitions, which is why we implement a buffer processor +%D here. The macro \type {\processXMLbuffer} behaves like +%D any buffer processor. + +\def\processXMLbuffer + {\dosingleempty\doprocessXMLbuffer} + +\def\doprocessXMLbuffer[#1]% + {\doifelsenothing{#1} + {\doprocessXMLbuffer[\jobname]} + {\begingroup + \enableXML + \def\dodoprocessXMLbuffer##1{\getbuffer[##1]}% + \processcommalist[#1]\dodoprocessXMLbuffer + \endgroup}} + +%D Loading specific modules takes place with \type +%D {\useXMLfilters}. + +% todo: flag + +\def\useXMLfilter[#1]% + {\processcommalist[#1]\douseXMLfilter} + +\def\douseXMLfilter#1% + {\doifundefined{\c!file\f!xtagprefix#1} + {\letvalue{\c!file\f!xtagprefix#1}\empty + \startreadingfile + % \truefilename removed + \readsysfile{\f!xtagprefix#1.mkii} + {\writestatus{xml}{loading module #1.mkii}} + {\readsysfile{\f!xtagprefix#1.tex} + {\writestatus{xml}{loading module #1.tex}} + \donothing}% + \stopreadingfile}} + +%D Temporarily here. + +\newtoks\groupedtoks +\newif\ifcollectXMLgrouped + +\bgroup \catcode`\<=\@@active + +\newtoks\XMLgtoks + +\long\unexpanded\gdef\getXMLgroupedenvironment#1#2#3% + {\collectXMLgroupedtrue + \XMLgtoks{#2}% + \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\the\groupedtoks#3}% + \getXMLgrouped{#1}} + +\long\unexpanded\gdef\getXMLgroupedargument#1#2% + {\collectXMLgroupedtrue + \XMLgtoks{#2}% + \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\@EA{\the\groupedtoks}}% + \getXMLgrouped{#1}} + +\long\unexpanded\gdef\getXMLgroupedignore#1% + {\collectXMLgroupedfalse + \let\dodogetgrouped\relax + \getXMLgrouped{#1}} + +\long\gdef\docountXMLgrouped#1\end#2\end % 1 relax is enough since it's + {\long\def\dosplitXMLstring##1#1##2\relax\relax##3\end % another regime + {\def\ascii{##2}% + \ifx\ascii\empty \else + \advance\scratchcounter \plusone + \dosplitXMLstring##2\relax\relax#1\relax\relax\end + \fi}% + \dosplitXMLstring#2\relax\relax#1\relax\relax\end} + +\long\unexpanded\gdef\getXMLgrouped#1% #1 kan weg % klopt dit nu? + {\groupedtoks\emptytoks + \scratchcounter\zerocount + \edef\theXMLnamespace + {\ifx\originalXMLnamespace\empty\else\originalXMLnamespace:\fi + \currentXMLidentifier}% + \expanded{\long\noexpand\def\noexpand\dogetgrouped####1\noexpand}% + {\ifcollectXMLgrouped\appendtoks##1\to\groupedtoks\fi + \@EA\docountXMLgrouped\@EA<\theXMLnamespace>\end##1\end + \@EAEAEA\docountXMLgrouped\@EA\@EA\@EA<\@EA\theXMLnamespace\space \end##1\end + \ifcase\scratchcounter + \let\dogetgrouped\dodogetgrouped + \else + \advance\scratchcounter \minusone + \ifcollectXMLgrouped\@EA\appendtoks\@EA<\@EA/\currentXMLelement>\to\groupedtoks\fi + \fi + \dogetgrouped}% + \dogetgrouped} + +\egroup + +% interesting and fully expandable + +\def\XMLownifequalelse#1#2% + {\@EAEAEA\@@ifequal\csname\@@XMLvariable:\ownXMLelement:#1\endcsname\relax\@@and#2\relax\@@then} + +% \def\XMLifequalelse#1#2#3% +% {\@EAEAEA\@@ifequal\csname\@@XMLvariable:#1:#2\endcsname\relax\@@and#3\relax\@@then} + +\def\XMLifequalelse#1#2% + {\ifcsname\@@XMLvariable:#1:#2\endcsname + % \@EAEAEA\doXMLifequalelse\@EA\@EA\csname\@@XMLvariable:#1:#2\endcsname + \@EA\doXMLifequalelse\csname\@@XMLvariable:#1:#2\@EA\endcsname + \else + \@EA\secondoftwoarguments + \fi} + +\def\doXMLifequalelse#1#2% + {\@EA\@@ifequal#1\relax\@@and#2\relax\@@then} + +%D \starttyping +%D \defineXMLenvironment[test][a=1] +%D {\XMLownifequalelse{a}{2}{YES}{NO}} +%D {} +%D +%D \defineXMLenvironment[test][a=1] +%D {\XMLifequalelse{test}{a}{1}{YES}{NO}} +%D {} +%D +%D \startXMLdata +%D test +%D \stopXMLdata +%D \stoptyping + +\def\XMLyes#1{\XMLownifequalelse{#1}{yes}{#1}{}} + +%D The next macro will set the variable \type {\flattenedXMLcontent} +%D to the content with elements removed and entity names. + +\bgroup + +\catcode`\<\active +\catcode`\&\active + +\gdef\flattenXMLcontent#1% we need taco's 'over one group' + {\begingroup + \keeputfcharacters + \def<##1>{}% + \def&##1;{##1}% + \edef\flattenedXMLcontent{#1}% + \edef\flattenedXMLcontent{\expandafter\dounspaced\flattenedXMLcontent\end}% + \@EA\endgroup + \@EA\def\@EA\flattenedXMLcontent\@EA{\flattenedXMLcontent}} + +\egroup + +\def\defXMLexpanded#1#2% + {\begingroup + \let\getXMLentity\expandedXMLentity + \expanded{\endgroup\edef\noexpand#1{#2}}} + +\def\gdefXMLexpanded#1#2% + {\begingroup + \let\getXMLentity\expandedXMLentity + \expanded{\endgroup\xdef\noexpand#1{#2}}} + +\protect \endinput diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex deleted file mode 100644 index 8da2ec3fb..000000000 --- a/tex/context/base/xtag-ini.tex +++ /dev/null @@ -1,3019 +0,0 @@ -%D \module -%D [ file=xtag-ini, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Initialization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Initialization} - -%D Beware: don't rely on \longempty things, since this may -%D change! - -%D \macros -%D {defineinputmode,setinputmode} -%D -%D For old times sake we still support: - -\unexpanded\def\defineinputmode[#1]{\expandafter\newtoks\csname every#1inputmode\endcsname} -\unexpanded\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks} - -\defineinputmode [TEX] -\defineinputmode [XML] - -\setinputmode [TEX] - -%D Finally we make sure that the compound handler keeps doingits job. - -\ifx\normalcompound\undefined \let\normalcompound=| \fi - -\appendtoks \catcode`|=\activecatcode \let|\normalcompound \to \everyTEXinputmode -\appendtoks \catcode`|=\lettercatcode \to \everyXMLinputmode - -%D This module is highly optimized for speed, which sometimes -%D leads to rather unreadable code. Sorry for this. - -\bgroup \obeylines - -\gdef\startXMLdefinitions% keep % - {\bgroup\obeylines\dostartXMLdefinitions} - -\gdef\dostartXMLdefinitions #1 - {\egroup\doifsomething{#1}{\writestatus{XML}{loading #1 support}}} - -\global\let\stopXMLdefinitions\relax - -\egroup - -% todo: XMLfullsave == also attributes -% csnames -% XMLelse -> elseXML - -%D Remark: some hard coded character things will be replaced -%D by named glyphs as soon as the upgraded encoding modules -%D are released. At that moment, unicode support will be -%D provided in accordance with the normal support in \CONTEXT. - -%D Like it or not, this module deals with angle bracketed -%D input. Processing \XML\ alike input in \CONTEXT\ has been -%D possible since 1995, and till 2000 several methods ran in -%D parallel. These were implemented in modules like the semi -%D public \type {m-sgml}. -%D -%D There is not one optimal solution for processing \XML\ data. -%D The oldest method was based on a very simple preprocessor -%D written in \MODULA\ and later \PERL: \type {} was -%D converted into \type {\begSGML[command]} and optional -%D parameters were passed. -%D -%D A second method uses a \PERL\ or \XSL\ transformation -%D script that produces \CONTEXT\ commands. This method is -%D much slower, mainly because the whole document is read into -%D memory and a document tree is to be build. The advantage is -%D that processing of the resulting document is fast. -%D -%D The third method uses a basic parser written in the \TEX\ -%D language, and apart from a few pitfalls, this method is -%D clean and efficient, but not always robust. Because errors -%D in the input are not catched on forehand, processing in -%D \TEX\ may fail due to errors. But, given that a document -%D can be validated on forehand, this is no big problem. -%D -%D Each method has its advantage, but especially the third -%D method puts some demands on \CONTEXT, since no interference -%D between the parser and the core commands may occur. What -%D method is used, depends on the situation. -%D -%D All three methods introduce some problems in interfacing to -%D core \CONTEXT\ functionality. This is due to the fact that -%D sometimes we want to typeset content directly, while in -%D other cases we just want to pick up data for later usage, -%D either or not using delimited arguments. And, when moving -%D data around, there is always the expansion problem to deal -%D with. -%D -%D As can be expected, we have to map begin and end tags onto -%D \CONTEXT's start- and stopcommands. This is the easy part. -%D When we have to pass the content of an element to a macro -%D as argument, we need to do a delimited grab. Such mappings -%D are not that hard to implement and were part of \type -%D {m-sgml.tex} already. New in this core module is nested -%D grabbing. Also new here is the support for namespaces and -%D extensive attribute handling. On the other hand, recursive -%D traceback of attributes is no longer supported. Because -%D this feature was not really used, we can hereby safely we -%D declare the \type {m-sgml.tex} module obsolete. -%D -%D In order to be able to incorporate \XML\ style definitions -%D into basic \TEX\ styles, we will provide some basic -%D functionality in the core itself. Some of the functionality -%D can be set up with this general command. We use a token -%D list register to handle post||setup actions. This permits -%D us to extend this command. - -\unprotect - -\newtoks\aftersetupXMLprocessing - -\def\setupXMLprocessing - {\dosingleargument\dosetupXMLprocessing} - -\def\dosetupXMLprocessing[#1]% - {\getparameters[\??xp][#1]\the\aftersetupXMLprocessing} - -\def\XMLprocessingparameter#1% - {\csname\??xp#1\endcsname} - -\protect - -%D Formally an \XML\ file starts with an unique sequence -%D \type {} - -%D We will be dealing with elements, which means that we have -%D to take care of \type {} and \type {}, but -%D also with \type {} and \type {}. In some cases -%D the upper and lowercase alternatives need to be dealt with, -%D although this is not realy needed since XML is case -%D sensitive. -%D -%D We also have to handle entities, like \type {&you;} and -%D \type {&me;}. These are quite easy to deal with and need to -%D be hooked into the encoding and abbreviation mechanisms. -%D -%D And then there are the parameters to be taken care of. Here -%D we meet \type {key="value"} but also \type {key='eulav'} -%D and even the spacy \typ {key = "value"}. -%D -%D Since we have to handlers for each element and entity, we -%D will create a few namespaces. Special care has to be -%D given to preformated code. -%D -%D There are two namespace mechanisms in place: one for -%D \TEX, and one for \XML. The later mechanism permits -%D remapping and ignoring. - -\unprotect - -\def \@@XML {XML:} -\edef\@@XMLentity {\@@XML ent} % &crap; -\edef\@@XMLelement {\@@XML ele} % -\edef\@@XMLvariable {\@@XML var} % key="val" -\edef\@@XMLvalue {\@@XML val} % key="val" -\edef\@@XMLpars {\@@XML par} % -\edef\@@XMLdata {\@@XML dat} % mem buffer -\edef\@@XMLcode {\@@XML cod} % named mem buffers -\edef\@@XMLinstruction {\@@XML ins} % -\edef\@@XMLvariable {\@@XML c} % key="val" -\edef\@@XMLvalue {\@@XML d} % key="val" -\edef\@@XMLpars {\@@XML e} % -\edef\@@XMLdata {\@@XML f} % mem buffer -\edef\@@XMLcode {\@@XML g} % named mem buffers -\edef\@@XMLinstruction {\@@XML h} % =.@@other -% .catcode`."=.@@other -% .catcode`./=.@@other -% .catcode`.'=.@@other -% .catcode`.~=.@@other -% .catcode`.#=.@@other -% .let &=.doXMLentity -% .unexpanded.def=.@@other -% .unexpanded.def=.@@other -% .let<.relax * new -% .processingXMLfalse -% E -% -% .global.let<.relax * new -% .global.let&.relax * new -% -% .egroup -% -% \def\disableXML -% {\setnormalcatcodes\processingXMLfalse} - -\defcatcodecommand\xmlcatcodese `\& \doXMLentity -\defcatcodecommand\xmlcatcodese `\< \doXMLelement -\defcatcodecommand\xmlcatcodesr `\& \doXMLentity -\defcatcodecommand\xmlcatcodesr `\< \doXMLelement -\defcatcodecommand\xmlcatcodesn `\& \doXMLentity -\defcatcodecommand\xmlcatcodesn `\< \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 \let&\relax - -\xdef\entityhash {&\string#035;} -\xdef\entitydollar {&\string#036;} -\xdef\entitypercent {&\string#037;} -\xdef\entitybackslash {&\string#092;} -\xdef\entityhat {&\string#094;} -\xdef\entityunderscore{&\string#095;} -\xdef\entityleftbrace {&\string#123;} -\xdef\entityrightbrace{&\string#125;} -\xdef\entitybar {&\string#124;} - -\egroup - -\letcatcodecommand\xmlcatcodese `\# \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 < & - -\doifmodeelse {mkiv} { - - \def\mksetXMLtokensreduction % mkiv - {\setcatcodetable\xmlcatcodesn} - -} { - - \def\mksetXMLtokensreduction % mkii - {\ifcase\XMLtokensreduction - \setcatcodetable\xmlcatcodese \or - \setcatcodetable\xmlcatcodesr \else - \setcatcodetable\xmlcatcodesn - \fi} - -} - -\bgroup \catcode`\<=13 \catcode`\&=13 - -\gdef\enableXML - {\mksetXMLtokensreduction - \let&\doXMLentity - \unexpanded\def<{\doXMLelement}% - \processingXMLtrue - \the\everyenableXML} - -\gdef\disableXML - {\setcatcodetable\ctxcatcodes % maybe \texcatcodes - \processingXMLfalse} - -\gdef\enableXMLexpansion - {\def<{\doXMLelement}% - \let&\doXMLentity} - -\gdef\disableXMLexpansion - {\unexpanded\def<{\doXMLelement}% - \let&\doXMLentity} - -\unexpanded\gdef\enableXMLelements - {\catcode60=\@@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 -%D equivalent: -%D -%D \starttyping -%D -%D \stoptyping -%D -%D Empty elements can have arguments too. Conforming the -%D standard, each key must have a value. These are separated -%D by an \type {=} sign and the value is delimited by either -%D \type {"} or \type {'}. There may be spaces around the -%D equal sign. -%D -%D \starttyping -%D -%D \stoptyping -%D -%D Officially the following definition is not valid: -%D -%D \starttyping -%D some text -%D \stoptyping -%D -%D Although we can handle both cases independently, this is -%D seldom needed. -%D -%D Processing instructions are identified by a~\type {?} and are -%D like empty elements. -%D -%D \starttyping -%D -%D \stoptyping -%D -%D Comment is formatted as follows. -%D -%D \starttyping -%D -%D \stoptyping -%D -%D Verbatim code inits purest form is called \type {CDATA} and -%D is embedded in the following ugly and therefore recognizable -%D way: -%D -%D \starttyping -%D -%D \stoptyping - -%D The parser is implemented as a multi||step macro. Because -%D \type {!} and \type {?} should be picked up correctly, we -%D need to define a few macros in unprotected mode! -%D -%D Because \XML\ is defined with some restrictions in mind, -%D parsing the elements is not that complicated. First we have -%D to determine if we're dealing with a comment or processing -%D instruction. We need a bit of grouping because we have to -%D mess up with catcodes. We probably have to treat a few -%D more catcode and first character cases. We need to use -%D \type {\begingroup} here, otherwise we get funny spaces in -%D math. - -%D Maybe I will remove grouping here and introduce \type -%D {\obeyXMLlines}. - -%D By using a few {\expandafter}'s we can avoid a \type {\next} -%D construction. We could speed the first char test up a bit -%D by using an installer and something \typ {\getvalue -%D {#1doXMLelement}} (todo). - -\protect % we need an normal ! ? - -% \long\def\doXMLelement#1% -% {\if#1!\expandafter \xparseXMLescape \else -% \if#1?\expandafter\expandafter\expandafter \xparseXMLprocess \else -% \expandafter\expandafter\expandafter \xparseXMLelement \fi\fi -% #1} - -\def\expandthree{\expandafter\expandafter\expandafter} - -\long\def\doXMLelement#1% - {\if#1!\expandafter \xparseXMLescape \else - \if#1?\expandthree \xparseXMLprocess \else - \expandthree \xparseXMLelement \fi\fi - #1} - -% does it end with ? or ?> - -\long\def\xparseXMLescape !#1 {\parseXMLescape{#1}} -\long\def\xparseXMLprocess ?#1 #2>{\parseXMLprocess{#1}{#2}} -\long\def\xparseXMLelement #1>{\parseXMLelement #1 >} - -%D The escape handler takes care of the fuzzy \type { parsing takes place in macros - {\executeifdefined{\@@XMLescape:#1}{\csname\@@XMLescape:\s!default\endcsname}} - -%D In our case, processing instructions are only needed if -%D we want specific \CONTEXT\ support. This may be useful in -%D applications where the data is generated by an -%D application. We will implement a \CONTEXT\ code handler -%D later. - -%D The processing instructions handler is implemented as -%D follows. - -\long\def\defineXMLprocessor[#1]#2% - {\long\setvalue{\@@XMLinstruction:#1}{#2}} - -% \def\parseXMLprocess#1#2% -% {\executeifdefined{\@@XMLinstruction:#1}\gobbleoneargument{#2}} - -%D Because we support \type {.. ?>} as well as \type {.. >} -%D end||of||pi situations, we need to clean up the ending -%D \type {?}. - -\protect - -\long\def\cleanupXMLprocess#1% - {\docleanupXMLprocess#1 ? \relax} - -\long\def\docleanupXMLprocess#1? #2\relax - {\def\currentXMLprocess{#1}} - -\unprotect - -\def\parseXMLprocess#1#2% - {\cleanupXMLprocess{#2}% - \defconvertedcommand\ascii{#1}% - %\writestatus{xml-process}{\ascii} - \expanded - {\executeifdefined - {\@@XMLinstruction:\ascii} - \noexpand\gobbleoneargument - {\expandafter\noexpand\currentXMLprocess}}} - -%D One never knows: - -\let\normalparseXMLescape \parseXMLescape -\let\normalparseXMLelement\parseXMLelement -\let\normalparseXMLprocess\parseXMLprocess - -%D Next we will implement the normal element handler. This -%D piece of code is complicated by the fact that we need to -%D handle namespaces. - -\let\currentXMLarguments \empty -\let\currentXMLelement \empty % name -\let\currentXMLidentifier\empty % name or name/ -\let\currentXMLnamespace \empty % the (remapped) namespace -\let\originalXMLnamespace\empty % the unremapped namespace -\let\rawXMLidentifier \empty - -\def\rawXMLnamespace - {\ifx\currentXMLnamespace\empty\else\currentXMLnamespace:\fi} - -\def\rawXMLelement{\rawXMLnamespace\rawXMLidentifier} - -%D The following token list register provided the user a hook -%D for extensions. - -\newtoks\everyXMLelement - -%D We try to keep track of the nature of an element. This -%D flag can be used for special purposes (as in the pretty -%D printing macros). - -\chardef\kindofXMLelement=0 - -\chardef\beginXMLtag=1 -\chardef\endXMLtag =2 -\chardef\emptyXMLtag=3 - -%D We do a rather hard coded scan for the namespace attribute. This -%D is needed because its value determines further namespace related -%D actions. - -\def\openXMLargument{ /} - -\long\def\parseXMLelement#1#2 #3>% - {\def\currentXMLarguments{#3}% including end / - \if#1/% - \chardef\kindofXMLelement\endXMLtag - \def\currentXMLelement{#2}% - \else - \docleanupXMLelement#1#2/\empty\relax - \fi - \ifx\currentXMLarguments\openXMLargument - \chardef\kindofXMLelement\emptyXMLtag - \fi - \@EA\splitoffXMLnamespace\currentXMLelement::\relax - \ifcase\kindofXMLelement - % can't happen - \or - % begintag or emptytag with arguments or space before / - \the\everyXMLelement % only for begin/empty tag ! - \ifx\currentXMLarguments\empty \else - \dogetXMLarguments\rawXMLelement#3>% - \fi - \or - % no arguments - \or - % empty element without arguments (but possible presets) - \the\everyXMLelement - \fi - \ifcase\kindofXMLelement\or - \let \currentXMLidentifier \rawXMLidentifier - \edef\currentXMLfullidentifier {\rawXMLelement }% - \or - \edef\currentXMLidentifier {/\rawXMLidentifier }% - \edef\currentXMLfullidentifier{/\rawXMLelement }% - \or - \edef\currentXMLidentifier {\rawXMLidentifier/}% - \edef\currentXMLfullidentifier {\rawXMLelement /}% - \fi - \iftraceXMLelements\traceXMLelement\fi - \executeXMLelement} - -\long\def\docleanupXMLelement#1/#2#3\relax - {\def\currentXMLelement{#1}% watch out: \empty == begin or empty tag - \chardef\kindofXMLelement\ifx#2\empty\beginXMLtag\else\emptyXMLtag\fi} - -\def\@@traceXMLelement - {\originalXMLfullidentifier - \ifx\originalXMLfullidentifier\currentXMLfullidentifier\else - \space=>\space\currentXMLfullidentifier - \fi - \ifx\currentXMLarguments\empty\else - \space\string|\space\currentXMLarguments - \fi} - -\long\def\traceXMLelement - {\edef\originalXMLfullidentifier{\someXMLelementID\currentXMLelement}% - \cleanupXMLarguments\writestatus{xml-element}{\@@traceXMLelement}} - -%D We split off the namespace part, construct the -%D identifier, and remap the namespace if needed. - -\def\splitoffXMLnamespace#1:#2:#3\relax - {\def\rawXMLidentifier{#2}% - \ifx\rawXMLidentifier\empty - \let\currentXMLnamespace\empty - \edef\rawXMLidentifier{#1}% - \else - \edef\currentXMLnamespace{#1}% - \fi - \let\originalXMLnamespace\currentXMLnamespace - \checkXMLnamespace\rawXMLidentifier} - -\def\xsplitoffXMLnamespace% fast resplit - {\ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname - \csname\@@XMLnamespace:\currentXMLnamespace\endcsname - \fi} - -%D We will implement this macro later. - -\let\checkXMLnamespace\gobbleoneargument % see below - -%D The namespace attribute checking is part of the element -%D parser, since the value of \type {xmlns} may influence other -%D namespace mapping. - -\def\@@XMLns{xmlns} - -\def\checkXMLnamespaceattr#1% xmlns:\@@XMLname="\XMLns" - {\edef\XMLns{#1}% - \ifx\XMLns\empty \else - \ifcsname\@@XMLurlspace:\XMLns\endcsname - % get remapped namespace (from url) - % \edef\XMLns{\csname\@@XMLurlspace:\XMLns\endcsname}% - \@EA\let\@EA\XMLns\csname\@@XMLurlspace:\XMLns\endcsname - % remap this one - \ifx\@@XMLname\empty - % not watertight since no implicit grouping - \xautoXMLnamespace\XMLns - \else - \xremapXMLnamespace\@@XMLname\XMLns - % redo namespace remapping of self if needed - \ifx\XMLns\currentXMLnamespace - % i'm still not sure if this is ok - \else - \xsplitoffXMLnamespace - \fi - \fi - \fi - \fi} - -%D Although not really needed, we clean up the arguments. - -% \long\def\cleanupXMLarguments -% {\ifnum\kindofXMLelement=\emptyXMLtag -% \ifx\currentXMLarguments\empty \else -% \@EA\docleanupXMLarguments\currentXMLarguments/\empty -% \fi -% \fi} -% -% \long\def\docleanupXMLarguments#1/#2\empty -% {\edef\currentXMLarguments{#1}} -% -% we need to be ...="/" .... /> safe - -\long\def\cleanupXMLarguments - {\ifnum\kindofXMLelement=\emptyXMLtag - \ifx\currentXMLarguments\empty \else - \@EA\docleanupXMLarguments\currentXMLarguments/ \relax - \fi - \else\ifnum\kindofXMLelement=\beginXMLtag - \ifx\currentXMLarguments\space - \let\currentXMLarguments\empty - \fi - \fi\fi} - -% \long\def\docleanupXMLarguments#1/ #2\relax % space added earlier -% {\edef\currentXMLarguments{#1}} -% -% \startbuffer -% -% \stopbuffer -% -% \showXMLbuffer -% -% No \type {\edef} in the following, else \showXMLbuffer fails: - -\long\def\docleanupXMLarguments#1/ #2\relax % space added earlier - {\def\currentXMLarguments{#1}} % no \edef, goes wrong in \showXML - -\def\executeXMLelementA % no fallback - {\ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname - \csname\@@XMLelement:\currentXMLfullidentifier\endcsname - \fi} - -\def\executeXMLelementB % default fallback - {\csname \@@XMLelement:% - \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname - \currentXMLfullidentifier - \else - \defaultXMLelementID % was \s!default - \fi - \endcsname} - -\def\executeXMLelementC % no namespace of default fallback - {\csname \@@XMLelement:% - \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname - \currentXMLfullidentifier - \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname - \currentXMLidentifier - \else - \defaultXMLelementID % was \s!default - \fi\fi - \endcsname} - -\def\executeXMLelementD - {\csname - \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname - \@@XMLelement:\currentXMLfullidentifier - \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname - \@@XMLelement:\currentXMLidentifier - \else - \executeXMLelementDD % less skipping and thereby faster - \fi\fi - \endcsname} - -\def\executeXMLelementDD % now forget about tex mapping - {\ifcsname\normal@@XMLelement:\currentXMLfullidentifier\endcsname - \normal@@XMLelement:\currentXMLfullidentifier - \else\ifcsname\normal@@XMLelement:\currentXMLidentifier\endcsname - \normal@@XMLelement:\currentXMLidentifier - \else - \normal@@XMLelement:\defaultXMLelementID % was \@@XMLelement:\s!default - \fi\fi} - -\def\setXMLfallbackmode#1% - {\ifcase#1\relax - \let\executeXMLelement \executeXMLelementA - \let\automateXMLnamespace\automateXMLnamespaceA - \or % 1 - \let\executeXMLelement \executeXMLelementB - \let\automateXMLnamespace\automateXMLnamespaceB - \or % 2 - \let\executeXMLelement \executeXMLelementC - \let\automateXMLnamespace\automateXMLnamespaceC - \or % 3 - \let\executeXMLelement \executeXMLelementD - \let\automateXMLnamespace\automateXMLnamespaceD - \fi} - -\setXMLfallbackmode3 % was 2 - -%D An example of fall back modes is given below. - -%D The automated namespace stuff is new and yet undocumented -%D (see resource libraries for usage). - -\def\xautoXMLnamespace#1% fast internal one - {\ifcsname\@@XMLnamespace-#1\endcsname\else - \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces - \fi - \@EA\edef\csname\@@XMLnamespace-#1\endcsname - {\noexpand\edef\noexpand\@axmlns@{#1}% quicker #1 -> \#1 - \noexpand\doautoXMLnamespace\noexpand\@axmlns@}} - -\def\doautoXMLnamespace#1% \done is set before list - {\ifdone\else\automateXMLnamespace#1\fi} - -\def\automateXMLnamespaceA#1% - {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname - \let\currentXMLnamespace#1% - \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname - \let\currentXMLnamespace#1% - \fi\fi} - -\let\automateXMLnamespaceB\automateXMLnamespaceA -\let\automateXMLnamespaceC\automateXMLnamespaceA - -\def\automateXMLnamespaceD#1% - {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname - \let\currentXMLnamespace#1% - \else\ifcsname\normal@@XMLelement:#1:\checkedXMLnamespace\endcsname - \let\currentXMLnamespace#1% - \else - \automateXMLnamespaceDD#1% - \fi\fi} - -\def\automateXMLnamespaceDD#1% - {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname - \let\currentXMLnamespace#1% - \else\ifcsname\normal@@XMLelement:#1:\checkedXMLnamespace/\endcsname - \let\currentXMLnamespace#1% - \fi\fi} - -%D Later we will implement the error handler, here we handle -%D the default case. - -\def\someXMLelementID#1% - {\ifnum\kindofXMLelement=\endXMLtag /\fi - #1% - \ifnum\kindofXMLelement=\emptyXMLtag/\fi} - -\def\defaultXMLelementID - {\someXMLelementID\s!default} - -%D It is possible to keep track of nesting automatically, -%D but this would kind of prohibit things like \type -%D {\ignorespaces}. In the future we may provide an -%D automatic depth tracking as an alternative (exclusive) -%D mode of operation combined with space grabbing. - -\def\beginXMLelement - {\global\advance\XMLdepth\plusone - \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement - }%\writestatus{XML TRACE}{[begin] [\the\XMLdepth] [\XMLself]}} - -\def\endXMLelement - {%\writestatus{XML TRACE}{[end] [\the\XMLdepth] [\XMLself]}% - \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\undefined - \global\advance\XMLdepth\minusone} - -% 0 = nothing -% 1 = unknown -% 2 = current element - -\chardef\XMLancestormode=2 % never change this one globally - -% \def\XMLancestor#1% -% {\ifnum\numexpr(\XMLdepth-#1)>0 -% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname -% \else -% \ifcase\XMLancestormode\or\s!unknown\or\currentXMLelement\fi -% \fi} - -\def\XMLancestor#1% - {\ifnum\numexpr\XMLdepth-#1\relax>\zerocount - \csname\@@XMLdepth:\the\numexpr\XMLdepth-#1\relax\endcsname - \else - \ifcase\XMLancestormode\or\s!unknown\or\currentXMLelement\fi - \fi} - -% \def\XMLpureancestor#1% -% {\ifnum\numexpr(\XMLdepth-#1)>0 -% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname -% \fi} - -\def\XMLpureancestor#1% - {\ifcase\numexpr\XMLdepth-#1\relax\or - \csname\@@XMLdepth:\the\numexpr\XMLdepth-#1\relax\endcsname - \fi} - -\def\XMLparent {\XMLancestor \plusone } -\def\XMLself {\XMLancestor \zerocount} -\def\XMLpureparent{\XMLpureancestor\plusone } -\def\XMLpureself {\XMLpureancestor\zerocount} - -% \def\XMLpureancestor#1% -% {\csname -% \ifnum\numexpr(\XMLdepth-#1)>\zerocount -% \@@XMLdepth:\the\numexpr(\XMLdepth-#1)% -% \else -% \s!empty -% \fi -% \endcsname} - -\def\XMLpureparent - {\XMLpureancestor\plusone} - -% probleem: depth is vast en dus ook ancestor - -% \XMLinh{...} will backtrack definitions (given that the elements -% use begin/end, the backtracking stops when a non-empty value is -% encountered; maybe we will add some keyword (inherit) some day - -\def\XMLinhpar#1#2% - {\@EA\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty - \@EA\pXMLinh - \else - \csname\@@XMLvariable:#1:#2\endcsname - \@EA\gobbletwoarguments - \fi\XMLdepth{#2}} - -\def\XMLinh - {\XMLinhpar\currentXMLelement} - -% \def\pXMLinh#1% -% {\@EA\ppXMLinh\@EA{\the\numexpr(#1-\plusone)}} - -\def\pXMLinh#1% - {\@EA\ppXMLinh\@EA{\the\numexpr#1-\plusone\relax}} - -\def\ppXMLinh#1#2% - {\@EA\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty - \ifnum#1>\plusone - \@EAEAEA\pXMLinh - \else - \@EAEAEA\gobbletwoarguments - \fi - \else - \csname\@@XMLvariable:#1:#2\endcsname - \@EA\gobbletwoarguments - \fi{#1}{#2}} - -% better -% -% \def\XMLpureancestor#1% -% {\ifcsname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname -% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname -% \fi} - -% replaces macro in xtag-ini: ! ! ! - -\def\edefXMLop#1#2% \macro{att} - {\edef#1% - {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#2\endcsname - \@@XMLvariable:\ownXMLelement:#2\else\s!empty - \fi\endcsname}} - -\def\edefXMLinh#1#2% \macro{att} - {\edef#1{\XMLinh{#2}}} - -\def\edefXMLinhpar#1#2#3% \macro{tag}{att} - {\edef#1{\XMLinhpar{#2}{#3}}} - -% \def\doifXMLopdef#1#2% \macro{att} -% {\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname -% \@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#1\endcsname -% \expandafter\firstofoneargument -% \else -% \expandafter\gobbleoneargument -% \fi} - -\fetchruntimecommand \tracebackXMLattribute {\f!xtagprefix\s!run} -\fetchruntimecommand \showXMLinh {\f!xtagprefix\s!run} - -% \defineXMLenvironment[one] -% {\beginXMLelement} -% {\endXMLelement} -% -% \defineXMLenvironment[two] -% {\beginXMLelement -% \starttabulatie -% \NC ancestor 1 \NC \XMLancestor{1} \NC \NR -% \NC ancestor 2 \NC \XMLancestor{2} \NC \NR -% \NC ancestor 3 \NC \XMLancestor{3} \NC \NR -% \NC ancestor 4 \NC \XMLancestor{4} \NC \NR -% \stoptabulatie} -% {\endXMLelement} -% -% \startbuffer -% -% \stopbuffer -% -% {fallback A: \setXMLfallbackmode 0 \processXMLbuffer}\par -% {fallback B: \setXMLfallbackmode 1 \processXMLbuffer}\par -% {fallback C: \setXMLfallbackmode 2 \processXMLbuffer}\par - -% todo: split #1 into raws en reconstruct, set current etc, push and pop -% -% \def\beginXMLelement -% {\dosingleempty\dobeginXMLelement} -% -% \def\dobeginXMLelement[#1]% -% {\global\advance\XMLdepth 1 -% \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement -% \global\@EA\edef\csname\@@XMLdopth:\the\XMLdepth\endcsname{\ownXMLelement}% -% \iffirstargument\edef\ownXMLelement{#1}\fi} -% -% \def\endXMLelement -% {\@EA\let\@EA\ownXMLelement\csname\@@XMLdopth:\the\XMLdepth\endcsname -% \global\advance\XMLdepth -1 } - -%D \defineXMLenvironment[one] -%D {\beginXMLelement} -%D {\endXMLelement} -%D -%D \defineXMLenvironment[two] -%D {\beginXMLelement -%D \starttabulate -%D \NC parent 1 \NC \XMLancestor{1} \NC \NR -%D \NC parent 2 \NC \XMLancestor{2} \NC \NR -%D \NC parent 3 \NC \XMLancestor{3} \NC \NR -%D \NC parent 4 \NC \XMLancestor{4} \NC \NR -%D \stoptabulate} -%D {\endXMLelement} -%D -%D \startbuffer -%D -%D \stopbuffer -%D -%D fallback A: \setXMLfallbackmode0 \processXMLbuffer -%D fallback B: \setXMLfallbackmode1 \processXMLbuffer -%D fallback C: \setXMLfallbackmode2 \processXMLbuffer - -%D Here we do the namespace (re)mapping. More examples are -%D provided in the manual. -%D -%D \starttyping -%D \supportXMLnamespace [test] % needed to get a namespace working -%D \skipXMLnamespace [test] % slow -%D \ignoreXMLnamespace [test] % faster -%D \defineXMLenvironment [rubish:itemize] {[} {]} -%D \defineXMLenvironment [rubish:item] {(} {)} -%D \remapXMLnamespace [crap] [rubish] -%D \remapXMLnamespace [con] [context] -%D \remapXMLurlspace [http://www.pragma-ade.com/dtd/context] [context] -%D \autoXMLnamespace [context] % fallback -%D \autoXMLnamespace [whatever] % second fall back -%D \stoptyping - -\newtoks\autoXMLnamespaces - -%D The automatically mapped namespaces (the fallbacks so to -%D day) are collected in a token list. - -\let\checkedXMLnamespace\empty - -\def\checkXMLnamespace#1% - {\edef\checkedXMLnamespace{#1}% - \ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname - \csname\@@XMLnamespace:\currentXMLnamespace\endcsname - % forced namespace - \else\ifcsname\@@XMLelement:\currentXMLelement\endcsname - % natural element - \else\ifcsname\@@XMLelement:\currentXMLelement/\endcsname - % natural element - \else - % locate fallback - \donefalse\the\autoXMLnamespaces - \fi\fi\fi} - -\def\skipXMLnamespace[#1]% - {\letvalue{\@@XMLnamespace:#1}\doXMLskipnamespace} - -\def\doXMLskipnamespace - {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname - {\getXMLgroupedignore\checkedXMLnamespace}} - -\def\hideXMLnamespace[#1]% - {\letvalue{\@@XMLnamespace:#1}\doXMLhidenamespace} - -\def\doXMLhidenamespace - {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname - {\redoXMLignore\checkedXMLnamespace}} - -\def\ignoreXMLnamespace[#1]% - {\letvalue{\@@XMLnamespace:#1}\doXMLignorenamespace} - -\def\doXMLignorenamespace % \let binnen def - {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname - {\@EA\redoXMLignore\@EA{\checkedXMLnamespace}}} % EA ? - -\def\remapXMLnamespace - {\dodoubleargument\doremapXMLnamespace} - -\def\doremapXMLnamespace[#1][#2]% - {\ifsecondargument - \setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#2}}% - \else - \letvalue{\@@XMLnamespace:#1}\relax - \fi} - -\def\supportXMLnamespace% - {\dosingleargument\dosupportXMLnamespace} - -\def\dosupportXMLnamespace[#1]% - {\setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#1}}} - -\def\xremapXMLnamespace#1#2% fast internal one - {\@EA\edef\csname\@@XMLnamespace:#1\endcsname - {\def\noexpand\currentXMLnamespace{#2}}} - -\def\autoXMLnamespace[#1]% - {\xautoXMLnamespace{#1}} - -\def\xautoXMLnamespace#1% fast internal one - {\ifcsname\@@XMLnamespace-#1\endcsname\else - \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces - \fi - \@EA\edef\csname\@@XMLnamespace-#1\endcsname - {\noexpand\doautoXMLnamespace{#1}}} - -\def\doautoXMLnamespace#1% \done is set before list - {\ifdone\else - \ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname - \def\currentXMLnamespace{#1}% - \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname - \def\currentXMLnamespace{#1}% - \fi\fi - \fi} - -\def\resetXMLnamespace[#1]% - {\letvalue{\@@XMLnamespace-#1}\gobbleoneargument - \letvalue{\@@XMLnamespace:#1}\gobbleoneargument} - -\def\remapXMLurlspace - {\dodoubleargument\doremapXMLurlspace} - -\def\doremapXMLurlspace[#1][#2]% - {\setvalue{\@@XMLurlspace:#1}{#2}} - -%D Entities needs a bit more work, as well as a connection -%D with the encoding handlers. - -% we need to be able to do: -% -% \defineXMLentity[amp] {\FunnyAmp} \def\FunnyAmp#1;{\getXMLentity{#1}} -% -% \defineXMLentity [pound] {(why not use euro's?)} -% -% \startXMLdata -% test &pound; test -% \stopXMLdata -% -% so we need an ifless implementation -% -% also .. this should work: -% -% \defineXMLentity[ctx-var-textwidth] {\textwidth} -% -% \defineXMLcommand[test][width=\textwidth] -% {\the\dimexpr\XMLop{width}\relax} -% -% \startXMLdata -% -% -% \stopXMLdata - -% \eacute -> simplified -> e (via raw encoding) -% -> raw -> eacute (via handler) -% -% naming sucks - -\newif\ifXMLrawentities % proper fallback -\newif\ifXMLsimpleentities % last resort - -\def\simpleXMLencoding{raw} - -\ifnum\texengine=\luatexengine - \def\simplifyXMLentities - {\XMLsimpleentitiestrue} -\else - \def\simplifyXMLentities - {\fastenableencoding\simpleXMLencoding - \XMLsimpleentitiestrue} -\fi - -\def\defineXMLentity - {\dodoubleempty\dodefineXMLentity} - -\def\dodefineXMLentity[#1][#2]#3% - {\ifsecondargument - \defineXMLentities[#1]{#2}{#3}% - \else - \dododefineXMLentity{#1}{#3}% - \fi} - -\def\defineXMLentities[#1]#2#3% - {\dododefineXMLentity{#1}{\ifXMLsimpleentities#2\else#3\fi}} - -\def\dododefineXMLentity#1#2% - {\unspaceargument#1\to\ascii % #1 can be {[} or so - \long\setvalue{\@@XMLentity:\@EA\firstofoneargument\ascii}{#2}} - -\def\setXMLentity#1% fast one - {\long\@EA\def\csname\@@XMLentity:#1\endcsname} - -%D May this wile become dodo (more in tune with rest); -%D beware: also remapped in xtag-map. - -\def\doXMLentity#1#2;% interesting: # is now ## - {\if\string#1\letterhash - \@EA\parseXMLcharacter - \else\ifXMLrawentities - \@EAEAEA\firstofoneargument - \else - \@EAEAEA\executeXMLentity - \fi\fi{#1#2}} - -%D Here we need to get rid of the double hash and act upon the -%D number. Proper hex/oct number support can be implemented by -%D redefining \type {\executeXMLcharacter}. - -% \def\parseXMLcharacter#1% gobble the ##x -% {\@EA\executeXMLcharacter\@EA{\gobblethreearguments#1}} -% -% single hash now -% -% \def\parseXMLcharacter#1% -% {\@EA\executeXMLcharacter\@EA{\gobbleoneargument#1}} -% -% \def\executeXMLcharacter#1% can be overloaded -% {\ifnum"#1<256 -% \@EA\getXMLcharacter -% \else\ifXMLrawentities -% \@EAEAEA\firstofoneargument -% \else -% \@EAEAEA\unknownXMLcharacter -% \fi\fi{\number"#1}} -% -% \unexpanded\def\getXMLcharacter#1{\rawcharacter{#1}} - -\def\parseXMLcharacter#1% - {\@EA\executeXMLcharacter\gobbleoneargument#1\empty\relax} - -\def\executeXMLcharacter#1#2\relax - {\if#1x% - \@EA\noexecuteXMLhexcharacter - \else - \@EA\doexecuteXMLdeccharacter - \fi#1#2\relax} - -\def\noexecuteXMLhexcharacter x#1\relax - {\uppercase{\doexecuteXMLhexcharacter#1\relax}} - -% \unexpanded\def\getXMLcharacter#1% -% {\ifXMLrawentities -% \@EA\firstofoneargument -% \else\ifcsname\@@XMLentity:#1\endcsname -% \@EAEAEA\getXMLentity -% \else -% \@EAEAEA\unicodechar % was: \rawcharacter -% \fi\fi{#1}} -% -% \def\doexecuteXMLhexcharacter#1\relax{\getXMLcharacter{"#1}} -% \def\doexecuteXMLdeccharacter#1\relax{\getXMLcharacter {#1}} -% -% if we want to support x in entity overloading, we prefer: - -\unexpanded\def\getXMLdeccharacter#1% - {\ifXMLrawentities - \@EA\rawXMLdecentity - \else\ifcsname\@@XMLentity:#1\endcsname - \@EAEAEA\getXMLdecentity - \else - \@EAEAEA\unicodechar - \fi\fi{#1}} - -\unexpanded\def\getXMLhexcharacter#1% - {\ifXMLrawentities - \@EA\rawXMLhexentity - \else\ifcsname\@@XMLentity:x#1\endcsname - \@EAEAEA\getXMLhexentity - \else - \@EAEAEA\unicodehexchar - \fi\fi{#1}} - -\def\unicodehexchar#1{\unicodechar{"#1}} - -\let\getXMLcharacter\getXMLdeccharacter - -\def\getXMLdecentity#1{\getXMLentity {#1}} -\def\getXMLhexentity#1{\getXMLentity{x#1}} - -\def\rawXMLdecentity#1{#1} -\def\rawXMLhexentity#1{x#1} - -\def\doexecuteXMLhexcharacter#1\relax{\getXMLhexcharacter{#1}} -\def\doexecuteXMLdeccharacter#1\relax{\getXMLdeccharacter{#1}} - -% \defineXMLentity[8218] {Adam} -% \defineXMLentity[x007D]{Eve} -% -% \startbuffer -% @ ‘ ‚ “ ” „• -% & -% $ { }   … -% \stopbuffer -% -% \typebuffer \processXMLbuffer - -% left overs - -\def\unknownXMLcharacter#1{[#1]} - -\ifx\unicodechar\undefined\let\unicodechar\rawcharacter\fi % brrrr - -% \useXMLfilter[ent] -% -% \defineXMLsingular[test]{{\simplifyXMLentities\XMLpar{test}{bla}{}}} -% -% \startXMLdata -% -% \stopXMLdata -% -% \defineXMLentity[45]{|it works|} % {|-|} -% -% \startXMLdata -% text-.text -% textEFtext -% \stopXMLdata - -%D May be this will change a bit ... - -\def\executeXMLentity#1% named one - {\getXMLentity{#1}} - -%\def\expandedXMLentity#1% -% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi} -% -%\unexpanded\def\getXMLentity#1% -% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi} -% -%\def\expandedXMLentity#1% -% {\csname\@@XMLentity:#1\endcsname} -% -%\unexpanded\def\getXMLentity#1% -% {\csname\@@XMLentity:#1\endcsname} - -\doifundefined{autoXMLentitiestrue}{\expandafter\newif\csname ifautoXMLentities\endcsname} % fall back on context commands - -\def\expandedXMLentity#1% - {\ifcsname\@@XMLentity:#1\endcsname \@EA \execXMLentity - \else\ifautoXMLentities \@EAEAEA \autoXMLentity - \else \@EAEAEA \crapXMLentity - \fi\fi{#1}} - -\def\execXMLentity#1{\csname\@@XMLentity:#1\endcsname} -\def\crapXMLentity#1{\inframed[\c!offset=.1ex]{\tttf#1}} -\def\autoXMLentity#1{\ifcsname#1\endcsname\csname#1\endcsname\fi} - -\unexpanded\def\getXMLentity{\expandedXMLentity} - -%\def\doifXMLentityelse#1#2#3% -% {\ifcsname\@@XMLentity:#1\endcsname#2\else#3\fi} - -\def\doifXMLentityelse#1% - {\ifcsname\@@XMLentity:#1\endcsname - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -% \letvalue{1@2}\firstoftwoarguments -% \letvalue{2@2}\secondoftwoarguments -% -% \def\doifXMLentityelse#1% -% {\csname\ifcsname\@@XMLentity:#1\endcsname1\else2\fi @2\endcsname} - -% see \defineXML... commands: -% -% [key=val] => \presetXMLarguments{element} => default key/vals -% [blabla] => \theXMLarguments{blabla} => user key/vals -% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals -% \theXMLarguments{blabla} => user key/vals -% -% stored in case of [blabla] else set as \XMLpar -% -% see m-steps for an example of usage - -\let\@@XMLmapmap\empty -\newif\ifXMLnamespace - -\long\def\getXMLarguments#1#2% - {\XMLnamespacefalse - \dogetXMLarguments{#1}#2>} - -\let\dosetXMLattributeA\gobbleoneargument - -\def\dosetXMLattributeB#1% - {\ifx\@@XMLspac\originalXMLnamespace - \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname{#1}% - % maybe some day global handling here as well - \fi} - -\def\dosetXMLattributeC - {\@EA\def\csname\@@XMLvariable:\@@XMLclass\ifx\@@XMLspac - \originalXMLnamespace\else:\@@XMLspac\fi:\@@XMLname\endcsname} - -\def\dosetXMLattributeD - {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\ifx\@@XMLspac - \originalXMLnamespace\currentXMLnamespace\else\@@XMLspac\fi:\@@XMLname\endcsname} - -\def\setXMLattributemode#1% - {\ifcase#1\relax - \let\dosetXMLattribute\dosetXMLattributeA - \or - \let\dosetXMLattribute\dosetXMLattributeB - \or - \let\dosetXMLattribute\dosetXMLattributeC - \or - \let\dosetXMLattribute\dosetXMLattributeD - \fi} - -\setXMLattributemode{2} % a reasonable default - -\let\@@XMLspac\empty % argumentnamespace - -\long\def\dogetXMLarguments#1% - {\XMLtoks\emptytoks - \ifcsname\@@XMLmap:#1\endcsname - \let\dodosetXMLargument\dodosetXMLargumentB - \else - \def\@@XMLclass{#1}% - \let\dodosetXMLargument\dodosetXMLargumentA - \fi - \let\dodoparseXMLarguments\doparseXMLarguments - \doparseXMLarguments} - -% \long\def\doparseXMLarguments#1% space goes ok -% {\if#1>% -% \let\dodoparseXMLarguments\empty -% \else\if#1=% -% \edef\@@XMLname{\the\XMLtoks}% -% \XMLtoks\emptytoks -% \else\if#1"% -% \let\dodoparseXMLarguments\dodoparseXMLargumentsD -% \else\if#1'% -% \let\dodoparseXMLarguments\dodoparseXMLargumentsS -% \else\if#1:% -% \XMLnamespacetrue -% \edef\@@XMLspac{\the\XMLtoks}% -% \XMLtoks\emptytoks -% \else\if#1/% -% \chardef\kindofXMLelement\emptyXMLtag -% \else -% \XMLtoks\@EA{\the\XMLtoks#1}% -% \fi\fi\fi\fi\fi\fi -% \dodoparseXMLarguments} -% -% The next speed optimization is suggested by Taco. Since we -% are dealing with validated code, we can grab larger chunks. -% -% \long\def\doparseXMLarguments#1% space goes ok -% {\if#1>% -% \let\dodoparseXMLarguments\empty -% \else\if#1/% -% \chardef\kindofXMLelement\emptyXMLtag -% \else -% \XMLtoks{#1}% -% \let\dodoparseXMLarguments\dodoparseXMLargumentsX -% \fi\fi -% \dodoparseXMLarguments} -% -% we can get rid of one more assignment - -\long\def\doparseXMLarguments#1% space goes ok - {\if#1>% - %\let\dodoparseXMLarguments\empty - \expandafter\gobbleoneargument % speedup - \else\if#1/% - \chardef\kindofXMLelement\emptyXMLtag - \else - \XMLtoks{#1}% - \let\dodoparseXMLarguments\dodoparseXMLargumentsX - \fi\fi - \dodoparseXMLarguments} - -% slightly faster: -% -% \long\def\doparseXMLarguments#1% space goes ok -% {\if#1>% -% \@EA\gobbleoneargument -% \else\if#1/% -% \chardef\kindofXMLelement\emptyXMLtag -% \@EAEAEA\gobbletwoarguments -% \else -% \@EAEAEA\dodoparseXMLargumentsX -% \fi\fi#1} -% -% \def\dodoparseXMLargumentsX#1=#2% -% {\def\@@XMLname{#1}% -% \getXMLNSSSS#1:\relax -% \if#2"% -% \expandafter\dodoparseXMLargumentsD -% \else -% \expandafter\dodoparseXMLargumentsS -% \fi} - -\def\dodoparseXMLargumentsX#1=#2% - {\edef\@@XMLname{\the\XMLtoks#1}% - \@EA\getXMLNSSSS\@@XMLname:\relax - \XMLtoks\emptytoks - \if#2"% - \let\dodoparseXMLarguments\dodoparseXMLargumentsD - \else - \let\dodoparseXMLarguments\dodoparseXMLargumentsS - \fi - \dodoparseXMLarguments} - -\def\gobbleuntilcolon#1:{#1} - -\def\getXMLNSSSS#1:#2\relax - {\def\!!stringa{#2}% - \ifx\!!stringa\empty \else - \XMLnamespacetrue - \edef\@@XMLname{\gobbleuntilcolon#2}% - \edef\@@XMLspac{#1}% - \fi} - -% ok ? -% -% \def\dodoparseXMLargumentsX#1=#2% -% {\edef\@@XMLname{\the\XMLtoks#1}% -% \@EA\getXMLNSSSS\@@XMLname:\relax -% \XMLtoks\emptytoks -% \if#2"% -% \@EA\dodoparseXMLargumentsD -% \else -% \@EA\dodoparseXMLargumentsS -% \fi} - -% Storing \type {#1} in a macro in order to minimize the -% amount of data passed as argument does not improve -% performance, so we keep the readable form. - -\def\dodoparseXMLargumentsD#1"{\dosetXMLargument{#1}} -\def\dodoparseXMLargumentsS#1'{\dosetXMLargument{#1}} - -% the readable version -% -% \def\dosetXMLargument#1% -% {\ifXMLnamespace -% \ifx\@@XMLspac\@@XMLns -% \checkXMLnamespaceattr{#1}% xmlns:\@@XMLname="#1" -% \else -% \dosetXMLattribute{#1}% some:\@@XMLname="#1" -% \fi -% \XMLnamespacefalse -% \else\ifx\@@XMLname\@@XMLns -% \checkXMLnamespaceattr{#1}% xmlns="#1" -% \else -% \dodosetXMLargument{#1}% -% \fi\fi -% \let\dodoparseXMLarguments\doparseXMLarguments -% \dodoparseXMLarguments} -% -% the ugly alternative - -% \def\dosetXMLargument#1% ugly alternative -% {\ifXMLnamespace -% \XMLnamespacefalse -% \ifx\@@XMLspac\@@XMLns -% \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1" -% \else -% \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1" -% \fi -% \else\ifx\@@XMLname\@@XMLns -% \@EAEAEA\checkXMLnamespaceattr % xmlns="#1" -% \else -% \@EAEAEA\dodosetXMLargument -% \fi\fi{#1}% -% \let\dodoparseXMLarguments\doparseXMLarguments -% \dodoparseXMLarguments} - -\def\dosetXMLargument#1% ugly alternative - {\ifXMLnamespace - \XMLnamespacefalse - \ifx\@@XMLspac\@@XMLns - \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1" - \else - \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1" - \fi - \else\ifx\@@XMLname\@@XMLns - \@EAEAEA\checkXMLnamespaceattr % xmlns="#1" - \else - \@EAEAEA\dodosetXMLargument - \fi\fi{#1}% - \dodocopyXMLargument - \let\dodoparseXMLarguments\doparseXMLarguments - \dodoparseXMLarguments} - -\let\dodocopyXMLargument\relax - -% \def\dododocopyXMLargument -% {\@EA\let\csname\@@XMLvariable:\the\numexpr(\XMLdepth+1):\@@XMLname\@EA\endcsname -% \csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname} - -\def\dododocopyXMLargument - {\@EA\let\csname\@@XMLvariable:\the\numexpr\XMLdepth+\plusone\relax:\@@XMLname\@EA\endcsname - \csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname} - -\def\copyXMLargumentindeed - {\let\dodocopyXMLargument\dododocopyXMLargument - \let\copyXMLargumentindeed\relax} - -\def\dodosetXMLargumentA - {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname} - -% \def\dodosetXMLargumentB#1% -% {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname -% {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else -% \csname\@@XMLmap:\@@XMLmapmap\endcsname,% -% \fi -% \@@XMLname=#1}} - -\def\dodosetXMLargumentB#1% - {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname - {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else - \csname\@@XMLmap:\@@XMLmapmap\endcsname,% - \fi - \@@XMLname={#1}}} % {} is needed for aa='bb,cc' - -\appendtoks - \resetXMLarguments{\rawXMLnamespace\rawXMLidentifier}% -\to \everyXMLelement - -\def\resetXMLarguments#1% - {\ifcsname\@@XMLmap:#1\endcsname - \@EA\let\@EA\@@XMLmapmap\csname\@@XMLmap:#1\endcsname - \@EA\let\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty - \fi} - -\def\theXMLarguments#1% - {\ifcsname\@@XMLmap:#1\endcsname\csname\@@XMLmap:#1\endcsname\fi} - -\def\doexpandXMLvalue#1#2% - {\ifcsname#2\endcsname - \bgroup - \enableXMLexpansion - \let\getXMLentity\expandedXMLentity - #1% simplify maps entities back to _ and alike - \expanded{\global\globalscratchtoks{\csname#2\endcsname}}% - \egroup - \@EA\edef\csname#2\endcsname{\the\globalscratchtoks}% - \fi} - -\def\expandXMLvalue {\doexpandXMLvalue\relax} -\def\simplifyXMLvalue{\doexpandXMLvalue\XMLsimpleentitiestrue} - -\def\expandTEXpar #1#2{\expandXMLvalue{#1\interfaced{#2}}} -\def\expandXMLpar #1#2{\expandXMLvalue{\@@XMLvariable:#1:#2}} -\def\expandXMLarguments #1{\expandXMLvalue{\@@XMLmap:#1}} - -\def\simplifyTEXpar #1#2{\simplifyXMLvalue{#1\interfaced{#2}}} -\def\simplifyXMLpar #1#2{\simplifyXMLvalue{\@@XMLvariable:#1:#2}} -\def\simplifyXMLarguments#1{\simplifyXMLvalue{\@@XMLmap:#1}} - -%D \startbuffer[tex] -%D \defineXMLsingular [fx:root] -%D {\XMLNSpar{fx:root}{xml}{lang}{} -%D \XMLpar{fx:root}{xml:lang}{} -%D \starttabulate[||||] -%D \HL -%D \NC \bf mode \NC \bf call \NC \bf result \NC\NR -%D \HL -%D \NC 0\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR -%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR -%D \HL -%D \NC 1\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR -%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR -%D \HL -%D \NC 2\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR -%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR -%D \HL -%D \NC 3\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR -%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC rubish\NC\NR -%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR -%D \HL -%D \stoptabulate} -%D -%D \remapXMLurlspace [http://www.w3.org/1999/XSL/Format] [fx] -%D \stopbuffer -%D -%D \startbuffer[xml] -%D -%D \stopbuffer -%D -%D \typebuffer[tex] \processTEXbuffer[tex] -%D \typebuffer[xml] \processXMLbuffer[xml] - -%D The previous macros were the basic parser and their working -%D is left to the imagination of the reader. These macros -%D will be improved over time. We use rather low level -%D definitions so that the mappings will run as fast as -%D possible. - -\bgroup \catcode`<=\@@active - -\long\gdef\dododefineXMLsingular#1#2% - {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}} - -\long\gdef\dododefineXMLcommand#1#2% - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}} - -\long\gdef\dododefineXMLgrouped#1#2% - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\groupedcommand{#2}\donothing\bgroup}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\egroup - \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} - -\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1 - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLargument{#1}{#2}} - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}} - -\long\gdef\redoXMLargument#1#2% potential optimization: globalnext - {\long\@EA\gdef\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}% - \next} - -\long\gdef\dododefineXMLignore#1% - {\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLignore{#1}} - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} - -\long\gdef\redoXMLignore#1% - {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{}% - \next} - -\long\gdef\dododefineXMLpickup#1#2#3% - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLpickup{#1}{#2}{#3}} - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}} - -\long\gdef\redoXMLpickup#1#2#3% - {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2##1#3}% - \next} - -\long\gdef\dododefineXMLenvironment#1#2#3% - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}% - \long\@EA\def\csname\@@XMLelement:/#1\endcsname{#3}% - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}} - -\long\gdef\dododefineXMLsave#1% - {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty - \long\@EA\def\csname\@@XMLelement:#1\endcsname {\redoXMLsave{#1}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} - -\long\gdef\dododefineXMLsavecontent#1#2% - {\long\@EA\def\csname\@@XMLdata:#1\endcsname{#2}% - \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLsave{#1}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} - -\long\gdef\redoXMLsave#1% - {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% - {\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}% - \next} - -\long\gdef\dododefineXMLgsave#1% - {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty - \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} - -\long\gdef\dododefineXMLgsavecontent#1#2% - {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{#2}% - \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} - -\long\gdef\redoXMLgsave#1% - {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% - {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}}% - \next} - -\long\gdef\dododefineXMLenvironmentsave#1#2#3% - {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty - \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentsave{#1}{#2}{#3}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}} - -% maybe \globalnext - -\long\gdef\redoXMLenvironmentsave#1#2#3% - {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% - {#2\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}#3}% - \next} - -\long\gdef\dododefineXMLenvironmentgsave#1#2#3% - {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty - \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentgsave{#1}{#2}{#3}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}} - -\long\gdef\redoXMLenvironmentgsave#1#2#3% - {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>% - {#2\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}#3}% - \next} - -\long\gdef\dododefineXMLprocess#1% - {\@EA\let\csname\@@XMLelement:#1\endcsname\donothing - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} - -\long\gdef\dododefineXMLnestedenvironment#1#2#3% - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedenvironment{#1}{#2}{#3}}% - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}} - -\long\gdef\dododefineXMLnestedargument#1#2% - {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedargument{#1}{#2}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}} - -\long\gdef\dododefineXMLnestedsave#1% - {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty - \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedsave{#1}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}} - -\long\unexpanded\gdef\getXMLgroupednestedsave#1% - {\collectXMLgroupedtrue - \long\def\dodogetgrouped{\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}}% - \getXMLgrouped{#1}} - -\long\gdef\dododefineXMLnestedenvironmentsave#1#2#3% - {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty - \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedenvironmentsave{#1}{#2}{#3}}% - \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing - \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}} - -\long\unexpanded\gdef\getXMLgroupednestedenvironmentsave#1#2#3% - {\collectXMLgroupedtrue - \long\def\dodogetgrouped{#2\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}#3}% - \getXMLgrouped{#1}} - -\egroup - -%D The high level definition macros. - -\def\defineXMLsingular {\dotripleempty\dodefineXMLsingular} -\def\defineXMLcommand {\dotripleempty\dodefineXMLcommand} -\def\defineXMLgrouped {\dotripleempty\dodefineXMLgrouped} -\def\defineXMLargument {\dotripleempty\dodefineXMLargument} -\def\defineXMLignore {\dotripleempty\dodefineXMLignore} -\def\defineXMLpickup {\dotripleempty\dodefineXMLpickup} -\def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment} -\def\defineXMLsave {\dotripleempty\dodefineXMLsave} -\def\defineXMLsavecontent {\dotripleempty\dodefineXMLsavecontent} -\def\defineXMLgsave {\dotripleempty\dodefineXMLgsave} -\def\defineXMLgsavecontent {\dotripleempty\dodefineXMLgsavecontent} -\def\defineXMLenvironmentsave {\dotripleempty\dodefineXMLenvironmentsave} -\def\defineXMLenvironmentgsave {\dotripleempty\dodefineXMLenvironmentgsave} -\def\defineXMLprocess {\dotripleempty\dodefineXMLprocess} -\def\defineXMLnested {\dotripleempty\dodefineXMLnestedenvironment} -\def\defineXMLnestedenvironment {\dotripleempty\dodefineXMLnestedenvironment} -\def\defineXMLnestedargument {\dotripleempty\dodefineXMLnestedargument} -\def\defineXMLnestedsave {\dotripleempty\dodefineXMLnestedsave} -\def\defineXMLnestedenvironmentsave{\dotripleempty\dodefineXMLnestedenvironmentsave} - -%D We can nill definitions with: - -\def\resetXMLelement[#1]{\dododefineXMLprocess{#1}} - -%D This is equivalent to: -%D -%D \starttyping -%D \def\resetXMLelement[#1]% handy in case only singular -%D {\@EA\let\csname\@@XMLelement:#1\endcsname \donothing -%D \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing -%D \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing} -%D \stoptyping - -% push is (not yet) a real push, so: - -\def\defineXMLpush {\dotripleempty\dodefineXMLsave} -\def\defineXMLenvironmentpush{\dotripleempty\dodefineXMLenvironmentsave} - -% goes for all types - -\long\def\dodefineXMLsingular[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLsingular{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLcommand[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLcommand{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLgrouped[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLgrouped{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLargument[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLargument{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLignore[#1][#2][#3]% - {\defineXMLmethod\dododefineXMLignore{#1}{#2}{#3}{}{}} - -\long\def\dodefineXMLpickup[#1][#2][#3]#4#5% - {\defineXMLmethod\dododefineXMLpickup{#1}{#2}{#3}{#4}{#5}} - -\long\def\dodefineXMLenvironment[#1][#2][#3]#4#5% - {\defineXMLmethod\dododefineXMLenvironment{#1}{#2}{#3}{#4}{#5}} - -\long\def\dodefineXMLsave[#1][#2][#3]% - {\defineXMLmethod\dododefineXMLsave{#1}{#2}{#3}{}{}} - -\long\def\dodefineXMLsavecontent[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLsavecontent{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLgsave[#1][#2][#3]% - {\defineXMLmethod\dododefineXMLgsave{#1}{#2}{#3}{}{}} - -\long\def\dodefineXMLgsavecontent[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLgsavecontent{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLenvironmentsave[#1][#2][#3]#4#5% - {\defineXMLmethod\dododefineXMLenvironmentsave{#1}{#2}{#3}{#4}{#5}} - -\long\def\dodefineXMLenvironmentgsave[#1][#2][#3]#4#5% - {\defineXMLmethod\dododefineXMLenvironmentgsave{#1}{#2}{#3}{#4}{#5}} - -\long\def\dodefineXMLprocess[#1][#2][#3]% - {\defineXMLmethod\dododefineXMLprocess{#1}{#2}{#3}{}{}} - -\long\def\dodefineXMLnestedenvironment[#1][#2][#3]#4#5% - {\defineXMLmethod\dododefineXMLnestedenvironment{#1}{#2}{#3}{#4}{#5}} - -\long\def\dodefineXMLnestedargument[#1][#2][#3]#4% - {\defineXMLmethod\dododefineXMLnestedargument{#1}{#2}{#3}{#4}{}} - -\long\def\dodefineXMLnestedsave[#1][#2][#3]% - {\defineXMLmethod\dododefineXMLnestedsave{#1}{#2}{#3}{}{}} - -\long\def\dodefineXMLnestedenvironmentsave[#1][#2][#3]#4#5% - {\defineXMLmethod\dododefineXMLnestedenvironmentsave{#1}{#2}{#3}{#4}{#5}} - -% [key=val] => \presetXMLarguments{element} => default key/vals -% [blabla] => \theXMLarguments{blabla} => user key/vals -% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals -% \theXMLarguments{blabla} => user key/vals - -% command element [map] [parlst] begin end - -\long\def\defineXMLmethod#1#2#3#4#5#6% - {\ifsecondargument - \setXMLarguments{#2}{#3}{#4}% - \else - \resetXMLarguments{#2}% new - \fi - #1{#2}{#5}{#6}} - -%D Arguments (attributes) \unknown - -% \long\def\setXMLarguments#1#2#3% element [tag] settings -% {\doifassignmentelse{#2} -% {\long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}} -% {\long\setvalue{\@@XMLmap :#1}{#2}% later we can init vars by this name -% \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}} - -\long\def\setXMLarguments#1#2#3% element [tag] settings - {\doifassignmentelse{#2} % ROOM FOR OPTIMIZATION - {\letbeundefined{\@@XMLmap:#1}% - \long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}} - {\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name - \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}} - -\def\presetXMLarguments#1% - {\csname\@@XMLpars:\rawXMLnamespace#1\endcsname} % == \getvalue{} - -\prependtoks - \presetXMLarguments\rawXMLidentifier -\to \everyXMLelement - -%D We now overload the previously defined argument setter by one -%D that is faster when definitions are surrounded by -%D -%D \starttyping -%D \startXMLcompiling ... \stopXMLcompiling -%D \stoptyping -%D -%D This method is twice as fast on (for instance) 100K calls to -%D an empty element with 10 arguments. - -% \long\def\prepareXMLargument#1#2#3% -% {\scratchtoks\expandafter{\the\scratchtoks\@EA\def\csname#1#2\endcsname{#3}}} - -% \long\def\prepareXMLargument#1#2#3% -% {\scratchtoks\@EA\@EA\@EA{\@EA\the\@EA\scratchtoks\@EA\def\csname\@@XMLvariable:#1:#2\endcsname{#3}}} - -% \let\@@globalprefix\empty - -% \long\def\prepareXMLargument#1#2#3% -% {\expanded{\scratchtoks -% {\the\scratchtoks -% \def\@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname{#3}% -% \noexpand\@EA\let\noexpand\csname\@@XMLvariable:\noexpand\the\numexpr(\XMLdepth+1):#2\endcsname -% \@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname}}} - -\long\def\prepareXMLargument#1#2#3% - {\expanded{\scratchtoks - {\the\scratchtoks - \def\@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname{#3}% - \noexpand\@EA\let\noexpand\csname\@@XMLvariable:\noexpand\the\numexpr\XMLdepth+\plusone\relax:#2\endcsname - \@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname}}} - -\long\def\setXMLargumentsN#1#2#3% element [tag] settings - {\doifassignmentelse{#2} - {\letbeundefined{\@@XMLmap:#1}% - \long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}} - {\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name - \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}} - -\long\def\setXMLargumentsP#1#2#3% element settings empty (we cannot test for assignment) - {\letbeundefined{\@@XMLmap:#1}% - \bgroup - %def\XMLinheritance{\noexpand\XMLinheritance} - \def\XMLop##1{\noexpand\XMLpar{#1}{##1}{}}% - \def\XMLpar{\noexpand\XMLpar}% - \def\XMLanc{\noexpand\XMLanc}% - \def\XMLinh{\noexpand\XMLinh}% - \xdef\!!XMLattr{[#1][#2]}% - \scratchtoks\emptytoks - \@EA\dogetparameters\@EA\prepareXMLargument\!!XMLattr - \xdef\globalnext{\the\scratchtoks}% - \egroup - \letvalue{\@@XMLpars:#1}\globalnext - \globallet\globalnext\relax} - -\def\defineXMLattributeset{\dodoubleargument\dodefineXMLattributeset} -\def\extendXMLattributeset{\dodoubleargument\doextendXMLattributeset} - -\def\dodefineXMLattributeset[#1][#2]{\setvalue {\@@XMLpars::#1}{#2}} -\def\doextendXMLattributeset[#1][#2]{\appendvalue{\@@XMLpars::#1}{,#2}} - -\def\XMLattributeset #1{\executeifdefined{\@@XMLpars::#1}\empty} -%def\XMLinheritance #1{\executeifdefined{\@@XMLpars:#1}\empty} -\def\showXMLattributes#1{\showvalue{\@@XMLpars:#1}} - -\chardef\@@precompile\zerocount - -\def\setXMLarguments - {\ifcase\@@precompile - \expandafter\setXMLargumentsN - \else - \expandafter\setXMLargumentsP - \fi} - -\def\startXMLcompiling - {\dosingleargument\dostartXMLcompiling} - -% \def\dostartXMLcompiling[#1]% -% {\iffirstargument -% \copyXMLargumentindeed % when needed, from now on -) -% \def\@@globalprefix{#1}% -% \fi -% \chardef\@@precompile\plusone} - -\def\dostartXMLcompiling[#1]% - {\doif{#1}\v!inherit - \copyXMLargumentindeed - \chardef\@@precompile\plusone} - -\def\stopXMLcompiling - {\chardef\@@precompile\zerocount} % no \let\@@globalprefix\empty - -%D Interesting what kind of things are needed \unknown - -\appendtoks - \ifdefined\disablelanguagespecifics\disablelanguagespecifics\fi -\to \everyenableXML - -\long\def\longempty{} -\long\def\longspace{ } - -% \def\doifelseXMLdata#1% always empty at start [gets a long assignment] -% {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty -% \expandafter\secondoftwoarguments -% \else -% \expandafter\firstoftwoarguments -% \fi} -% -% \def\doifXMLdata#1% always empty at start [gets a long assignment] -% {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty -% \expandafter\gobbleoneargument -% \else -% \expandafter\firstofoneargument -% \fi} -% -% \let\doifXMLdataelse\doifelseXMLdata - -\def\doifelseXMLdata#1% always empty at start [gets a long assignment] - {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty - \expandafter\secondoftwoarguments - \else - \expandafter\firstoftwoarguments - \fi} - -\def\doifXMLdata#1% always empty at start [gets a long assignment] - {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty - \expandafter\gobbleoneargument - \else - \expandafter\firstofoneargument - \fi} - -\let\doifXMLdataelse\doifelseXMLdata - -\def\doifelseXMLempty#1% - {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty - \expandafter\firstoftwoarguments - \else\@EA\ifx\csname\@@XMLdata:#1\endcsname\longspace - \expandthree\firstoftwoarguments - \else - \expandthree\secondoftwoarguments - \fi\fi} - -% test case: -% -% \defineXMLenvironmentsave[test] -% {} -% {\message{[\XMLflush{test}]} -% \message{\doifelseXMLdata {test}{}{no }data} -% \message{/} -% \message{\doifelseXMLempty{test}{}{not }empty} -% \wait} -% -% \startXMLdata -% xxx -% -% -% -% -% x -% \stopXMLdata - -% \def\XMLflush#1% one level -% {\csname\@@XMLdata:#1\endcsname} - -% evt meer van dit gedoe en alle \longempty's vervangen - -\def\XMLflush#1% one level - {\csname\ifcsname\@@XMLdata:#1\endcsname\@@XMLdata:#1\else\s!empty\fi\endcsname} - -%D \starttyping -%D \defineXMLenvironmentsave[formula]{}{$\XMLtexdata{formula}$} -%D -%D \startXMLdata -%D t+3+x+t\neq m\alpha\frac\theta\hbar -%D \stopXMLdata -%D \stoptyping - -\def\XMLtexdata#1% - {\begingroup - \disableXML - \scantokens\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}% - \endgroup} - -\def\XMLflushdata#1% see m-steps for usage - {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else - %\@EAEAEA\XMLdata\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}% - \@EA\XMLdata\csname\@@XMLdata:#1\endcsname - \fi} - -\def\XMLflushasis#1% - {\detokenize\@EAEAEA{\csname\@@XMLdata:#1\endcsname}} - -\let\XMLpop \XMLflush -\let\XMLpopdata\XMLflushdata - -\def\XMLappend#1#2% let to empty expands to nothing -) - {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\csname\@@XMLdata:#1\endcsname#2}} - -\def\XMLprepend#1#2% let to empty expands to nothing -) - {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{#2\csname\@@XMLdata:#1\endcsname}} - -\def\XMLerase#1% - {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty} - -\def\XMLassign#1% - {\long\@EA\def\csname\@@XMLdata:#1\endcsname} - -\def\dontparseXMLelement#1>{} - -\def\simplifyXMLelements{\let\parseXMLelement\dontparseXMLelement} - -\def\defXMLstring#1#2% - {\bgroup - \enableXMLexpansion - \simplifyXMLelements - \let\getXMLentity\firstofoneargument - \XMLrawentitiestrue - \utfunicodetracer\plusseven % new - \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}% - \egroup - \defconvertedcommand#1\@@XML@@string} - -% this has to expand nicely: -% -% ]> -% -% so keep the following as is! - -\def\defXMLclean#1#2% - {\bgroup - \enableXMLexpansion - \simplifyXMLelements - \simplifyXMLentities - \utfunicodetracer\plusseven % new - \let\getXMLentity\expandedXMLentity % should this go in \simplify ? - \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}% - \egroup - \defconvertedcommand#1\@@XML@@string} - -\def\defXMLpar#1#2#3% to be documented - {\@EA\def\@EA#1\csname\ifcsname\@@XMLvariable:#2:#3\endcsname\@@XMLvariable:#2:#3\else\s!empty\fi\endcsname} - -\def\setvalueXMLpar#1#2#3% to be documented - {\@EA\let\csname#1\@EA\endcsname\csname\ifcsname\@@XMLvariable:#2:#3\endcsname\@@XMLvariable:#2:#3\else\s!empty\fi\endcsname} - -\def\XMLshow#1% - {\showvalue{\@@XMLdata:#1}} - -\def\XMLunspace#1% kan sneller - {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else - \long\@EA\edef\csname\@@XMLdata:#1\endcsname - {\@EAEAEA\dounspaced\csname\@@XMLdata:#1\endcsname\end}% - \fi} - -\chardef\asciispacecode=32 - -\def\defXMLlowerclean#1% lowercase ! evt tzt upper too - {\bgroup - \lccode`\#\asciispacecode - \lccode`\$\asciispacecode - \lccode`\%\asciispacecode - \lccode`\\\asciispacecode - \lccode`\^\asciispacecode - \lccode`\_\asciispacecode - \lccode`\{\asciispacecode - \lccode`\}\asciispacecode - \lccode`\|\asciispacecode - \lccode`\~\asciispacecode - \@EA\lowercase\@EA{\@EA\xdef\@EA#1\@EA{#1}}% - \egroup} - -\def\processXMLparelse#1#2#3#4% - {\processaction - [\XMLpar{#1}{#2}{}] - [#3,\s!unknown=>{#4},\s!default={#4}]} - -%D We can pick up key|/|value pairs, but we still need a way -%D to process these. - -% bugged -% -% \def\mapXMLvalue#1#2#3% td align center -> middle -% {\setvalue{\@@XMLvalue:#1:#2:#3}} - -\def\mapXMLvalue#1#2#3% td:align center -> middle - {\setvalue{\@@XMLvalue:#1:#2}{#3}} % keep #3 to grab spaces - -\def\XMLvar#1#2#3% td align center - {\ifcsname\@@XMLvariable:#1:#2\endcsname - \XMLval{#1}{#2}{\csname\@@XMLvariable:#1:#2\endcsname}% - \else - \XMLval{#1}{#2}{#3}% evt inline code - \fi} - -% \def\XMLvar#1#2#3% td align center -% {\XMLval{#1}{#2}{\ifcsname\@@XMLvariable:#1:#2\endcsname -% \csname\@@XMLvariable:#1:#2\endcsname\else#3\fi}} - -% \def\XMLval#1#2#3% td:align value default -% {\ifcsname\@@XMLvalue:#1:#2\endcsname -% \csname\@@XMLvalue:#1:#2\endcsname -% \else -% #3% -% \fi} -% -% The next one permits commands instead of strings in #3 - -\def\XMLval#1#2% #1=td:align #2=value #3=default - {\ifcsname\@@XMLvalue:#1:#2\endcsname - \@EA\firstoftwoarguments - \else - \@EA\secondoftwoarguments - \fi - {\csname\@@XMLvalue:#1:#2\endcsname}} - -\def\XMLpar#1#2#3% - {\ifcsname\@@XMLvariable:#1:#2\endcsname - \csname\@@XMLvariable:#1:#2\endcsname - \else - #3% - \fi} - -\def\XMLNSpar#1#2#3#4% element namespace name default - {\ifcsname\@@XMLvariable:#1:#2:#3\endcsname - \csname\@@XMLvariable:#1:#2:#3\endcsname - \else - #4% - \fi} - -% \def\setXMLpar#1#2% -% {\@EA\def\csname\@@XMLvariable:#1:#2\endcsname} - -\def\letXMLpar #1#2{\@EA \let\csname\@@XMLvariable:#1:#2\endcsname} -\def\setXMLpar #1#2{\@EA \def\csname\@@XMLvariable:#1:#2\endcsname} -\def\setXMLepar#1#2{\@EA\edef\csname\@@XMLvariable:#1:#2\endcsname} - -% ancestor arguments: -% -% \defineXMLenvironment -% [fo:root] -% [test=unset] -% {\beginXMLelement} -% {\endXMLelement} -% -% \defineXMLenvironment -% [fo:block-container] -% [test=oeps] -% {\beginXMLelement} -% {\endXMLelement} -% -% \defineXMLenvironment -% [fo:block] -% {\beginXMLelement -% \begingroup} -% {\endgroup -% \XMLanc{test}{} -% \endXMLelement} -% -% \startXMLdata -% -% second: -% unset: -% deep:nested:outer: -% last: -% -% \stopXMLdata -% -% \startXMLdata -% -% second: -% unset: -% deep:nested:outer: -% last: -% -% \stopXMLdata -% -% \startXMLdata -% -% second: -% unset: -% deep:nested:outer: -% last: -% -% \stopXMLdata - -% dit werkt alleen ok in niet ... situaties omdat anders -% de laatste b de attributen van de vorige heeft: - -\def\XMLanc#1% - {\ifcsname\@@XMLvariable:\currentXMLelement:#1\endcsname % \ownXMLelement - \csname\@@XMLvariable:\currentXMLelement:#1\endcsname % \ownXMLelement - \@EA\gobblethreearguments - \else - \@EA\pXMLanc - \fi\XMLdepth{#1}} - -% \def\pXMLanc#1% -% {\@EA\ppXMLanc\@EA{\the\numexpr(#1-\plusone)}} - -\def\pXMLanc#1% - {\@EA\ppXMLanc\@EA{\the\numexpr#1-\plusone\relax}} - -\def\ppXMLanc#1#2#3% - {\ifcsname\@@XMLdepth:#1\endcsname % is er altijd dus redundant - \ifcsname\@@XMLvariable:\csname\@@XMLdepth:#1\endcsname:#2\endcsname - \csname\@@XMLvariable:\csname\@@XMLdepth:#1\endcsname:#2\endcsname - \@EAEAEA\gobblethreearguments - \else - \@EAEAEA\pppXMLanc - \fi - \else - \@EA\pppXMLanc - \fi{#1}{#2}{#3}} - -\def\pppXMLanc#1% - {\ifnum#1>\zerocount - \@EA\pXMLanc - \else - \@EA\thirdofthreearguments - \fi{#1}} - -%D Experimental (not sure if this will stay): -%D -%D \starttyping -%D \startdefineXMLhandlers[one,two] -%D -%D \defineXMLenvironment[a=b,c=\XMLop{a}] -%D {}{} -%D -%D \stopdefineXMLhandlers -%D \stoptyping - -\long\def\startdefineXMLhandlers - {\bgroup\catcode\endoflineasciicode\spacecatcode - \dodoubleempty\dostartdefineXMLhandlers} - -\long\def\dostartdefineXMLhandlers[#1][#2]#3#4\stopdefineXMLhandlers % #2 is dummy - {\egroup - \long\def\dodefineXMLhandlers##1{#3[##1]#4}% - \processcommalist[#1]\dodefineXMLhandlers} - -\let\currentXMLhandler\s!unknown - -% \long\def\dostartdefineXMLhandlers[#1][#2]#3#4[#5]#6\stopdefineXMLhandlers % #2 is dummy -% {\egroup -% \pushmacro\XMLop -% \pushmacro\XMLpar -% \pushmacro\currentXMLhandler -% \long\def\dodefineXMLhandlers##1% -% {\edef\currentXMLhandler{##1}% -% \def\XMLop####1{\noexpand\XMLpar{##1}{####1}{}}% -% \def\XMLpar{\noexpand\XMLpar}% -% \def\XMLanc{\noexpand\XMLanc}% -% \edef\!!stringa{[##1][#5]}% -% \expandafter#3\!!stringa#6}% -% \processcommalist[#1]\dodefineXMLhandlers -% \popmacro\currentXMLhandler -% \popmacro\XMLpar -% \popmacro\XMLop} - -\long\def\dostartdefineXMLhandlers[#1][#2]#3#4[#5]#6\stopdefineXMLhandlers % #2 is dummy - {\egroup - \long\def\dodefineXMLhandlers##1% - {\bgroup - \edef\currentXMLhandler{##1}% - \def\XMLop####1{\noexpand\XMLpar{##1}{####1}{}}% - \def\XMLpar{\noexpand\XMLpar}% - \def\XMLanc{\noexpand\XMLanc}% - \def\XMLinh{\noexpand\XMLinh}% - \xdef\!!XMLattr{[##1][#5]}% - \egroup - \expandafter#3\!!XMLattr#6}% - \processcommalist[#1]\dodefineXMLhandlers} - -\def\XMLpav#1#2#3#4% - {\XMLval{#1}{\XMLpar{#2}{#3}{}}{#4}} - -%D A few weird ones: - -\def\TEXpar#1#2% - {\csname#1\interfaced{#2}\endcsname} - -\let\texXMLpar\TEXpar % soon obsolete - -\let\XMLtex\TEXpar - -% handy one - -\def\XMLtyp#1#2#3% - {\ifcsname\@@XMLvariable:#1:#2\endcsname - \@EA\defconvertedcommand\@EA\ascii\csname\@@XMLvariable:#1:#2\endcsname - \else - \defconvertedargument\ascii{#3}% - \fi - \ascii} - -\defineXMLsingular [begingroup] {\begingroup} -\defineXMLsingular [endgroup] {\endgroup} -\defineXMLsingular [gobblespacetokens] {\gobblespacetokens} -\defineXMLsingular [disableXML] {\disableXML} - -\long\def\XMLstr#1% - {{\enableXML\scantokens{#1}\unskip}} - -\long\def\XMLstr#1% test, does not work - {\ifprocessingXML - % \begingroup\enableXML\scantokens{#1}% - \scantokens{#1}% - \else - \begingroup\enableXML\scantokens{#1\ignorespaces}% - \fi} - -\def\XMLgetvariable#1#2% hooks into generic \getvariable and setvariables - {\expanded{\XMLstr{\getvariable{#1}{#2}}}} - -\long\def\XMLstrpar#1#2#3% test - {\ifcsname\@@XMLvariable:#1:#2\endcsname - \scantokens\@EAEAEA{\@EA\begingroup\@EA\enableXML - \csname\@@XMLvariable:#1:#2\endcsname}% - \else - \scantokens{\begingroup\enableXML#3}% - \fi} - -\def\doifXMLvarelse#1#2% geen etex, \relax too - {\ifcsname\@@XMLvariable:#1:#2\endcsname - \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty - \@EAEAEA\secondoftwoarguments - \else - \@EAEAEA\firstoftwoarguments - \fi - \else - \@EA\secondoftwoarguments - \fi} - -\def\doifXMLvar#1#2% geen etex, \relax too - {\ifcsname\@@XMLvariable:#1:#2\endcsname - \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty - \@EAEAEA\gobbleoneargument - \else - \@EAEAEA\firstofoneargument - \fi - \else - \@EA\gobbleoneargument - \fi} - -\def\doifXMLvalelse#1#2% geen etex, \relax too - {\ifcsname\@@XMLvalue:#1:#2\endcsname - \expandafter\ifx\csname\@@XMLvalue:#1:#2\endcsname\empty - \@EAEAEA\secondoftwoarguments - \else - \@EAEAEA\firstoftwoarguments - \fi - \else - \@EA\secondoftwoarguments - \fi} - -\let\doifXMLparelse\doifXMLvarelse -\let\doifXMLpar \doifXMLvar - -%D Used in x-fo: I really need to document this! - -\bgroup \catcode`\<=\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\defconvertedcommand\@EA#1\csname\@@XMLvariable:#2:#3\endcsname - \else - \defconvertedargument#1{#4}% - \fi} - -\def\XMLprocess#1% - {\begingroup\enableXML\XMLflush{#1}\endgroup} - -\bgroup \catcode`<=\@@active - -\long\gdef\ignoreuntilXMLelement#1<{<} -\long\gdef\grabuntilXMLelement #1<\to#2{\def#2{#1}<} - -\egroup - -%D Saves tokens and typing. - -\def\XMLownvar {\XMLvar {\rawXMLnamespace\rawXMLidentifier}} -\def\XMLownval {\XMLval {\rawXMLnamespace\rawXMLidentifier}} -\def\XMLownpar {\XMLpar {\rawXMLnamespace\rawXMLidentifier}} -\def\XMLownstrpar {\XMLstrpar {\rawXMLnamespace\rawXMLidentifier}} -\def\doifXMLownvarelse{\doifXMLvarelse{\rawXMLnamespace\rawXMLidentifier}} -\def\doifXMLownvalelse{\doifXMLvalelse{\rawXMLnamespace\rawXMLidentifier}} -\def\doifXMLownparelse{\doifXMLparelse{\rawXMLnamespace\rawXMLidentifier}} - -\def\letXMLpar #1#2{\@EA \let\csname\@@XMLvariable:#1:#2\endcsname} -\def\setXMLpar #1#2{\@EA \def\csname\@@XMLvariable:#1:#2\endcsname} -\def\setXMLepar#1#2{\@EA\edef\csname\@@XMLvariable:#1:#2\endcsname} - -\def\ownXMLelement{\rawXMLnamespace\rawXMLidentifier} - -\def\XMLop#1% ownpar - {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname - \@@XMLvariable:\ownXMLelement:#1\else\s!empty - \fi\endcsname} - -\def\XMLtp#1% texpar - {\csname\ifcsname\@@XMLmapmap\interfaced{#1}\endcsname - \@@XMLmapmap\interfaced{#1}\else\s!empty - \fi\endcsname} - -\def\doifelseXMLop#1{\doifelse{\XMLop{#1}}} -\def\doifXMLop #1{\doif {\XMLop{#1}}} -\def\doifnotXMLop #1{\doifnot {\XMLop{#1}}} - -\def\doifelsenothingXMLop#1{\doifelsenothing{\XMLop{#1}}} -\def\doifsomethingXMLop #1{\doifsomething {\XMLop{#1}}} -\def\doifnothingXMLop #1{\doifnothing {\XMLop{#1}}} - -\def\doifelseXMLtp#1{\doifelse{\XMLtp{#1}}} -\def\doifXMLtp #1{\doif {\XMLtp{#1}}} -\def\doifnotXMLtp #1{\doifnot {\XMLtp{#1}}} - -\def\doifelsenothingXMLtp#1{\doifelsenothing{\XMLtp{#1}}} -\def\doifsomethingXMLtp #1{\doifsomething {\XMLtp{#1}}} -\def\doifnothingXMLtp #1{\doifnothing {\XMLtp{#1}}} - -\def\XMLflushself{\csname\@@XMLdata:\ownXMLelement\endcsname} - -\def\showXMLdata#1{\showvalue{\@@XMLdata:#1}} - -\def\XMLta {\theXMLarguments\@@XMLmapmap} -\def\getXMLta {\expanded{\getparameters[\@@XMLmapmap][\XMLta]}} -\def\expandXMLta{\expandXMLarguments\@@XMLmapmap} -\def\expandXMLtp{\expandTEXpar\@@XMLmapmap} % #1 - -\def\getXMLparameters[#1]% faster than \rawgetparameters[#1][\theXMLar..] - {\ifcsname\@@XMLmap:#1\endcsname - \expanded{\rawgetparameters[#1][\csname\@@XMLmap:#1\endcsname]}% - \fi} - -\def\defXMLop#1#2{\@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#2\endcsname} -\def\defXMLtp#1#2{\@EA\let\@EA#1\csname\@@XMLmapmap\interfaced{#2}\endcsname} - -%D ... - -\def\protectXMLdata - {\catcode\tabasciicode \spacecatcode - \catcode\endoflineasciicode\spacecatcode - \catcode\formfeedasciicode \spacecatcode - \catcode\endoffileasciicode\spacecatcode - \catcode`\#\@@other} - -\long\def\startXMLcode - {\begingroup - \protectXMLdata - \dostartXMLcode} - -\long\def\dostartXMLcode[#1] #2 \stopXMLcode - {\@EA\gdef\csname\@@XMLcode:#1\endcsname{\startXMLdata#2\stopXMLdata}% - \endgroup} - -\def\getXMLcode[#1]% \expandXMLcode - {\csname\@@XMLcode:#1\endcsname} - -% \long\def\startXMLdata#1\stopXMLdata% -% {\begingroup\enableXML\scantokens{#1}\endgroup} -% -% \defineXMLentity[tex-backslash] {\catchXMLpar} -% -% \def\catchXMLpar#1#2#3 -% {\if#1p\if#2a\if#3r\ifmmode\else\endgraf\fi -% \else\texescape\fi\else\texescape\fi\else\texescape\fi} - -\long\def\startXMLdata - {\begingroup - \protectXMLdata - \dostartXMLdata} - -\long\def\dostartXMLdata#1\stopXMLdata % evt \everyeof{} - {\enableXML\scantokens{#1}% - \endgroup - \ifhmode\unskip\unskip\fi} - -% suboptimal: -% -% \unexpanded\def\XMLdata#1% % \unexpanded added 22/5/2001 -% {\begingroup -% \enableXML\scantokens{#1}\ifhmode\unskip\unskip\fi -% \endgroup} -% -% better but does not work in tables: -% -% \unexpanded\def\XMLdata#1% % grouping changed 20/5/2001 -% {\scantokens{\begingroup\enableXML#1\gobblespacetokens}} -% -% currently: - -\unexpanded\def\XMLdata % # safe - {\begingroup - \protectXMLdata - \doXMLdata} - -\def\doXMLdata#1% - {\enableXML - \scantokens{#1}% - \endgroup} - -%D - -\def\bXMLs{\ifignoreXMLspaces\ignorespaces\fi} -\def\eXMLs{\ifignoreXMLspaces\ifhmode\unskip\fi\fi} - -\protect - -% \defineXMLcommand{placeindex/} -% {\placeindex[criterium=all]} -% -% \defineXMLargument{index} -% {\index[\XMLvar{index}{key}{}]} - -%D Here we implement the handling of preformatted code. - -\unprotect - -\def\startXMLpreformatted#1% - {\startpacked - #1% - \fixedXMLfonttrue - \obeylines - \obeyspaces - \setbox\scratchbox=\hbox{x}% - \edef\obeyedspace{\noindent\noexpand\kern\the\wd\scratchbox}} - -\def\stopXMLpreformatted#1% - {\stoppacked} - -%D - -\def\XMLinput{\enableXML\input} \global\let\inputXML\XMLinput - -% options - -\def\processXMLfile #1{\enableXML\processfile{#1}} -\def\processXMLfilegrouped#1{{\enableXML\processfile{#1}\relax\ifmmode\else\par\fi}} - -%D \type -%D {processXMLbuffer} -%D -%D For illustrative purposes, we need to be able to reuse -%D definitions, which is why we implement a buffer processor -%D here. The macro \type {\processXMLbuffer} behaves like -%D any buffer processor. - -\def\processXMLbuffer - {\dosingleempty\doprocessXMLbuffer} - -\def\doprocessXMLbuffer[#1]% - {\doifelsenothing{#1} - {\doprocessXMLbuffer[\jobname]} - {\begingroup - \enableXML - \def\dodoprocessXMLbuffer##1{\getbuffer[##1]}% - \processcommalist[#1]\dodoprocessXMLbuffer - \endgroup}} - -%D Loading specific modules takes place with \type -%D {\useXMLfilters}. - -% todo: flag - -\def\useXMLfilter[#1]% - {\processcommalist[#1]\douseXMLfilter} - -\def\douseXMLfilter#1% - {\doifundefined{\c!file\f!xtagprefix#1} - {\letvalue{\c!file\f!xtagprefix#1}\empty - \startreadingfile - % will be \showmessage - \readsysfile{\truefilename{\f!xtagprefix#1}}{\writestatus{xml}{loading module #1}}\donothing - \stopreadingfile}} - -%D Temporarily here. - -\newtoks\groupedtoks -\newif\ifcollectXMLgrouped - -\bgroup \catcode`\<=\@@active - -\newtoks\XMLgtoks - -\long\unexpanded\gdef\getXMLgroupedenvironment#1#2#3% - {\collectXMLgroupedtrue - \XMLgtoks{#2}% - \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\the\groupedtoks#3}% - \getXMLgrouped{#1}} - -\long\unexpanded\gdef\getXMLgroupedargument#1#2% - {\collectXMLgroupedtrue - \XMLgtoks{#2}% - \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\@EA{\the\groupedtoks}}% - \getXMLgrouped{#1}} - -\long\unexpanded\gdef\getXMLgroupedignore#1% - {\collectXMLgroupedfalse - \let\dodogetgrouped\relax - \getXMLgrouped{#1}} - -\long\gdef\docountXMLgrouped#1\end#2\end % 1 relax is enough since it's - {\long\def\dosplitXMLstring##1#1##2\relax\relax##3\end % another regime - {\def\ascii{##2}% - \ifx\ascii\empty \else - \advance\scratchcounter \plusone - \dosplitXMLstring##2\relax\relax#1\relax\relax\end - \fi}% - \dosplitXMLstring#2\relax\relax#1\relax\relax\end} - -\long\unexpanded\gdef\getXMLgrouped#1% #1 kan weg % klopt dit nu? - {\groupedtoks\emptytoks - \scratchcounter\zerocount - \edef\theXMLnamespace - {\ifx\originalXMLnamespace\empty\else\originalXMLnamespace:\fi - \currentXMLidentifier}% - \expanded{\long\noexpand\def\noexpand\dogetgrouped####1\noexpand}% - {\ifcollectXMLgrouped\appendtoks##1\to\groupedtoks\fi - \@EA\docountXMLgrouped\@EA<\theXMLnamespace>\end##1\end - \@EAEAEA\docountXMLgrouped\@EA\@EA\@EA<\@EA\theXMLnamespace\space \end##1\end - \ifcase\scratchcounter - \let\dogetgrouped\dodogetgrouped - \else - \advance\scratchcounter \minusone - \ifcollectXMLgrouped\@EA\appendtoks\@EA<\@EA/\currentXMLelement>\to\groupedtoks\fi - \fi - \dogetgrouped}% - \dogetgrouped} - -\egroup - -% interesting and fully expandable - -\def\XMLownifequalelse#1#2% - {\@EAEAEA\@@ifequal\csname\@@XMLvariable:\ownXMLelement:#1\endcsname\relax\@@and#2\relax\@@then} - -% \def\XMLifequalelse#1#2#3% -% {\@EAEAEA\@@ifequal\csname\@@XMLvariable:#1:#2\endcsname\relax\@@and#3\relax\@@then} - -\def\XMLifequalelse#1#2% - {\ifcsname\@@XMLvariable:#1:#2\endcsname - % \@EAEAEA\doXMLifequalelse\@EA\@EA\csname\@@XMLvariable:#1:#2\endcsname - \@EA\doXMLifequalelse\csname\@@XMLvariable:#1:#2\@EA\endcsname - \else - \@EA\secondoftwoarguments - \fi} - -\def\doXMLifequalelse#1#2% - {\@EA\@@ifequal#1\relax\@@and#2\relax\@@then} - -%D \starttyping -%D \defineXMLenvironment[test][a=1] -%D {\XMLownifequalelse{a}{2}{YES}{NO}} -%D {} -%D -%D \defineXMLenvironment[test][a=1] -%D {\XMLifequalelse{test}{a}{1}{YES}{NO}} -%D {} -%D -%D \startXMLdata -%D test -%D \stopXMLdata -%D \stoptyping - -\def\XMLyes#1{\XMLownifequalelse{#1}{yes}{#1}{}} - -%D The next macro will set the variable \type {\flattenedXMLcontent} -%D to the content with elements removed and entity names. - -\bgroup - -\catcode`\<\active -\catcode`\&\active - -\gdef\flattenXMLcontent#1% we need taco's 'over one group' - {\begingroup - \keeputfcharacters - \def<##1>{}% - \def&##1;{##1}% - \edef\flattenedXMLcontent{#1}% - \edef\flattenedXMLcontent{\expandafter\dounspaced\flattenedXMLcontent\end}% - \@EA\endgroup - \@EA\def\@EA\flattenedXMLcontent\@EA{\flattenedXMLcontent}} - -\egroup - -\def\defXMLexpanded#1#2% - {\begingroup - \let\getXMLentity\expandedXMLentity - \expanded{\endgroup\edef\noexpand#1{#2}}} - -\def\gdefXMLexpanded#1#2% - {\begingroup - \let\getXMLentity\expandedXMLentity - \expanded{\endgroup\xdef\noexpand#1{#2}}} - -\protect \endinput diff --git a/tex/context/base/xtag-map.mkii b/tex/context/base/xtag-map.mkii new file mode 100644 index 000000000..cbde4f1b1 --- /dev/null +++ b/tex/context/base/xtag-map.mkii @@ -0,0 +1,746 @@ +%D \module +%D [ file=xtag-map, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Remapping, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 There is a more versatile mapper available in \type {xtag-rem.tex}! + +%D We also need something that lets content as-is, like for +%D instance XML embedded in a chemical caption. + +\writestatus{loading}{ConTeXt XML Macros / Remapping} + +%D A fundamental characteristic of \TEX\ is that much +%D processing depends on picking up one or more arguments and +%D acting upon them. In \type {xtag-ini} we have implemented +%D the normal (high) level interface between \XML\ and +%D \CONTEXT, and there we already saw some ways to pick up an +%D element as argument. +%D +%D In this module we will implement a preprocessor. An element +%D that feeds its content to the preprocessor, becomes a token +%D list consisting of \TEX\ macros, which in turn may expand to +%D their meanings. +%D +%D This module is only tested with \ETEX. In principle we can +%D make it work with good old \TEX, but we see no objection +%D against using \ETEX, especially since it's part of every +%D grown up \TEX\ distribution. + +\unprotect + +\let\normalparseXMLescape \parseXMLescape +\let\normalparseXMLelement\parseXMLelement +\let\normalparseXMLprocess\parseXMLprocess + +\let\normaldoXMLelement \doXMLelement +\let\normaldoXMLentity \doXMLentity + +\def\setnormalXMLhandler + {\let\doXMLelement \normaldoXMLelement + \let\parseXMLelement\normalparseXMLelement + \let\parseXMLescape \normalparseXMLescape + \let\parseXMLprocess\normalparseXMLprocess + \let\doXMLentity \normaldoXMLentity} + +%D A careful reader will notice that we do a full expansion of +%D the content of the element, although commands that are +%D protected will stay untouched. In this stage we also +%D collect key|/|value pairs and pass them onto the \TEX\ +%D macros if needed. Again, we need a fully expandable parser +%D to handle this, which make the core macros slightly +%D unreadable. +%D +%D The interface presented here evolved from an older module, +%D written on top of \type {m-sgml}, that could take care of +%D \MATHML\ (version 1). The implementation here is more +%D advanced in the sense that it permits all kind of parsers. + +\def\findendofXMLelement#1% space after 0/1 prevents auto \relax + {\if#1>0 \else + \if#1/1 \endofXMLelementE\else + \if#1"\endofXMLelementD \else + \if#1'\endofXMLelementS \else + \endofXMLelementN \fi\fi\fi\fi} + +\def\endofXMLelementE#1\fi\fi\fi\fi#2>{\fi\fi} +\def\endofXMLelementD#1\fi\fi\fi\fi#2"{\fi\fi\fi \findendofXMLelement} +\def\endofXMLelementS#1\fi\fi\fi\fi#2'{\fi\fi\fi\fi\findendofXMLelement} +\def\endofXMLelementN \fi\fi\fi\fi {\fi\fi\fi\fi\findendofXMLelement} + +% not faster +% +% \def\findendofXMLelement#1% +% {\csname**\if#1>>\else\if#1//\else\if#1""\else\if#1''\else.\fi\fi\fi\fi\endcsname} +% +% \def\findendofXMLelement#1% +% {\csname**\ifcsname**#1\endcsname#1\else.\fi\endcsname} +% +% \setvalue{**>}{0 } +% \setvalue{**/}#1>{1 } +% \setvalue{**"}#1"{\findendofXMLelement} +% \setvalue{**'}#1'{\findendofXMLelement} +% \letvalue{**.}\findendofXMLelement + +\newif\ifremapXMLunknown + +%D We need three steps to avoid namespace: tag since comment +%D and processing instructions don't have a namespace. The +%D first step distinguishes between comment, processing +%D instructions and elements. The second step (which is +%D defined in the main mapping macro) either or not grabs the +%D namespace. We may extend this model later to a more +%D versatile one, using remapping. + +%D Parsing escapes is done by specific macros. For the +%D moment we assume that the sequence ends with an \type {>} +%D (which is definietly not the case for \type {CDATA}). + +\long\def\remapXMLescape#1#2>{} + +%D Processing instructions are remapped and only certain +%D cases are handled. + +\long\def\remapXMLprocess#1#2{\xmlp{procins/}{X}{#1}{#2}} + +%D This one is more efficient (although no one will notice +%D this since this macro is used seldom). + +\long\def\remapXMLprocess{\xmlp{procins/}{X}} + +%D Element need a bit more work; \type {#4} consumes spaces. + +% \def\remapXMLunknownONE#1#2% name args +% {\ifremapXMLunknown\remapXMLone{\s!unknown}{#1 #2}\fi} +% +% \def\remapXMLunknownTWO#1#2% name args +% {\ifremapXMLunknown\remapXMLtwo{\s!unknown}{#1 #2}\fi} +% +% \def\remapXMLunknownTHREE#1#2% name args +% {\ifremapXMLunknown\remapXMLthree{\s!unknown/}{#1 #2}\fi} +% +% \long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end / +% {\ifcase\findendofXMLelement#2#3>% +% \if#1/% +% \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax +% \remapXMLunknownONE{#2}{}% +% \else +% \remapXMLone{#2}{}% +% \fi +% \else +% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax +% \remapXMLunknownTWO{#1#2}{#3}% +% \else +% \remapXMLtwo{#1#2}{#3}% +% \fi +% \fi +% \else +% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax +% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax +% \remapXMLunknownTHREE{#1#2}{#3}% +% \else +% \remapXMLthree{#1#2/}{#3}% +% \fi +% \else +% \remapXMLthree{#1#2}{#3}% +% \fi +% \fi#4} + +\def\remapXMLthreeempty#1% + {\remapXMLthree{#1/}} + +\def\remapXMLunknownONE#1#2% name args + {\ifremapXMLunknown\remapXMLone\s!unknown{#1 #2}\fi} + +\def\remapXMLunknownTWO#1#2% name args + {\ifremapXMLunknown\remapXMLtwo\s!unknown{#1 #2}\fi} + +\def\remapXMLunknownTHREE#1#2% name args + {\ifremapXMLunknown\remapXMLthreeempty\s!unknown{#1 #2}\fi} + +\long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end / + {\ifcase\findendofXMLelement#2#3>% + \if#1/% + \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax + \@EA\remapXMLunknownONE + \else + \@EA\remapXMLone + \fi{#2}\empty + \else + \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax + \@EA\remapXMLunknownTWO + \else + \@EA\remapXMLtwo + \fi{#1#2}{#3}% + \fi + \else + \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax + \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax + \@EAEAEA\remapXMLunknownTHREE + \else + \@EAEAEA\remapXMLthreeempty + \fi + \else + \@EA\remapXMLthree + \fi{#1#2}{#3}% + \fi#4} + +\unexpanded\def\xmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname} +\unexpanded\def\xmlp#1#2{\csname\@@XML :#1:#2\endcsname} +\def \expandedxmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname} + +\def\expandXMLremapping{\let\xmlr\expandedxmlr} + +\def\@@XMLremap{XMLremap} + +\def\remapXMLone#1#2% + {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname + \or % GCPA + \XMLeg\XMLeg + \or % GCP- + \XMLeg + \or % GC-A + \XMLeg\XMLeg + \or % GC-- + \XMLeg + \or % -CPA + \XMLeg + \or % -CP- + % + \or % -C-A + \XMLeg + \or % -C-- + % + \or % G--- + \XMLeg + \or % GLR- + \xmlr{#1}{R}\XMLeg + \or % -LR- + \xmlr{#1}{R}% + \fi} + +\def\remapXMLtwo#1#2% + {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname + \or % GCPA + \XMLbg\xmlr{#1}{X}{#2}\XMLbg + \or % GCP- + \XMLbg\xmlr{#1}{X}{#2}% + \or % GC-A + \XMLbg\xmlr{#1}{X}\XMLbg + \or % GC-- + \XMLbg\xmlr{#1}{X}% + \or % -CPA + \xmlr{#1}{X}{#2}\XMLbg + \or % -CP- + \xmlr{#1}{X}{#2}% + \or % -C-A + \xmlr{#1}{X}\XMLbg + \or % -C-- + \xmlr{#1}{X}% + \or % G--- + \XMLbg + \or % GLR- + \XMLbg\xmlr{#1}{L}% + \or % -LR- + \xmlr{#1}{L}% + \fi} + +\def\remapXMLthree#1#2% + {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname + \or % GCPA + \XMLbg\xmlr{#1}{X}{#2}\XMLbg\XMLeg\XMLeg + \or % GCP- + \XMLbg\xmlr{#1}{X}{#2}\XMLeg + \or % GC-A + \XMLbg\xmlr{#1}{X}\XMLbg\XMLeg\XMLeg + \or % GC-- + \XMLbg\xmlr{#1}{X}\XMLeg + \or % -CPA + \xmlr{#1}{X}{#2}\XMLbg\XMLeg + \or % -CP- + \xmlr{#1}{X}{#2}% + \or % -C-A + \xmlr{#1}{X}\XMLbg\XMLeg + \or % -C-- + \xmlr{#1}{X}% + \or % G--- + \XMLbg\XMLeg + \fi} + +\scratchtoks\@EA{\string{} \edef\XMLbg{\the\scratchtoks} +\scratchtoks\@EA{\string}} \edef\XMLeg{\the\scratchtoks} + +\chardef\XMLremapGCPA = 1 % {\command {arg} { } } +\chardef\XMLremapGCP = 2 % {\command {arg} } % +\chardef\XMLremapGCA = 3 % {\command { } } +\chardef\XMLremapGC = 4 % {\command } % +\chardef\XMLremapCPA = 5 % \command {arg} { } +\chardef\XMLremapCP = 6 % \command {arg} % +\chardef\XMLremapCA = 7 % \command { } +\chardef\XMLremapC = 8 % \command % +\chardef\XMLremapG = 9 % { } +\chardef\XMLremapGLR = 10 % { \bcom \ecom } +\chardef\XMLremapLR = 11 % \bcom \ecom + +%D The remapping is controlled by only a few definition +%D macros, that both deal with elements. We distinguish +%D between normal and empty elements. +%D +%D \starttyping +%D \remapXMLsequence [name] [result map] \unexpandablecommand +%D \remapXMLsequence [name] [result map] \unexpandablecommand +%D \stoptyping +%D +%D The \MATHML\ module demonstrates how these can be used. +%D The element is converted into a sequence with one or more +%D of the following components. +%D +%D \starttyping +%D { \command {parameters} {argument} } +%D \stoptyping +%D +%D The following combinations are supported. +%D +%D \starttabulate[|c|c|c|c|c|] +%D \NC GCPA \NC grouped \NC command \NC parameters \NC argument \NC \NR +%D \NC GCP \NC grouped \NC command \NC parameters \NC \NC \NR +%D \NC GCA \NC grouped \NC command \NC \NC argument \NC \NR +%D \NC GC \NC grouped \NC command \NC \NC \NC \NR +%D \NC CPA \NC \NC command \NC parameters \NC argument \NC \NR +%D \NC CP \NC \NC command \NC parameters \NC \NC \NR +%D \NC CA \NC \NC command \NC \NC argument \NC \NR +%D \NC C \NC \NC command \NC \NC \NC \NR +%D \NC G \NC grouped \NC \NC \NC \NC \NR +%D \stoptabulate +%D +%D Empty elements (singular ones) never get an argument, +%D which makes sense, since they have at most parameters. + +\def\remapXMLsequence{\doquadrupleargument\doremapXML []} +\def\remapXMLsingular{\doquadrupleargument\doremapXML[/]} + +\def\doremapXML[#1][#2][#3][#4]% + {\iffourthargument + \def\next{\dodoremapXML[#2][#1][#3][#4]}% + \else + \def\next{\dodoremapXML[\@@XMLmapping][#1][#2][#3]}% + \fi + \next} + +%\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern +% {\doifinstringelse{LR}{#4} +% {\let\next\doremapXMLtwo} +% {\let\next\doremapXMLone}% +% \next[#1][#2][#3][#4]}% + +\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern + {\doifinstringelse{LR}{#4}\doremapXMLtwo\doremapXMLone[#1][#2][#3][#4]} + +\def\doremapXMLone[#1][#2][#3][#4]#5% + {\setvalue{\@@XML#1:#3#2:M}{#4}% + \setvalue{\@@XML#1:#3#2:X}{#5}} + +\def\doremapXMLtwo[#1][#2][#3][#4]#5#6% + {\setvalue{\@@XML#1:#3:M}{#4}% + \setvalue{\@@XML#1:#3:L}{#5}% + \setvalue{\@@XML#1:#3:R}{#6}} + +\let\dowithentity\empty + +%D We handle processing instructions and unknown elements with: + +\remapXMLsingular [procins] [CPA] \normalparseXMLprocess +\remapXMLsingular [\s!unknown] [CPA] \doXMLunknownSI +\remapXMLsequence [\s!unknown] [CPA] \doXMLunknownSE + +\def\doXMLunknownSI#1#2{{\tttf[#1 #2]}} +\def\doXMLunknownSE#1#2{{\tttf[#1 #2]}} + +%D In a similar way, we can remap entities. + +\def\remapXMLentity#1;#2% + {\doremapXMLentity{#1}#2}% + +\def\doremapXMLentity + {\xmlrent} + +% \unexpanded\def\xmlrent#1% +% {\getXMLentity{#1}} +% +% replaced by: + +\unexpanded\def\xmlrent#1% + {\doXMLentity#1;} + +%D The remapping is taken care of by the following macro, +%D which takes three arguments. +%D +%D \starttyping +%D \XMLremapdata{before}{after}{content} +%D \stoptyping +%D +%D After the remapping, the content is executed (expanded) +%D under the normal \TEX\ catcode regime. The intermediate +%D result can be traced by turning on the following switch. + +\newif\iftraceXMLremapping + +\newtoks \everyXMLremapping + +\appendtoks + \defineXMLentity[tex-hash]{\letterhash}% + \defineXMLentity[tex-bar]{\myspecialnormalvert}% +\to \everyXMLremapping + +\def\setnormalXMLentities% will change ! ! ! ! ! + {\defineXMLentity[tex-hash]\letterhash + \defineXMLentity[tex-dollar]\letterdollar + \defineXMLentity[tex-percent]\letterpercent + \defineXMLentity[tex-backslash]\letterbackslash + \defineXMLentity[tex-hat]\letterhat + \defineXMLentity[tex-underscore]\letterunderscore + \defineXMLentity[tex-leftbrace]\letterbgroup + \defineXMLentity[tex-rightbrace]\letteregroup + \defineXMLentity[tex-bar]\letterbar} + +\let\XMLremappedpar\empty + +%D Here we implement the second step in the element grabber. + +\long\def\XMLremapdata + {\dosingleempty\doXMLremapdata} + +\long\def\doXMLremapdata[#1]#2#3#4% + {\bgroup + \startXMLmapping[#1]% + % enable unknown elements (should be macro) + \doifsomething{#1} + {\doifdefinedelse{\@@XML#1:\s!unknown:M} + {\remapXMLunknowntrue}{\remapXMLunknownfalse}}% + % + \pushmacro\doXMLentity % needed ? + % this will change, proper split in element itself + \ifx\currentXMLnamespace\empty + \let\parseXMLelement\remapXMLelement + \else + % here we need to get rid of the namespace; we also + % have to preserve the leading / if present + \@EA\long\@EA\def\@EA\parseXMLelement\@EA + ##\@EA1\currentXMLnamespace:{\remapXMLelement##1}% + % ##2 removes leading spaces + \fi + % + \let\parseXMLescape \remapXMLescape + \let\parseXMLprocess\remapXMLprocess + % + \let\doXMLentity \remapXMLentity + % + \enableXML % sets entities + \enableXMLexpansion + \let\par\XMLremappedpar + \the\everyXMLremapping + %\ignorelines + \catcode\tabasciicode \spacecatcode + \catcode\endoflineasciicode\spacecatcode + \catcode\formfeedasciicode \spacecatcode + \catcode\endoffileasciicode\spacecatcode + \pushmacro\unicodechar + \let\unicodechar\relax + \xdef\remappedXMLdata{#4\empty}% + \popmacro\unicodechar + \let\par\endgraf + \popmacro\doXMLentity % needed ? + \disableXMLexpansion + \catcode`\{=\@@begingroup + \catcode`\}=\@@endgroup + \catcode`\\=\@@escape + \iftraceXMLremapping + \ifmmode\vbox\fi\bgroup + \defconvertedcommand\ascii\remappedXMLdata + \tttf\veryraggedright\ascii\par + \writestatus{xml-remap}{\ascii}% + \egroup + \fi + #2\scantokens\@EA{\remappedXMLdata\empty\empty}#3% + \stopXMLmapping + \egroup} + +% testcase: +% +% aap‒noot coördinatie – één +% +% \startXMLdata +% aap‒noot coördinatie – één +% aap‒noot coördinatie – één +% \stopXMLdata +% +% weird case: +% +% \chardef\XMLtokensreduction\zerocount +% \startXMLdata +% \"{a}\"{o}\"{u}\v{c}\v{s}\v{z} +% \stopXMLdata +% +% \chardef\XMLtokensreduction\plustwo +% \startXMLdata +% \"{a}\"{o}\"{u}\v{c}\v{s}\v{z} +% \stopXMLdata + +% rename to better names + +\newtoks \XMLRtoks +\newcount \nofXMLRchildren + +\def\naturalxmlr#1#2{\getvalue{\@@XML\@@XMLmapping:#1:#2}} + +\def\ignoreXMLRelement#1#2{} +\def\normalXMLRelement#1#2{#2} + +\let\nextXMLRelement \empty +\let\firstXMLRelement \empty +\let\secondXMLRelement\empty + +% \def\withnextXMLRelement#1% +% {\pushmacro\dowithnextXMLRelement +% \def\dowithnextXMLRelement##1##2##3##4##5% +% {\popmacro\dowithnextXMLRelement +% \def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}% +% #1}% +% \doifnextcharelse\empty\empty\dowithnextXMLRelement} +% +% better and faster: + +\def\dowithnextXMLRelement#1#2#3#4#5#6% + {\def\nextXMLRelement{#2{#3}{#4}{#5}{#6}}#1}% + +\def\withnextXMLRelement#1% + {\doifnextcharelse\empty\empty{\dowithnextXMLRelement{#1}}} + +\def\withnexttwoXMLRelements#1% + {\pushmacro\firstXMLRelement + \pushmacro\secondXMLRelement + \withnextXMLRelement + {\let\firstXMLRelement\nextXMLRelement + \withnextXMLRelement + {\let\secondXMLRelement\nextXMLRelement + #1% + \popmacro\secondXMLRelement + \popmacro\firstXMLRelement}}} + +\def\withnextthreeXMLRelements#1% korter, met two + {\pushmacro\firstXMLRelement + \pushmacro\secondXMLRelement + \pushmacro\thirdXMLRelement + \withnextXMLRelement + {\let\firstXMLRelement\nextXMLRelement + \withnextXMLRelement + {\let\secondXMLRelement\nextXMLRelement + \withnextXMLRelement + {\let\thirdXMLRelement\nextXMLRelement + #1% + \popmacro\thirdXMLRelement + \popmacro\secondXMLRelement + \popmacro\firstXMLRelement}}}} + +\def\doifXMLRchildelse#1#2#3#4% + {\pushmacro\xmlr + \def\next{#4}% + \def\xmlr##1##2##3##4% the / should be sorted out in the mapper + {\rawdoifinsetelse{##1}{#1} + {\def\next{#3}} + {\doif{##1}{#1/}{\def\next{#3}}}}% + #2\empty + \popmacro\xmlr + \next} + +\def\doifXMLRchild#1#2#3% + {\pushmacro\xmlr + \let\next\empty + \def\xmlr##1##2##3##4% the / should be sorted out in the mapper + {\rawdoifinsetelse{##1}{#1} + {\def\next{#3}} + {\doif{##1}{#1/}{\def\next{#3}}}}% + #2\empty + \popmacro\xmlr + \next} + +\def\encapsulateXMLRchild#1#2#3#4#5% + {\pushmacro\xmlr + \def\xmlr##1##2##3##4% + {\doifelse{##1}{#1} + {\def\next{\doencapsulateXMLRchild{#2}{#3}{#4}{##4}}} + {\let\next\empty}% + \next}% + #5\empty + \popmacro\xmlr} + +\def\encapsulateXMLRchildren#1#2#3#4#5% + {\pushmacro\xmlr + \pushmacro\betweenXMLRchild + \def\betweenXMLRchild{\def\betweenXMLRchild{#3}}% + \def\xmlr##1##2##3##4% + {\rawdoifinsetelse{##1}{#1} + {\pushmacro\xmlr + \let\xmlr\naturalxmlr + \betweenXMLRchild\xmlr{##1}{##2}{##3}{##4}% + \popmacro\xmlr} + {}}% + #2#5\empty#4% + \popmacro\betweenXMLRchild + \popmacro\xmlr} + +\def\doencapsulateXMLRchild#1#2#3#4% + {\pushmacro\xmlr + \pushmacro\betweenXMLRchild + \def\betweenXMLRchild{\def\betweenXMLRchild{#2}}% + \def\xmlr##1##2##3##4% + {\pushmacro\xmlr + \let\xmlr\naturalxmlr + \betweenXMLRchild\xmlr{##1}{##2}{##3}{##4}% + \popmacro\xmlr}% + #1#4\empty#3% + \popmacro\betweenXMLRchild + \popmacro\xmlr} + +\let\encapsulateXMLR\doencapsulateXMLRchild + +\def\withnextXMLRelementelse#1#2% + {\def\xdowithnextXMLRelement##1##2##3##4##5% + {\def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}#1}% + \def\xnowithnextXMLRelement% + {\let\nextXMLRelement\empty#2}% + \doifnextcharelse\xmlr\xdowithnextXMLRelement\xnowithnextXMLRelement} + +\def\encapsulatenextXMLRelements#1#2#3#4% oude bewaren + {\pushmacro\betweenXMLRchild + \pushmacro\afterXMLRchild + \def\betweenXMLRchild{#1\def\betweenXMLRchild{#2}}% + \let\afterXMLRchild\empty + \withnextXMLRelementelse + {\betweenXMLRchild + \def\afterXMLRchild{#3}% + \nextXMLRelement + \doifnextcharelse\empty\xnowithnextXMLRelement\xdowithnextXMLRelement} + {\afterXMLRchild + \popmacro\afterXMLRchild + \popmacro\betweenXMLRchild}% + #4} + +\def\collectXMLRchild#1#2% + {\XMLRtoks\emptytoks + \pushmacro\xmlr + \def\xmlr##1##2##3##4% + {\doif{##1}{#1}{\appendtoks##4\to\XMLRtoks}}% + #2\empty + \popmacro\xmlr} + +\def\doifelseXMLRneighbors#1#2% + {\XMLRtoks\emptytoks + \pushmacro\xmlr + \donefalse + \let\prevXMLRchild\empty + \def\xmlr##1##2##3##4% + {\doif{##1}{#1}{\doif{##1}\prevXMLRchild{\donetrue}}% + \def\prevXMLRchild{##1}}% + #2\empty + \popmacro\xmlr + \ifdone + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +\def\collectbetweenXMLRchild#1#2#3% + {\XMLRtoks\emptytoks + \pushmacro\xmlr + \pushmacro\betweenXMLRchild + \def\betweenXMLRchild{\def\betweenXMLRchild{\appendtoks#2\to\XMLRtoks}}% + \def\xmlr##1##2##3##4% + {\rawdoifinsetelse{##1}{#1} + {\betweenXMLRchild\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}{}}% + #3\empty + \popmacro\betweenXMLRchild + \popmacro\xmlr} + +\def\dorawcollectbetweenXMLR#1#2% + {\pushmacro\xmlr + \pushmacro\betweenXMLRchild + \def\betweenXMLRchild{\def\betweenXMLRchild{#1}}% + \def\xmlr##1##2##3##4% + {\betweenXMLRchild\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}% + #2\empty + \popmacro\betweenXMLRchild + \popmacro\xmlr} + +\def\rawcollectbetweenXMLR% + {\XMLRtoks\emptytoks\dorawcollectbetweenXMLR} + +\def\docollectbetweenXMLR#1% + {\dorawcollectbetweenXMLR{\appendtoks#1\to\XMLRtoks}} + +\def\collectbetweenXMLR% + {\XMLRtoks\emptytoks\docollectbetweenXMLR} + +\def\processXMLRchildren#1% + {\pushmacro\xmlr + \let\xmlr\naturalxmlr + #1\empty + \popmacro\xmlr} + +\def\processXMLRchild#1#2% slow but more versatile + {\pushmacro\xmlr + \XMLRtoks\emptytoks + \def\xmlr##1##2##3##4% + {\rawdoifinsetelse{##1}{#1} + {\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}{}}% + #2% + \popmacro\xmlr + \the\XMLRtoks\empty} + +\def\countXMLRchildren#1% + {\pushmacro\xmlr + \nofXMLRchildren=0 + \def\xmlr##1##2##3##4{\advance\nofXMLRchildren\plusone} + #1\empty + \popmacro\xmlr} + +\def\countXMLRchild#1#2% + {\pushmacro\xmlr + \nofXMLRchildren=0 + \def\xmlr##1##2##3##4% + {\rawdoifinsetelse{##1}{#1}{\advance\nofXMLRchildren\plusone}{}} + #2\empty + \popmacro\xmlr} + +\def\installXMLunknownremapping + {\remapXMLsingular[\s!unknown][CPA]\doXMLunknownSI + \remapXMLsequence[\s!unknown][CPA]\doXMLunknownSE} + +\bgroup \catcode`<=\active + +\gdef\revertXMLremapping + {\gdef\doXMLunknownSE##1##2{<##1>##2}% + \gdef\doXMLunknownSI##1##2{<##1>}} + +\gdef\unmapXMLdata#1#2% todo: singular, evt ##2 space ervoor en ##1##2 + {\bgroup + \revertXMLremapping + \expandXMLremapping % now we can roll back + \setnormalXMLhandler % using the normal parser + \resetXMLmapping % and leaving the mapping namespace + \xdef\unmappedXMLdata{#2}% recreate the original + \enableXMLelements % enable normal handler + \unmappedXMLdata % off we go ... + \egroup} + +\egroup + +\protect \endinput diff --git a/tex/context/base/xtag-map.tex b/tex/context/base/xtag-map.tex deleted file mode 100644 index cbde4f1b1..000000000 --- a/tex/context/base/xtag-map.tex +++ /dev/null @@ -1,746 +0,0 @@ -%D \module -%D [ file=xtag-map, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Remapping, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 There is a more versatile mapper available in \type {xtag-rem.tex}! - -%D We also need something that lets content as-is, like for -%D instance XML embedded in a chemical caption. - -\writestatus{loading}{ConTeXt XML Macros / Remapping} - -%D A fundamental characteristic of \TEX\ is that much -%D processing depends on picking up one or more arguments and -%D acting upon them. In \type {xtag-ini} we have implemented -%D the normal (high) level interface between \XML\ and -%D \CONTEXT, and there we already saw some ways to pick up an -%D element as argument. -%D -%D In this module we will implement a preprocessor. An element -%D that feeds its content to the preprocessor, becomes a token -%D list consisting of \TEX\ macros, which in turn may expand to -%D their meanings. -%D -%D This module is only tested with \ETEX. In principle we can -%D make it work with good old \TEX, but we see no objection -%D against using \ETEX, especially since it's part of every -%D grown up \TEX\ distribution. - -\unprotect - -\let\normalparseXMLescape \parseXMLescape -\let\normalparseXMLelement\parseXMLelement -\let\normalparseXMLprocess\parseXMLprocess - -\let\normaldoXMLelement \doXMLelement -\let\normaldoXMLentity \doXMLentity - -\def\setnormalXMLhandler - {\let\doXMLelement \normaldoXMLelement - \let\parseXMLelement\normalparseXMLelement - \let\parseXMLescape \normalparseXMLescape - \let\parseXMLprocess\normalparseXMLprocess - \let\doXMLentity \normaldoXMLentity} - -%D A careful reader will notice that we do a full expansion of -%D the content of the element, although commands that are -%D protected will stay untouched. In this stage we also -%D collect key|/|value pairs and pass them onto the \TEX\ -%D macros if needed. Again, we need a fully expandable parser -%D to handle this, which make the core macros slightly -%D unreadable. -%D -%D The interface presented here evolved from an older module, -%D written on top of \type {m-sgml}, that could take care of -%D \MATHML\ (version 1). The implementation here is more -%D advanced in the sense that it permits all kind of parsers. - -\def\findendofXMLelement#1% space after 0/1 prevents auto \relax - {\if#1>0 \else - \if#1/1 \endofXMLelementE\else - \if#1"\endofXMLelementD \else - \if#1'\endofXMLelementS \else - \endofXMLelementN \fi\fi\fi\fi} - -\def\endofXMLelementE#1\fi\fi\fi\fi#2>{\fi\fi} -\def\endofXMLelementD#1\fi\fi\fi\fi#2"{\fi\fi\fi \findendofXMLelement} -\def\endofXMLelementS#1\fi\fi\fi\fi#2'{\fi\fi\fi\fi\findendofXMLelement} -\def\endofXMLelementN \fi\fi\fi\fi {\fi\fi\fi\fi\findendofXMLelement} - -% not faster -% -% \def\findendofXMLelement#1% -% {\csname**\if#1>>\else\if#1//\else\if#1""\else\if#1''\else.\fi\fi\fi\fi\endcsname} -% -% \def\findendofXMLelement#1% -% {\csname**\ifcsname**#1\endcsname#1\else.\fi\endcsname} -% -% \setvalue{**>}{0 } -% \setvalue{**/}#1>{1 } -% \setvalue{**"}#1"{\findendofXMLelement} -% \setvalue{**'}#1'{\findendofXMLelement} -% \letvalue{**.}\findendofXMLelement - -\newif\ifremapXMLunknown - -%D We need three steps to avoid namespace: tag since comment -%D and processing instructions don't have a namespace. The -%D first step distinguishes between comment, processing -%D instructions and elements. The second step (which is -%D defined in the main mapping macro) either or not grabs the -%D namespace. We may extend this model later to a more -%D versatile one, using remapping. - -%D Parsing escapes is done by specific macros. For the -%D moment we assume that the sequence ends with an \type {>} -%D (which is definietly not the case for \type {CDATA}). - -\long\def\remapXMLescape#1#2>{} - -%D Processing instructions are remapped and only certain -%D cases are handled. - -\long\def\remapXMLprocess#1#2{\xmlp{procins/}{X}{#1}{#2}} - -%D This one is more efficient (although no one will notice -%D this since this macro is used seldom). - -\long\def\remapXMLprocess{\xmlp{procins/}{X}} - -%D Element need a bit more work; \type {#4} consumes spaces. - -% \def\remapXMLunknownONE#1#2% name args -% {\ifremapXMLunknown\remapXMLone{\s!unknown}{#1 #2}\fi} -% -% \def\remapXMLunknownTWO#1#2% name args -% {\ifremapXMLunknown\remapXMLtwo{\s!unknown}{#1 #2}\fi} -% -% \def\remapXMLunknownTHREE#1#2% name args -% {\ifremapXMLunknown\remapXMLthree{\s!unknown/}{#1 #2}\fi} -% -% \long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end / -% {\ifcase\findendofXMLelement#2#3>% -% \if#1/% -% \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax -% \remapXMLunknownONE{#2}{}% -% \else -% \remapXMLone{#2}{}% -% \fi -% \else -% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax -% \remapXMLunknownTWO{#1#2}{#3}% -% \else -% \remapXMLtwo{#1#2}{#3}% -% \fi -% \fi -% \else -% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax -% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax -% \remapXMLunknownTHREE{#1#2}{#3}% -% \else -% \remapXMLthree{#1#2/}{#3}% -% \fi -% \else -% \remapXMLthree{#1#2}{#3}% -% \fi -% \fi#4} - -\def\remapXMLthreeempty#1% - {\remapXMLthree{#1/}} - -\def\remapXMLunknownONE#1#2% name args - {\ifremapXMLunknown\remapXMLone\s!unknown{#1 #2}\fi} - -\def\remapXMLunknownTWO#1#2% name args - {\ifremapXMLunknown\remapXMLtwo\s!unknown{#1 #2}\fi} - -\def\remapXMLunknownTHREE#1#2% name args - {\ifremapXMLunknown\remapXMLthreeempty\s!unknown{#1 #2}\fi} - -\long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end / - {\ifcase\findendofXMLelement#2#3>% - \if#1/% - \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax - \@EA\remapXMLunknownONE - \else - \@EA\remapXMLone - \fi{#2}\empty - \else - \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax - \@EA\remapXMLunknownTWO - \else - \@EA\remapXMLtwo - \fi{#1#2}{#3}% - \fi - \else - \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax - \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax - \@EAEAEA\remapXMLunknownTHREE - \else - \@EAEAEA\remapXMLthreeempty - \fi - \else - \@EA\remapXMLthree - \fi{#1#2}{#3}% - \fi#4} - -\unexpanded\def\xmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname} -\unexpanded\def\xmlp#1#2{\csname\@@XML :#1:#2\endcsname} -\def \expandedxmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname} - -\def\expandXMLremapping{\let\xmlr\expandedxmlr} - -\def\@@XMLremap{XMLremap} - -\def\remapXMLone#1#2% - {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname - \or % GCPA - \XMLeg\XMLeg - \or % GCP- - \XMLeg - \or % GC-A - \XMLeg\XMLeg - \or % GC-- - \XMLeg - \or % -CPA - \XMLeg - \or % -CP- - % - \or % -C-A - \XMLeg - \or % -C-- - % - \or % G--- - \XMLeg - \or % GLR- - \xmlr{#1}{R}\XMLeg - \or % -LR- - \xmlr{#1}{R}% - \fi} - -\def\remapXMLtwo#1#2% - {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname - \or % GCPA - \XMLbg\xmlr{#1}{X}{#2}\XMLbg - \or % GCP- - \XMLbg\xmlr{#1}{X}{#2}% - \or % GC-A - \XMLbg\xmlr{#1}{X}\XMLbg - \or % GC-- - \XMLbg\xmlr{#1}{X}% - \or % -CPA - \xmlr{#1}{X}{#2}\XMLbg - \or % -CP- - \xmlr{#1}{X}{#2}% - \or % -C-A - \xmlr{#1}{X}\XMLbg - \or % -C-- - \xmlr{#1}{X}% - \or % G--- - \XMLbg - \or % GLR- - \XMLbg\xmlr{#1}{L}% - \or % -LR- - \xmlr{#1}{L}% - \fi} - -\def\remapXMLthree#1#2% - {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname - \or % GCPA - \XMLbg\xmlr{#1}{X}{#2}\XMLbg\XMLeg\XMLeg - \or % GCP- - \XMLbg\xmlr{#1}{X}{#2}\XMLeg - \or % GC-A - \XMLbg\xmlr{#1}{X}\XMLbg\XMLeg\XMLeg - \or % GC-- - \XMLbg\xmlr{#1}{X}\XMLeg - \or % -CPA - \xmlr{#1}{X}{#2}\XMLbg\XMLeg - \or % -CP- - \xmlr{#1}{X}{#2}% - \or % -C-A - \xmlr{#1}{X}\XMLbg\XMLeg - \or % -C-- - \xmlr{#1}{X}% - \or % G--- - \XMLbg\XMLeg - \fi} - -\scratchtoks\@EA{\string{} \edef\XMLbg{\the\scratchtoks} -\scratchtoks\@EA{\string}} \edef\XMLeg{\the\scratchtoks} - -\chardef\XMLremapGCPA = 1 % {\command {arg} { } } -\chardef\XMLremapGCP = 2 % {\command {arg} } % -\chardef\XMLremapGCA = 3 % {\command { } } -\chardef\XMLremapGC = 4 % {\command } % -\chardef\XMLremapCPA = 5 % \command {arg} { } -\chardef\XMLremapCP = 6 % \command {arg} % -\chardef\XMLremapCA = 7 % \command { } -\chardef\XMLremapC = 8 % \command % -\chardef\XMLremapG = 9 % { } -\chardef\XMLremapGLR = 10 % { \bcom \ecom } -\chardef\XMLremapLR = 11 % \bcom \ecom - -%D The remapping is controlled by only a few definition -%D macros, that both deal with elements. We distinguish -%D between normal and empty elements. -%D -%D \starttyping -%D \remapXMLsequence [name] [result map] \unexpandablecommand -%D \remapXMLsequence [name] [result map] \unexpandablecommand -%D \stoptyping -%D -%D The \MATHML\ module demonstrates how these can be used. -%D The element is converted into a sequence with one or more -%D of the following components. -%D -%D \starttyping -%D { \command {parameters} {argument} } -%D \stoptyping -%D -%D The following combinations are supported. -%D -%D \starttabulate[|c|c|c|c|c|] -%D \NC GCPA \NC grouped \NC command \NC parameters \NC argument \NC \NR -%D \NC GCP \NC grouped \NC command \NC parameters \NC \NC \NR -%D \NC GCA \NC grouped \NC command \NC \NC argument \NC \NR -%D \NC GC \NC grouped \NC command \NC \NC \NC \NR -%D \NC CPA \NC \NC command \NC parameters \NC argument \NC \NR -%D \NC CP \NC \NC command \NC parameters \NC \NC \NR -%D \NC CA \NC \NC command \NC \NC argument \NC \NR -%D \NC C \NC \NC command \NC \NC \NC \NR -%D \NC G \NC grouped \NC \NC \NC \NC \NR -%D \stoptabulate -%D -%D Empty elements (singular ones) never get an argument, -%D which makes sense, since they have at most parameters. - -\def\remapXMLsequence{\doquadrupleargument\doremapXML []} -\def\remapXMLsingular{\doquadrupleargument\doremapXML[/]} - -\def\doremapXML[#1][#2][#3][#4]% - {\iffourthargument - \def\next{\dodoremapXML[#2][#1][#3][#4]}% - \else - \def\next{\dodoremapXML[\@@XMLmapping][#1][#2][#3]}% - \fi - \next} - -%\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern -% {\doifinstringelse{LR}{#4} -% {\let\next\doremapXMLtwo} -% {\let\next\doremapXMLone}% -% \next[#1][#2][#3][#4]}% - -\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern - {\doifinstringelse{LR}{#4}\doremapXMLtwo\doremapXMLone[#1][#2][#3][#4]} - -\def\doremapXMLone[#1][#2][#3][#4]#5% - {\setvalue{\@@XML#1:#3#2:M}{#4}% - \setvalue{\@@XML#1:#3#2:X}{#5}} - -\def\doremapXMLtwo[#1][#2][#3][#4]#5#6% - {\setvalue{\@@XML#1:#3:M}{#4}% - \setvalue{\@@XML#1:#3:L}{#5}% - \setvalue{\@@XML#1:#3:R}{#6}} - -\let\dowithentity\empty - -%D We handle processing instructions and unknown elements with: - -\remapXMLsingular [procins] [CPA] \normalparseXMLprocess -\remapXMLsingular [\s!unknown] [CPA] \doXMLunknownSI -\remapXMLsequence [\s!unknown] [CPA] \doXMLunknownSE - -\def\doXMLunknownSI#1#2{{\tttf[#1 #2]}} -\def\doXMLunknownSE#1#2{{\tttf[#1 #2]}} - -%D In a similar way, we can remap entities. - -\def\remapXMLentity#1;#2% - {\doremapXMLentity{#1}#2}% - -\def\doremapXMLentity - {\xmlrent} - -% \unexpanded\def\xmlrent#1% -% {\getXMLentity{#1}} -% -% replaced by: - -\unexpanded\def\xmlrent#1% - {\doXMLentity#1;} - -%D The remapping is taken care of by the following macro, -%D which takes three arguments. -%D -%D \starttyping -%D \XMLremapdata{before}{after}{content} -%D \stoptyping -%D -%D After the remapping, the content is executed (expanded) -%D under the normal \TEX\ catcode regime. The intermediate -%D result can be traced by turning on the following switch. - -\newif\iftraceXMLremapping - -\newtoks \everyXMLremapping - -\appendtoks - \defineXMLentity[tex-hash]{\letterhash}% - \defineXMLentity[tex-bar]{\myspecialnormalvert}% -\to \everyXMLremapping - -\def\setnormalXMLentities% will change ! ! ! ! ! - {\defineXMLentity[tex-hash]\letterhash - \defineXMLentity[tex-dollar]\letterdollar - \defineXMLentity[tex-percent]\letterpercent - \defineXMLentity[tex-backslash]\letterbackslash - \defineXMLentity[tex-hat]\letterhat - \defineXMLentity[tex-underscore]\letterunderscore - \defineXMLentity[tex-leftbrace]\letterbgroup - \defineXMLentity[tex-rightbrace]\letteregroup - \defineXMLentity[tex-bar]\letterbar} - -\let\XMLremappedpar\empty - -%D Here we implement the second step in the element grabber. - -\long\def\XMLremapdata - {\dosingleempty\doXMLremapdata} - -\long\def\doXMLremapdata[#1]#2#3#4% - {\bgroup - \startXMLmapping[#1]% - % enable unknown elements (should be macro) - \doifsomething{#1} - {\doifdefinedelse{\@@XML#1:\s!unknown:M} - {\remapXMLunknowntrue}{\remapXMLunknownfalse}}% - % - \pushmacro\doXMLentity % needed ? - % this will change, proper split in element itself - \ifx\currentXMLnamespace\empty - \let\parseXMLelement\remapXMLelement - \else - % here we need to get rid of the namespace; we also - % have to preserve the leading / if present - \@EA\long\@EA\def\@EA\parseXMLelement\@EA - ##\@EA1\currentXMLnamespace:{\remapXMLelement##1}% - % ##2 removes leading spaces - \fi - % - \let\parseXMLescape \remapXMLescape - \let\parseXMLprocess\remapXMLprocess - % - \let\doXMLentity \remapXMLentity - % - \enableXML % sets entities - \enableXMLexpansion - \let\par\XMLremappedpar - \the\everyXMLremapping - %\ignorelines - \catcode\tabasciicode \spacecatcode - \catcode\endoflineasciicode\spacecatcode - \catcode\formfeedasciicode \spacecatcode - \catcode\endoffileasciicode\spacecatcode - \pushmacro\unicodechar - \let\unicodechar\relax - \xdef\remappedXMLdata{#4\empty}% - \popmacro\unicodechar - \let\par\endgraf - \popmacro\doXMLentity % needed ? - \disableXMLexpansion - \catcode`\{=\@@begingroup - \catcode`\}=\@@endgroup - \catcode`\\=\@@escape - \iftraceXMLremapping - \ifmmode\vbox\fi\bgroup - \defconvertedcommand\ascii\remappedXMLdata - \tttf\veryraggedright\ascii\par - \writestatus{xml-remap}{\ascii}% - \egroup - \fi - #2\scantokens\@EA{\remappedXMLdata\empty\empty}#3% - \stopXMLmapping - \egroup} - -% testcase: -% -% aap‒noot coördinatie – één -% -% \startXMLdata -% aap‒noot coördinatie – één -% aap‒noot coördinatie – één -% \stopXMLdata -% -% weird case: -% -% \chardef\XMLtokensreduction\zerocount -% \startXMLdata -% \"{a}\"{o}\"{u}\v{c}\v{s}\v{z} -% \stopXMLdata -% -% \chardef\XMLtokensreduction\plustwo -% \startXMLdata -% \"{a}\"{o}\"{u}\v{c}\v{s}\v{z} -% \stopXMLdata - -% rename to better names - -\newtoks \XMLRtoks -\newcount \nofXMLRchildren - -\def\naturalxmlr#1#2{\getvalue{\@@XML\@@XMLmapping:#1:#2}} - -\def\ignoreXMLRelement#1#2{} -\def\normalXMLRelement#1#2{#2} - -\let\nextXMLRelement \empty -\let\firstXMLRelement \empty -\let\secondXMLRelement\empty - -% \def\withnextXMLRelement#1% -% {\pushmacro\dowithnextXMLRelement -% \def\dowithnextXMLRelement##1##2##3##4##5% -% {\popmacro\dowithnextXMLRelement -% \def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}% -% #1}% -% \doifnextcharelse\empty\empty\dowithnextXMLRelement} -% -% better and faster: - -\def\dowithnextXMLRelement#1#2#3#4#5#6% - {\def\nextXMLRelement{#2{#3}{#4}{#5}{#6}}#1}% - -\def\withnextXMLRelement#1% - {\doifnextcharelse\empty\empty{\dowithnextXMLRelement{#1}}} - -\def\withnexttwoXMLRelements#1% - {\pushmacro\firstXMLRelement - \pushmacro\secondXMLRelement - \withnextXMLRelement - {\let\firstXMLRelement\nextXMLRelement - \withnextXMLRelement - {\let\secondXMLRelement\nextXMLRelement - #1% - \popmacro\secondXMLRelement - \popmacro\firstXMLRelement}}} - -\def\withnextthreeXMLRelements#1% korter, met two - {\pushmacro\firstXMLRelement - \pushmacro\secondXMLRelement - \pushmacro\thirdXMLRelement - \withnextXMLRelement - {\let\firstXMLRelement\nextXMLRelement - \withnextXMLRelement - {\let\secondXMLRelement\nextXMLRelement - \withnextXMLRelement - {\let\thirdXMLRelement\nextXMLRelement - #1% - \popmacro\thirdXMLRelement - \popmacro\secondXMLRelement - \popmacro\firstXMLRelement}}}} - -\def\doifXMLRchildelse#1#2#3#4% - {\pushmacro\xmlr - \def\next{#4}% - \def\xmlr##1##2##3##4% the / should be sorted out in the mapper - {\rawdoifinsetelse{##1}{#1} - {\def\next{#3}} - {\doif{##1}{#1/}{\def\next{#3}}}}% - #2\empty - \popmacro\xmlr - \next} - -\def\doifXMLRchild#1#2#3% - {\pushmacro\xmlr - \let\next\empty - \def\xmlr##1##2##3##4% the / should be sorted out in the mapper - {\rawdoifinsetelse{##1}{#1} - {\def\next{#3}} - {\doif{##1}{#1/}{\def\next{#3}}}}% - #2\empty - \popmacro\xmlr - \next} - -\def\encapsulateXMLRchild#1#2#3#4#5% - {\pushmacro\xmlr - \def\xmlr##1##2##3##4% - {\doifelse{##1}{#1} - {\def\next{\doencapsulateXMLRchild{#2}{#3}{#4}{##4}}} - {\let\next\empty}% - \next}% - #5\empty - \popmacro\xmlr} - -\def\encapsulateXMLRchildren#1#2#3#4#5% - {\pushmacro\xmlr - \pushmacro\betweenXMLRchild - \def\betweenXMLRchild{\def\betweenXMLRchild{#3}}% - \def\xmlr##1##2##3##4% - {\rawdoifinsetelse{##1}{#1} - {\pushmacro\xmlr - \let\xmlr\naturalxmlr - \betweenXMLRchild\xmlr{##1}{##2}{##3}{##4}% - \popmacro\xmlr} - {}}% - #2#5\empty#4% - \popmacro\betweenXMLRchild - \popmacro\xmlr} - -\def\doencapsulateXMLRchild#1#2#3#4% - {\pushmacro\xmlr - \pushmacro\betweenXMLRchild - \def\betweenXMLRchild{\def\betweenXMLRchild{#2}}% - \def\xmlr##1##2##3##4% - {\pushmacro\xmlr - \let\xmlr\naturalxmlr - \betweenXMLRchild\xmlr{##1}{##2}{##3}{##4}% - \popmacro\xmlr}% - #1#4\empty#3% - \popmacro\betweenXMLRchild - \popmacro\xmlr} - -\let\encapsulateXMLR\doencapsulateXMLRchild - -\def\withnextXMLRelementelse#1#2% - {\def\xdowithnextXMLRelement##1##2##3##4##5% - {\def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}#1}% - \def\xnowithnextXMLRelement% - {\let\nextXMLRelement\empty#2}% - \doifnextcharelse\xmlr\xdowithnextXMLRelement\xnowithnextXMLRelement} - -\def\encapsulatenextXMLRelements#1#2#3#4% oude bewaren - {\pushmacro\betweenXMLRchild - \pushmacro\afterXMLRchild - \def\betweenXMLRchild{#1\def\betweenXMLRchild{#2}}% - \let\afterXMLRchild\empty - \withnextXMLRelementelse - {\betweenXMLRchild - \def\afterXMLRchild{#3}% - \nextXMLRelement - \doifnextcharelse\empty\xnowithnextXMLRelement\xdowithnextXMLRelement} - {\afterXMLRchild - \popmacro\afterXMLRchild - \popmacro\betweenXMLRchild}% - #4} - -\def\collectXMLRchild#1#2% - {\XMLRtoks\emptytoks - \pushmacro\xmlr - \def\xmlr##1##2##3##4% - {\doif{##1}{#1}{\appendtoks##4\to\XMLRtoks}}% - #2\empty - \popmacro\xmlr} - -\def\doifelseXMLRneighbors#1#2% - {\XMLRtoks\emptytoks - \pushmacro\xmlr - \donefalse - \let\prevXMLRchild\empty - \def\xmlr##1##2##3##4% - {\doif{##1}{#1}{\doif{##1}\prevXMLRchild{\donetrue}}% - \def\prevXMLRchild{##1}}% - #2\empty - \popmacro\xmlr - \ifdone - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -\def\collectbetweenXMLRchild#1#2#3% - {\XMLRtoks\emptytoks - \pushmacro\xmlr - \pushmacro\betweenXMLRchild - \def\betweenXMLRchild{\def\betweenXMLRchild{\appendtoks#2\to\XMLRtoks}}% - \def\xmlr##1##2##3##4% - {\rawdoifinsetelse{##1}{#1} - {\betweenXMLRchild\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}{}}% - #3\empty - \popmacro\betweenXMLRchild - \popmacro\xmlr} - -\def\dorawcollectbetweenXMLR#1#2% - {\pushmacro\xmlr - \pushmacro\betweenXMLRchild - \def\betweenXMLRchild{\def\betweenXMLRchild{#1}}% - \def\xmlr##1##2##3##4% - {\betweenXMLRchild\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}% - #2\empty - \popmacro\betweenXMLRchild - \popmacro\xmlr} - -\def\rawcollectbetweenXMLR% - {\XMLRtoks\emptytoks\dorawcollectbetweenXMLR} - -\def\docollectbetweenXMLR#1% - {\dorawcollectbetweenXMLR{\appendtoks#1\to\XMLRtoks}} - -\def\collectbetweenXMLR% - {\XMLRtoks\emptytoks\docollectbetweenXMLR} - -\def\processXMLRchildren#1% - {\pushmacro\xmlr - \let\xmlr\naturalxmlr - #1\empty - \popmacro\xmlr} - -\def\processXMLRchild#1#2% slow but more versatile - {\pushmacro\xmlr - \XMLRtoks\emptytoks - \def\xmlr##1##2##3##4% - {\rawdoifinsetelse{##1}{#1} - {\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}{}}% - #2% - \popmacro\xmlr - \the\XMLRtoks\empty} - -\def\countXMLRchildren#1% - {\pushmacro\xmlr - \nofXMLRchildren=0 - \def\xmlr##1##2##3##4{\advance\nofXMLRchildren\plusone} - #1\empty - \popmacro\xmlr} - -\def\countXMLRchild#1#2% - {\pushmacro\xmlr - \nofXMLRchildren=0 - \def\xmlr##1##2##3##4% - {\rawdoifinsetelse{##1}{#1}{\advance\nofXMLRchildren\plusone}{}} - #2\empty - \popmacro\xmlr} - -\def\installXMLunknownremapping - {\remapXMLsingular[\s!unknown][CPA]\doXMLunknownSI - \remapXMLsequence[\s!unknown][CPA]\doXMLunknownSE} - -\bgroup \catcode`<=\active - -\gdef\revertXMLremapping - {\gdef\doXMLunknownSE##1##2{<##1>##2}% - \gdef\doXMLunknownSI##1##2{<##1>}} - -\gdef\unmapXMLdata#1#2% todo: singular, evt ##2 space ervoor en ##1##2 - {\bgroup - \revertXMLremapping - \expandXMLremapping % now we can roll back - \setnormalXMLhandler % using the normal parser - \resetXMLmapping % and leaving the mapping namespace - \xdef\unmappedXMLdata{#2}% recreate the original - \enableXMLelements % enable normal handler - \unmappedXMLdata % off we go ... - \egroup} - -\egroup - -\protect \endinput diff --git a/tex/context/base/xtag-mea.mkii b/tex/context/base/xtag-mea.mkii new file mode 100644 index 000000000..d56d6c54b --- /dev/null +++ b/tex/context/base/xtag-mea.mkii @@ -0,0 +1,152 @@ +% filtered from html files by Patrick Ion +% +% ISOAMSA Characters Extended +% +% Added Math Symbols: Arrow Relations + +\defineMMLentity angzarr E248 {unknown} angle with down zig-zag arrow +\defineMMLentity cirmid E250 {unknown} circle, mid below +\defineMMLentity cudarrl E23E {unknown} left, curved, down arrow +\defineMMLentity cudarrr E400 {unknown} right, curved, down arrow +\defineMMLentity cularr 21B6 {unknown} left curved arrow +\defineMMLentity cularrp E24A {unknown} curved left arrow with plus +\defineMMLentity curarr 21B7 {unknown} right curved arrow +\defineMMLentity curarrm E249 {unknown} curved right arrow with minus +\defineMMLentity Darr 21A1 {unknown} down two-headed arrow +\defineMMLentity dArr 21D3 {\Downarrow} down double arrow +\defineMMLentity ddarr 21CA {unknown} two down arrows +\defineMMLentity DDotrahd E238 {unknown} right arrow with dotted stem +\defineMMLentity dfisht E24C {unknown} down fish tail +\defineMMLentity dHar E227 {unknown} down harpoon-left, down harpoon-right +\defineMMLentity dharl 21C3 {unknown} down harpoon-left +\defineMMLentity dharr 21C2 {unknown} down harpoon-rt +\defineMMLentity duarr E216 {unknown} down arrow, up arrow +\defineMMLentity duhar E217 {unknown} down harp, up harp +\defineMMLentity dzigrarr 21DD {unknown} right long zig-zag arrow +\defineMMLentity erarr E236 {unknown} equal, right arrow below +\defineMMLentity hArr 21D4 {\Leftrightarrow} left and right double arrow +\defineMMLentity harr 2194 {\leftrightarrow} left and right arrow +\defineMMLentity harrcir E240 {unknown} left and right arrow with a circle +\defineMMLentity harrw 21AD {unknown} left and right arr-wavy +\defineMMLentity hoarr E243 {unknown} horizontal open arrow +\defineMMLentity imof 22B7 {unknown} image of +\defineMMLentity lAarr 21DA {unknown} left triple arrow +\defineMMLentity Larr 219E {unknown} twoheadleftarrow +\defineMMLentity larrbfs E220 {unknown} left arrow-bar, filled square +\defineMMLentity larrfs E222 {unknown} left arrow, filled square +\defineMMLentity larrhk 21A9 {unknown} left arrow-hooked +\defineMMLentity larrlp 21AB {unknown} left arrow-looped +\defineMMLentity larrpl E23F {unknown} left arrow, plus +\defineMMLentity larrsim E24E {unknown} left arrow, similar +\defineMMLentity larrtl 21A2 {unknown} left arrow-tailed +\defineMMLentity lAtail E23D {unknown} left double arrow-tail +\defineMMLentity latail E23C {unknown} left arrow-tail +\defineMMLentity lBarr E206 {unknown} left doubly broken arrow +\defineMMLentity lbarr E402 {unknown} left broken arrow +\defineMMLentity ldca E21A {unknown} left down curved arrow +\defineMMLentity ldrdhar E22C {unknown} left harpoon-down over right harpoon-down +\defineMMLentity ldrushar E228 {unknown} left-down-right-up harpoon +\defineMMLentity ldsh 21B2 {unknown} left down angled arrow +\defineMMLentity lfisht E214 {unknown} left fish tail +\defineMMLentity lHar E225 {unknown} left harpoon-up over left harpoon-down +\defineMMLentity lhard 21BD {\leftharpoondown} left harpoon-down +\defineMMLentity lharu 21BC {\leftharpoonup} left harpoon-up +\defineMMLentity lharul E22E {unknown} left harpoon-up over long dash +\defineMMLentity llarr 21C7 {unknown} two left arrows +\defineMMLentity llhard E231 {unknown} left harpoon-down below long dash +\defineMMLentity loarr E242 {unknown} left open arrow +\defineMMLentity lrarr 21C6 {unknown} left arr over right arr +\defineMMLentity lrhar 21CB {unknown} left harp over r +\defineMMLentity lrhard E22F {unknown} right harpoon-down below long dash +\defineMMLentity lsh 21B0 {\Lsh} Lsh +\defineMMLentity lurdshar E229 {unknown} left-up-right-down harpoon +\defineMMLentity luruhar E22B {unknown} left harpoon-up over right harpoon-up +\defineMMLentity Map E212 {unknown} twoheaded mapsto +\defineMMLentity map 21A6 {\mapsto} mapsto +\defineMMLentity midcir E20F {unknown} mid, circle below +\defineMMLentity mumap 22B8 {unknown} multimap +\defineMMLentity nearhk E20D {unknown} NE arrow-hooked +\defineMMLentity neArr 21D7 {unknown} NE pointing double arrow +\defineMMLentity nearr 2197 {\nearrow} NE pointing arrow +\defineMMLentity nesear E20E {unknown} NE \& SE arrows +\defineMMLentity nhArr 21CE {unknown} not left and right double arr +\defineMMLentity nharr 21AE {unknown} not left and right arrow +\defineMMLentity nlArr 21CD {unknown} not implied by +\defineMMLentity nlarr 219A {unknown} not left arrow +\defineMMLentity nrArr 21CF {unknown} not implies +\defineMMLentity nrarr 219B {unknown} not right arrow +\defineMMLentity nrarrc E21D {unknown} not right arrow-curved +\defineMMLentity nrarrw E21B {unknown} not right arrow-wavy +\defineMMLentity nvhArr* 21CE {unknown} not, vert, left and right double arrow +\defineMMLentity nvlArr 21CD {unknown} not, vert, left double arrow +\defineMMLentity nvrArr 21CF {unknown} not, vert, right double arrow +\defineMMLentity nwarhk E20C {unknown} NW arrow-hooked +\defineMMLentity nwArr 21D6 {unknown} NW pointing double arrow +\defineMMLentity nwarr 2196 {\nwarrow} NW pointing arrow +\defineMMLentity nwnear E211 {unknown} NW \& NE arrows +\defineMMLentity olarr 21BA {unknown} left arr in circle +\defineMMLentity orarr 21BB {unknown} right arr in circle +\defineMMLentity origof 22B6 {unknown} original of +\defineMMLentity rAarr 21DB {unknown} right triple arrow +\defineMMLentity Rarr 21A0 {unknown} twoheadrightarrow +\defineMMLentity rarrap E235 {unknown} approximate, right arrow above +\defineMMLentity rarrbfs E221 {unknown} right arrow-bar, filled square +\defineMMLentity rarrc E21C {unknown} right arrow-curved +\defineMMLentity rarrfs E223 {unknown} right arrow, filled square +\defineMMLentity rarrhk 21AA {\hookrightarrow} right arrow-hooked +\defineMMLentity rarrlp 21AC {unknown} right arrow-looped +\defineMMLentity rarrpl E21E {unknown} right arrow, plus +\defineMMLentity rarrsim E24D {unknown} right arrow, similar +\defineMMLentity Rarrtl E239 {unknown} right two-headed arrow with tail +\defineMMLentity rarrtl 21A3 {unknown} right arrow-tailed +\defineMMLentity rarrw 219D {unknown} right arrow-wavy +\defineMMLentity rAtail E23B {unknown} right double arrow-tail +\defineMMLentity ratail 21A3 {unknown} right arrow-tail +\defineMMLentity RBarr E209 {unknown} twoheaded right broken arrow +\defineMMLentity rBarr E207 {unknown} right doubly broken arrow +\defineMMLentity rbarr E405 {unknown} right broken arrow +\defineMMLentity rdca E219 {unknown} right down curved arrow +\defineMMLentity rdldhar E22D {unknown} right harpoon-down over left harpoon-down +\defineMMLentity rdsh 21B3 {unknown} right down angled arrow +\defineMMLentity rfisht E215 {unknown} right fish tail +\defineMMLentity rHar E224 {unknown} right harpoon-up over right harpoon-down +\defineMMLentity rhard 21C1 {\rightharpoondown} right harpoon-down +\defineMMLentity rharu 21C0 {\rightharpoonup} right harpoon-up +\defineMMLentity rharul E230 {unknown} right harpoon-up over long dash +\defineMMLentity rlarr 21C4 {unknown} right arr over left arr +\defineMMLentity rlhar 21CC {unknown} right harp over l +\defineMMLentity roarr E241 {unknown} right open arrow +\defineMMLentity rrarr 21C9 {unknown} two right arrows +\defineMMLentity rsh 21B1 {\Rsh} Rsh +\defineMMLentity ruluhar E22A {unknown} right harpoon-up over left harpoon-up +\defineMMLentity searhk E20B {unknown} SE arrow-hooked +\defineMMLentity seArr 21D8 {unknown} SE pointing double arrow +\defineMMLentity searr 2198 {\searrow} SE pointing arrow +\defineMMLentity seswar E406 {unknown} SE \& SW arrows +\defineMMLentity simrarr E234 {unknown} similar, right arrow below +\defineMMLentity slarr E233 {unknown} short left arrow +\defineMMLentity srarr E232 {unknown} short right arrow +\defineMMLentity swarhk E20A {unknown} SW arrow-hooked +\defineMMLentity swArr 21D9 {unknown} SW pointing double arrow +\defineMMLentity swarr 2199 {\swarrow} SW pointing arrow +\defineMMLentity swnwar E210 {unknown} SW \& NW arrows +\defineMMLentity Uarr 219F {unknown} up two-headed arrow +\defineMMLentity uArr 21D1 {\Uparrow} up double arrow +\defineMMLentity Uarrocir E237 {unknown} up two-headed arrow above circle +\defineMMLentity udarr 21C5 {unknown} up arrow, down arrow +\defineMMLentity udhar E218 {unknown} up harp, down harp +\defineMMLentity ufisht E24B {unknown} up fish tail +\defineMMLentity uHar E226 {unknown} up harpoon-left, up harpoon-right +\defineMMLentity uharl 21BF {unknown} up harpoon-left +\defineMMLentity uharr 21BE {unknown} up harp-r +\defineMMLentity uuarr 21C8 {unknown} two up arrows +\defineMMLentity vArr 21D5 {\Updownarrow} up \& down double arrow +\defineMMLentity varr 2195 {\updownarrow} up \& down arrow +\defineMMLentity xhArr E202 {unknown} long left and right double arr +\defineMMLentity xharr E203 {unknown} long left and right arr +\defineMMLentity xlArr E200 {unknown} long left double arrow +\defineMMLentity xlarr E201 {unknown} long left arrow +\defineMMLentity xmap E208 {unknown} longmapsto +\defineMMLentity xrArr E204 {unknown} long right double arr +\defineMMLentity xrarr E205 {unknown} long right arrow +\defineMMLentity zigrarr E244 {unknown} right zig-zag arrow diff --git a/tex/context/base/xtag-mea.tex b/tex/context/base/xtag-mea.tex deleted file mode 100644 index d56d6c54b..000000000 --- a/tex/context/base/xtag-mea.tex +++ /dev/null @@ -1,152 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOAMSA Characters Extended -% -% Added Math Symbols: Arrow Relations - -\defineMMLentity angzarr E248 {unknown} angle with down zig-zag arrow -\defineMMLentity cirmid E250 {unknown} circle, mid below -\defineMMLentity cudarrl E23E {unknown} left, curved, down arrow -\defineMMLentity cudarrr E400 {unknown} right, curved, down arrow -\defineMMLentity cularr 21B6 {unknown} left curved arrow -\defineMMLentity cularrp E24A {unknown} curved left arrow with plus -\defineMMLentity curarr 21B7 {unknown} right curved arrow -\defineMMLentity curarrm E249 {unknown} curved right arrow with minus -\defineMMLentity Darr 21A1 {unknown} down two-headed arrow -\defineMMLentity dArr 21D3 {\Downarrow} down double arrow -\defineMMLentity ddarr 21CA {unknown} two down arrows -\defineMMLentity DDotrahd E238 {unknown} right arrow with dotted stem -\defineMMLentity dfisht E24C {unknown} down fish tail -\defineMMLentity dHar E227 {unknown} down harpoon-left, down harpoon-right -\defineMMLentity dharl 21C3 {unknown} down harpoon-left -\defineMMLentity dharr 21C2 {unknown} down harpoon-rt -\defineMMLentity duarr E216 {unknown} down arrow, up arrow -\defineMMLentity duhar E217 {unknown} down harp, up harp -\defineMMLentity dzigrarr 21DD {unknown} right long zig-zag arrow -\defineMMLentity erarr E236 {unknown} equal, right arrow below -\defineMMLentity hArr 21D4 {\Leftrightarrow} left and right double arrow -\defineMMLentity harr 2194 {\leftrightarrow} left and right arrow -\defineMMLentity harrcir E240 {unknown} left and right arrow with a circle -\defineMMLentity harrw 21AD {unknown} left and right arr-wavy -\defineMMLentity hoarr E243 {unknown} horizontal open arrow -\defineMMLentity imof 22B7 {unknown} image of -\defineMMLentity lAarr 21DA {unknown} left triple arrow -\defineMMLentity Larr 219E {unknown} twoheadleftarrow -\defineMMLentity larrbfs E220 {unknown} left arrow-bar, filled square -\defineMMLentity larrfs E222 {unknown} left arrow, filled square -\defineMMLentity larrhk 21A9 {unknown} left arrow-hooked -\defineMMLentity larrlp 21AB {unknown} left arrow-looped -\defineMMLentity larrpl E23F {unknown} left arrow, plus -\defineMMLentity larrsim E24E {unknown} left arrow, similar -\defineMMLentity larrtl 21A2 {unknown} left arrow-tailed -\defineMMLentity lAtail E23D {unknown} left double arrow-tail -\defineMMLentity latail E23C {unknown} left arrow-tail -\defineMMLentity lBarr E206 {unknown} left doubly broken arrow -\defineMMLentity lbarr E402 {unknown} left broken arrow -\defineMMLentity ldca E21A {unknown} left down curved arrow -\defineMMLentity ldrdhar E22C {unknown} left harpoon-down over right harpoon-down -\defineMMLentity ldrushar E228 {unknown} left-down-right-up harpoon -\defineMMLentity ldsh 21B2 {unknown} left down angled arrow -\defineMMLentity lfisht E214 {unknown} left fish tail -\defineMMLentity lHar E225 {unknown} left harpoon-up over left harpoon-down -\defineMMLentity lhard 21BD {\leftharpoondown} left harpoon-down -\defineMMLentity lharu 21BC {\leftharpoonup} left harpoon-up -\defineMMLentity lharul E22E {unknown} left harpoon-up over long dash -\defineMMLentity llarr 21C7 {unknown} two left arrows -\defineMMLentity llhard E231 {unknown} left harpoon-down below long dash -\defineMMLentity loarr E242 {unknown} left open arrow -\defineMMLentity lrarr 21C6 {unknown} left arr over right arr -\defineMMLentity lrhar 21CB {unknown} left harp over r -\defineMMLentity lrhard E22F {unknown} right harpoon-down below long dash -\defineMMLentity lsh 21B0 {\Lsh} Lsh -\defineMMLentity lurdshar E229 {unknown} left-up-right-down harpoon -\defineMMLentity luruhar E22B {unknown} left harpoon-up over right harpoon-up -\defineMMLentity Map E212 {unknown} twoheaded mapsto -\defineMMLentity map 21A6 {\mapsto} mapsto -\defineMMLentity midcir E20F {unknown} mid, circle below -\defineMMLentity mumap 22B8 {unknown} multimap -\defineMMLentity nearhk E20D {unknown} NE arrow-hooked -\defineMMLentity neArr 21D7 {unknown} NE pointing double arrow -\defineMMLentity nearr 2197 {\nearrow} NE pointing arrow -\defineMMLentity nesear E20E {unknown} NE \& SE arrows -\defineMMLentity nhArr 21CE {unknown} not left and right double arr -\defineMMLentity nharr 21AE {unknown} not left and right arrow -\defineMMLentity nlArr 21CD {unknown} not implied by -\defineMMLentity nlarr 219A {unknown} not left arrow -\defineMMLentity nrArr 21CF {unknown} not implies -\defineMMLentity nrarr 219B {unknown} not right arrow -\defineMMLentity nrarrc E21D {unknown} not right arrow-curved -\defineMMLentity nrarrw E21B {unknown} not right arrow-wavy -\defineMMLentity nvhArr* 21CE {unknown} not, vert, left and right double arrow -\defineMMLentity nvlArr 21CD {unknown} not, vert, left double arrow -\defineMMLentity nvrArr 21CF {unknown} not, vert, right double arrow -\defineMMLentity nwarhk E20C {unknown} NW arrow-hooked -\defineMMLentity nwArr 21D6 {unknown} NW pointing double arrow -\defineMMLentity nwarr 2196 {\nwarrow} NW pointing arrow -\defineMMLentity nwnear E211 {unknown} NW \& NE arrows -\defineMMLentity olarr 21BA {unknown} left arr in circle -\defineMMLentity orarr 21BB {unknown} right arr in circle -\defineMMLentity origof 22B6 {unknown} original of -\defineMMLentity rAarr 21DB {unknown} right triple arrow -\defineMMLentity Rarr 21A0 {unknown} twoheadrightarrow -\defineMMLentity rarrap E235 {unknown} approximate, right arrow above -\defineMMLentity rarrbfs E221 {unknown} right arrow-bar, filled square -\defineMMLentity rarrc E21C {unknown} right arrow-curved -\defineMMLentity rarrfs E223 {unknown} right arrow, filled square -\defineMMLentity rarrhk 21AA {\hookrightarrow} right arrow-hooked -\defineMMLentity rarrlp 21AC {unknown} right arrow-looped -\defineMMLentity rarrpl E21E {unknown} right arrow, plus -\defineMMLentity rarrsim E24D {unknown} right arrow, similar -\defineMMLentity Rarrtl E239 {unknown} right two-headed arrow with tail -\defineMMLentity rarrtl 21A3 {unknown} right arrow-tailed -\defineMMLentity rarrw 219D {unknown} right arrow-wavy -\defineMMLentity rAtail E23B {unknown} right double arrow-tail -\defineMMLentity ratail 21A3 {unknown} right arrow-tail -\defineMMLentity RBarr E209 {unknown} twoheaded right broken arrow -\defineMMLentity rBarr E207 {unknown} right doubly broken arrow -\defineMMLentity rbarr E405 {unknown} right broken arrow -\defineMMLentity rdca E219 {unknown} right down curved arrow -\defineMMLentity rdldhar E22D {unknown} right harpoon-down over left harpoon-down -\defineMMLentity rdsh 21B3 {unknown} right down angled arrow -\defineMMLentity rfisht E215 {unknown} right fish tail -\defineMMLentity rHar E224 {unknown} right harpoon-up over right harpoon-down -\defineMMLentity rhard 21C1 {\rightharpoondown} right harpoon-down -\defineMMLentity rharu 21C0 {\rightharpoonup} right harpoon-up -\defineMMLentity rharul E230 {unknown} right harpoon-up over long dash -\defineMMLentity rlarr 21C4 {unknown} right arr over left arr -\defineMMLentity rlhar 21CC {unknown} right harp over l -\defineMMLentity roarr E241 {unknown} right open arrow -\defineMMLentity rrarr 21C9 {unknown} two right arrows -\defineMMLentity rsh 21B1 {\Rsh} Rsh -\defineMMLentity ruluhar E22A {unknown} right harpoon-up over left harpoon-up -\defineMMLentity searhk E20B {unknown} SE arrow-hooked -\defineMMLentity seArr 21D8 {unknown} SE pointing double arrow -\defineMMLentity searr 2198 {\searrow} SE pointing arrow -\defineMMLentity seswar E406 {unknown} SE \& SW arrows -\defineMMLentity simrarr E234 {unknown} similar, right arrow below -\defineMMLentity slarr E233 {unknown} short left arrow -\defineMMLentity srarr E232 {unknown} short right arrow -\defineMMLentity swarhk E20A {unknown} SW arrow-hooked -\defineMMLentity swArr 21D9 {unknown} SW pointing double arrow -\defineMMLentity swarr 2199 {\swarrow} SW pointing arrow -\defineMMLentity swnwar E210 {unknown} SW \& NW arrows -\defineMMLentity Uarr 219F {unknown} up two-headed arrow -\defineMMLentity uArr 21D1 {\Uparrow} up double arrow -\defineMMLentity Uarrocir E237 {unknown} up two-headed arrow above circle -\defineMMLentity udarr 21C5 {unknown} up arrow, down arrow -\defineMMLentity udhar E218 {unknown} up harp, down harp -\defineMMLentity ufisht E24B {unknown} up fish tail -\defineMMLentity uHar E226 {unknown} up harpoon-left, up harpoon-right -\defineMMLentity uharl 21BF {unknown} up harpoon-left -\defineMMLentity uharr 21BE {unknown} up harp-r -\defineMMLentity uuarr 21C8 {unknown} two up arrows -\defineMMLentity vArr 21D5 {\Updownarrow} up \& down double arrow -\defineMMLentity varr 2195 {\updownarrow} up \& down arrow -\defineMMLentity xhArr E202 {unknown} long left and right double arr -\defineMMLentity xharr E203 {unknown} long left and right arr -\defineMMLentity xlArr E200 {unknown} long left double arrow -\defineMMLentity xlarr E201 {unknown} long left arrow -\defineMMLentity xmap E208 {unknown} longmapsto -\defineMMLentity xrArr E204 {unknown} long right double arr -\defineMMLentity xrarr E205 {unknown} long right arrow -\defineMMLentity zigrarr E244 {unknown} right zig-zag arrow diff --git a/tex/context/base/xtag-meb.mkii b/tex/context/base/xtag-meb.mkii new file mode 100644 index 000000000..ba370cadf --- /dev/null +++ b/tex/context/base/xtag-meb.mkii @@ -0,0 +1,124 @@ +% filtered from html files by Patrick Ion +% +% ISOAMSB Characters Extended +% +% Added Math Symbols: Binary Operators + +\defineMMLentity ac E207 {unknown} most positive +\defineMMLentity acE E290 {unknown} most positive, two lines below +\defineMMLentity amalg E251 {\amalg} amalgamation or coproduct +\defineMMLentity barvee 22BD {unknown} bar, vee +\defineMMLentity Barwed 2306 {unknown} logical and, double bar above +\defineMMLentity barwed 22BC {unknown} logical and, bar above +\defineMMLentity bsolb E280 {unknown} reverse solidus in square +\defineMMLentity Cap 22D2 {unknown} double intersection +\defineMMLentity capand E281 {unknown} intersection, and +\defineMMLentity capbrcup E271 {unknown} intersection, bar, union +\defineMMLentity capcap E273 {unknown} intersection, intersection, joined +\defineMMLentity capcup E26F {unknown} intersection above union +\defineMMLentity capdot E261 {unknown} intersection, with dot +\defineMMLentity caps E275 {unknown} intersection, serifs +\defineMMLentity ccaps E279 {unknown} closed intersection, serifs +\defineMMLentity ccups E278 {unknown} closed union, serifs +\defineMMLentity ccupssm E27A {unknown} closed union, serifs, smash product +\defineMMLentity coprod 2210 {\coprod} coproduct operator +\defineMMLentity Cup 22D3 {unknown} double union +\defineMMLentity cupbrcap E270 {unknown} union, bar, intersection +\defineMMLentity cupcap E26E {unknown} union above intersection +\defineMMLentity cupcup E272 {unknown} union, union, joined +\defineMMLentity cupdot 228D {unknown} union, with dot +\defineMMLentity cupor E282 {unknown} union, or +\defineMMLentity cups E274 {unknown} union, serifs +\defineMMLentity cuvee 22CE {unknown} curly logical or +\defineMMLentity cuwed 22CF {unknown} curly logical and +\defineMMLentity Dagger 2021 {\ddagger} double dagger relation +\defineMMLentity dagger 2020 {\dagger} dagger relation +\defineMMLentity diam 22C4 {unknown} open diamond +\defineMMLentity divonx 22C7 {unknown} division on times +\defineMMLentity eplus E268 {unknown} equal, plus +\defineMMLentity hercon 22B9 {unknown} hermitian conjugate matrix +\defineMMLentity intcal 22BA {\intercal} intercal +\defineMMLentity iprod E259 {unknown} interior product +\defineMMLentity loplus E25C {unknown} plus sign in left half circle +\defineMMLentity lotimes E25E {unknown} multiply sign in left half circle +\defineMMLentity lthree 22CB {unknown} leftthreetimes +\defineMMLentity ltimes 22C9 {unknown} times sign, left closed +\defineMMLentity midast 2217 {\ast} centered asterisk +\defineMMLentity minusb 229F {unknown} minus sign in box +\defineMMLentity minusd 2238 {unknown} minus sign, dot above +\defineMMLentity minusdu E25B {unknown} minus sign, dot below +\defineMMLentity ncap E284 {unknown} bar, intersection +\defineMMLentity ncup E283 {unknown} bar, union +\defineMMLentity oast 229B {unknown} asterisk in circle +\defineMMLentity ocir 229A {unknown} small circle in circle +\defineMMLentity odash 229D {unknown} hyphen in circle +\defineMMLentity odiv E285 {unknown} divide in circle +\defineMMLentity odot 2299 {\odot} middle dot in circle +\defineMMLentity odsold E286 {unknown} dot, solidus, dot in circle +\defineMMLentity ofcir E287 {unknown} filled circle in circle +\defineMMLentity ogt E289 {unknown} greater-than in circle +\defineMMLentity ohbar E260 {unknown} circle with horizontal bar +\defineMMLentity olcir E409 {unknown} large circle in circle +\defineMMLentity olt E288 {unknown} less-than in circle +\defineMMLentity omid E40A {unknown} vertical bar in circle +\defineMMLentity ominus 2296 {\ominus} minus sign in circle +\defineMMLentity opar E28A {unknown} parallel in circle +\defineMMLentity operp E28B {unknown} perpendicular in circle +\defineMMLentity oplus 2295 {\oplus} plus sign in circle +\defineMMLentity osol 2298 {unknown} solidus in circle +\defineMMLentity Otimes E28C {unknown} multiply sign in double circle +\defineMMLentity otimes 2297 {\otimes} multiply sign in circle +\defineMMLentity otimesas E28D {unknown} multiply sign in circle, circumflex accent +\defineMMLentity ovbar E40B {unknown} circle with vertical bar +\defineMMLentity plusacir E26A {unknown} plus, circumflex accent above +\defineMMLentity plusb 229E {unknown} plus sign in box +\defineMMLentity pluscir E266 {unknown} plus, small circle above +\defineMMLentity plusdo 2214 {unknown} plus sign, dot above +\defineMMLentity plusdu E25A {unknown} plus sign, dot below +\defineMMLentity pluse E267 {unknown} plus, equals +\defineMMLentity plussim E26C {unknown} plus, similar below +\defineMMLentity plustwo E269 {unknown} plus, two; Nim-addition +\defineMMLentity race E40C {unknown} reverse most positive, line below +\defineMMLentity roplus E25D {unknown} plus sign in right half circle +\defineMMLentity rotimes E40D {unknown} multiply sign in right half circle +\defineMMLentity rthree 22CC {unknown} rightthreetimes +\defineMMLentity rtimes 22CA {unknown} times sign, right closed +\defineMMLentity sdot 22C5 {\cdot} small middle dot +\defineMMLentity sdotb 22A1 {unknown} small dot in box +\defineMMLentity setmn 2216 {unknown} reverse solidus +\defineMMLentity simplus E26B {unknown} plus, similar above +\defineMMLentity smashp E264 {unknown} smash product +\defineMMLentity solb E27F {unknown} solidus in square +\defineMMLentity sqcap 2293 {\sqcap} square intersection +\defineMMLentity sqcaps E277 {unknown} square intersection, serifs +\defineMMLentity sqcup 2294 {\sqcup} square union +\defineMMLentity sqcups E276 {unknown} square union, serifs +\defineMMLentity ssetmn E844 {unknown} sm reverse solidus +\defineMMLentity sstarf 22C6 {\star} small star, filled, low +\defineMMLentity subdot E262 {unknown} subset, with dot +\defineMMLentity sum 2211 {\sum} summation operator +\defineMMLentity supdot E263 {unknown} superset, with dot +\defineMMLentity timesb 22A0 {unknown} multiply sign in box +\defineMMLentity timesbar E28E {unknown} multiply sign, bar below +\defineMMLentity timesd E26D {unknown} times, dot +\defineMMLentity tridot 25EC {unknown} dot in triangle +\defineMMLentity triminus E27C {unknown} minus in triangle +\defineMMLentity triplus E27B {unknown} plus in triangle +\defineMMLentity trisb E27E {unknown} triangle, serifs at bottom +\defineMMLentity tritime E27D {unknown} multiply in triangle +\defineMMLentity uplus 228E {\uplus} plus sign in union +\defineMMLentity veebar 22BB {unknown} logical or, bar below +\defineMMLentity wedbar E265 {unknown} wedge, bar below +\defineMMLentity wreath 2240 {unknown} wreath product +\defineMMLentity xcap 22C2 {\bigcap} intersection operator +\defineMMLentity xcirc 25CB {\bigcirc} large circle +\defineMMLentity xcup 22C3 {\bigcup} union operator +\defineMMLentity xdtri 25BD {\bigtriangledown} big down triangle, open +\defineMMLentity xodot 2299 {\bigodot} circle dot operator +\defineMMLentity xoplus 2295 {\bigoplus} circle plus operator +\defineMMLentity xotime 2297 {\bigotimes} circle times operator +\defineMMLentity xsqcup 2294 {\bigsqcup} square union operator +\defineMMLentity xuplus 228E {\biguplus} biguplus +\defineMMLentity xutri 25B3 {\bigtriangleup} big up triangle, open +\defineMMLentity xvee 22C1 {\bigvee} logical and operator +\defineMMLentity xwedge 22C0 {\bigwedge} logical or operator diff --git a/tex/context/base/xtag-meb.tex b/tex/context/base/xtag-meb.tex deleted file mode 100644 index ba370cadf..000000000 --- a/tex/context/base/xtag-meb.tex +++ /dev/null @@ -1,124 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOAMSB Characters Extended -% -% Added Math Symbols: Binary Operators - -\defineMMLentity ac E207 {unknown} most positive -\defineMMLentity acE E290 {unknown} most positive, two lines below -\defineMMLentity amalg E251 {\amalg} amalgamation or coproduct -\defineMMLentity barvee 22BD {unknown} bar, vee -\defineMMLentity Barwed 2306 {unknown} logical and, double bar above -\defineMMLentity barwed 22BC {unknown} logical and, bar above -\defineMMLentity bsolb E280 {unknown} reverse solidus in square -\defineMMLentity Cap 22D2 {unknown} double intersection -\defineMMLentity capand E281 {unknown} intersection, and -\defineMMLentity capbrcup E271 {unknown} intersection, bar, union -\defineMMLentity capcap E273 {unknown} intersection, intersection, joined -\defineMMLentity capcup E26F {unknown} intersection above union -\defineMMLentity capdot E261 {unknown} intersection, with dot -\defineMMLentity caps E275 {unknown} intersection, serifs -\defineMMLentity ccaps E279 {unknown} closed intersection, serifs -\defineMMLentity ccups E278 {unknown} closed union, serifs -\defineMMLentity ccupssm E27A {unknown} closed union, serifs, smash product -\defineMMLentity coprod 2210 {\coprod} coproduct operator -\defineMMLentity Cup 22D3 {unknown} double union -\defineMMLentity cupbrcap E270 {unknown} union, bar, intersection -\defineMMLentity cupcap E26E {unknown} union above intersection -\defineMMLentity cupcup E272 {unknown} union, union, joined -\defineMMLentity cupdot 228D {unknown} union, with dot -\defineMMLentity cupor E282 {unknown} union, or -\defineMMLentity cups E274 {unknown} union, serifs -\defineMMLentity cuvee 22CE {unknown} curly logical or -\defineMMLentity cuwed 22CF {unknown} curly logical and -\defineMMLentity Dagger 2021 {\ddagger} double dagger relation -\defineMMLentity dagger 2020 {\dagger} dagger relation -\defineMMLentity diam 22C4 {unknown} open diamond -\defineMMLentity divonx 22C7 {unknown} division on times -\defineMMLentity eplus E268 {unknown} equal, plus -\defineMMLentity hercon 22B9 {unknown} hermitian conjugate matrix -\defineMMLentity intcal 22BA {\intercal} intercal -\defineMMLentity iprod E259 {unknown} interior product -\defineMMLentity loplus E25C {unknown} plus sign in left half circle -\defineMMLentity lotimes E25E {unknown} multiply sign in left half circle -\defineMMLentity lthree 22CB {unknown} leftthreetimes -\defineMMLentity ltimes 22C9 {unknown} times sign, left closed -\defineMMLentity midast 2217 {\ast} centered asterisk -\defineMMLentity minusb 229F {unknown} minus sign in box -\defineMMLentity minusd 2238 {unknown} minus sign, dot above -\defineMMLentity minusdu E25B {unknown} minus sign, dot below -\defineMMLentity ncap E284 {unknown} bar, intersection -\defineMMLentity ncup E283 {unknown} bar, union -\defineMMLentity oast 229B {unknown} asterisk in circle -\defineMMLentity ocir 229A {unknown} small circle in circle -\defineMMLentity odash 229D {unknown} hyphen in circle -\defineMMLentity odiv E285 {unknown} divide in circle -\defineMMLentity odot 2299 {\odot} middle dot in circle -\defineMMLentity odsold E286 {unknown} dot, solidus, dot in circle -\defineMMLentity ofcir E287 {unknown} filled circle in circle -\defineMMLentity ogt E289 {unknown} greater-than in circle -\defineMMLentity ohbar E260 {unknown} circle with horizontal bar -\defineMMLentity olcir E409 {unknown} large circle in circle -\defineMMLentity olt E288 {unknown} less-than in circle -\defineMMLentity omid E40A {unknown} vertical bar in circle -\defineMMLentity ominus 2296 {\ominus} minus sign in circle -\defineMMLentity opar E28A {unknown} parallel in circle -\defineMMLentity operp E28B {unknown} perpendicular in circle -\defineMMLentity oplus 2295 {\oplus} plus sign in circle -\defineMMLentity osol 2298 {unknown} solidus in circle -\defineMMLentity Otimes E28C {unknown} multiply sign in double circle -\defineMMLentity otimes 2297 {\otimes} multiply sign in circle -\defineMMLentity otimesas E28D {unknown} multiply sign in circle, circumflex accent -\defineMMLentity ovbar E40B {unknown} circle with vertical bar -\defineMMLentity plusacir E26A {unknown} plus, circumflex accent above -\defineMMLentity plusb 229E {unknown} plus sign in box -\defineMMLentity pluscir E266 {unknown} plus, small circle above -\defineMMLentity plusdo 2214 {unknown} plus sign, dot above -\defineMMLentity plusdu E25A {unknown} plus sign, dot below -\defineMMLentity pluse E267 {unknown} plus, equals -\defineMMLentity plussim E26C {unknown} plus, similar below -\defineMMLentity plustwo E269 {unknown} plus, two; Nim-addition -\defineMMLentity race E40C {unknown} reverse most positive, line below -\defineMMLentity roplus E25D {unknown} plus sign in right half circle -\defineMMLentity rotimes E40D {unknown} multiply sign in right half circle -\defineMMLentity rthree 22CC {unknown} rightthreetimes -\defineMMLentity rtimes 22CA {unknown} times sign, right closed -\defineMMLentity sdot 22C5 {\cdot} small middle dot -\defineMMLentity sdotb 22A1 {unknown} small dot in box -\defineMMLentity setmn 2216 {unknown} reverse solidus -\defineMMLentity simplus E26B {unknown} plus, similar above -\defineMMLentity smashp E264 {unknown} smash product -\defineMMLentity solb E27F {unknown} solidus in square -\defineMMLentity sqcap 2293 {\sqcap} square intersection -\defineMMLentity sqcaps E277 {unknown} square intersection, serifs -\defineMMLentity sqcup 2294 {\sqcup} square union -\defineMMLentity sqcups E276 {unknown} square union, serifs -\defineMMLentity ssetmn E844 {unknown} sm reverse solidus -\defineMMLentity sstarf 22C6 {\star} small star, filled, low -\defineMMLentity subdot E262 {unknown} subset, with dot -\defineMMLentity sum 2211 {\sum} summation operator -\defineMMLentity supdot E263 {unknown} superset, with dot -\defineMMLentity timesb 22A0 {unknown} multiply sign in box -\defineMMLentity timesbar E28E {unknown} multiply sign, bar below -\defineMMLentity timesd E26D {unknown} times, dot -\defineMMLentity tridot 25EC {unknown} dot in triangle -\defineMMLentity triminus E27C {unknown} minus in triangle -\defineMMLentity triplus E27B {unknown} plus in triangle -\defineMMLentity trisb E27E {unknown} triangle, serifs at bottom -\defineMMLentity tritime E27D {unknown} multiply in triangle -\defineMMLentity uplus 228E {\uplus} plus sign in union -\defineMMLentity veebar 22BB {unknown} logical or, bar below -\defineMMLentity wedbar E265 {unknown} wedge, bar below -\defineMMLentity wreath 2240 {unknown} wreath product -\defineMMLentity xcap 22C2 {\bigcap} intersection operator -\defineMMLentity xcirc 25CB {\bigcirc} large circle -\defineMMLentity xcup 22C3 {\bigcup} union operator -\defineMMLentity xdtri 25BD {\bigtriangledown} big down triangle, open -\defineMMLentity xodot 2299 {\bigodot} circle dot operator -\defineMMLentity xoplus 2295 {\bigoplus} circle plus operator -\defineMMLentity xotime 2297 {\bigotimes} circle times operator -\defineMMLentity xsqcup 2294 {\bigsqcup} square union operator -\defineMMLentity xuplus 228E {\biguplus} biguplus -\defineMMLentity xutri 25B3 {\bigtriangleup} big up triangle, open -\defineMMLentity xvee 22C1 {\bigvee} logical and operator -\defineMMLentity xwedge 22C0 {\bigwedge} logical or operator diff --git a/tex/context/base/xtag-mec.mkii b/tex/context/base/xtag-mec.mkii new file mode 100644 index 000000000..9e941897c --- /dev/null +++ b/tex/context/base/xtag-mec.mkii @@ -0,0 +1,28 @@ +% filtered from html files by Patrick Ion +% +% ISOAMSC Characters Extended +% +% Added Math Symbols: Delimiters + +\defineMMLentity dlcorn 231E {unknown} lower left corner +\defineMMLentity drcorn 231F {unknown} lower right corner +\defineMMLentity gtlPar E296 {unknown} double left parenthesis, greater +\defineMMLentity langd E297 {unknown} left angle, dot +\defineMMLentity lbrke E299 {unknown} left bracket, equal +\defineMMLentity lbrksld E29D {unknown} left bracket, solidus bottom corner +\defineMMLentity lbrkslu E29B {unknown} left bracket, solidus top corner +\defineMMLentity lceil 2308 {\lceil} left ceiling +\defineMMLentity lfloor 230A {\lfloor} left floor +\defineMMLentity lmoust E294 {\lmoustache} left moustache +\defineMMLentity lparlt E292 {unknown} left parenthesis, lt +\defineMMLentity ltrPar E295 {unknown} double right parenthesis, less +\defineMMLentity rangd E298 {unknown} right angle, dot +\defineMMLentity rbrke E29A {unknown} right bracket, equal +\defineMMLentity rbrksld E29C {unknown} right bracket, solidus bottom corner +\defineMMLentity rbrkslu E29E {unknown} right bracket, solidus top corner +\defineMMLentity rceil 2309 {\rceil} right ceiling +\defineMMLentity rfloor 230B {\rfloor} right floor +\defineMMLentity rmoust E293 {\rmoustache} right moustache +\defineMMLentity rpargt E291 {unknown} right paren, gt +\defineMMLentity ulcorn 231C {unknown} upper left corner +\defineMMLentity urcorn 231D {unknown} upper right corner diff --git a/tex/context/base/xtag-mec.tex b/tex/context/base/xtag-mec.tex deleted file mode 100644 index 9e941897c..000000000 --- a/tex/context/base/xtag-mec.tex +++ /dev/null @@ -1,28 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOAMSC Characters Extended -% -% Added Math Symbols: Delimiters - -\defineMMLentity dlcorn 231E {unknown} lower left corner -\defineMMLentity drcorn 231F {unknown} lower right corner -\defineMMLentity gtlPar E296 {unknown} double left parenthesis, greater -\defineMMLentity langd E297 {unknown} left angle, dot -\defineMMLentity lbrke E299 {unknown} left bracket, equal -\defineMMLentity lbrksld E29D {unknown} left bracket, solidus bottom corner -\defineMMLentity lbrkslu E29B {unknown} left bracket, solidus top corner -\defineMMLentity lceil 2308 {\lceil} left ceiling -\defineMMLentity lfloor 230A {\lfloor} left floor -\defineMMLentity lmoust E294 {\lmoustache} left moustache -\defineMMLentity lparlt E292 {unknown} left parenthesis, lt -\defineMMLentity ltrPar E295 {unknown} double right parenthesis, less -\defineMMLentity rangd E298 {unknown} right angle, dot -\defineMMLentity rbrke E29A {unknown} right bracket, equal -\defineMMLentity rbrksld E29C {unknown} right bracket, solidus bottom corner -\defineMMLentity rbrkslu E29E {unknown} right bracket, solidus top corner -\defineMMLentity rceil 2309 {\rceil} right ceiling -\defineMMLentity rfloor 230B {\rfloor} right floor -\defineMMLentity rmoust E293 {\rmoustache} right moustache -\defineMMLentity rpargt E291 {unknown} right paren, gt -\defineMMLentity ulcorn 231C {unknown} upper left corner -\defineMMLentity urcorn 231D {unknown} upper right corner diff --git a/tex/context/base/xtag-meh.mkii b/tex/context/base/xtag-meh.mkii new file mode 100644 index 000000000..1636f2a2b --- /dev/null +++ b/tex/context/base/xtag-meh.mkii @@ -0,0 +1,166 @@ +% filtered from html files by Patrick Ion +% +% ISOTECH Characters Extended +% +% General Technical + +\defineMMLentity acd E3A6 {unknown} ac current +\defineMMLentity aleph 2135 {\aleph} aleph, Hebrew +\defineMMLentity And E374 {unknown} double logical and +\defineMMLentity and 2227 {\wedge} logical and +\defineMMLentity andand E36E {unknown} two logical and +\defineMMLentity andd E394 {unknown} and, horizontal dash +\defineMMLentity andslope E50A {unknown} sloping large and +\defineMMLentity andv E391 {unknown} and with middle stem +\defineMMLentity angrt 221F {unknown} right (90 degree) angle +\defineMMLentity angsph 2222 {unknown} angle-spherical +\defineMMLentity angst 212B {\Angstrom} Angstrom capital A, ring +\defineMMLentity ap 2248 {\approx} approximate +\defineMMLentity apacir E38C {unknown} approximate, circumflex accent +\defineMMLentity awconint 2233 {unknown} contour integral, anti-clockwise +\defineMMLentity awint E39B {unknown} anti clock-wise integration +\defineMMLentity becaus 2235 {unknown} because +\defineMMLentity bernou 212C {unknown} Bernoulli function (script capital B) +\defineMMLentity bne E388 {unknown} reverse not equal +\defineMMLentity bnequiv E387 {unknown} reverse not equivalent +\defineMMLentity bNot E3AD {unknown} reverse not with two horizontal strokes +\defineMMLentity bnot 2310 {unknown} reverse not +\defineMMLentity bottom 22A5 {unknown} bottom +\defineMMLentity cap 2229 {\cap} intersection +\defineMMLentity Cconint 2230 {unknown} triple contour integral operator +\defineMMLentity cirfnint E395 {unknown} circulation function +\defineMMLentity compfn 2218 {\circ} composite function (small circle) +\defineMMLentity cong 2245 {\cong} congruent with +\defineMMLentity Conint 222F {unknown} double contour integral operator +\defineMMLentity conint 222E {\oint} contour integral operator +\defineMMLentity ctdot 22EF {\cdots} three dots, centered +\defineMMLentity cup 222A {\cup} union or logical sum +\defineMMLentity cwconint 2232 {unknown} contour integral, clockwise +\defineMMLentity cwint 2231 {unknown} clockwise integral +\defineMMLentity cylcty 232D {unknown} cylindricity +\defineMMLentity disin E3A0 {unknown} set membership, long horizontal stroke +\defineMMLentity Dot 0308 {unknown} dieresis or umlaut mark +\defineMMLentity DotDot 20DC {unknown} four dots above +\defineMMLentity dsol E3A9 {unknown} solidus, bar above +\defineMMLentity dtdot 22F1 {\ddots} three dots, descending +\defineMMLentity dwangle E3AA {unknown} large downward pointing angle +\defineMMLentity elinters E3A7 {unknown} electrical intersection +\defineMMLentity epar 22D5 {unknown} parallel, equal; equal or parallel +\defineMMLentity eparsl E384 {unknown} parallel, slanted, equal; homothetically co +\defineMMLentity equiv 2261 {\equiv} identical with +\defineMMLentity eqvparsl E386 {unknown} equivalent, equal; congruent and parallel +\defineMMLentity exist 2203 {\exists} at least one exists +\defineMMLentity fltns E381 {unknown} flatness +\defineMMLentity forall 2200 {\forall} for all +\defineMMLentity fpartint E396 {unknown} finite part integral +\defineMMLentity ge 2265 {\geq} greater-than-or-equal +\defineMMLentity hamilt 210B {unknown} Hamiltonian (script capital H) +\defineMMLentity iff E365 {unknown} if and only if +\defineMMLentity iinfin E372 {unknown} infinity sign, incomplete +\defineMMLentity imped E50B {unknown} impedance +\defineMMLentity infin 221E {\infty} infinity +\defineMMLentity infintie E50C {unknown} tie, infinity +\defineMMLentity Int 222C {unknown} double integral operator +\defineMMLentity int 222B {\int} integral operator +\defineMMLentity intlarhk E39A {unknown} integral, left arrow with hook +\defineMMLentity isin 220A {\in} set membership +\defineMMLentity isindot E39C {unknown} set membership, dot above +\defineMMLentity isinE E39E {unknown} set membership, two horizontal strokes +\defineMMLentity isins E3A4 {unknown} set membership, vertical bar on horizontal +\defineMMLentity isinsv E3A2 {unknown} large set membership, vertical bar on horiz +\defineMMLentity isinv 2208 {unknown} set membership, variant +\defineMMLentity lagran 2112 {unknown} Lagrangian (script capital L) +\defineMMLentity Lang 300A {unknown} left angle bracket, double +\defineMMLentity lang 3008 {\langle} left angle bracket +\defineMMLentity lArr 21D0 {\Leftarrow} is implied by +\defineMMLentity lbbrk 3014 {unknown} left broken bracket +\defineMMLentity le 2264 {\leq} less-than-or-equal +\defineMMLentity loang 3018 {unknown} left open angular bracket +\defineMMLentity lobrk 301A {unknown} left open bracket +\defineMMLentity lopar E379 {unknown} left open parenthesis +\defineMMLentity lowast 2217 {unknown} low asterisk +\defineMMLentity minus 2212 {unknown} minus sign +\defineMMLentity mnplus 2213 {\mp} minus-or-plus sign +\defineMMLentity nabla 2207 {\nabla} del, Hamilton operator +\defineMMLentity ne 2260 {\ne} not equal +\defineMMLentity nedot E38A {unknown} not equal, dot +\defineMMLentity nhpar E38D {unknown} not, horizontal, parallel +\defineMMLentity ni 220D {unknown} contains +\defineMMLentity nis E3A5 {unknown} contains, vertical bar on horizontal stroke +\defineMMLentity nisd E3A1 {unknown} contains, long horizontal stroke +\defineMMLentity niv 220B {\ni} contains, variant +\defineMMLentity Not E3AC {unknown} not with two horizontal strokes +\defineMMLentity notin 2209 {\notin} negated set membership +\defineMMLentity notindot E39D {unknown} negated set membership, dot above +\defineMMLentity notinE E50D {unknown} negated set membership, two horizontal strokes +\defineMMLentity notinva E370 {unknown} negated set membership, variant +\defineMMLentity notinvb E37B {unknown} negated set membership, variant +\defineMMLentity notinvc E37C {unknown} negated set membership, variant +\defineMMLentity notni 220C {unknown} negated contains +\defineMMLentity notniva 220C {unknown} negated contains, variant +\defineMMLentity notnivb E37D {unknown} contains, variant +\defineMMLentity notnivc E37E {unknown} contains, variant +\defineMMLentity nparsl E389 {unknown} not parallel, slanted +\defineMMLentity npart E390 {unknown} not partial differential +\defineMMLentity npolint E399 {unknown} line integration, not including the pole +\defineMMLentity nvinfin E38E {unknown} not, vert, infinity +\defineMMLentity olcross E3A8 {unknown} circle, cross +\defineMMLentity Or E375 {unknown} double logical or +\defineMMLentity or 2228 {\vee} logical or +\defineMMLentity ord E393 {unknown} or, horizontal dash +\defineMMLentity order 2134 {unknown} order of (script small o) +\defineMMLentity oror E50E {unknown} two logical or +\defineMMLentity orslope E3AE {unknown} sloping large or +\defineMMLentity orv E392 {unknown} or with middle stem +\defineMMLentity par 2225 {\parallel} parallel +\defineMMLentity parsl E382 {unknown} parallel, slanted +\defineMMLentity part 2202 {\partial} partial differential +\defineMMLentity permil 2030 {unknown} per thousand +\defineMMLentity perp 22A5 {\perp} perpendicular +\defineMMLentity pertenk 2031 {unknown} per 10 thousand +\defineMMLentity phmmat 2133 {unknown} physics M-matrix (script capital M) +\defineMMLentity pointint E376 {unknown} integral around a point operator +\defineMMLentity Prime 2033 {unknown} double prime or second +\defineMMLentity prime 2032 {\prime} prime or minute +\defineMMLentity profalar 232E {unknown} all-around profile +\defineMMLentity profline 2312 {unknown} profile of a line +\defineMMLentity profsurf 2313 {unknown} profile of a surface +\defineMMLentity prop 221D {\propto} is proportional to +\defineMMLentity qint E378 {unknown} quadruple integral operator +\defineMMLentity qprime E371 {unknown} quadruple prime +\defineMMLentity quatint E377 {unknown} quaternion integral operator +\defineMMLentity radic 221A {\surd} radical +\defineMMLentity Rang 300B {unknown} right angle bracket, double +\defineMMLentity rang 3009 {\rangle} right angle bracket +\defineMMLentity rArr 21D2 {\Rightarrow} implies +\defineMMLentity rbbrk 3015 {unknown} right broken bracket +\defineMMLentity roang 3019 {unknown} right open angular bracket +\defineMMLentity robrk 301B {unknown} right open bracket +\defineMMLentity ropar E37A {unknown} right open parenthesis +\defineMMLentity rppolint E397 {unknown} line integration, rectangular path around pole +\defineMMLentity scpolint E398 {unknown} line integration, semi-circular path around pole +\defineMMLentity sim 223C {\sim} similar +\defineMMLentity simdot E38B {unknown} similar, dot +\defineMMLentity sime 2243 {\simeq} similar, equals +\defineMMLentity smeparsl E385 {unknown} similar, parallel, slanted, equal +\defineMMLentity square 25A1 {\square} square +\defineMMLentity squarf 25A0 {unknown} square, filled +\defineMMLentity strns E380 {unknown} straightness +\defineMMLentity sub 2282 {\subset} subset or is implied by +\defineMMLentity sube 2286 {\subseteq} subset, equals +\defineMMLentity sup 2283 {\supset} superset or implies +\defineMMLentity supe 2287 {\supseteq} superset, equals +\defineMMLentity tdot 20DB {unknown} three dots above +\defineMMLentity there4 2234 {unknown} therefore +\defineMMLentity tint 222D {unknown} triple integral operator +\defineMMLentity top 22A4 {\top} top +\defineMMLentity topbot 2336 {unknown} top and bottom +\defineMMLentity topcir E383 {unknown} top, circle below +\defineMMLentity tprime 2034 {unknown} triple prime +\defineMMLentity utdot 22F0 {unknown} three dots, ascending +\defineMMLentity uwangle E3AB {unknown} large upward pointing angle +\defineMMLentity vangrt 22BE {unknown} right angle, variant (with arc) +\defineMMLentity veeeq 225A {unknown} logical or, equals +\defineMMLentity Verbar 2016 {\Vert} double vertical bar +\defineMMLentity wedgeq 2259 {unknown} corresponds to (wedge, equals) +\defineMMLentity xnis E3A3 {unknown} large contains, vertical bar on horizontal stroke diff --git a/tex/context/base/xtag-meh.tex b/tex/context/base/xtag-meh.tex deleted file mode 100644 index 1636f2a2b..000000000 --- a/tex/context/base/xtag-meh.tex +++ /dev/null @@ -1,166 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOTECH Characters Extended -% -% General Technical - -\defineMMLentity acd E3A6 {unknown} ac current -\defineMMLentity aleph 2135 {\aleph} aleph, Hebrew -\defineMMLentity And E374 {unknown} double logical and -\defineMMLentity and 2227 {\wedge} logical and -\defineMMLentity andand E36E {unknown} two logical and -\defineMMLentity andd E394 {unknown} and, horizontal dash -\defineMMLentity andslope E50A {unknown} sloping large and -\defineMMLentity andv E391 {unknown} and with middle stem -\defineMMLentity angrt 221F {unknown} right (90 degree) angle -\defineMMLentity angsph 2222 {unknown} angle-spherical -\defineMMLentity angst 212B {\Angstrom} Angstrom capital A, ring -\defineMMLentity ap 2248 {\approx} approximate -\defineMMLentity apacir E38C {unknown} approximate, circumflex accent -\defineMMLentity awconint 2233 {unknown} contour integral, anti-clockwise -\defineMMLentity awint E39B {unknown} anti clock-wise integration -\defineMMLentity becaus 2235 {unknown} because -\defineMMLentity bernou 212C {unknown} Bernoulli function (script capital B) -\defineMMLentity bne E388 {unknown} reverse not equal -\defineMMLentity bnequiv E387 {unknown} reverse not equivalent -\defineMMLentity bNot E3AD {unknown} reverse not with two horizontal strokes -\defineMMLentity bnot 2310 {unknown} reverse not -\defineMMLentity bottom 22A5 {unknown} bottom -\defineMMLentity cap 2229 {\cap} intersection -\defineMMLentity Cconint 2230 {unknown} triple contour integral operator -\defineMMLentity cirfnint E395 {unknown} circulation function -\defineMMLentity compfn 2218 {\circ} composite function (small circle) -\defineMMLentity cong 2245 {\cong} congruent with -\defineMMLentity Conint 222F {unknown} double contour integral operator -\defineMMLentity conint 222E {\oint} contour integral operator -\defineMMLentity ctdot 22EF {\cdots} three dots, centered -\defineMMLentity cup 222A {\cup} union or logical sum -\defineMMLentity cwconint 2232 {unknown} contour integral, clockwise -\defineMMLentity cwint 2231 {unknown} clockwise integral -\defineMMLentity cylcty 232D {unknown} cylindricity -\defineMMLentity disin E3A0 {unknown} set membership, long horizontal stroke -\defineMMLentity Dot 0308 {unknown} dieresis or umlaut mark -\defineMMLentity DotDot 20DC {unknown} four dots above -\defineMMLentity dsol E3A9 {unknown} solidus, bar above -\defineMMLentity dtdot 22F1 {\ddots} three dots, descending -\defineMMLentity dwangle E3AA {unknown} large downward pointing angle -\defineMMLentity elinters E3A7 {unknown} electrical intersection -\defineMMLentity epar 22D5 {unknown} parallel, equal; equal or parallel -\defineMMLentity eparsl E384 {unknown} parallel, slanted, equal; homothetically co -\defineMMLentity equiv 2261 {\equiv} identical with -\defineMMLentity eqvparsl E386 {unknown} equivalent, equal; congruent and parallel -\defineMMLentity exist 2203 {\exists} at least one exists -\defineMMLentity fltns E381 {unknown} flatness -\defineMMLentity forall 2200 {\forall} for all -\defineMMLentity fpartint E396 {unknown} finite part integral -\defineMMLentity ge 2265 {\geq} greater-than-or-equal -\defineMMLentity hamilt 210B {unknown} Hamiltonian (script capital H) -\defineMMLentity iff E365 {unknown} if and only if -\defineMMLentity iinfin E372 {unknown} infinity sign, incomplete -\defineMMLentity imped E50B {unknown} impedance -\defineMMLentity infin 221E {\infty} infinity -\defineMMLentity infintie E50C {unknown} tie, infinity -\defineMMLentity Int 222C {unknown} double integral operator -\defineMMLentity int 222B {\int} integral operator -\defineMMLentity intlarhk E39A {unknown} integral, left arrow with hook -\defineMMLentity isin 220A {\in} set membership -\defineMMLentity isindot E39C {unknown} set membership, dot above -\defineMMLentity isinE E39E {unknown} set membership, two horizontal strokes -\defineMMLentity isins E3A4 {unknown} set membership, vertical bar on horizontal -\defineMMLentity isinsv E3A2 {unknown} large set membership, vertical bar on horiz -\defineMMLentity isinv 2208 {unknown} set membership, variant -\defineMMLentity lagran 2112 {unknown} Lagrangian (script capital L) -\defineMMLentity Lang 300A {unknown} left angle bracket, double -\defineMMLentity lang 3008 {\langle} left angle bracket -\defineMMLentity lArr 21D0 {\Leftarrow} is implied by -\defineMMLentity lbbrk 3014 {unknown} left broken bracket -\defineMMLentity le 2264 {\leq} less-than-or-equal -\defineMMLentity loang 3018 {unknown} left open angular bracket -\defineMMLentity lobrk 301A {unknown} left open bracket -\defineMMLentity lopar E379 {unknown} left open parenthesis -\defineMMLentity lowast 2217 {unknown} low asterisk -\defineMMLentity minus 2212 {unknown} minus sign -\defineMMLentity mnplus 2213 {\mp} minus-or-plus sign -\defineMMLentity nabla 2207 {\nabla} del, Hamilton operator -\defineMMLentity ne 2260 {\ne} not equal -\defineMMLentity nedot E38A {unknown} not equal, dot -\defineMMLentity nhpar E38D {unknown} not, horizontal, parallel -\defineMMLentity ni 220D {unknown} contains -\defineMMLentity nis E3A5 {unknown} contains, vertical bar on horizontal stroke -\defineMMLentity nisd E3A1 {unknown} contains, long horizontal stroke -\defineMMLentity niv 220B {\ni} contains, variant -\defineMMLentity Not E3AC {unknown} not with two horizontal strokes -\defineMMLentity notin 2209 {\notin} negated set membership -\defineMMLentity notindot E39D {unknown} negated set membership, dot above -\defineMMLentity notinE E50D {unknown} negated set membership, two horizontal strokes -\defineMMLentity notinva E370 {unknown} negated set membership, variant -\defineMMLentity notinvb E37B {unknown} negated set membership, variant -\defineMMLentity notinvc E37C {unknown} negated set membership, variant -\defineMMLentity notni 220C {unknown} negated contains -\defineMMLentity notniva 220C {unknown} negated contains, variant -\defineMMLentity notnivb E37D {unknown} contains, variant -\defineMMLentity notnivc E37E {unknown} contains, variant -\defineMMLentity nparsl E389 {unknown} not parallel, slanted -\defineMMLentity npart E390 {unknown} not partial differential -\defineMMLentity npolint E399 {unknown} line integration, not including the pole -\defineMMLentity nvinfin E38E {unknown} not, vert, infinity -\defineMMLentity olcross E3A8 {unknown} circle, cross -\defineMMLentity Or E375 {unknown} double logical or -\defineMMLentity or 2228 {\vee} logical or -\defineMMLentity ord E393 {unknown} or, horizontal dash -\defineMMLentity order 2134 {unknown} order of (script small o) -\defineMMLentity oror E50E {unknown} two logical or -\defineMMLentity orslope E3AE {unknown} sloping large or -\defineMMLentity orv E392 {unknown} or with middle stem -\defineMMLentity par 2225 {\parallel} parallel -\defineMMLentity parsl E382 {unknown} parallel, slanted -\defineMMLentity part 2202 {\partial} partial differential -\defineMMLentity permil 2030 {unknown} per thousand -\defineMMLentity perp 22A5 {\perp} perpendicular -\defineMMLentity pertenk 2031 {unknown} per 10 thousand -\defineMMLentity phmmat 2133 {unknown} physics M-matrix (script capital M) -\defineMMLentity pointint E376 {unknown} integral around a point operator -\defineMMLentity Prime 2033 {unknown} double prime or second -\defineMMLentity prime 2032 {\prime} prime or minute -\defineMMLentity profalar 232E {unknown} all-around profile -\defineMMLentity profline 2312 {unknown} profile of a line -\defineMMLentity profsurf 2313 {unknown} profile of a surface -\defineMMLentity prop 221D {\propto} is proportional to -\defineMMLentity qint E378 {unknown} quadruple integral operator -\defineMMLentity qprime E371 {unknown} quadruple prime -\defineMMLentity quatint E377 {unknown} quaternion integral operator -\defineMMLentity radic 221A {\surd} radical -\defineMMLentity Rang 300B {unknown} right angle bracket, double -\defineMMLentity rang 3009 {\rangle} right angle bracket -\defineMMLentity rArr 21D2 {\Rightarrow} implies -\defineMMLentity rbbrk 3015 {unknown} right broken bracket -\defineMMLentity roang 3019 {unknown} right open angular bracket -\defineMMLentity robrk 301B {unknown} right open bracket -\defineMMLentity ropar E37A {unknown} right open parenthesis -\defineMMLentity rppolint E397 {unknown} line integration, rectangular path around pole -\defineMMLentity scpolint E398 {unknown} line integration, semi-circular path around pole -\defineMMLentity sim 223C {\sim} similar -\defineMMLentity simdot E38B {unknown} similar, dot -\defineMMLentity sime 2243 {\simeq} similar, equals -\defineMMLentity smeparsl E385 {unknown} similar, parallel, slanted, equal -\defineMMLentity square 25A1 {\square} square -\defineMMLentity squarf 25A0 {unknown} square, filled -\defineMMLentity strns E380 {unknown} straightness -\defineMMLentity sub 2282 {\subset} subset or is implied by -\defineMMLentity sube 2286 {\subseteq} subset, equals -\defineMMLentity sup 2283 {\supset} superset or implies -\defineMMLentity supe 2287 {\supseteq} superset, equals -\defineMMLentity tdot 20DB {unknown} three dots above -\defineMMLentity there4 2234 {unknown} therefore -\defineMMLentity tint 222D {unknown} triple integral operator -\defineMMLentity top 22A4 {\top} top -\defineMMLentity topbot 2336 {unknown} top and bottom -\defineMMLentity topcir E383 {unknown} top, circle below -\defineMMLentity tprime 2034 {unknown} triple prime -\defineMMLentity utdot 22F0 {unknown} three dots, ascending -\defineMMLentity uwangle E3AB {unknown} large upward pointing angle -\defineMMLentity vangrt 22BE {unknown} right angle, variant (with arc) -\defineMMLentity veeeq 225A {unknown} logical or, equals -\defineMMLentity Verbar 2016 {\Vert} double vertical bar -\defineMMLentity wedgeq 2259 {unknown} corresponds to (wedge, equals) -\defineMMLentity xnis E3A3 {unknown} large contains, vertical bar on horizontal stroke diff --git a/tex/context/base/xtag-men.mkii b/tex/context/base/xtag-men.mkii new file mode 100644 index 000000000..d548c8394 --- /dev/null +++ b/tex/context/base/xtag-men.mkii @@ -0,0 +1,98 @@ +% filtered from html files by Patrick Ion +% +% ISOAMSN Characters Extended +% +% Added Math Symbols: Negated Relations + +\defineMMLentity gnap E411 {unknown} greater, not approximate +\defineMMLentity gnE 2269 {unknown} greater, not double equals +\defineMMLentity gne 2269 {unknown} greater, not equals +\defineMMLentity gnsim 22E7 {unknown} greater, not similar +\defineMMLentity gvnE E2A1 {unknown} gt, vert, not double equals +\defineMMLentity lnap E2A2 {unknown} less, not approximate +\defineMMLentity lnE 2268 {unknown} less, not double equals +\defineMMLentity lne 2268 {unknown} less, not equals +\defineMMLentity lnsim 22E6 {unknown} less, not similar +\defineMMLentity lvnE E2A4 {unknown} less, vert, not double equals +\defineMMLentity nap 2249 {unknown} not approximate +\defineMMLentity napE E2C7 {unknown} not approximately equal or equal to +\defineMMLentity napid E2BC {unknown} not approximately identical to +\defineMMLentity ncong 2247 {unknown} not congruent with +\defineMMLentity ncongdot E2C5 {unknown} not congruent, dot +\defineMMLentity nequiv 2262 {unknown} not identical with +\defineMMLentity ngE 2271 {unknown} not greater, double equals +\defineMMLentity nge E2A6 {unknown} not greater-than-or-equal +\defineMMLentity nges 2271 {unknown} not gt-or-equals, slanted +\defineMMLentity nGg E2CE {unknown} not triple greater than +\defineMMLentity ngsim 2275 {unknown} not greater, similar +\defineMMLentity nGt E2CA {unknown} not, vert, much greater than +\defineMMLentity ngt 226F {unknown} not greater-than +\defineMMLentity nGtv E2CC {unknown} not much greater than, variant +\defineMMLentity nlE 2270 {unknown} not less, double equals +\defineMMLentity nle E2A7 {unknown} not less-than-or-equal +\defineMMLentity nles 2270 {unknown} not less-or-equals, slant +\defineMMLentity nLl E2CD {unknown} not triple less than +\defineMMLentity nlsim 2274 {unknown} not less, similar +\defineMMLentity nLt E2C9 {unknown} not, vert, much less than +\defineMMLentity nlt 226E {unknown} not less-than +\defineMMLentity nltri 22EA {unknown} not left triangle +\defineMMLentity nltrie 22EC {unknown} not left triangle, equals +\defineMMLentity nLtv E2CB {unknown} not much less than, variant +\defineMMLentity nmid 2224 {unknown} negated mid +\defineMMLentity npar 2226 {unknown} not parallel +\defineMMLentity npr 2280 {unknown} not precedes +\defineMMLentity nprcue 22E0 {unknown} not curly precedes, equals +\defineMMLentity npre E412 {unknown} not precedes, equals +\defineMMLentity nrtri 22EB {unknown} not right triangle +\defineMMLentity nrtrie 22ED {unknown} not right triangle, equals +\defineMMLentity nsc 2281 {unknown} not succeeds +\defineMMLentity nsccue 22E1 {unknown} not succeeds, curly equals +\defineMMLentity nsce E413 {unknown} not succeeds, equals +\defineMMLentity nsim 2241 {unknown} not similar +\defineMMLentity nsime 2244 {unknown} not similar, equals +\defineMMLentity nsmid E2AA {unknown} negated short mid +\defineMMLentity nspar E2AB {unknown} not short par +\defineMMLentity nsqsube 22E2 {unknown} not, square subset, equals +\defineMMLentity nsqsupe 22E3 {unknown} not, square superset, equals +\defineMMLentity nsub 2284 {unknown} not subset +\defineMMLentity nsubE 2288 {unknown} not subset, double equals +\defineMMLentity nsube 2288 {unknown} not subset, equals +\defineMMLentity nsup 2285 {unknown} not superset +\defineMMLentity nsupE 2289 {unknown} not superset, double equals +\defineMMLentity nsupe 2289 {unknown} not superset, equals +\defineMMLentity ntgl 2279 {unknown} not greater, less +\defineMMLentity ntlg 2278 {unknown} not less, greater +\defineMMLentity ntvgl 2279 {unknown} not, vert, greater, less +\defineMMLentity ntvlg 2278 {unknown} not, vert, less, greater +\defineMMLentity nvap E2C6 {unknown} not, vert, approximate +\defineMMLentity nVDash 22AF {unknown} not double vert, double dash +\defineMMLentity nVdash 22AE {unknown} not double vertical, dash +\defineMMLentity nvDash 22AD {unknown} not vertical, double dash +\defineMMLentity nvdash 22AC {unknown} not vertical, dash +\defineMMLentity nvge 2271 {unknown} not, vert, greater-than-or-equal +\defineMMLentity nvgt 226F {unknown} not, vert, greater-than +\defineMMLentity nvle 2270 {unknown} not, vert, less-than-or-equal +\defineMMLentity nvlt 226E {unknown} not, vert, less-than +\defineMMLentity nvltrie E2D0 {unknown} not, vert, left triangle, equals +\defineMMLentity nvrtrie E2CF {unknown} not, vert, right triangle, equals +\defineMMLentity nvsim E415 {unknown} not, vert, similar +\defineMMLentity parsim E2C8 {unknown} parallel, similar +\defineMMLentity prnap 22E8 {unknown} precedes, not approx +\defineMMLentity prnE E2B3 {unknown} precedes, not double equals +\defineMMLentity prnsim 22E8 {unknown} precedes, not similar +\defineMMLentity rnmid E2D1 {unknown} reverse nmid +\defineMMLentity scnap 22E9 {unknown} succeeds, not approx +\defineMMLentity scnE E2B5 {unknown} succeeds, not double equals +\defineMMLentity scnsim 22E9 {unknown} succeeds, not similar +\defineMMLentity simne 2246 {unknown} similar, not equals +\defineMMLentity solbar E416 {unknown} solidus, bar through +\defineMMLentity subnE 228A {unknown} subset, not double equals +\defineMMLentity subne 228A {unknown} subset, not equals +\defineMMLentity supnE 228B {unknown} superset, not double equals +\defineMMLentity supne 228B {unknown} superset, not equals +\defineMMLentity vnsub 2284 {unknown} not subset, variant +\defineMMLentity vnsup 2285 {unknown} not superset, variant +\defineMMLentity vsubnE E2B8 {unknown} subset not double equals, variant +\defineMMLentity vsubne E2B9 {unknown} subset, not equals, variant +\defineMMLentity vsupnE E2BB {unknown} super not double equals, variant +\defineMMLentity vsupne E2BA {unknown} superset, not equals, variant diff --git a/tex/context/base/xtag-men.tex b/tex/context/base/xtag-men.tex deleted file mode 100644 index d548c8394..000000000 --- a/tex/context/base/xtag-men.tex +++ /dev/null @@ -1,98 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOAMSN Characters Extended -% -% Added Math Symbols: Negated Relations - -\defineMMLentity gnap E411 {unknown} greater, not approximate -\defineMMLentity gnE 2269 {unknown} greater, not double equals -\defineMMLentity gne 2269 {unknown} greater, not equals -\defineMMLentity gnsim 22E7 {unknown} greater, not similar -\defineMMLentity gvnE E2A1 {unknown} gt, vert, not double equals -\defineMMLentity lnap E2A2 {unknown} less, not approximate -\defineMMLentity lnE 2268 {unknown} less, not double equals -\defineMMLentity lne 2268 {unknown} less, not equals -\defineMMLentity lnsim 22E6 {unknown} less, not similar -\defineMMLentity lvnE E2A4 {unknown} less, vert, not double equals -\defineMMLentity nap 2249 {unknown} not approximate -\defineMMLentity napE E2C7 {unknown} not approximately equal or equal to -\defineMMLentity napid E2BC {unknown} not approximately identical to -\defineMMLentity ncong 2247 {unknown} not congruent with -\defineMMLentity ncongdot E2C5 {unknown} not congruent, dot -\defineMMLentity nequiv 2262 {unknown} not identical with -\defineMMLentity ngE 2271 {unknown} not greater, double equals -\defineMMLentity nge E2A6 {unknown} not greater-than-or-equal -\defineMMLentity nges 2271 {unknown} not gt-or-equals, slanted -\defineMMLentity nGg E2CE {unknown} not triple greater than -\defineMMLentity ngsim 2275 {unknown} not greater, similar -\defineMMLentity nGt E2CA {unknown} not, vert, much greater than -\defineMMLentity ngt 226F {unknown} not greater-than -\defineMMLentity nGtv E2CC {unknown} not much greater than, variant -\defineMMLentity nlE 2270 {unknown} not less, double equals -\defineMMLentity nle E2A7 {unknown} not less-than-or-equal -\defineMMLentity nles 2270 {unknown} not less-or-equals, slant -\defineMMLentity nLl E2CD {unknown} not triple less than -\defineMMLentity nlsim 2274 {unknown} not less, similar -\defineMMLentity nLt E2C9 {unknown} not, vert, much less than -\defineMMLentity nlt 226E {unknown} not less-than -\defineMMLentity nltri 22EA {unknown} not left triangle -\defineMMLentity nltrie 22EC {unknown} not left triangle, equals -\defineMMLentity nLtv E2CB {unknown} not much less than, variant -\defineMMLentity nmid 2224 {unknown} negated mid -\defineMMLentity npar 2226 {unknown} not parallel -\defineMMLentity npr 2280 {unknown} not precedes -\defineMMLentity nprcue 22E0 {unknown} not curly precedes, equals -\defineMMLentity npre E412 {unknown} not precedes, equals -\defineMMLentity nrtri 22EB {unknown} not right triangle -\defineMMLentity nrtrie 22ED {unknown} not right triangle, equals -\defineMMLentity nsc 2281 {unknown} not succeeds -\defineMMLentity nsccue 22E1 {unknown} not succeeds, curly equals -\defineMMLentity nsce E413 {unknown} not succeeds, equals -\defineMMLentity nsim 2241 {unknown} not similar -\defineMMLentity nsime 2244 {unknown} not similar, equals -\defineMMLentity nsmid E2AA {unknown} negated short mid -\defineMMLentity nspar E2AB {unknown} not short par -\defineMMLentity nsqsube 22E2 {unknown} not, square subset, equals -\defineMMLentity nsqsupe 22E3 {unknown} not, square superset, equals -\defineMMLentity nsub 2284 {unknown} not subset -\defineMMLentity nsubE 2288 {unknown} not subset, double equals -\defineMMLentity nsube 2288 {unknown} not subset, equals -\defineMMLentity nsup 2285 {unknown} not superset -\defineMMLentity nsupE 2289 {unknown} not superset, double equals -\defineMMLentity nsupe 2289 {unknown} not superset, equals -\defineMMLentity ntgl 2279 {unknown} not greater, less -\defineMMLentity ntlg 2278 {unknown} not less, greater -\defineMMLentity ntvgl 2279 {unknown} not, vert, greater, less -\defineMMLentity ntvlg 2278 {unknown} not, vert, less, greater -\defineMMLentity nvap E2C6 {unknown} not, vert, approximate -\defineMMLentity nVDash 22AF {unknown} not double vert, double dash -\defineMMLentity nVdash 22AE {unknown} not double vertical, dash -\defineMMLentity nvDash 22AD {unknown} not vertical, double dash -\defineMMLentity nvdash 22AC {unknown} not vertical, dash -\defineMMLentity nvge 2271 {unknown} not, vert, greater-than-or-equal -\defineMMLentity nvgt 226F {unknown} not, vert, greater-than -\defineMMLentity nvle 2270 {unknown} not, vert, less-than-or-equal -\defineMMLentity nvlt 226E {unknown} not, vert, less-than -\defineMMLentity nvltrie E2D0 {unknown} not, vert, left triangle, equals -\defineMMLentity nvrtrie E2CF {unknown} not, vert, right triangle, equals -\defineMMLentity nvsim E415 {unknown} not, vert, similar -\defineMMLentity parsim E2C8 {unknown} parallel, similar -\defineMMLentity prnap 22E8 {unknown} precedes, not approx -\defineMMLentity prnE E2B3 {unknown} precedes, not double equals -\defineMMLentity prnsim 22E8 {unknown} precedes, not similar -\defineMMLentity rnmid E2D1 {unknown} reverse nmid -\defineMMLentity scnap 22E9 {unknown} succeeds, not approx -\defineMMLentity scnE E2B5 {unknown} succeeds, not double equals -\defineMMLentity scnsim 22E9 {unknown} succeeds, not similar -\defineMMLentity simne 2246 {unknown} similar, not equals -\defineMMLentity solbar E416 {unknown} solidus, bar through -\defineMMLentity subnE 228A {unknown} subset, not double equals -\defineMMLentity subne 228A {unknown} subset, not equals -\defineMMLentity supnE 228B {unknown} superset, not double equals -\defineMMLentity supne 228B {unknown} superset, not equals -\defineMMLentity vnsub 2284 {unknown} not subset, variant -\defineMMLentity vnsup 2285 {unknown} not superset, variant -\defineMMLentity vsubnE E2B8 {unknown} subset not double equals, variant -\defineMMLentity vsubne E2B9 {unknown} subset, not equals, variant -\defineMMLentity vsupnE E2BB {unknown} super not double equals, variant -\defineMMLentity vsupne E2BA {unknown} superset, not equals, variant diff --git a/tex/context/base/xtag-meo.mkii b/tex/context/base/xtag-meo.mkii new file mode 100644 index 000000000..f19f80fbe --- /dev/null +++ b/tex/context/base/xtag-meo.mkii @@ -0,0 +1,58 @@ +% filtered from html files by Patrick Ion +% +% ISOAMSO Characters Extended +% +% Added Math Symbols: Ordinary + +\defineMMLentity ang 2220 {\angle} angle +\defineMMLentity ange E2D6 {unknown} angle, equal +\defineMMLentity angmsd 2221 {unknown} angle-measured +\defineMMLentity angmsdaa E2D9 {unknown} angle-measured, arrow, up, right +\defineMMLentity angmsdab E2DA {unknown} angle-measured, arrow, up, left +\defineMMLentity angmsdac E2DB {unknown} angle-measured, arrow, down, right +\defineMMLentity angmsdad E2DC {unknown} angle-measured, arrow, down, left +\defineMMLentity angmsdae E2DD {unknown} angle-measured, arrow, right, up +\defineMMLentity angmsdaf E2DE {unknown} angle-measured, arrow, left, up +\defineMMLentity angmsdag E2DF {unknown} angle-measured, arrow, right, down +\defineMMLentity angmsdah E2E0 {unknown} angle-measured, arrow, left, down +\defineMMLentity angrtvb E418 {unknown} right angle-measured +\defineMMLentity angrtvbd E2E1 {unknown} right angle-measured, dot +\defineMMLentity bbrk E2EE {unknown} bottom square bracket +\defineMMLentity bbrktbrk E419 {unknown} bottom above top square bracket +\defineMMLentity bemptyv E41A {unknown} reversed circle, slash +\defineMMLentity beth 2136 {unknown} beth, Hebrew +\defineMMLentity boxbox E2E6 {unknown} two joined squares +\defineMMLentity bprime 2035 {unknown} reverse prime +\defineMMLentity bsemi E2ED {unknown} reverse semi-colon +\defineMMLentity cemptyv E2E8 {unknown} circle, slash, small circle above +\defineMMLentity cirE E41B {unknown} circle, two horizontal stroked to the right +\defineMMLentity cirscir E41C {unknown} circle, small circle to the right +\defineMMLentity comp 2201 {unknown} complement sign +\defineMMLentity daleth 2138 {unknown} daleth, Hebrew +\defineMMLentity demptyv E2E7 {unknown} circle, slash, bar above +\defineMMLentity ell 2113 {\ell} cursive small l +\defineMMLentity empty E2D3 {unknown} letter O slashed +\defineMMLentity emptyv 2205 {unknown} circle, slash +\defineMMLentity gimel 2137 {unknown} gimel, Hebrew +\defineMMLentity iiota 2129 {unknown} inverted iota +\defineMMLentity image 2111 {\Im} imaginary +\defineMMLentity imath 0131 {\imath} small i, no dot +\defineMMLentity jmath E2D4 {unknown} small j, no dot +\defineMMLentity laemptyv E2EA {unknown} circle, slash, left arrow above +\defineMMLentity lltri E2E5 {unknown} lower left triangle +\defineMMLentity lrtri E2E3 {unknown} lower right triangle +\defineMMLentity mho 2127 {unknown} conductance +\defineMMLentity nang E2D8 {unknown} not, vert, angle +\defineMMLentity nexist 2204 {unknown} negated exists +\defineMMLentity oS E41D {unknown} capital S in circle +\defineMMLentity plank E2D5 {unknown} Planck's over 2pi +\defineMMLentity plankv 210F {unknown} variant Planck's over 2pi +\defineMMLentity raemptyv E2E9 {unknown} circle, slash, right arrow above +\defineMMLentity range E2D7 {unknown} reverse angle, equal +\defineMMLentity real 211C {\Re} real +\defineMMLentity tbrk E2EF {unknown} top square bracket +\defineMMLentity trpezium E2EC {unknown} trapezium +\defineMMLentity ultri E2E4 {unknown} upper left triangle +\defineMMLentity urtri E2E2 {unknown} upper right triangle +\defineMMLentity vzigzag E2EB {unknown} vertical zig-zag line +\defineMMLentity weierp 2118 {\wp} Weierstrass p diff --git a/tex/context/base/xtag-meo.tex b/tex/context/base/xtag-meo.tex deleted file mode 100644 index f19f80fbe..000000000 --- a/tex/context/base/xtag-meo.tex +++ /dev/null @@ -1,58 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOAMSO Characters Extended -% -% Added Math Symbols: Ordinary - -\defineMMLentity ang 2220 {\angle} angle -\defineMMLentity ange E2D6 {unknown} angle, equal -\defineMMLentity angmsd 2221 {unknown} angle-measured -\defineMMLentity angmsdaa E2D9 {unknown} angle-measured, arrow, up, right -\defineMMLentity angmsdab E2DA {unknown} angle-measured, arrow, up, left -\defineMMLentity angmsdac E2DB {unknown} angle-measured, arrow, down, right -\defineMMLentity angmsdad E2DC {unknown} angle-measured, arrow, down, left -\defineMMLentity angmsdae E2DD {unknown} angle-measured, arrow, right, up -\defineMMLentity angmsdaf E2DE {unknown} angle-measured, arrow, left, up -\defineMMLentity angmsdag E2DF {unknown} angle-measured, arrow, right, down -\defineMMLentity angmsdah E2E0 {unknown} angle-measured, arrow, left, down -\defineMMLentity angrtvb E418 {unknown} right angle-measured -\defineMMLentity angrtvbd E2E1 {unknown} right angle-measured, dot -\defineMMLentity bbrk E2EE {unknown} bottom square bracket -\defineMMLentity bbrktbrk E419 {unknown} bottom above top square bracket -\defineMMLentity bemptyv E41A {unknown} reversed circle, slash -\defineMMLentity beth 2136 {unknown} beth, Hebrew -\defineMMLentity boxbox E2E6 {unknown} two joined squares -\defineMMLentity bprime 2035 {unknown} reverse prime -\defineMMLentity bsemi E2ED {unknown} reverse semi-colon -\defineMMLentity cemptyv E2E8 {unknown} circle, slash, small circle above -\defineMMLentity cirE E41B {unknown} circle, two horizontal stroked to the right -\defineMMLentity cirscir E41C {unknown} circle, small circle to the right -\defineMMLentity comp 2201 {unknown} complement sign -\defineMMLentity daleth 2138 {unknown} daleth, Hebrew -\defineMMLentity demptyv E2E7 {unknown} circle, slash, bar above -\defineMMLentity ell 2113 {\ell} cursive small l -\defineMMLentity empty E2D3 {unknown} letter O slashed -\defineMMLentity emptyv 2205 {unknown} circle, slash -\defineMMLentity gimel 2137 {unknown} gimel, Hebrew -\defineMMLentity iiota 2129 {unknown} inverted iota -\defineMMLentity image 2111 {\Im} imaginary -\defineMMLentity imath 0131 {\imath} small i, no dot -\defineMMLentity jmath E2D4 {unknown} small j, no dot -\defineMMLentity laemptyv E2EA {unknown} circle, slash, left arrow above -\defineMMLentity lltri E2E5 {unknown} lower left triangle -\defineMMLentity lrtri E2E3 {unknown} lower right triangle -\defineMMLentity mho 2127 {unknown} conductance -\defineMMLentity nang E2D8 {unknown} not, vert, angle -\defineMMLentity nexist 2204 {unknown} negated exists -\defineMMLentity oS E41D {unknown} capital S in circle -\defineMMLentity plank E2D5 {unknown} Planck's over 2pi -\defineMMLentity plankv 210F {unknown} variant Planck's over 2pi -\defineMMLentity raemptyv E2E9 {unknown} circle, slash, right arrow above -\defineMMLentity range E2D7 {unknown} reverse angle, equal -\defineMMLentity real 211C {\Re} real -\defineMMLentity tbrk E2EF {unknown} top square bracket -\defineMMLentity trpezium E2EC {unknown} trapezium -\defineMMLentity ultri E2E4 {unknown} upper left triangle -\defineMMLentity urtri E2E2 {unknown} upper right triangle -\defineMMLentity vzigzag E2EB {unknown} vertical zig-zag line -\defineMMLentity weierp 2118 {\wp} Weierstrass p diff --git a/tex/context/base/xtag-mer.mkii b/tex/context/base/xtag-mer.mkii new file mode 100644 index 000000000..becff584a --- /dev/null +++ b/tex/context/base/xtag-mer.mkii @@ -0,0 +1,185 @@ +% filtered from html files by Patrick Ion +% +% ISOAMSR Characters Extended +% +% Added Math Symbols: Relations + +\defineMMLentity apE E315 {unknown} approximately equal or equal to +\defineMMLentity ape 224A {unknown} approximate, equals +\defineMMLentity apid 224B {unknown} approximately identical to +\defineMMLentity asymp 224D {\asymp} asymptotically equal to +\defineMMLentity Barv E311 {unknown} vert, double bar (over) +\defineMMLentity bcong 224C {unknown} reverse congruent +\defineMMLentity bepsi E420 {unknown} such that +\defineMMLentity bowtie 22C8 {unknown} bowtie +\defineMMLentity bsim 223D {unknown} reverse similar +\defineMMLentity bsime 22CD {unknown} reverse similar, equals +\defineMMLentity bsolhsub E34D {unknown} reverse solidus, subset +\defineMMLentity bump 224E {unknown} bumpy equals +\defineMMLentity bumpe 224F {unknown} bumpy equals, equals +\defineMMLentity cire 2257 {unknown} circle, equals +\defineMMLentity Colon 2237 {unknown} two colons +\defineMMLentity Colone E30E {unknown} double colon, equals +\defineMMLentity colone 2254 {unknown} colon, equals +\defineMMLentity congdot E314 {unknown} congruent, dot +\defineMMLentity csub E351 {unknown} subset, closed +\defineMMLentity csube E353 {unknown} subset, closed, equals +\defineMMLentity csup E352 {unknown} superset, closed +\defineMMLentity csupe E354 {unknown} superset, closed, equals +\defineMMLentity cuepr 22DE {unknown} curly equals, precedes +\defineMMLentity cuesc 22DF {unknown} curly equals, succeeds +\defineMMLentity Dashv E30F {unknown} double dash, vertical +\defineMMLentity dashv 22A3 {\dashv} dash, vertical +\defineMMLentity easter 225B {unknown} equal, asterisk above +\defineMMLentity ecir 2256 {unknown} circle on equals sign +\defineMMLentity ecolon 2255 {unknown} equals, colon +\defineMMLentity eDDot E309 {unknown} equal with four dots +\defineMMLentity eDot 2251 {unknown} equals, even dots +\defineMMLentity efDot 2252 {unknown} equals, falling dots +\defineMMLentity eg E328 {unknown} equal-or-greater +\defineMMLentity egs 22DD {unknown} equal-or-gtr, slanted +\defineMMLentity egsdot E324 {unknown} equal-or-greater, slanted, dot inside +\defineMMLentity el E327 {unknown} equal-or-less +\defineMMLentity els 22DC {unknown} eq-or-less, slanted +\defineMMLentity elsdot E323 {unknown} equal-or-less, slanted, dot inside +\defineMMLentity equest 225F {unknown} equal with questionmark +\defineMMLentity equivDD E318 {unknown} equivalent, four dots above +\defineMMLentity erDot 2253 {unknown} equals, rising dots +\defineMMLentity esdot 2250 {unknown} equals, single dot above +\defineMMLentity Esim E317 {unknown} equal, similar +\defineMMLentity esim 2242 {unknown} equals, similar +\defineMMLentity fork 22D4 {unknown} pitchfork +\defineMMLentity forkv E31B {unknown} fork, variant +\defineMMLentity frown 2322 {\frown} down curve +\defineMMLentity gap 2273 {unknown} greater, approximate +\defineMMLentity gE 2267 {unknown} greater, double equals +\defineMMLentity gEl 22DB {unknown} gt, double equals, less +\defineMMLentity gel 22DB {unknown} greater, equals, less +\defineMMLentity ges E421 {unknown} gt-or-equal, slanted +\defineMMLentity gescc E358 {unknown} greater than, closed by curve, equal, slanted +\defineMMLentity gesdot E31E {unknown} greater-than-or-equal, slanted, dot inside +\defineMMLentity gesdoto E320 {unknown} greater-than-or-equal, slanted, dot above +\defineMMLentity gesdotol E322 {unknown} greater-than-or-equal, slanted, dot above left +\defineMMLentity gesl E32C {unknown} greater, equal, slanted, less +\defineMMLentity gesles E332 {unknown} greater, equal, slanted, less, equal, slanted +\defineMMLentity Gg 22D9 {unknown} triple gtr-than +\defineMMLentity gl 2277 {unknown} greater, less +\defineMMLentity gla E330 {unknown} greater, less, apart +\defineMMLentity glE E32E {unknown} greater, less, equal +\defineMMLentity glj E32F {unknown} greater, less, overlapping +\defineMMLentity gsim 2273 {unknown} greater, similar +\defineMMLentity gsime E334 {unknown} greater, similar, equal +\defineMMLentity gsiml E336 {unknown} greater, similar, less +\defineMMLentity Gt 226B {unknown} double greater-than sign +\defineMMLentity gtcc E356 {unknown} greater than, closed by curve +\defineMMLentity gtcir E326 {unknown} greater than, circle inside +\defineMMLentity gtdot 22D7 {unknown} greater than, with dot +\defineMMLentity gtquest E32A {unknown} greater than, questionmark above +\defineMMLentity gtrarr E35F {unknown} greater than, right arrow +\defineMMLentity homtht 223B {unknown} homothetic +\defineMMLentity lap 2272 {unknown} less, approximate +\defineMMLentity lat E33A {unknown} larger than +\defineMMLentity late E33C {unknown} larger than or equal +\defineMMLentity lates E33E {unknown} larger than or equal, slanted +\defineMMLentity lE 2266 {unknown} less, double equals +\defineMMLentity lEg 22DA {unknown} less, double equals, greater +\defineMMLentity leg 22DA {unknown} less, equals, greater +\defineMMLentity les E425 {unknown} less-than-or-equals, slant +\defineMMLentity lescc E357 {unknown} less than, closed by curve, equal, slanted +\defineMMLentity lesdot E31D {unknown} less-than-or-equal, slanted, dot inside +\defineMMLentity lesdoto E31F {unknown} less-than-or-equal, slanted, dot above +\defineMMLentity lesdotor E321 {unknown} less-than-or-equal, slanted, dot above right +\defineMMLentity lesg E32B {unknown} less, equal, slanted, greater +\defineMMLentity lesges E331 {unknown} less, equal, slanted, greater, equal, slanted +\defineMMLentity lg 2276 {unknown} less, greater +\defineMMLentity lgE E32D {unknown} less, greater, equal +\defineMMLentity Ll 22D8 {unknown} triple less-than +\defineMMLentity lsim 2272 {unknown} less, similar +\defineMMLentity lsime E333 {unknown} less, similar, equal +\defineMMLentity lsimg E335 {unknown} less, similar, greater +\defineMMLentity Lt 226A {unknown} double less-than sign +\defineMMLentity ltcc E355 {unknown} less than, closed by curve +\defineMMLentity ltcir E325 {unknown} less than, circle inside +\defineMMLentity ltdot 22D6 {unknown} less than, with dot +\defineMMLentity ltlarr E35E {unknown} less than, left arrow +\defineMMLentity ltquest E329 {unknown} less than, questionmark above +\defineMMLentity ltrie 22B4 {unknown} left triangle, equals +\defineMMLentity mcomma E31A {unknown} minus, comma above +\defineMMLentity mDDot 223A {unknown} minus with four dots, geometric properties +\defineMMLentity mid 2223 {\mid} mid +\defineMMLentity mlcp E30A {unknown} transversal intersection +\defineMMLentity models 22A7 {\models} models +\defineMMLentity mstpos 223E {unknown} most positive +\defineMMLentity Pr E35C {unknown} double precedes +\defineMMLentity pr 227A {\prec} precedes +\defineMMLentity prap 227E {unknown} precedes, approximate +\defineMMLentity prcue 227C {unknown} precedes, curly equals +\defineMMLentity prE 227C {unknown} precedes, double equals +\defineMMLentity pre 227C {\preceq} precedes, equals +\defineMMLentity prsim 227E {unknown} precedes, similar +\defineMMLentity prurel 22B0 {unknown} element precedes under relation +\defineMMLentity ratio 2236 {unknown} ratio +\defineMMLentity rtrie 22B5 {unknown} right triangle, equals +\defineMMLentity rtriltri E359 {unknown} right triangle above left triangle +\defineMMLentity Sc E35D {unknown} double succeeds +\defineMMLentity sc 227B {\succ} succeeds +\defineMMLentity scap 227F {unknown} succeeds, approximate +\defineMMLentity sccue 227D {unknown} succeeds, curly equals +\defineMMLentity scE 227E {unknown} succeeds, double equals +\defineMMLentity sce 227D {\succeq} succeeds, equals +\defineMMLentity scsim 227F {unknown} succeeds, similar +\defineMMLentity sdote E319 {unknown} equal, dot below +\defineMMLentity sfrown E426 {unknown} small down curve +\defineMMLentity simg E30C {unknown} similar, greater +\defineMMLentity simgE E338 {unknown} similar, greater, equal +\defineMMLentity siml E30B {unknown} similar, less +\defineMMLentity simlE E337 {unknown} similar, less, equal +\defineMMLentity smid E301 {unknown} shortmid +\defineMMLentity smile 2323 {\smile} up curve +\defineMMLentity smt E339 {unknown} smaller than +\defineMMLentity smte E33B {unknown} smaller than or equal +\defineMMLentity smtes E33D {unknown} smaller than or equal, slanted +\defineMMLentity spar E302 {unknown} short parallel +\defineMMLentity sqsub 228F {unknown} square subset +\defineMMLentity sqsube 2291 {\sqsubseteq} square subset, equals +\defineMMLentity sqsup 2290 {unknown} square superset +\defineMMLentity sqsupe 2292 {\sqsupseteq} square superset, equals +\defineMMLentity ssmile E303 {unknown} small up curve +\defineMMLentity Sub 22D0 {unknown} double subset +\defineMMLentity subE 2286 {unknown} subset, double equals +\defineMMLentity subedot E34F {unknown} subset, equals, dot +\defineMMLentity submult E343 {unknown} subset, multiply +\defineMMLentity subplus E341 {unknown} subset, plus +\defineMMLentity subrarr E33F {unknown} subset, right arrow +\defineMMLentity subsim E345 {unknown} subset, similar +\defineMMLentity subsub E349 {unknown} subset above subset +\defineMMLentity subsup E347 {unknown} subset above superset +\defineMMLentity Sup 22D1 {unknown} double superset +\defineMMLentity supdsub E34C {unknown} superset, subset, dash joining them +\defineMMLentity supE 2287 {unknown} superset, double equals +\defineMMLentity supedot E350 {unknown} superset, equals, dot +\defineMMLentity suphsol E34E {unknown} superset, solidus +\defineMMLentity suphsub E34B {unknown} superset, subset +\defineMMLentity suplarr E340 {unknown} superset, left arrow +\defineMMLentity supmult E344 {unknown} superset, multiply +\defineMMLentity supplus E342 {unknown} superset, plus +\defineMMLentity supsim E346 {unknown} superset, similar +\defineMMLentity supsub E348 {unknown} superset above subset +\defineMMLentity supsup E34A {unknown} superset above superset +\defineMMLentity thkap E306 {unknown} thick approximate +\defineMMLentity thksim E429 {unknown} thick similar +\defineMMLentity topfork E31C {unknown} fork with top +\defineMMLentity trie 225C {unknown} triangle, equals +\defineMMLentity twixt 226C {unknown} between +\defineMMLentity Vbar E30D {unknown} double vert, bar (under) +\defineMMLentity vBar E310 {unknown} vert, double bar (under) +\defineMMLentity vBarv E312 {unknown} double bar, vert over and under +\defineMMLentity VDash 22AB {unknown} double vert, double dash +\defineMMLentity Vdash 22A9 {unknown} double vertical, dash +\defineMMLentity vDash 22A8 {unknown} vertical, double dash +\defineMMLentity vdash 22A2 {\vdash} vertical, dash +\defineMMLentity Vdashl E313 {unknown} vertical, dash (long) +\defineMMLentity vltri 22B2 {\triangleleft} left triangle, open, variant +\defineMMLentity vprop 221D {unknown} proportional, variant +\defineMMLentity vrtri 22B3 {\triangleright} right triangle, open, variant +\defineMMLentity Vvdash 22AA {unknown} triple vertical, dash diff --git a/tex/context/base/xtag-mer.tex b/tex/context/base/xtag-mer.tex deleted file mode 100644 index becff584a..000000000 --- a/tex/context/base/xtag-mer.tex +++ /dev/null @@ -1,185 +0,0 @@ -% filtered from html files by Patrick Ion -% -% ISOAMSR Characters Extended -% -% Added Math Symbols: Relations - -\defineMMLentity apE E315 {unknown} approximately equal or equal to -\defineMMLentity ape 224A {unknown} approximate, equals -\defineMMLentity apid 224B {unknown} approximately identical to -\defineMMLentity asymp 224D {\asymp} asymptotically equal to -\defineMMLentity Barv E311 {unknown} vert, double bar (over) -\defineMMLentity bcong 224C {unknown} reverse congruent -\defineMMLentity bepsi E420 {unknown} such that -\defineMMLentity bowtie 22C8 {unknown} bowtie -\defineMMLentity bsim 223D {unknown} reverse similar -\defineMMLentity bsime 22CD {unknown} reverse similar, equals -\defineMMLentity bsolhsub E34D {unknown} reverse solidus, subset -\defineMMLentity bump 224E {unknown} bumpy equals -\defineMMLentity bumpe 224F {unknown} bumpy equals, equals -\defineMMLentity cire 2257 {unknown} circle, equals -\defineMMLentity Colon 2237 {unknown} two colons -\defineMMLentity Colone E30E {unknown} double colon, equals -\defineMMLentity colone 2254 {unknown} colon, equals -\defineMMLentity congdot E314 {unknown} congruent, dot -\defineMMLentity csub E351 {unknown} subset, closed -\defineMMLentity csube E353 {unknown} subset, closed, equals -\defineMMLentity csup E352 {unknown} superset, closed -\defineMMLentity csupe E354 {unknown} superset, closed, equals -\defineMMLentity cuepr 22DE {unknown} curly equals, precedes -\defineMMLentity cuesc 22DF {unknown} curly equals, succeeds -\defineMMLentity Dashv E30F {unknown} double dash, vertical -\defineMMLentity dashv 22A3 {\dashv} dash, vertical -\defineMMLentity easter 225B {unknown} equal, asterisk above -\defineMMLentity ecir 2256 {unknown} circle on equals sign -\defineMMLentity ecolon 2255 {unknown} equals, colon -\defineMMLentity eDDot E309 {unknown} equal with four dots -\defineMMLentity eDot 2251 {unknown} equals, even dots -\defineMMLentity efDot 2252 {unknown} equals, falling dots -\defineMMLentity eg E328 {unknown} equal-or-greater -\defineMMLentity egs 22DD {unknown} equal-or-gtr, slanted -\defineMMLentity egsdot E324 {unknown} equal-or-greater, slanted, dot inside -\defineMMLentity el E327 {unknown} equal-or-less -\defineMMLentity els 22DC {unknown} eq-or-less, slanted -\defineMMLentity elsdot E323 {unknown} equal-or-less, slanted, dot inside -\defineMMLentity equest 225F {unknown} equal with questionmark -\defineMMLentity equivDD E318 {unknown} equivalent, four dots above -\defineMMLentity erDot 2253 {unknown} equals, rising dots -\defineMMLentity esdot 2250 {unknown} equals, single dot above -\defineMMLentity Esim E317 {unknown} equal, similar -\defineMMLentity esim 2242 {unknown} equals, similar -\defineMMLentity fork 22D4 {unknown} pitchfork -\defineMMLentity forkv E31B {unknown} fork, variant -\defineMMLentity frown 2322 {\frown} down curve -\defineMMLentity gap 2273 {unknown} greater, approximate -\defineMMLentity gE 2267 {unknown} greater, double equals -\defineMMLentity gEl 22DB {unknown} gt, double equals, less -\defineMMLentity gel 22DB {unknown} greater, equals, less -\defineMMLentity ges E421 {unknown} gt-or-equal, slanted -\defineMMLentity gescc E358 {unknown} greater than, closed by curve, equal, slanted -\defineMMLentity gesdot E31E {unknown} greater-than-or-equal, slanted, dot inside -\defineMMLentity gesdoto E320 {unknown} greater-than-or-equal, slanted, dot above -\defineMMLentity gesdotol E322 {unknown} greater-than-or-equal, slanted, dot above left -\defineMMLentity gesl E32C {unknown} greater, equal, slanted, less -\defineMMLentity gesles E332 {unknown} greater, equal, slanted, less, equal, slanted -\defineMMLentity Gg 22D9 {unknown} triple gtr-than -\defineMMLentity gl 2277 {unknown} greater, less -\defineMMLentity gla E330 {unknown} greater, less, apart -\defineMMLentity glE E32E {unknown} greater, less, equal -\defineMMLentity glj E32F {unknown} greater, less, overlapping -\defineMMLentity gsim 2273 {unknown} greater, similar -\defineMMLentity gsime E334 {unknown} greater, similar, equal -\defineMMLentity gsiml E336 {unknown} greater, similar, less -\defineMMLentity Gt 226B {unknown} double greater-than sign -\defineMMLentity gtcc E356 {unknown} greater than, closed by curve -\defineMMLentity gtcir E326 {unknown} greater than, circle inside -\defineMMLentity gtdot 22D7 {unknown} greater than, with dot -\defineMMLentity gtquest E32A {unknown} greater than, questionmark above -\defineMMLentity gtrarr E35F {unknown} greater than, right arrow -\defineMMLentity homtht 223B {unknown} homothetic -\defineMMLentity lap 2272 {unknown} less, approximate -\defineMMLentity lat E33A {unknown} larger than -\defineMMLentity late E33C {unknown} larger than or equal -\defineMMLentity lates E33E {unknown} larger than or equal, slanted -\defineMMLentity lE 2266 {unknown} less, double equals -\defineMMLentity lEg 22DA {unknown} less, double equals, greater -\defineMMLentity leg 22DA {unknown} less, equals, greater -\defineMMLentity les E425 {unknown} less-than-or-equals, slant -\defineMMLentity lescc E357 {unknown} less than, closed by curve, equal, slanted -\defineMMLentity lesdot E31D {unknown} less-than-or-equal, slanted, dot inside -\defineMMLentity lesdoto E31F {unknown} less-than-or-equal, slanted, dot above -\defineMMLentity lesdotor E321 {unknown} less-than-or-equal, slanted, dot above right -\defineMMLentity lesg E32B {unknown} less, equal, slanted, greater -\defineMMLentity lesges E331 {unknown} less, equal, slanted, greater, equal, slanted -\defineMMLentity lg 2276 {unknown} less, greater -\defineMMLentity lgE E32D {unknown} less, greater, equal -\defineMMLentity Ll 22D8 {unknown} triple less-than -\defineMMLentity lsim 2272 {unknown} less, similar -\defineMMLentity lsime E333 {unknown} less, similar, equal -\defineMMLentity lsimg E335 {unknown} less, similar, greater -\defineMMLentity Lt 226A {unknown} double less-than sign -\defineMMLentity ltcc E355 {unknown} less than, closed by curve -\defineMMLentity ltcir E325 {unknown} less than, circle inside -\defineMMLentity ltdot 22D6 {unknown} less than, with dot -\defineMMLentity ltlarr E35E {unknown} less than, left arrow -\defineMMLentity ltquest E329 {unknown} less than, questionmark above -\defineMMLentity ltrie 22B4 {unknown} left triangle, equals -\defineMMLentity mcomma E31A {unknown} minus, comma above -\defineMMLentity mDDot 223A {unknown} minus with four dots, geometric properties -\defineMMLentity mid 2223 {\mid} mid -\defineMMLentity mlcp E30A {unknown} transversal intersection -\defineMMLentity models 22A7 {\models} models -\defineMMLentity mstpos 223E {unknown} most positive -\defineMMLentity Pr E35C {unknown} double precedes -\defineMMLentity pr 227A {\prec} precedes -\defineMMLentity prap 227E {unknown} precedes, approximate -\defineMMLentity prcue 227C {unknown} precedes, curly equals -\defineMMLentity prE 227C {unknown} precedes, double equals -\defineMMLentity pre 227C {\preceq} precedes, equals -\defineMMLentity prsim 227E {unknown} precedes, similar -\defineMMLentity prurel 22B0 {unknown} element precedes under relation -\defineMMLentity ratio 2236 {unknown} ratio -\defineMMLentity rtrie 22B5 {unknown} right triangle, equals -\defineMMLentity rtriltri E359 {unknown} right triangle above left triangle -\defineMMLentity Sc E35D {unknown} double succeeds -\defineMMLentity sc 227B {\succ} succeeds -\defineMMLentity scap 227F {unknown} succeeds, approximate -\defineMMLentity sccue 227D {unknown} succeeds, curly equals -\defineMMLentity scE 227E {unknown} succeeds, double equals -\defineMMLentity sce 227D {\succeq} succeeds, equals -\defineMMLentity scsim 227F {unknown} succeeds, similar -\defineMMLentity sdote E319 {unknown} equal, dot below -\defineMMLentity sfrown E426 {unknown} small down curve -\defineMMLentity simg E30C {unknown} similar, greater -\defineMMLentity simgE E338 {unknown} similar, greater, equal -\defineMMLentity siml E30B {unknown} similar, less -\defineMMLentity simlE E337 {unknown} similar, less, equal -\defineMMLentity smid E301 {unknown} shortmid -\defineMMLentity smile 2323 {\smile} up curve -\defineMMLentity smt E339 {unknown} smaller than -\defineMMLentity smte E33B {unknown} smaller than or equal -\defineMMLentity smtes E33D {unknown} smaller than or equal, slanted -\defineMMLentity spar E302 {unknown} short parallel -\defineMMLentity sqsub 228F {unknown} square subset -\defineMMLentity sqsube 2291 {\sqsubseteq} square subset, equals -\defineMMLentity sqsup 2290 {unknown} square superset -\defineMMLentity sqsupe 2292 {\sqsupseteq} square superset, equals -\defineMMLentity ssmile E303 {unknown} small up curve -\defineMMLentity Sub 22D0 {unknown} double subset -\defineMMLentity subE 2286 {unknown} subset, double equals -\defineMMLentity subedot E34F {unknown} subset, equals, dot -\defineMMLentity submult E343 {unknown} subset, multiply -\defineMMLentity subplus E341 {unknown} subset, plus -\defineMMLentity subrarr E33F {unknown} subset, right arrow -\defineMMLentity subsim E345 {unknown} subset, similar -\defineMMLentity subsub E349 {unknown} subset above subset -\defineMMLentity subsup E347 {unknown} subset above superset -\defineMMLentity Sup 22D1 {unknown} double superset -\defineMMLentity supdsub E34C {unknown} superset, subset, dash joining them -\defineMMLentity supE 2287 {unknown} superset, double equals -\defineMMLentity supedot E350 {unknown} superset, equals, dot -\defineMMLentity suphsol E34E {unknown} superset, solidus -\defineMMLentity suphsub E34B {unknown} superset, subset -\defineMMLentity suplarr E340 {unknown} superset, left arrow -\defineMMLentity supmult E344 {unknown} superset, multiply -\defineMMLentity supplus E342 {unknown} superset, plus -\defineMMLentity supsim E346 {unknown} superset, similar -\defineMMLentity supsub E348 {unknown} superset above subset -\defineMMLentity supsup E34A {unknown} superset above superset -\defineMMLentity thkap E306 {unknown} thick approximate -\defineMMLentity thksim E429 {unknown} thick similar -\defineMMLentity topfork E31C {unknown} fork with top -\defineMMLentity trie 225C {unknown} triangle, equals -\defineMMLentity twixt 226C {unknown} between -\defineMMLentity Vbar E30D {unknown} double vert, bar (under) -\defineMMLentity vBar E310 {unknown} vert, double bar (under) -\defineMMLentity vBarv E312 {unknown} double bar, vert over and under -\defineMMLentity VDash 22AB {unknown} double vert, double dash -\defineMMLentity Vdash 22A9 {unknown} double vertical, dash -\defineMMLentity vDash 22A8 {unknown} vertical, double dash -\defineMMLentity vdash 22A2 {\vdash} vertical, dash -\defineMMLentity Vdashl E313 {unknown} vertical, dash (long) -\defineMMLentity vltri 22B2 {\triangleleft} left triangle, open, variant -\defineMMLentity vprop 221D {unknown} proportional, variant -\defineMMLentity vrtri 22B3 {\triangleright} right triangle, open, variant -\defineMMLentity Vvdash 22AA {unknown} triple vertical, dash diff --git a/tex/context/base/xtag-mmc.mkii b/tex/context/base/xtag-mmc.mkii new file mode 100644 index 000000000..27e2c42ea --- /dev/null +++ b/tex/context/base/xtag-mmc.mkii @@ -0,0 +1,1265 @@ +%D \module +%D [ file=xtag-mmc, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Content MathML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Content MathML} + +% this is the first, experimental, shabby implementation, as +% always, the third will do -) + +% okay, now this is the second one, with a more kid based +% approach, which we needed for proper nesting, but the +% code is still too ugly + +\startXMLmapping[mml] + +\unprotect + +\def\MMLccomma{{,}} + +\def\getmmlarguments#1#2#3#4#5#6% {class} {defaults} mmlargs + {\getXMLarguments{#1}{#2 #5}}% + +\def\doifMMLoperatorelse#1#2#3% temp hack + {\pushmacro\xmlrent + \let\xmlrent\firstofoneargument + \edef\mmloperator{#1}% + \@EA\unspaceargument\mmloperator\to\mmloperator + \popmacro\xmlrent + \doifXMLentityelse\mmloperator + {\doifdefinedelse{doMMLcFN\mmloperator}{#2}{#3}} + {#3}} + +\remapXMLsequence [ci] [CPA] \MMLcCI +\remapXMLsequence [cn] [CPA] \MMLcCN +\remapXMLsequence [csymbol] [CPA] \MMLcCSYMBOL + +\setupMMLappearance[polar][\c!alternative=\v!a] % a|b|c + +\def\MMLcpolar#1% + {\doifdefinedelse{MMLcdopolar\@@MMLpolaralternative} + {\getvalue{MMLcdopolar\@@MMLpolaralternative}{#1}} + {#1}} + +\def\MMLcdopolara#1% + {\def\MMLcsep{\MMLccomma}\getXMLentity{polar}\left(#1\right)} + +\def\MMLcdopolarb#1% + {\def\MMLcsep##1\empty% + {\getXMLentity{exponentiale}^{##1\mskip2mu\getXMLentity{imaginaryi}}}#1} + +\def\MMLcdopolarc#1% + {\def\MMLcsep##1\empty% + {\getXMLentity{exp}\left(##1\mskip2mu\getXMLentity{imaginaryi}\right)}#1} + +\def\MMLccartesian#1% + {\def\MMLcsep{+}#1\getXMLentity{imaginaryi}} + +% float will be obsolete, an is replace by e-notation + +\setupMMLappearance[float][\c!symbol=\v!no] % \v!yes|dot + +\def\MMLcfloat#1% + {\doifelse\@@MMLfloatsymbol\v!no + {{\rm#1}} % make sure that e shows up ok + {% we should ignore \entities ! + \beforesplitstring#1\at e\to\first + \aftersplitstring #1\at e\to\last + \ifx\first\empty #1\else + \ifx\last \empty #1\else + \first + \doifelse\@@MMLfloatsymbol{dot}\cdot\times + 10^{\last}% + \fi\fi}} + +% we now have: + +\setupMMLappearance[enotation][\c!symbol=\v!no] % \v!yes|dot + +\def\MMLcenotation#1% + {\doifelse\@@MMLenotationsymbol\v!no + {\def\MMLcsep {\unskip{\rm e}\ignorespaces}} + {\def\MMLcsep##1\empty{\doifelse\@@MMLenotationsymbol{dot}\cdot\times10^{##1}}}% + #1\empty} + +\def\MMLcCI#1% #2% can be sped up with \doifundefined ... + {\getXMLarguments{ci}{type="" #1}% + \doifXMLparelse{ci}{type} + {\processaction + [\XMLpar{ci}{type}{}] + [ set=>\let\next\MMLcCIset, + vector=>\let\next\MMLcCIvector, + matrix=>\let\next\MMLcCImatrix, + function=>\let\next\MMLcCIfunction, +complex-cartesian=>\let\next\MMLccartesian, + complex=>\let\next\MMLccartesian, + complex-polar=>\let\next\MMLcpolar, + polar=>\let\next\MMLcpolar, + fn=>\let\next\MMLcCIfunction, + unknown=>\let\next\firstofoneargument]} % integer constant real float + {\let\next\firstofoneargument}% + \next} + +\def\MMLcCIset#1% + {{\bbd#1}} + +\def\widevec#1% + {\vbox{\mathsurround\zeropoint\ialign{##\crcr + \rightarrowfill\crcr\noalign{\nointerlineskip}% + $\hfil\displaystyle{#1}\hfil$\crcr}}} + +\def\MMLcCIvector#1% + {\widevec{#1}} + +\def\MMLcCImatrix#1% + {{\bi#1}} + +\def\MMLcCIfunction#1% + {\doifMMLoperatorelse{#1}\MMLcCIdefault\MMLcFNdefault{}{#1}} + +\def\MMLcCIdefault#1#2% #1=dummy + {#2%\!% \getXMLentity{NegThinSpace}% looks bad in A(x) + \doifnextcharelse\xmlr + {\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}} + {}} + +% \def\MMLcFNdefault#1#2% neg space needed because of \left +% {#2\!% \getXMLentity{NegThinSpace}% +% \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}} + +\def\MMLcCN#1% #2% can be sped up with \doifundefined ... + {\getXMLarguments{cn}{type="" #1}% + \doifXMLparelse{cn}{type} + {\processaction + [\XMLpar{cn}{type}{}] + [ integer=>\let\next\MMLcCNinteger, + logical=>\let\next\MMLcCNlogical, + rational=>\let\next\MMLcCNrational, +complex-cartesian=>\let\next\MMLccartesian, + complex=>\let\next\MMLccartesian, + complex-polar=>\let\next\MMLcpolar, + polar=>\let\next\MMLcpolar, + e-notation=>\let\next\MMLcenotation, % new + float=>\let\next\MMLcfloat, % obsolete + real=>\let\next\MMLcfloat, % ? + unknown=>\let\next\firstofoneargument]} + {\let\next\firstofoneargument} + \next} + +\setupMMLappearance[base][\c!symbol=\v!numbers] % cijfers|letters|tekst|nee + +\def\MMLcCNinteger#1% + {\doifXMLparelse{cn}{base} + {\def\MMLcCNbase{\XMLpar{cn}{base}{}}% + \doifelse\@@MMLbasesymbol\v!no + {\MMLcCNbasedata{#1}} + {\MMLcCNbasedata{#1}_{\hbox{$\rm\scriptscriptstyle + \processaction + [\@@MMLbasesymbol] + [\v!characters=>\MMLcCNbasestring BODH, + \v!text=>\MMLcCNbasestring{BIN}{OCT}{DEC}{HEX}, + \s!unknown=>\MMLcCNbase]$}}}} + {#1}} + +\def\MMLcCNbasedata#1% + {\ifnum\MMLcCNbase>10{\rm#1}\else#1\fi} + +\def\MMLcCNbasestring#1#2#3#4% + {\ifnum\MMLcCNbase= 2 #1\else + \ifnum\MMLcCNbase= 8 #2\else + \ifnum\MMLcCNbase=10 #3\else + \ifnum\MMLcCNbase=16 #4\else + \MMLcCNbase \fi\fi\fi\fi} + +\def\MMLcCNlogical#1% + {{\rm#1}} + +\def\MMLcCNrational#1% + {\ConvertConstantAfter\doifinstringelse{sep}{#1} + {\doMMLcCNrational#1\empty} + {#1}} + +\def\doMMLcCNrational#1\xmlr#2#3#4#5\empty + {\hbox{$\frac{#1}{#5}$}} + +\def\MMLcCSYMBOL#1#2% TO DO + {\getXMLarguments{csymbol}{encoding="text" #1}% + \doifelse{\XMLpar{csymbol}{encoding}{}}{text} + {{\rm#2}}{#2}} + +%%% basic content elements + +\remapXMLsequence [apply] [CPA] \MMLcAPPLY + +\newcount\@MMLlevel \def\MMLcreset{\@MMLlevel=0 } + +\let\MMLctempresetlist\empty \def\setMMLcreset{\edef\MMLctempresetlist} + +\def\MMLcmainresetlist% + {times/,divide/,power/,% + lt/,gt/,eq/,leq/,geq/,% + in/,inverse/,% + fn,% + floor/,ceiling/,% + mean/,% + selector/,% + abs/,int/,limit/,sum/,product/,% + outerproduct/,innerproduct/,scalarproduct/} + +\def\MMLcfunctionlist + {sin/,arcsin/,sinh/,arcsinh/,% + cos/,arccos/,cosh/,arccosh/,% + tan/,arctan/,tanh/,arctanh/,% + cot/,arccot/,coth/,arccoth/,% + csc/,arccsc/,csch/,arccsch/,% + sec/,arcsec/,sech/,arcsech/,% + ln/,exp/,log/,% + abs/,int/,limit/,sum/,product/,% + fn} % ? + +\def\MMLcconstructlist + {diff/,partialdiff/,root/} % apply goes wrong on 1/2 * (a_2 + b_3) + +% better: no () here but explicitly when needed, which is in +% less cases + +\def\MMLcAPPLY#1#2% + {\mathinner{\begingroup % new, else 1/2(1+2) problem / inner: ask taco + \pushmacro\xmlr + \@EA\@EA\@EA\doifXMLRchild\@EA\@EA\@EA{\@EA\MMLcmainresetlist\@EA,\MMLctempresetlist}{#2} + {\MMLcreset}% + \ifcase\@MMLlevel + \getXMLarguments{apply}{open="" close="" #1}% + \else + \getXMLarguments{apply}{open="(" close=")" #1}% + \fi + \doifXMLparelse{apply}{open}{\left\XMLpar{apply}{open}{}}{}% + \advance\@MMLlevel+1 + \begingroup + \let\MMLctempresetlist\empty + \let\xmlr\naturalxmlr % beter een \pushmacro\xmlr + #2\empty + \endgroup % ook level push + \advance\@MMLlevel-1 + \doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}{}% + \popmacro\xmlr + \endgroup}} + +\remapXMLsequence [reln] [CPA] \MMLcRELN + +\def\MMLcRELN% + {\writestatus{XML}{MathML element "reln" is obsolete}\MMLcAPPLY} + +\remapXMLsequence [fn] [CPA] \MMLcFN + +\def\MMLcFN#1#2% neg space needed because of \left + {\doifXMLRchildelse{ci}{#2} + {\collectXMLRchild{ci}{#2}% + \@EA\doifMMLoperatorelse\@EA{\the\XMLRtoks} + \MMLcFNoperator\MMLcFNdefault} + {\MMLcFNdefault}% + {#1}{#2}} + +\def\MMLcFNdefault#1#2% neg space needed because of \left + {#2\!% \getXMLentity{NegThinSpace}% + \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}} + +% special function handlers + +\def\MMLcFNoperator + {\getvalue{doMMLcFN\mmloperator}} + +% \def\doMMLcFNplusminus#1#2#3\empty +% {\countXMLRchildren{#3}% +% \ifcase\nofXMLRchildren\or +% #2#3% +% \else % suboptimal for instance under root +% \encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}% +% \fi} + +\def\doMMLcFNplusminus#1#2#3\empty + {\countXMLRchildren{#3}% + \ifcase\nofXMLRchildren\or + \def\next{#2#3}% + \else + \def\next + {\doifnextcharelse\xmlr + {\encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}}% + {\encapsulateXMLR{}{#2}{}{\MMLcreset#3}}}% + \fi + \next} + +\let\doMMLcFNminusplus\doMMLcFNplusminus + +\def\doMMLcFNcontinued#1#2#3\empty + {#3\getXMLentity{continued}} + +% so far for the special handlers + +\remapXMLsequence [interval] [CPA] \MMLcINTERVAL + +\def\MMLcINTERVAL#1#2% + {\withnexttwoXMLRelements + {\getXMLarguments{interval}{closure="closed" #1}% + \processaction + [\XMLpar{interval}{closure}{closed}] + [ closed=>{[\firstXMLRelement,\secondXMLRelement]}, + open-closed=>{(\firstXMLRelement,\secondXMLRelement]}, + closed-open=>{[\firstXMLRelement,\secondXMLRelement)}, + open=>{(\firstXMLRelement,\secondXMLRelement)}, + \s!unknown=>{[\firstXMLRelement,\secondXMLRelement]}]}% + #2\empty} + +\remapXMLsingular [inverse] [CPA] \MMLcINVERSE + +\def\MMLcINVERSE#1#2% + {\withnextXMLRelement + {\nextXMLRelement\empty^{-1}% \empty kills MMLcfunction lookahead + \withnextXMLRelement + {\ifx\nextXMLRelement\empty \else + \left[\nextXMLRelement\right]% + \fi}}} + +\remapXMLsingular [sep] [CPA] \MMLcSEP + +\def\MMLcSEP#1#2{\MMLcsep} \def\MMLcsep{\,} + +\remapXMLsequence [condition] [CPA] \MMLcCONDITION + +\def\MMLcCONDITION#1#2% + {\pushmacro\MMLcBVAR + \doifXMLRchild{bvar}{#2}{\processXMLRchild{bvar}{#2}\mid}% + \let\MMLcBVAR\ignoreXMLRelement + \processXMLRchildren{#2}% + \popmacro\MMLcBVAR} + +\remapXMLsequence [declare] [CPA] \MMLcDECLARE + +\setupMMLappearance[declare][\c!state=\v!start] + +\def\MMLcDECLARE#1#2% + {\doif\@@MMLdeclarestate\v!start + {\withnextXMLRelement + {\getXMLentity{declare}\nextXMLRelement + \countXMLRchildren{#2}% + \ifnum\nofXMLRchildren>1 + \;% \getXMLentity{ThickSpace}% + \getXMLentity{as}% + \;% \getXMLentity{ThickSpace}% + \fi}% + #2\empty}} + +\remapXMLsequence [lambda] [CPA] \MMLcLAMBDA + +\setupMMLappearance[lambda][\c!alternative=b] + +\def\MMLcLAMBDA#1#2% + {\doifelse\@@MMLlambdaalternative\v!a + {\encapsulateXMLR{\getXMLentity{lambda}(}{\MMLccomma}{)}{#2}} + {\countXMLRchild{bvar}{#2}% + \ifnum\nofXMLRchildren>1 + \collectXMLRchild{bvar}{#2}% + \encapsulateXMLR{\left(}{\MMLccomma}{\right)}{\the\XMLRtoks}% + \else + \processXMLRchild{bvar}{#2}% + \fi + \getXMLentity{mapsto}% + \processXMLRchild{apply,reln,ci,cn}{#2}}} + +\remapXMLsingular [compose] [CPA] \MMLcCOMPOSE + +\def\MMLcCOMPOSE#1#2#3\empty + {\doifMMLfunctionelse{#3} + {\encapsulateXMLR{\left(}{\circ}{\right)}{#3}} + {\encapsulateXMLR{}{\circ}{}{#3}}} + +\remapXMLsingular [ident] [CPA] \MMLcIDENT + +\def\MMLcIDENT#1#2{\getXMLentity{identity}} + +\remapXMLsingular [domain] [CPA] \MMLcDOMAIN +\remapXMLsingular [codomain] [CPA] \MMLcCODOMAIN + +\def\MMLcDOMAIN #1#2#3\empty + {\getXMLentity{domain}(\MMLcreset\processXMLRchildren{#3})} + +\def\MMLcCODOMAIN#1#2#3\empty + {\getXMLentity{codomain}(\MMLcreset\processXMLRchildren{#3})} + +\remapXMLsingular [image] [CPA] \MMLcIMAGE + +\def\MMLcIMAGE#1#2% + {\withnextXMLRelement{\getXMLentity{image}(\nextXMLRelement)}} + +\remapXMLsequence [domainofapplication] [CPA] \MMLcDOMAINOFAPPLICATION + +\def\MMLcDOMAINOFAPPLICATION#1#2{#2} + +\remapXMLsequence [piecewise] [CPA] \MMLcPIECEWISE +\remapXMLsequence [piece] [CPA] \MMLcPIECE +\remapXMLsequence [otherwise] [CPA] \MMLcOTHERWISE + +\setupMMLappearance[piece][\c!separator=] + +\def\MMLcPIECEWISE#1#2% + {\cases{#2}} + +\def\MMLcPIECEseparator{\doif\@@MMLpieceseparator\v!yes,} + +\def\MMLcPIECE#1#2% + {\withnexttwoXMLRelements + {\@EA\XMLRtoks\@EA{\firstXMLRelement\MMLcPIECEseparator\@col@amp@}% + \@EA\appendtoks\@EA\mathematics\@EA{\secondXMLRelement}\to\XMLRtoks + \the\XMLRtoks\crcr}% + #2} + +\def\MMLcOTHERWISE#1#2% + {#2\MMLcPIECEseparator\@col@amp@\mathematics{\getXMLentity{otherwise}}\crcr} + +%%% arithmic, algebra and logic + +\remapXMLsingular [quotient] [CPA] \MMLcQUOTIENT + +\def\MMLcQUOTIENT#1#2% + {\withnexttwoXMLRelements{\lfloor\firstXMLRelement/\secondXMLRelement\rfloor}} + +\remapXMLsingular [factorial] [CPA] \MMLcFACTORIAL + +\def\MMLcFACTORIAL#1#2% + {\withnextXMLRelement{\nextXMLRelement !}} + +\remapXMLsingular [divide] [CPA] \MMLcDIVIDE + +\setupMMLappearance [divide] [\c!level=\!!maxcard] + +\def\MMLcDIVIDE#1#2% + {\withnexttwoXMLRelements + {\increment\MMLcDIVIDElevel + \ifnum\MMLcDIVIDElevel>\@@MMLdividelevel\space + \firstXMLRelement/\secondXMLRelement + \else + \frac{\MMLcreset\firstXMLRelement}{\MMLcreset\secondXMLRelement}% + \fi + \decrement\MMLcDIVIDElevel}} + +\remapXMLsingular [min] [CPA] \MMLcMIN +\remapXMLsingular [max] [CPA] \MMLcMAX + +\def\MMLcMIN#1#2#3\empty + {\encapsulateXMLR + {\min\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{} + {\MMLccomma}{\right\}}{#3}} + +\def\MMLcMAX#1#2#3\empty + {\encapsulateXMLR + {\max\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{} + {\MMLccomma}{\right\}}{#3}} + +\remapXMLsingular [minus] [CPA] \MMLcMINUS +\remapXMLsingular [plus] [CPA] \MMLcPLUS + +\setupMMLappearance[sign][\c!reduction=\v!yes] + +\def\MMLcMINUS % expandafter needed ? + {\doifelse\@@MMLsignreduction\v!yes + {\expandafter\MMLcMINUSyes}{\expandafter\MMLcMINUSno}} + +\def\MMLcPLUS % expandafter needed ? + {\doifelse\@@MMLsignreduction\v!yes + {\expandafter\MMLcPLUSyes}{\expandafter\MMLcPLUSno}} + +\def\MMLcMINUSno#1#2#3\empty + {\countXMLRchildren{#3}% + \encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}} + +\def\MMLcPLUSno#1#2#3\empty + {\countXMLRchildren{#3}% + \encapsulateXMLR{\ifcase\nofXMLRchildren\or+\fi}{+}{}{#3}} + +\def\MMLcMINUSyes#1#2#3\empty + {\setMMLcreset{\MMLcfunctionlist}% + \countXMLRchildren{#3}% + \encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}} + +\def\MMLcPLUSyes#1#2#3\empty + {\setMMLcreset{plus/,minus/,\MMLcfunctionlist,\MMLcconstructlist}% + \encapsulatenextXMLRelements + {} + {\doifXMLRchildelse{apply}{\nextXMLRelement}% + {\collectXMLRchild{apply}{\nextXMLRelement}% + \doifXMLRchildelse{minus/}{\the\XMLRtoks} + {\countXMLRchildren{\the\XMLRtoks} + \ifnum\nofXMLRchildren>2 +\else\fi}{+}} + {+}} + {} + {#3\empty}} + +\remapXMLsingular [power] [CPA] \MMLcPOWER + +\setupMMLappearance[power][\c!reduction=\v!yes] + +\let\MMLpowerelement\empty + +\def\MMLcPOWER#1#2% + {\withnexttwoXMLRelements + {\doifXMLRchildelse{apply}{\firstXMLRelement} + {\doifelse\@@MMLpowerreduction\v!yes + {\collectXMLRchild{apply}{\firstXMLRelement}% + \@EA\doifXMLRchildelse\@EA{\MMLcfunctionlist}{\the\XMLRtoks} + {\let\MMLpowerelement\secondXMLRelement + \MMLcreset\firstXMLRelement\empty} + {\left(\MMLcreset\firstXMLRelement\empty\right)^{\MMLcreset\secondXMLRelement}}} + {\left(\MMLcreset\firstXMLRelement\empty\right)^{\MMLcreset\secondXMLRelement}}} + {\firstXMLRelement^{\MMLcreset\secondXMLRelement}}}} + +\remapXMLsingular [rem] [CPA] \MMLcREM + +\def\MMLcREM#1#2% + {\withnexttwoXMLRelements + {\firstXMLRelement\getXMLentity{mod}\secondXMLRelement}} + +\remapXMLsingular [times] [CPA] \MMLcTIMES + +\setupMMLappearance[times][\c!symbol=\v!no] % +\setupMMLappearance[times][\c!auto=\v!yes] % new, auto catches cn cn cn + +\def\MMLcTIMES#1#2#3\empty + {\setMMLcreset{\MMLcfunctionlist,\MMLcconstructlist}% + \doifelse\@@MMLtimesauto\v!no + {\let\@@MMLtimes@@symbol\@@MMLtimessymbol} + {\doifelseXMLRneighbors{cn}{#3} + {\let\@@MMLtimes@@symbol\v!yes} + {\let\@@MMLtimes@@symbol\@@MMLtimessymbol}}% + \doifelse\@@MMLtimes@@symbol\v!yes + {\encapsulateXMLR{}{\times}{}{#3\empty}} + {\doifelse\@@MMLtimes@@symbol{dot} + {\encapsulateXMLR{}{\cdot}{}{#3\empty}} + {#3\empty}}} + +\remapXMLsingular [root] [CPA] \MMLcROOT + +\setupMMLappearance[root][\c!symbol=\v!yes] + +\def\MMLcROOT#1#2#3\empty + {\doifXMLRchildelse{degree}{#3}\donetrue\donefalse + \doif\@@MMLrootsymbol\v!no\donefalse + \ifdone + \root\processXMLRchild{degree}{#3}\of + {\let\MMLcDEGREE\ignoreXMLRelement + \MMLcreset\processXMLRchildren{#3}}% + \else + \sqrt + {\MMLcreset\processXMLRchildren{#3}}% + \fi} + +\remapXMLsingular [gcd] [CPA] \MMLcGCD + +\def\MMLcGCD#1#2#3\empty{\encapsulateXMLR{\gcd(}{\MMLccomma}{)}{#3}} + +\remapXMLsingular [and] [CPA] \MMLcAND +\remapXMLsingular [or] [CPA] \MMLcOR +\remapXMLsingular [xor] [CPA] \MMLcXOR +\remapXMLsingular [implies] [CPA] \MMLcIMPLIES + +\def\MMLcAND #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{and}}{}{#3}} +\def\MMLcOR #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{or}}{}{#3}} +\def\MMLcXOR #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{xor}}{}{#3}} +\def\MMLcIMPLIES#1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{implies}}{}{#3}} + +\remapXMLsingular [not] [CPA] \MMLcNOT + +\def\MMLcNOT#1#2#3\empty{\getXMLentity{not}\processXMLRchildren{#3}} + +\remapXMLsingular [forall] [CPA] \MMLcFORALL +\remapXMLsingular [exists] [CPA] \MMLcEXISTS + +\def\MMLcFORALL% + {\getXMLentity{forall}% + \!% \getXMLentity{NegThinSpace}% + \MMLcFORALLandEXISTS} + +\def\MMLcEXISTS% + {\getXMLentity{exists}% + \MMLcFORALLandEXISTS} + +\def\MMLcFORALLandEXISTS#1#2#3\empty + {\MMLcreset + _{\encapsulateXMLRchildren{bvar}{}{\MMLccomma}{}{#3}}% + \doifXMLRchildelse{condition}{#3} + {\;% \getXMLentity{ThickSpace}% + \processXMLRchild{condition}{#3} + \doifXMLRchildelse{apply,reln,ci,cn}{#3} + {\countXMLRchild{apply,reln,ci,cn}{#3}% + \ifcase\nofXMLRchildren\or % == snelle volgende + \encapsulateXMLRchildren{apply,reln,ci,cn} + {\left\vert}% + {} + {\right.} + {#3\empty}% + \else % special case + \pushmacro\MMLcCONDITION + \let\MMLcCONDITION\gobbletwoarguments + \collectbetweenXMLRchild{apply,reln,ci,cn}{\hfill\crcr}{#3}% + \left\vert\matrix{\the\XMLRtoks}\right.% + \popmacro\MMLcCONDITION + \fi} + {}} + {:\processXMLRchild{apply,reln,ci,cn}{#3\empty}}} + +\remapXMLsingular [abs] [CPA] \MMLcABS + +\def\MMLcABS#1#2#3\empty + {\left\vert\MMLcreset\processXMLRchildren{#3}\right\vert} + +\remapXMLsingular [conjugate] [CPA] \MMLcCONJUGATE + +\def\MMLcCONJUGATE#1#2#3\empty% + {\overline{\MMLcreset\processXMLRchildren{#3}}} + +\remapXMLsingular [arg] [CPA] \MMLcARG + +\def\MMLcARG#1#2#3\empty + {\getXMLentity{arg}(\MMLcreset\processXMLRchildren{#3})} + +\remapXMLsingular [real] [CPA] \MMLcREAL +\remapXMLsingular [imaginary] [CPA] \MMLcIMAGINARY + +\def\MMLcREAL#1#2#3\empty + {\getXMLentity{real}(\MMLcreset\processXMLRchildren{#3})} + +\def\MMLcIMAGINARY#1#2#3\empty + {\getXMLentity{imaginary}(\MMLcreset\processXMLRchildren{#3})} + +\remapXMLsingular [lcm] [CPA] \MMLcLCM + +\def\MMLcLCM#1#2#3\empty + {\encapsulateXMLR{\getXMLentity{lcm}(}{\MMLccomma}{)}{#3}} + +\remapXMLsingular [floor] [CPA] \MMLcFLOOR +\remapXMLsingular [ceiling] [CPA] \MMLcCEILING + +\def\MMLcFLOOR#1#2#3\empty + {\getXMLentity{lfloor}\processXMLRchildren{#3}\getXMLentity{rfloor}} + +\def\MMLcCEILING#1#2#3\empty + {\getXMLentity{lceiling}\processXMLRchildren{#3}\getXMLentity{rceiling}} + +%%% relations + +\remapXMLsingular [eq] [CPA] \MMLcEQ +\remapXMLsingular [neq] [CPA] \MMLcNEQ +\remapXMLsingular [gt] [CPA] \MMLcGT +\remapXMLsingular [lt] [CPA] \MMLcLT +\remapXMLsingular [geq] [CPA] \MMLcGEQ +\remapXMLsingular [leq] [CPA] \MMLcLEQ +\remapXMLsingular [equivalent] [CPA] \MMLcEQUIVALENT +\remapXMLsingular [approx] [CPA] \MMLcAPPROX +\remapXMLsingular [factorof] [CPA] \MMLcFACTOROF + +\setupMMLappearance[relation][\c!align=\v!no] + +\def\noMMLcrelation#1#2% + {\encapsulatenextXMLRelements{}{#1}{}#2\empty} + +\def\lastMMLcrelation#1#2% + {\countXMLRchildren{#2}% + \rawcollectbetweenXMLR + {\advance\nofXMLRchildren -1 + \ifnum\nofXMLRchildren>1 + \appendtoks\@col@amp@#1\crcr\to\XMLRtoks + \else + \appendtoks\@col@amp@#1\to\XMLRtoks + \fi} + {#2}% + \eqalign{\the\XMLRtoks\crcr}} + +\def\firstMMLcrelation#1#2% + {\nofXMLRchildren=0 + \rawcollectbetweenXMLR + {\advance\nofXMLRchildren 1 + \ifnum\nofXMLRchildren=1 + \appendtoks\@col@amp@#1\to\XMLRtoks + \else + \appendtoks\crcr\@col@amp@#1\to\XMLRtoks + \fi} + {#2}% + \eqalign{\the\XMLRtoks\crcr}} + +\def\leftMMLcrelation#1#2% + {\collectbetweenXMLR{\@col@amp@#1\crcr}{#2}% + \eqalign{\the\XMLRtoks}} + +\def\rightMMLcrelation#1#2% + {\collectbetweenXMLR{\crcr#1{}\@col@amp@}{#2}% watch the {} + \prependtoks\@col@amp@\to\XMLRtoks + \eqalign{\the\XMLRtoks\crcr}} + +\def\MMLcrelation#1#2\empty + {\MMLcreset + \processaction + [\@@MMLrelationalign] + [\v!last=>\let\next\lastMMLcrelation , + \v!first=>\let\next\firstMMLcrelation, + \v!yes=>\let\next\leftMMLcrelation , + \v!left=>\let\next\leftMMLcrelation , + \v!right=>\let\next\rightMMLcrelation, + \s!default=>\let\next\noMMLcrelation , + \s!unknown=>\let\next\noMMLcrelation ] + \next{#1}{#2}} + +\def\MMLcEQ #1#2{\MMLcrelation=} +\def\MMLcNEQ #1#2{\MMLcrelation\neq} +\def\MMLcGT #1#2{\MMLcrelation>} +\def\MMLcLT #1#2{\MMLcrelation<} +\def\MMLcGEQ #1#2{\MMLcrelation\geq} +\def\MMLcLEQ #1#2{\MMLcrelation\leq} +\def\MMLcEQUIVALENT#1#2{\MMLcrelation\equiv} +\def\MMLcAPPROX #1#2{\MMLcrelation\approx} +\def\MMLcFACTOROF #1#2{\MMLcrelation\mid} + +%%% introduced when making an example for Thorsten Bahne: + +\remapXMLsingular [becomes] [CPA] \MMLcBECOMES + +\def\MMLcBECOMES#1#2{\MMLcrelation{:=}} + +\addtocommalist{becomes/}\MMLcmainresetlist + +%%% calculus and vector calculus + +\setupMMLappearance[int][\c!location=\v!top] + +\remapXMLsingular [int] [CPA] \MMLcINT + +\def\doMMLlimits#1% + {\doifelsevalue{@@MML#1\c!location}\v!top\limits\nolimits} + +\def\MMLcINT#1#2#3\empty + {\pushmacro\xmlr + \MMLcreset + \doifXMLRchildelse{domainofapplication}{#3} + {\int\doMMLlimits{int}_{\processXMLRchild{domainofapplication}{#3}}} + {\doifXMLRchildelse{condition}{#3} + {\int\doMMLlimits{int}_{\processXMLRchild{condition}{#3}}} + {\doifXMLRchildelse{lowlimit}{#3} + {\int\doMMLlimits{int} + _{\processXMLRchild{lowlimit}{#3}} + ^{\processXMLRchild {uplimit}{#3}}} + {\int}}}% + \doifXMLRchildelse{apply}{#3} + {\doifMMLfunctionelse{#3}% + {\MMLcreset % TEST + \processXMLRchild{apply}{#3}} + {\left(\MMLcreset % TEST + \processXMLRchild{apply}{#3}\right)}} + {\MMLcreset % TEST + \processXMLRchild{ci}{#3}}% + \doifXMLRchild{bvar}{#3} + {\,% \getXMLentity{ThinSpace}% + {\rm\getXMLentity{mathematicald}}\processXMLRchild{bvar}{#3}}% + \popmacro\xmlr} + +\remapXMLsingular [diff] [CPA] \MMLcDIFF + +\setupMMLappearance[diff][\c!location=\v!top] + +\def\MMLcDIFF#1#2#3\empty + {\pushmacro\xmlr + \MMLcreset + \doifXMLRchildelse{bvar}{#3} + {\frac + {{\rm \getXMLentity{mathematicald}}% + \collectXMLRchild{bvar}{#3}% + \let\MMLcDEGREE\superMMLcelement + \expanded{\processXMLRchild{degree}{\the\XMLRtoks}}% + \doif\@@MMLdifflocation\v!top + {\doifXMLRchildelse{ci}{#3} + {\processXMLRchild{ci}{#3}} + {\doifMMLfunctionelse{#3} + {\MMLcreset\processXMLRchild{apply}{#3}} + {\left(\MMLcreset\processXMLRchild{apply}{#3}\right)}}}} + {\let\MMLcDEGREE\superMMLcelement + \begingroup\rm\getXMLentity{mathematicald}\endgroup + \processXMLRchild{bvar}{#3}}% + \doifnot\@@MMLdifflocation\v!top + {\left(\MMLcreset\processXMLRchild{apply,ci}{#3}\right)}} + {\processXMLRchildren{#3}^\prime}% + \popmacro\xmlr} + +\remapXMLsingular [partialdiff] [CPA] \MMLcPARTIALDIFF + +\def\MMLcBVARpartialdiff#1#2% + {\getXMLentity{differentiald}\processXMLRchild{apply,reln,ci,cn}{#2} + \doifXMLRchild{degree}{#2}{^{\processXMLRchild{degree}{#2}}}} + +\def\MMLcPARTIALDIFF#1#2#3\empty + {\pushmacro\xmlr + \doifXMLRchildelse{list}{#3} + {\getXMLentity{capitaldifferentiald}_{\encapsulateXMLRchild{list}{}{\MMLccomma}{}{#3}}% + \processXMLRchild{apply,reln,ci,cn}{#3}} + {\countXMLRchild{bvar}{#3}% + \ifnum\nofXMLRchildren>0 + \pushmacro\MMLcDEGREE + \pushmacro\MMLcBVAR + \frac + {\doifXMLRchildelse{degree}{#3} + {\collectXMLRchild{degree}{#3}} + {\collectXMLRchild{bvar}{#3}% + \expanded{\collectXMLRchild{degree}{\the\XMLRtoks}}}% + \getXMLentity{differentiald}^{\encapsulateXMLR{}{+}{}{\the\XMLRtoks}}% + \let\MMLcDEGREE\gobbletwoarguments + \doifMMLfunctionelse{#3}{\MMLcreset}{}% + \processXMLRchild{apply,reln,ci,cn}{#3}} + {\let\MMLcBVAR\MMLcBVARpartialdiff + \processXMLRchild{bvar}{#3}}% + \popmacro\MMLcBVAR + \popmacro\MMLcDEGREE + \else + \processXMLRchild{apply,reln,ci,cn}{#3}% + \fi}% + \popmacro\xmlr} + +\def\doifMMLfunctionelse#1#2#3% + {\collectXMLRchild{apply}{#1}% + \doifXMLRchildelse{fn}{\the\XMLRtoks#1} + {#2} + {\doifXMLRchildelse{ci}{\the\XMLRtoks#1} + {\pushmacro\xmlr + \getXMLarguments{dummy}{type=""}% + \def\xmlr{\getmmlarguments{dummy}{}}% + \the\XMLRtoks % what if more than one ? + \popmacro\xmlr + \doif{\XMLpar{dummy}{type}{}}{fn}{#2}{#3}} + {#2}}} + +\def\subMMLcelement #1#2{_{#2}} +\def\superMMLcelement#1#2{^{#2}} + +\remapXMLsequence [lowlimit][CPA] \MMLcLOWLIMIT +\remapXMLsequence [uplimit] [CPA] \MMLcUPLIMIT +\remapXMLsequence [bvar] [CPA] \MMLcBVAR +\remapXMLsequence [degree] [CPA] \MMLcDEGREE + +\def\MMLcLOWLIMIT#1#2{#2} +\def\MMLcUPLIMIT #1#2{#2} +\def\MMLcBVAR #1#2{#2} +\def\MMLcDEGREE #1#2{#2} + +\remapXMLsingular [divergence] [CPA] \MMLcDIVERGENCE +\remapXMLsingular [grad] [CPA] \MMLcGRAD +\remapXMLsingular [curl] [CPA] \MMLcCURL +\remapXMLsingular [laplacian] [CPA] \MMLcLAPLACIAN + +\def\MMLcDIVERGENCE#1#2#3\empty{\getXMLentity{divergence}\processXMLRchildren{#3}} +\def\MMLcGRAD #1#2#3\empty{\getXMLentity{grad}\processXMLRchildren{#3}} +\def\MMLcCURL #1#2#3\empty{\getXMLentity{curl}\processXMLRchildren{#3}} +\def\MMLcLAPLACIAN #1#2#3\empty{\getXMLentity{laplacian}\processXMLRchildren{#3}} + +%%% theory of sets + +\remapXMLsequence [set] [CPA] \MMLcSET + +\def\MMLcSET#1#2% + {\doifXMLRchildelse{condition}{#2} + {\{\processXMLRchild{bvar}{#2}\,\vert\,\processXMLRchild{condition}{#2}\}} + {\encapsulateXMLR{\{}{\MMLccomma}{\}}{#2}}} + +\remapXMLsequence [list] [CPA] \MMLcLIST + +\def\MMLcLIST#1#2{\encapsulateXMLR{[}{\MMLccomma}{]}{#2}} + +\remapXMLsingular [union] [CPA] \MMLcUNION +\remapXMLsingular [intersect] [CPA] \MMLcINTERSECT +\remapXMLsingular [in] [CPA] \MMLcIN +\remapXMLsingular [notin] [CPA] \MMLcNOTIN +\remapXMLsingular [subset] [CPA] \MMLcSUBSET +\remapXMLsingular [prsubset] [CPA] \MMLcPRSUBSET +\remapXMLsingular [notsubset] [CPA] \MMLcNOTSUBSET +\remapXMLsingular [notprsubset] [CPA] \MMLcNOTPRSUBSET +\remapXMLsingular [setdiff] [CPA] \MMLcSETDIFF + +\def\MMLcset#1{\withnexttwoXMLRelements{\firstXMLRelement#1\secondXMLRelement}} + +\def\MMLcUNION #1#2{\MMLcset\cup} +\def\MMLcINTERSECT #1#2{\MMLcset\cap} +\def\MMLcIN #1#2{\MMLcset\in} +\def\MMLcNOTIN #1#2{\MMLcset{\not\in}} +\def\MMLcSUBSET #1#2{\MMLcset\subset} +\def\MMLcPRSUBSET #1#2{\MMLcset\subseteq} +\def\MMLcNOTSUBSET #1#2{\MMLcset{\not\subset}} +\def\MMLcNOTPRSUBSET #1#2{\MMLcset{\not\subseteq}} +\def\MMLcSETDIFF #1#2{\MMLcset\setminus} + +\remapXMLsingular [card] [CPA] \MMLcCARD + +\def\MMLcCARD#1#2#3\empty{\encapsulateXMLR{\vert}{}{\vert}{#3}} + +\remapXMLsingular [cartesianproduct] [CPA] \MMLcCARTESIANPRODUCT + +\def\MMLcCARTESIANPRODUCT#1#2#3\empty{\encapsulateXMLR{}{\times}{}{#3}} + +%%% sequences and series + +\remapXMLsingular [sum] [CPA] \MMLcSUM +\remapXMLsingular [product] [CPA] \MMLcPRODUCT + +\def\MMLcSUM {\MMLcSUMandPRODUCT{sum}\sum} +\def\MMLcPRODUCT{\MMLcSUMandPRODUCT{product}\prod} + +\setupMMLappearance[sum][\c!location=\v!top] +\setupMMLappearance[product][\c!location=\v!top] + +\def\stackMMLsubscripts#1% + {\vbox + {\baselineskip\zeropoint % hack, taco vragen + \halign{$\scriptstyle\hss##\hss$\cr#1\crcr}}} + +\def\MMLcSUMandPRODUCT#1#2#3#4\empty + {\pushmacro\xmlr + \doifXMLRchildelse{condition,bvar,lowlimit}{#4} + {\def\MMLcSUMlow + {_{\doifXMLRchildelse{condition}{#4} + {\collectXMLRchild{condition}{#4}% + \expanded{\collectbetweenXMLR{\crcr}{\the\XMLRtoks}}% + \stackMMLsubscripts{\the\XMLRtoks}} + {\doifXMLRchild{bvar}{#4} + {\processXMLRchild{bvar}{#4}% + \doifXMLRchild{lowlimit}{#4}{=}}% + \processXMLRchild{lowlimit}{#4}}}}} + {\let\MMLcSUMlow\empty}% + \doifXMLRchildelse{uplimit}{#4} + {\def\MMLcSUMup{^{\processXMLRchild{uplimit}{#4}}}} + {\let\MMLcSUMup\empty}% + \MMLcreset#2\doMMLlimits{#1}\MMLcSUMup\MMLcSUMlow + \MMLcreset + \processXMLRchild{apply,ci}{#4}% + \popmacro\xmlr} + +\remapXMLsingular [limit] [CPA] \MMLcLIMIT + +\setupMMLappearance[limit][\c!location=\v!top] + +\def\MMLcLIMIT#1#2#3\empty + {\pushmacro\xmlr + \MMLcreset + \lim\doMMLlimits{limit}_ + {\MMLcreset + \doifXMLRchildelse{condition}{#3} + {\processXMLRchild{condition}{#3}} + {\doifXMLRchild{bvar}{#3} + {\processXMLRchild{bvar}{#3}\rightarrow}% + \processXMLRchild{lowlimit}{#3}}}% + \processXMLRchild{apply}{#3}% + \popmacro\xmlr} + +\remapXMLsingular [tendsto] [CPA] \MMLcTENDSTO + +\def\MMLcTENDSTO#1#2% + {\getXMLarguments{tendsto}{type="default" #1}% + \withnexttwoXMLRelements + {\MMLcreset\firstXMLRelement + \processaction + [\XMLpar{tendsto}{type}{default}] + [ above=>\downarrow, + below=>\uparrow, + unknown=>\rightarrow]% + \MMLcreset\secondXMLRelement}} + +%%% elementary classical functions + +\remapXMLsingular [exp] [CPA] \MMLcEXP + +\def\MMLcEXP#1#2#3\empty + {\getXMLentity{exponentiale}^{\MMLcreset#3}} + +\remapXMLsingular [ln] [CPA] \MMLcLN + +%\def\MMLcLN#1#2#3\empty +% {\ln\left(\MMLcreset#3\right)} + +\def\MMLcLN#1#2% + {\doMMLcfunction{ln}} + +\remapXMLsingular [log] [CPA] \MMLcLOG + +\setupMMLappearance[log][\c!location=\v!right] + +\def\MMLcLOG#1#2#3\empty + {\pushmacro\MMLcLOGBASE + \let\MMLcLOGBASE\secondoftwoarguments + \doifXMLRchildelse{logbase}{#3} + {\doifelse\@@MMLloglocation\v!left + {\mathop{{}^{\processXMLRchild{logbase}{#3}}\!\getXMLentity{log}}} + {\getXMLentity{log}_{\processXMLRchild{logbase}{#3}}}} + {\getXMLentity{log}}% + \let\MMLcLOGBASE\ignoreXMLRelement + \nodoMMLcfunction#3\empty + \popmacro\MMLcLOGBASE} + +\remapXMLsequence [logbase] [CPA] \MMLcLOGBASE + +\def\MMLcLOGBASE#1#2{#2} + +\remapXMLsingular [sin] [CPA] \MMLcSIN +\remapXMLsingular [arcsin] [CPA] \MMLcARCSIN +\remapXMLsingular [sinh] [CPA] \MMLcSINH +\remapXMLsingular [arcsinh] [CPA] \MMLcARCSINH +\remapXMLsingular [cos] [CPA] \MMLcCOS +\remapXMLsingular [arccos] [CPA] \MMLcARCCOS +\remapXMLsingular [cosh] [CPA] \MMLcCOSH +\remapXMLsingular [arccosh] [CPA] \MMLcARCCOSH +\remapXMLsingular [tan] [CPA] \MMLcTAN +\remapXMLsingular [arctan] [CPA] \MMLcARCTAN +\remapXMLsingular [tanh] [CPA] \MMLcTANH +\remapXMLsingular [arctanh] [CPA] \MMLcARCTANH +\remapXMLsingular [cot] [CPA] \MMLcCOT +\remapXMLsingular [arccot] [CPA] \MMLcARCCOT +\remapXMLsingular [coth] [CPA] \MMLcCOTH +\remapXMLsingular [arccoth] [CPA] \MMLcARCCOTH +\remapXMLsingular [csc] [CPA] \MMLcCSC +\remapXMLsingular [arccsc] [CPA] \MMLcARCCSC +\remapXMLsingular [csch] [CPA] \MMLcCSCH +\remapXMLsingular [arccsch] [CPA] \MMLcARCCSCH +\remapXMLsingular [sec] [CPA] \MMLcSEC +\remapXMLsingular [arcsec] [CPA] \MMLcARCSEC +\remapXMLsingular [sech] [CPA] \MMLcSECH +\remapXMLsingular [arcsech] [CPA] \MMLcARCSECH + +\setupMMLappearance[function][\c!reduction=\v!yes] + +\def\doMMLcfunction#1% + {\doifnextcharelse\xmlr{\dodoMMLcfunction{#1}}{\getXMLentity{#1}}} + +\def\dodoMMLcfunction#1% + {\getXMLentity{#1}% + \nodoMMLcfunction} + +\def\nodoMMLcfunction#1\empty + {\ifx\MMLpowerelement\empty\else + ^{\MMLcreset\MMLpowerelement\empty}\!\let\MMLpowerelement\empty + \fi + \doifelse\@@MMLfunctionreduction\v!yes + {\doifXMLRchildelse{apply}{#1} + {\collectXMLRchild{apply}{#1}% + \@EA\doifXMLRchildelse\@EA{\MMLcfunctionlist}{\the\XMLRtoks} + {\MMLcreset#1\empty} + {\left(\MMLcreset#1\empty\right)}} + {\MMLcreset#1\empty}} + {\left(\MMLcreset#1\empty\right)}} + +\def\MMLcSIN #1#2{\doMMLcfunction{sin}} +\def\MMLcARCSIN #1#2{\doMMLcfunction{arcsin}} +\def\MMLcSINH #1#2{\doMMLcfunction{sinh}} +\def\MMLcARCSINH#1#2{\doMMLcfunction{arcsinh}} +\def\MMLcCOS #1#2{\doMMLcfunction{cos}} +\def\MMLcARCCOS #1#2{\doMMLcfunction{arccos}} +\def\MMLcCOSH #1#2{\doMMLcfunction{cosh}} +\def\MMLcARCCOSH#1#2{\doMMLcfunction{arccosh}} +\def\MMLcTAN #1#2{\doMMLcfunction{tan}} +\def\MMLcARCTAN #1#2{\doMMLcfunction{arctan}} +\def\MMLcTANH #1#2{\doMMLcfunction{tanh}} +\def\MMLcARCTANH#1#2{\doMMLcfunction{arctanh}} +\def\MMLcCOT #1#2{\doMMLcfunction{cot}} +\def\MMLcARCCOT #1#2{\doMMLcfunction{arccot}} +\def\MMLcCOTH #1#2{\doMMLcfunction{coth}} +\def\MMLcARCCOTH#1#2{\doMMLcfunction{arccoth}} +\def\MMLcCSC #1#2{\doMMLcfunction{csc}} +\def\MMLcARCCSC #1#2{\doMMLcfunction{arccsc}} +\def\MMLcCSCH #1#2{\doMMLcfunction{csch}} +\def\MMLcARCCSCH#1#2{\doMMLcfunction{arccsch}} +\def\MMLcSEC #1#2{\doMMLcfunction{sec}} +\def\MMLcARCSEC #1#2{\doMMLcfunction{arcsec}} +\def\MMLcSECH #1#2{\doMMLcfunction{sech}} +\def\MMLcARCSECH#1#2{\doMMLcfunction{arcsech}} + +%%% statistics + +\remapXMLsingular [mean] [CPA] \MMLcMEAN +\remapXMLsingular [sdev] [CPA] \MMLcSDEV +\remapXMLsingular [variance] [CPA] \MMLcVARIANCE +\remapXMLsingular [median] [CPA] \MMLcMEDIAN +\remapXMLsingular [mode] [CPA] \MMLcMODE + +\def\MMLcMEAN #1#2{\withnextXMLRelement{\overline{\nextXMLRelement}}} +\def\MMLcSDEV #1#2{\withnextXMLRelement{\sigma(\MMLcreset\nextXMLRelement)}} +\def\MMLcVARIANCE#1#2{\withnextXMLRelement{\sigma(\MMLcreset\nextXMLRelement)^2}} +\def\MMLcMEDIAN #1#2{\withnextXMLRelement{\getXMLentity{median}(\MMLcreset\nextXMLRelement)}} +\def\MMLcMODE #1#2{\withnextXMLRelement{\getXMLentity{mode}(\MMLcreset\nextXMLRelement)}} + +\remapXMLsingular [moment] [CPA] \MMLcMOMENT +\remapXMLsequence [momentabout] [CPA] \MMLcMOMENTABOUT + +\def\MMLcMOMENT#1#2#3\empty + {\left\langle\processXMLRchild{apply,reln,ci,cn}{#3}% + ^{\processXMLRchild{degree}{#3}}\right\rangle} + +\def\MMLcMOMENTABOUT#1#2{} + +%%% linear algebra + +\remapXMLsequence [vector] [CPA] \MMLcVECTOR + +\setupMMLappearance[vector][\c!direction=\v!horizontal] % \v!vertical + +\def\MMLcVECTOR#1#2% + {\countXMLRchildren{#2}% + \ifnum\nofXMLRchildren>1 + \doifelse\@@MMLvectordirection\v!horizontal + {\encapsulateXMLR{\left(}{\MMLccomma}{\right)}{#2}} + {\collectbetweenXMLR{\crcr}{#2}% + \MMLcreset\left(\matrix{\the\XMLRtoks}\right)}% + \else + \overrightarrow{#2}% + \fi} + +\remapXMLsequence [matrix] [CPA] \MMLcMATRIX +\remapXMLsequence [matrixrow] [CPA] \MMLcMATRIXROW + +\unexpanded\def\@col@amp@{&} + +\def\doMMLcMATRIX#1#2#3% + {\pushmacro\MMLcMATRIXROW + \let\MMLcMATRIXROW\normalMMLcMATRIXROW + \MMLcreset + \ifcase#1\matrix{#3}\else\left(\matrix{#3}\right)\fi + \popmacro\MMLcMATRIXROW} + +\def\MMLcMATRIX#1#2% + {\doMMLcMATRIX1{#1}{#2}} + +\def\MMLcMATRIXROW#1#2% + {\collectbetweenXMLR{\@col@amp@}{#2}\the\XMLRtoks\crcr} + +\let\normalMMLcMATRIXROW\MMLcMATRIXROW + +\def\MMLcMATRIXROW#1#2% + {\collectbetweenXMLR{\@col@amp@}{#2}% + \left(\matrix{\the\XMLRtoks\crcr}\right)} + +\remapXMLsingular [determinant] [CPA] \MMLcDETERMINANT + +% \def\MMLcDETERMINANT#1#2{\getXMLentity{determinant}} % optie + +\def\MMLcDETERMINANT#1#2\empty + {\pushmacro\MMLcMATRIX + \def\MMLcMATRIX##1##2{\doMMLcMATRIX0{##1}{##2}}% + \left|#2\empty\right|% + \popmacro\MMLcMATRIX} + +\remapXMLsingular [transpose] [CPA] \MMLcTRANSPOSE + +\def\MMLcTRANSPOSE#1#2{\withnextXMLRelement{\nextXMLRelement^{\rm T}}} + +\remapXMLsingular [selector] [CPA] \MMLcSELECTOR + +\def\MMLcSELECTOR#1#2#3\empty + {\pushmacro\xmlr + \withnextXMLRelement + {\mathinner{\nextXMLRelement}% hm, assumes a matrix or so + \doMMLcSELECTOR}% + #3\empty + \popmacro\xmlr} + +\def\doMMLcSELECTOR#1\empty + {_{\MMLcreset\encapsulateXMLR{}{\MMLccomma}{}{#1\empty}}} + +\remapXMLsingular [vectorproduct] [CPA] \MMLcVECTORPRODUCT +\remapXMLsingular [scalarproduct] [CPA] \MMLcSCALARPRODUCT +\remapXMLsingular [outerproduct] [CPA] \MMLcOUTERPRODUCT + +\def\MMLcvector#1% + {\withnexttwoXMLRelements{\firstXMLRelement#1\secondXMLRelement}} + +\def\MMLcVECTORPRODUCT#1#2{\MMLcvector{\getXMLentity{vectorproduct}}#2}% #2?% +\def\MMLcSCALARPRODUCT#1#2{\MMLcvector{\getXMLentity{scalarproduct}}#2} +\def\MMLcOUTERPRODUCT #1#2{\MMLcvector{\getXMLentity{outerproduct}}#2} + +%%% semantic mapping elements + +\remapXMLsequence [semantics] [CPA] \MMLcSEMANTICS + +\def\MMLcSEMANTICS#1#2% + {\doifXMLRchildelse{annotation}{#2} + {\processXMLRchild{annotation}{#2}} + {#2}} + +\remapXMLsequence [annotation] [CPA] \MMLcANNOTATION + +\def\MMLcANNOTATION#1#2% we need a better unmapper + {\getXMLarguments{annotation}{encoding="" #1}% + \doif{\XMLpar{annotation}{encoding}{}}{TeX}% + {\begingroup + \setnormalXMLentities % better: \simplifyXMLentities ; test first + \let\xmlrent\expandedXMLentity + \edef\mmlascii{#2}% + \setnormalcatcodes + \ifx\mmlascii\empty + \donefalse + \else + \def\do##1##2\end % hack + {\edef\!!stringa{\string##1}% + \edef\!!stringb{\letterdollar}% + \ifx\!!stringa\!!stringb + \donetrue + \else + \donefalse + \fi}% + \expandafter\do\mmlascii\end + \fi + \ifdone + \hbox{\scantokens\@EA{\mmlascii}}% + \else + \scantokens\@EA{\mmlascii}% + \fi + \endgroup}} + +\remapXMLsequence [annotation-xml] [CPA] \MMLcANNOTATIONXML + +\def\MMLcANNOTATIONXML#1#2{} + +%%% constant and symbol elements + +\remapXMLsingular [integers] [CPA] \MMLcINTEGERS +\remapXMLsingular [reals] [CPA] \MMLcREALS +\remapXMLsingular [rationals] [CPA] \MMLcRATIONALS +\remapXMLsingular [naturalnumbers] [CPA] \MMLcNATURALNUMBERS +\remapXMLsingular [complexes] [CPA] \MMLcCOMPLEXES +\remapXMLsingular [primes] [CPA] \MMLcPRIMES +\remapXMLsingular [exponentiale] [CPA] \MMLcEXPONENTIALE +\remapXMLsingular [imaginaryi] [CPA] \MMLcIMAGINARYI +\remapXMLsingular [notanumber] [CPA] \MMLcNOTANUMBER +\remapXMLsingular [true] [CPA] \MMLcTRUE +\remapXMLsingular [false] [CPA] \MMLcFALSE +\remapXMLsingular [emptyset] [CPA] \MMLcEMPTYSET +\remapXMLsingular [pi] [CPA] \MMLcPI +\remapXMLsingular [eulergamma] [CPA] \MMLcEULERGAMMA +\remapXMLsingular [infinity] [CPA] \MMLcINFINITY + +\def\MMLcINTEGERS #1#2{\getXMLentity{integers}} +\def\MMLcREALS #1#2{\getXMLentity{reals}} +\def\MMLcRATIONALS #1#2{\getXMLentity{rationals}} +\def\MMLcNATURALNUMBERS#1#2{\getXMLentity{naturalnumbers}} +\def\MMLcCOMPLEXES #1#2{\getXMLentity{complexes}} +\def\MMLcPRIMES #1#2{\getXMLentity{primes}} +\def\MMLcEXPONENTIALE #1#2{\getXMLentity{ExponentialE}} +\def\MMLcIMAGINARYI #1#2{\getXMLentity{ImaginaryI}} +\def\MMLcNOTANUMBER #1#2{\mathop{\rm NaN}} +\def\MMLcTRUE #1#2{\mathop{\rm true}} +\def\MMLcFALSE #1#2{\mathop{\rm false}} +\def\MMLcEMPTYSET #1#2{\mathop{\hbox{\O}}} +\def\MMLcPI #1#2{\pi} +\def\MMLcEULERGAMMA #1#2{\gamma} +\def\MMLcINFINITY #1#2{\infty} + +\stopXMLmapping + +\protect \endinput diff --git a/tex/context/base/xtag-mmc.tex b/tex/context/base/xtag-mmc.tex deleted file mode 100644 index 27e2c42ea..000000000 --- a/tex/context/base/xtag-mmc.tex +++ /dev/null @@ -1,1265 +0,0 @@ -%D \module -%D [ file=xtag-mmc, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Content MathML, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Content MathML} - -% this is the first, experimental, shabby implementation, as -% always, the third will do -) - -% okay, now this is the second one, with a more kid based -% approach, which we needed for proper nesting, but the -% code is still too ugly - -\startXMLmapping[mml] - -\unprotect - -\def\MMLccomma{{,}} - -\def\getmmlarguments#1#2#3#4#5#6% {class} {defaults} mmlargs - {\getXMLarguments{#1}{#2 #5}}% - -\def\doifMMLoperatorelse#1#2#3% temp hack - {\pushmacro\xmlrent - \let\xmlrent\firstofoneargument - \edef\mmloperator{#1}% - \@EA\unspaceargument\mmloperator\to\mmloperator - \popmacro\xmlrent - \doifXMLentityelse\mmloperator - {\doifdefinedelse{doMMLcFN\mmloperator}{#2}{#3}} - {#3}} - -\remapXMLsequence [ci] [CPA] \MMLcCI -\remapXMLsequence [cn] [CPA] \MMLcCN -\remapXMLsequence [csymbol] [CPA] \MMLcCSYMBOL - -\setupMMLappearance[polar][\c!alternative=\v!a] % a|b|c - -\def\MMLcpolar#1% - {\doifdefinedelse{MMLcdopolar\@@MMLpolaralternative} - {\getvalue{MMLcdopolar\@@MMLpolaralternative}{#1}} - {#1}} - -\def\MMLcdopolara#1% - {\def\MMLcsep{\MMLccomma}\getXMLentity{polar}\left(#1\right)} - -\def\MMLcdopolarb#1% - {\def\MMLcsep##1\empty% - {\getXMLentity{exponentiale}^{##1\mskip2mu\getXMLentity{imaginaryi}}}#1} - -\def\MMLcdopolarc#1% - {\def\MMLcsep##1\empty% - {\getXMLentity{exp}\left(##1\mskip2mu\getXMLentity{imaginaryi}\right)}#1} - -\def\MMLccartesian#1% - {\def\MMLcsep{+}#1\getXMLentity{imaginaryi}} - -% float will be obsolete, an is replace by e-notation - -\setupMMLappearance[float][\c!symbol=\v!no] % \v!yes|dot - -\def\MMLcfloat#1% - {\doifelse\@@MMLfloatsymbol\v!no - {{\rm#1}} % make sure that e shows up ok - {% we should ignore \entities ! - \beforesplitstring#1\at e\to\first - \aftersplitstring #1\at e\to\last - \ifx\first\empty #1\else - \ifx\last \empty #1\else - \first - \doifelse\@@MMLfloatsymbol{dot}\cdot\times - 10^{\last}% - \fi\fi}} - -% we now have: - -\setupMMLappearance[enotation][\c!symbol=\v!no] % \v!yes|dot - -\def\MMLcenotation#1% - {\doifelse\@@MMLenotationsymbol\v!no - {\def\MMLcsep {\unskip{\rm e}\ignorespaces}} - {\def\MMLcsep##1\empty{\doifelse\@@MMLenotationsymbol{dot}\cdot\times10^{##1}}}% - #1\empty} - -\def\MMLcCI#1% #2% can be sped up with \doifundefined ... - {\getXMLarguments{ci}{type="" #1}% - \doifXMLparelse{ci}{type} - {\processaction - [\XMLpar{ci}{type}{}] - [ set=>\let\next\MMLcCIset, - vector=>\let\next\MMLcCIvector, - matrix=>\let\next\MMLcCImatrix, - function=>\let\next\MMLcCIfunction, -complex-cartesian=>\let\next\MMLccartesian, - complex=>\let\next\MMLccartesian, - complex-polar=>\let\next\MMLcpolar, - polar=>\let\next\MMLcpolar, - fn=>\let\next\MMLcCIfunction, - unknown=>\let\next\firstofoneargument]} % integer constant real float - {\let\next\firstofoneargument}% - \next} - -\def\MMLcCIset#1% - {{\bbd#1}} - -\def\widevec#1% - {\vbox{\mathsurround\zeropoint\ialign{##\crcr - \rightarrowfill\crcr\noalign{\nointerlineskip}% - $\hfil\displaystyle{#1}\hfil$\crcr}}} - -\def\MMLcCIvector#1% - {\widevec{#1}} - -\def\MMLcCImatrix#1% - {{\bi#1}} - -\def\MMLcCIfunction#1% - {\doifMMLoperatorelse{#1}\MMLcCIdefault\MMLcFNdefault{}{#1}} - -\def\MMLcCIdefault#1#2% #1=dummy - {#2%\!% \getXMLentity{NegThinSpace}% looks bad in A(x) - \doifnextcharelse\xmlr - {\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}} - {}} - -% \def\MMLcFNdefault#1#2% neg space needed because of \left -% {#2\!% \getXMLentity{NegThinSpace}% -% \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}} - -\def\MMLcCN#1% #2% can be sped up with \doifundefined ... - {\getXMLarguments{cn}{type="" #1}% - \doifXMLparelse{cn}{type} - {\processaction - [\XMLpar{cn}{type}{}] - [ integer=>\let\next\MMLcCNinteger, - logical=>\let\next\MMLcCNlogical, - rational=>\let\next\MMLcCNrational, -complex-cartesian=>\let\next\MMLccartesian, - complex=>\let\next\MMLccartesian, - complex-polar=>\let\next\MMLcpolar, - polar=>\let\next\MMLcpolar, - e-notation=>\let\next\MMLcenotation, % new - float=>\let\next\MMLcfloat, % obsolete - real=>\let\next\MMLcfloat, % ? - unknown=>\let\next\firstofoneargument]} - {\let\next\firstofoneargument} - \next} - -\setupMMLappearance[base][\c!symbol=\v!numbers] % cijfers|letters|tekst|nee - -\def\MMLcCNinteger#1% - {\doifXMLparelse{cn}{base} - {\def\MMLcCNbase{\XMLpar{cn}{base}{}}% - \doifelse\@@MMLbasesymbol\v!no - {\MMLcCNbasedata{#1}} - {\MMLcCNbasedata{#1}_{\hbox{$\rm\scriptscriptstyle - \processaction - [\@@MMLbasesymbol] - [\v!characters=>\MMLcCNbasestring BODH, - \v!text=>\MMLcCNbasestring{BIN}{OCT}{DEC}{HEX}, - \s!unknown=>\MMLcCNbase]$}}}} - {#1}} - -\def\MMLcCNbasedata#1% - {\ifnum\MMLcCNbase>10{\rm#1}\else#1\fi} - -\def\MMLcCNbasestring#1#2#3#4% - {\ifnum\MMLcCNbase= 2 #1\else - \ifnum\MMLcCNbase= 8 #2\else - \ifnum\MMLcCNbase=10 #3\else - \ifnum\MMLcCNbase=16 #4\else - \MMLcCNbase \fi\fi\fi\fi} - -\def\MMLcCNlogical#1% - {{\rm#1}} - -\def\MMLcCNrational#1% - {\ConvertConstantAfter\doifinstringelse{sep}{#1} - {\doMMLcCNrational#1\empty} - {#1}} - -\def\doMMLcCNrational#1\xmlr#2#3#4#5\empty - {\hbox{$\frac{#1}{#5}$}} - -\def\MMLcCSYMBOL#1#2% TO DO - {\getXMLarguments{csymbol}{encoding="text" #1}% - \doifelse{\XMLpar{csymbol}{encoding}{}}{text} - {{\rm#2}}{#2}} - -%%% basic content elements - -\remapXMLsequence [apply] [CPA] \MMLcAPPLY - -\newcount\@MMLlevel \def\MMLcreset{\@MMLlevel=0 } - -\let\MMLctempresetlist\empty \def\setMMLcreset{\edef\MMLctempresetlist} - -\def\MMLcmainresetlist% - {times/,divide/,power/,% - lt/,gt/,eq/,leq/,geq/,% - in/,inverse/,% - fn,% - floor/,ceiling/,% - mean/,% - selector/,% - abs/,int/,limit/,sum/,product/,% - outerproduct/,innerproduct/,scalarproduct/} - -\def\MMLcfunctionlist - {sin/,arcsin/,sinh/,arcsinh/,% - cos/,arccos/,cosh/,arccosh/,% - tan/,arctan/,tanh/,arctanh/,% - cot/,arccot/,coth/,arccoth/,% - csc/,arccsc/,csch/,arccsch/,% - sec/,arcsec/,sech/,arcsech/,% - ln/,exp/,log/,% - abs/,int/,limit/,sum/,product/,% - fn} % ? - -\def\MMLcconstructlist - {diff/,partialdiff/,root/} % apply goes wrong on 1/2 * (a_2 + b_3) - -% better: no () here but explicitly when needed, which is in -% less cases - -\def\MMLcAPPLY#1#2% - {\mathinner{\begingroup % new, else 1/2(1+2) problem / inner: ask taco - \pushmacro\xmlr - \@EA\@EA\@EA\doifXMLRchild\@EA\@EA\@EA{\@EA\MMLcmainresetlist\@EA,\MMLctempresetlist}{#2} - {\MMLcreset}% - \ifcase\@MMLlevel - \getXMLarguments{apply}{open="" close="" #1}% - \else - \getXMLarguments{apply}{open="(" close=")" #1}% - \fi - \doifXMLparelse{apply}{open}{\left\XMLpar{apply}{open}{}}{}% - \advance\@MMLlevel+1 - \begingroup - \let\MMLctempresetlist\empty - \let\xmlr\naturalxmlr % beter een \pushmacro\xmlr - #2\empty - \endgroup % ook level push - \advance\@MMLlevel-1 - \doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}{}% - \popmacro\xmlr - \endgroup}} - -\remapXMLsequence [reln] [CPA] \MMLcRELN - -\def\MMLcRELN% - {\writestatus{XML}{MathML element "reln" is obsolete}\MMLcAPPLY} - -\remapXMLsequence [fn] [CPA] \MMLcFN - -\def\MMLcFN#1#2% neg space needed because of \left - {\doifXMLRchildelse{ci}{#2} - {\collectXMLRchild{ci}{#2}% - \@EA\doifMMLoperatorelse\@EA{\the\XMLRtoks} - \MMLcFNoperator\MMLcFNdefault} - {\MMLcFNdefault}% - {#1}{#2}} - -\def\MMLcFNdefault#1#2% neg space needed because of \left - {#2\!% \getXMLentity{NegThinSpace}% - \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}} - -% special function handlers - -\def\MMLcFNoperator - {\getvalue{doMMLcFN\mmloperator}} - -% \def\doMMLcFNplusminus#1#2#3\empty -% {\countXMLRchildren{#3}% -% \ifcase\nofXMLRchildren\or -% #2#3% -% \else % suboptimal for instance under root -% \encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}% -% \fi} - -\def\doMMLcFNplusminus#1#2#3\empty - {\countXMLRchildren{#3}% - \ifcase\nofXMLRchildren\or - \def\next{#2#3}% - \else - \def\next - {\doifnextcharelse\xmlr - {\encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}}% - {\encapsulateXMLR{}{#2}{}{\MMLcreset#3}}}% - \fi - \next} - -\let\doMMLcFNminusplus\doMMLcFNplusminus - -\def\doMMLcFNcontinued#1#2#3\empty - {#3\getXMLentity{continued}} - -% so far for the special handlers - -\remapXMLsequence [interval] [CPA] \MMLcINTERVAL - -\def\MMLcINTERVAL#1#2% - {\withnexttwoXMLRelements - {\getXMLarguments{interval}{closure="closed" #1}% - \processaction - [\XMLpar{interval}{closure}{closed}] - [ closed=>{[\firstXMLRelement,\secondXMLRelement]}, - open-closed=>{(\firstXMLRelement,\secondXMLRelement]}, - closed-open=>{[\firstXMLRelement,\secondXMLRelement)}, - open=>{(\firstXMLRelement,\secondXMLRelement)}, - \s!unknown=>{[\firstXMLRelement,\secondXMLRelement]}]}% - #2\empty} - -\remapXMLsingular [inverse] [CPA] \MMLcINVERSE - -\def\MMLcINVERSE#1#2% - {\withnextXMLRelement - {\nextXMLRelement\empty^{-1}% \empty kills MMLcfunction lookahead - \withnextXMLRelement - {\ifx\nextXMLRelement\empty \else - \left[\nextXMLRelement\right]% - \fi}}} - -\remapXMLsingular [sep] [CPA] \MMLcSEP - -\def\MMLcSEP#1#2{\MMLcsep} \def\MMLcsep{\,} - -\remapXMLsequence [condition] [CPA] \MMLcCONDITION - -\def\MMLcCONDITION#1#2% - {\pushmacro\MMLcBVAR - \doifXMLRchild{bvar}{#2}{\processXMLRchild{bvar}{#2}\mid}% - \let\MMLcBVAR\ignoreXMLRelement - \processXMLRchildren{#2}% - \popmacro\MMLcBVAR} - -\remapXMLsequence [declare] [CPA] \MMLcDECLARE - -\setupMMLappearance[declare][\c!state=\v!start] - -\def\MMLcDECLARE#1#2% - {\doif\@@MMLdeclarestate\v!start - {\withnextXMLRelement - {\getXMLentity{declare}\nextXMLRelement - \countXMLRchildren{#2}% - \ifnum\nofXMLRchildren>1 - \;% \getXMLentity{ThickSpace}% - \getXMLentity{as}% - \;% \getXMLentity{ThickSpace}% - \fi}% - #2\empty}} - -\remapXMLsequence [lambda] [CPA] \MMLcLAMBDA - -\setupMMLappearance[lambda][\c!alternative=b] - -\def\MMLcLAMBDA#1#2% - {\doifelse\@@MMLlambdaalternative\v!a - {\encapsulateXMLR{\getXMLentity{lambda}(}{\MMLccomma}{)}{#2}} - {\countXMLRchild{bvar}{#2}% - \ifnum\nofXMLRchildren>1 - \collectXMLRchild{bvar}{#2}% - \encapsulateXMLR{\left(}{\MMLccomma}{\right)}{\the\XMLRtoks}% - \else - \processXMLRchild{bvar}{#2}% - \fi - \getXMLentity{mapsto}% - \processXMLRchild{apply,reln,ci,cn}{#2}}} - -\remapXMLsingular [compose] [CPA] \MMLcCOMPOSE - -\def\MMLcCOMPOSE#1#2#3\empty - {\doifMMLfunctionelse{#3} - {\encapsulateXMLR{\left(}{\circ}{\right)}{#3}} - {\encapsulateXMLR{}{\circ}{}{#3}}} - -\remapXMLsingular [ident] [CPA] \MMLcIDENT - -\def\MMLcIDENT#1#2{\getXMLentity{identity}} - -\remapXMLsingular [domain] [CPA] \MMLcDOMAIN -\remapXMLsingular [codomain] [CPA] \MMLcCODOMAIN - -\def\MMLcDOMAIN #1#2#3\empty - {\getXMLentity{domain}(\MMLcreset\processXMLRchildren{#3})} - -\def\MMLcCODOMAIN#1#2#3\empty - {\getXMLentity{codomain}(\MMLcreset\processXMLRchildren{#3})} - -\remapXMLsingular [image] [CPA] \MMLcIMAGE - -\def\MMLcIMAGE#1#2% - {\withnextXMLRelement{\getXMLentity{image}(\nextXMLRelement)}} - -\remapXMLsequence [domainofapplication] [CPA] \MMLcDOMAINOFAPPLICATION - -\def\MMLcDOMAINOFAPPLICATION#1#2{#2} - -\remapXMLsequence [piecewise] [CPA] \MMLcPIECEWISE -\remapXMLsequence [piece] [CPA] \MMLcPIECE -\remapXMLsequence [otherwise] [CPA] \MMLcOTHERWISE - -\setupMMLappearance[piece][\c!separator=] - -\def\MMLcPIECEWISE#1#2% - {\cases{#2}} - -\def\MMLcPIECEseparator{\doif\@@MMLpieceseparator\v!yes,} - -\def\MMLcPIECE#1#2% - {\withnexttwoXMLRelements - {\@EA\XMLRtoks\@EA{\firstXMLRelement\MMLcPIECEseparator\@col@amp@}% - \@EA\appendtoks\@EA\mathematics\@EA{\secondXMLRelement}\to\XMLRtoks - \the\XMLRtoks\crcr}% - #2} - -\def\MMLcOTHERWISE#1#2% - {#2\MMLcPIECEseparator\@col@amp@\mathematics{\getXMLentity{otherwise}}\crcr} - -%%% arithmic, algebra and logic - -\remapXMLsingular [quotient] [CPA] \MMLcQUOTIENT - -\def\MMLcQUOTIENT#1#2% - {\withnexttwoXMLRelements{\lfloor\firstXMLRelement/\secondXMLRelement\rfloor}} - -\remapXMLsingular [factorial] [CPA] \MMLcFACTORIAL - -\def\MMLcFACTORIAL#1#2% - {\withnextXMLRelement{\nextXMLRelement !}} - -\remapXMLsingular [divide] [CPA] \MMLcDIVIDE - -\setupMMLappearance [divide] [\c!level=\!!maxcard] - -\def\MMLcDIVIDE#1#2% - {\withnexttwoXMLRelements - {\increment\MMLcDIVIDElevel - \ifnum\MMLcDIVIDElevel>\@@MMLdividelevel\space - \firstXMLRelement/\secondXMLRelement - \else - \frac{\MMLcreset\firstXMLRelement}{\MMLcreset\secondXMLRelement}% - \fi - \decrement\MMLcDIVIDElevel}} - -\remapXMLsingular [min] [CPA] \MMLcMIN -\remapXMLsingular [max] [CPA] \MMLcMAX - -\def\MMLcMIN#1#2#3\empty - {\encapsulateXMLR - {\min\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{} - {\MMLccomma}{\right\}}{#3}} - -\def\MMLcMAX#1#2#3\empty - {\encapsulateXMLR - {\max\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{} - {\MMLccomma}{\right\}}{#3}} - -\remapXMLsingular [minus] [CPA] \MMLcMINUS -\remapXMLsingular [plus] [CPA] \MMLcPLUS - -\setupMMLappearance[sign][\c!reduction=\v!yes] - -\def\MMLcMINUS % expandafter needed ? - {\doifelse\@@MMLsignreduction\v!yes - {\expandafter\MMLcMINUSyes}{\expandafter\MMLcMINUSno}} - -\def\MMLcPLUS % expandafter needed ? - {\doifelse\@@MMLsignreduction\v!yes - {\expandafter\MMLcPLUSyes}{\expandafter\MMLcPLUSno}} - -\def\MMLcMINUSno#1#2#3\empty - {\countXMLRchildren{#3}% - \encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}} - -\def\MMLcPLUSno#1#2#3\empty - {\countXMLRchildren{#3}% - \encapsulateXMLR{\ifcase\nofXMLRchildren\or+\fi}{+}{}{#3}} - -\def\MMLcMINUSyes#1#2#3\empty - {\setMMLcreset{\MMLcfunctionlist}% - \countXMLRchildren{#3}% - \encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}} - -\def\MMLcPLUSyes#1#2#3\empty - {\setMMLcreset{plus/,minus/,\MMLcfunctionlist,\MMLcconstructlist}% - \encapsulatenextXMLRelements - {} - {\doifXMLRchildelse{apply}{\nextXMLRelement}% - {\collectXMLRchild{apply}{\nextXMLRelement}% - \doifXMLRchildelse{minus/}{\the\XMLRtoks} - {\countXMLRchildren{\the\XMLRtoks} - \ifnum\nofXMLRchildren>2 +\else\fi}{+}} - {+}} - {} - {#3\empty}} - -\remapXMLsingular [power] [CPA] \MMLcPOWER - -\setupMMLappearance[power][\c!reduction=\v!yes] - -\let\MMLpowerelement\empty - -\def\MMLcPOWER#1#2% - {\withnexttwoXMLRelements - {\doifXMLRchildelse{apply}{\firstXMLRelement} - {\doifelse\@@MMLpowerreduction\v!yes - {\collectXMLRchild{apply}{\firstXMLRelement}% - \@EA\doifXMLRchildelse\@EA{\MMLcfunctionlist}{\the\XMLRtoks} - {\let\MMLpowerelement\secondXMLRelement - \MMLcreset\firstXMLRelement\empty} - {\left(\MMLcreset\firstXMLRelement\empty\right)^{\MMLcreset\secondXMLRelement}}} - {\left(\MMLcreset\firstXMLRelement\empty\right)^{\MMLcreset\secondXMLRelement}}} - {\firstXMLRelement^{\MMLcreset\secondXMLRelement}}}} - -\remapXMLsingular [rem] [CPA] \MMLcREM - -\def\MMLcREM#1#2% - {\withnexttwoXMLRelements - {\firstXMLRelement\getXMLentity{mod}\secondXMLRelement}} - -\remapXMLsingular [times] [CPA] \MMLcTIMES - -\setupMMLappearance[times][\c!symbol=\v!no] % -\setupMMLappearance[times][\c!auto=\v!yes] % new, auto catches cn cn cn - -\def\MMLcTIMES#1#2#3\empty - {\setMMLcreset{\MMLcfunctionlist,\MMLcconstructlist}% - \doifelse\@@MMLtimesauto\v!no - {\let\@@MMLtimes@@symbol\@@MMLtimessymbol} - {\doifelseXMLRneighbors{cn}{#3} - {\let\@@MMLtimes@@symbol\v!yes} - {\let\@@MMLtimes@@symbol\@@MMLtimessymbol}}% - \doifelse\@@MMLtimes@@symbol\v!yes - {\encapsulateXMLR{}{\times}{}{#3\empty}} - {\doifelse\@@MMLtimes@@symbol{dot} - {\encapsulateXMLR{}{\cdot}{}{#3\empty}} - {#3\empty}}} - -\remapXMLsingular [root] [CPA] \MMLcROOT - -\setupMMLappearance[root][\c!symbol=\v!yes] - -\def\MMLcROOT#1#2#3\empty - {\doifXMLRchildelse{degree}{#3}\donetrue\donefalse - \doif\@@MMLrootsymbol\v!no\donefalse - \ifdone - \root\processXMLRchild{degree}{#3}\of - {\let\MMLcDEGREE\ignoreXMLRelement - \MMLcreset\processXMLRchildren{#3}}% - \else - \sqrt - {\MMLcreset\processXMLRchildren{#3}}% - \fi} - -\remapXMLsingular [gcd] [CPA] \MMLcGCD - -\def\MMLcGCD#1#2#3\empty{\encapsulateXMLR{\gcd(}{\MMLccomma}{)}{#3}} - -\remapXMLsingular [and] [CPA] \MMLcAND -\remapXMLsingular [or] [CPA] \MMLcOR -\remapXMLsingular [xor] [CPA] \MMLcXOR -\remapXMLsingular [implies] [CPA] \MMLcIMPLIES - -\def\MMLcAND #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{and}}{}{#3}} -\def\MMLcOR #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{or}}{}{#3}} -\def\MMLcXOR #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{xor}}{}{#3}} -\def\MMLcIMPLIES#1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{implies}}{}{#3}} - -\remapXMLsingular [not] [CPA] \MMLcNOT - -\def\MMLcNOT#1#2#3\empty{\getXMLentity{not}\processXMLRchildren{#3}} - -\remapXMLsingular [forall] [CPA] \MMLcFORALL -\remapXMLsingular [exists] [CPA] \MMLcEXISTS - -\def\MMLcFORALL% - {\getXMLentity{forall}% - \!% \getXMLentity{NegThinSpace}% - \MMLcFORALLandEXISTS} - -\def\MMLcEXISTS% - {\getXMLentity{exists}% - \MMLcFORALLandEXISTS} - -\def\MMLcFORALLandEXISTS#1#2#3\empty - {\MMLcreset - _{\encapsulateXMLRchildren{bvar}{}{\MMLccomma}{}{#3}}% - \doifXMLRchildelse{condition}{#3} - {\;% \getXMLentity{ThickSpace}% - \processXMLRchild{condition}{#3} - \doifXMLRchildelse{apply,reln,ci,cn}{#3} - {\countXMLRchild{apply,reln,ci,cn}{#3}% - \ifcase\nofXMLRchildren\or % == snelle volgende - \encapsulateXMLRchildren{apply,reln,ci,cn} - {\left\vert}% - {} - {\right.} - {#3\empty}% - \else % special case - \pushmacro\MMLcCONDITION - \let\MMLcCONDITION\gobbletwoarguments - \collectbetweenXMLRchild{apply,reln,ci,cn}{\hfill\crcr}{#3}% - \left\vert\matrix{\the\XMLRtoks}\right.% - \popmacro\MMLcCONDITION - \fi} - {}} - {:\processXMLRchild{apply,reln,ci,cn}{#3\empty}}} - -\remapXMLsingular [abs] [CPA] \MMLcABS - -\def\MMLcABS#1#2#3\empty - {\left\vert\MMLcreset\processXMLRchildren{#3}\right\vert} - -\remapXMLsingular [conjugate] [CPA] \MMLcCONJUGATE - -\def\MMLcCONJUGATE#1#2#3\empty% - {\overline{\MMLcreset\processXMLRchildren{#3}}} - -\remapXMLsingular [arg] [CPA] \MMLcARG - -\def\MMLcARG#1#2#3\empty - {\getXMLentity{arg}(\MMLcreset\processXMLRchildren{#3})} - -\remapXMLsingular [real] [CPA] \MMLcREAL -\remapXMLsingular [imaginary] [CPA] \MMLcIMAGINARY - -\def\MMLcREAL#1#2#3\empty - {\getXMLentity{real}(\MMLcreset\processXMLRchildren{#3})} - -\def\MMLcIMAGINARY#1#2#3\empty - {\getXMLentity{imaginary}(\MMLcreset\processXMLRchildren{#3})} - -\remapXMLsingular [lcm] [CPA] \MMLcLCM - -\def\MMLcLCM#1#2#3\empty - {\encapsulateXMLR{\getXMLentity{lcm}(}{\MMLccomma}{)}{#3}} - -\remapXMLsingular [floor] [CPA] \MMLcFLOOR -\remapXMLsingular [ceiling] [CPA] \MMLcCEILING - -\def\MMLcFLOOR#1#2#3\empty - {\getXMLentity{lfloor}\processXMLRchildren{#3}\getXMLentity{rfloor}} - -\def\MMLcCEILING#1#2#3\empty - {\getXMLentity{lceiling}\processXMLRchildren{#3}\getXMLentity{rceiling}} - -%%% relations - -\remapXMLsingular [eq] [CPA] \MMLcEQ -\remapXMLsingular [neq] [CPA] \MMLcNEQ -\remapXMLsingular [gt] [CPA] \MMLcGT -\remapXMLsingular [lt] [CPA] \MMLcLT -\remapXMLsingular [geq] [CPA] \MMLcGEQ -\remapXMLsingular [leq] [CPA] \MMLcLEQ -\remapXMLsingular [equivalent] [CPA] \MMLcEQUIVALENT -\remapXMLsingular [approx] [CPA] \MMLcAPPROX -\remapXMLsingular [factorof] [CPA] \MMLcFACTOROF - -\setupMMLappearance[relation][\c!align=\v!no] - -\def\noMMLcrelation#1#2% - {\encapsulatenextXMLRelements{}{#1}{}#2\empty} - -\def\lastMMLcrelation#1#2% - {\countXMLRchildren{#2}% - \rawcollectbetweenXMLR - {\advance\nofXMLRchildren -1 - \ifnum\nofXMLRchildren>1 - \appendtoks\@col@amp@#1\crcr\to\XMLRtoks - \else - \appendtoks\@col@amp@#1\to\XMLRtoks - \fi} - {#2}% - \eqalign{\the\XMLRtoks\crcr}} - -\def\firstMMLcrelation#1#2% - {\nofXMLRchildren=0 - \rawcollectbetweenXMLR - {\advance\nofXMLRchildren 1 - \ifnum\nofXMLRchildren=1 - \appendtoks\@col@amp@#1\to\XMLRtoks - \else - \appendtoks\crcr\@col@amp@#1\to\XMLRtoks - \fi} - {#2}% - \eqalign{\the\XMLRtoks\crcr}} - -\def\leftMMLcrelation#1#2% - {\collectbetweenXMLR{\@col@amp@#1\crcr}{#2}% - \eqalign{\the\XMLRtoks}} - -\def\rightMMLcrelation#1#2% - {\collectbetweenXMLR{\crcr#1{}\@col@amp@}{#2}% watch the {} - \prependtoks\@col@amp@\to\XMLRtoks - \eqalign{\the\XMLRtoks\crcr}} - -\def\MMLcrelation#1#2\empty - {\MMLcreset - \processaction - [\@@MMLrelationalign] - [\v!last=>\let\next\lastMMLcrelation , - \v!first=>\let\next\firstMMLcrelation, - \v!yes=>\let\next\leftMMLcrelation , - \v!left=>\let\next\leftMMLcrelation , - \v!right=>\let\next\rightMMLcrelation, - \s!default=>\let\next\noMMLcrelation , - \s!unknown=>\let\next\noMMLcrelation ] - \next{#1}{#2}} - -\def\MMLcEQ #1#2{\MMLcrelation=} -\def\MMLcNEQ #1#2{\MMLcrelation\neq} -\def\MMLcGT #1#2{\MMLcrelation>} -\def\MMLcLT #1#2{\MMLcrelation<} -\def\MMLcGEQ #1#2{\MMLcrelation\geq} -\def\MMLcLEQ #1#2{\MMLcrelation\leq} -\def\MMLcEQUIVALENT#1#2{\MMLcrelation\equiv} -\def\MMLcAPPROX #1#2{\MMLcrelation\approx} -\def\MMLcFACTOROF #1#2{\MMLcrelation\mid} - -%%% introduced when making an example for Thorsten Bahne: - -\remapXMLsingular [becomes] [CPA] \MMLcBECOMES - -\def\MMLcBECOMES#1#2{\MMLcrelation{:=}} - -\addtocommalist{becomes/}\MMLcmainresetlist - -%%% calculus and vector calculus - -\setupMMLappearance[int][\c!location=\v!top] - -\remapXMLsingular [int] [CPA] \MMLcINT - -\def\doMMLlimits#1% - {\doifelsevalue{@@MML#1\c!location}\v!top\limits\nolimits} - -\def\MMLcINT#1#2#3\empty - {\pushmacro\xmlr - \MMLcreset - \doifXMLRchildelse{domainofapplication}{#3} - {\int\doMMLlimits{int}_{\processXMLRchild{domainofapplication}{#3}}} - {\doifXMLRchildelse{condition}{#3} - {\int\doMMLlimits{int}_{\processXMLRchild{condition}{#3}}} - {\doifXMLRchildelse{lowlimit}{#3} - {\int\doMMLlimits{int} - _{\processXMLRchild{lowlimit}{#3}} - ^{\processXMLRchild {uplimit}{#3}}} - {\int}}}% - \doifXMLRchildelse{apply}{#3} - {\doifMMLfunctionelse{#3}% - {\MMLcreset % TEST - \processXMLRchild{apply}{#3}} - {\left(\MMLcreset % TEST - \processXMLRchild{apply}{#3}\right)}} - {\MMLcreset % TEST - \processXMLRchild{ci}{#3}}% - \doifXMLRchild{bvar}{#3} - {\,% \getXMLentity{ThinSpace}% - {\rm\getXMLentity{mathematicald}}\processXMLRchild{bvar}{#3}}% - \popmacro\xmlr} - -\remapXMLsingular [diff] [CPA] \MMLcDIFF - -\setupMMLappearance[diff][\c!location=\v!top] - -\def\MMLcDIFF#1#2#3\empty - {\pushmacro\xmlr - \MMLcreset - \doifXMLRchildelse{bvar}{#3} - {\frac - {{\rm \getXMLentity{mathematicald}}% - \collectXMLRchild{bvar}{#3}% - \let\MMLcDEGREE\superMMLcelement - \expanded{\processXMLRchild{degree}{\the\XMLRtoks}}% - \doif\@@MMLdifflocation\v!top - {\doifXMLRchildelse{ci}{#3} - {\processXMLRchild{ci}{#3}} - {\doifMMLfunctionelse{#3} - {\MMLcreset\processXMLRchild{apply}{#3}} - {\left(\MMLcreset\processXMLRchild{apply}{#3}\right)}}}} - {\let\MMLcDEGREE\superMMLcelement - \begingroup\rm\getXMLentity{mathematicald}\endgroup - \processXMLRchild{bvar}{#3}}% - \doifnot\@@MMLdifflocation\v!top - {\left(\MMLcreset\processXMLRchild{apply,ci}{#3}\right)}} - {\processXMLRchildren{#3}^\prime}% - \popmacro\xmlr} - -\remapXMLsingular [partialdiff] [CPA] \MMLcPARTIALDIFF - -\def\MMLcBVARpartialdiff#1#2% - {\getXMLentity{differentiald}\processXMLRchild{apply,reln,ci,cn}{#2} - \doifXMLRchild{degree}{#2}{^{\processXMLRchild{degree}{#2}}}} - -\def\MMLcPARTIALDIFF#1#2#3\empty - {\pushmacro\xmlr - \doifXMLRchildelse{list}{#3} - {\getXMLentity{capitaldifferentiald}_{\encapsulateXMLRchild{list}{}{\MMLccomma}{}{#3}}% - \processXMLRchild{apply,reln,ci,cn}{#3}} - {\countXMLRchild{bvar}{#3}% - \ifnum\nofXMLRchildren>0 - \pushmacro\MMLcDEGREE - \pushmacro\MMLcBVAR - \frac - {\doifXMLRchildelse{degree}{#3} - {\collectXMLRchild{degree}{#3}} - {\collectXMLRchild{bvar}{#3}% - \expanded{\collectXMLRchild{degree}{\the\XMLRtoks}}}% - \getXMLentity{differentiald}^{\encapsulateXMLR{}{+}{}{\the\XMLRtoks}}% - \let\MMLcDEGREE\gobbletwoarguments - \doifMMLfunctionelse{#3}{\MMLcreset}{}% - \processXMLRchild{apply,reln,ci,cn}{#3}} - {\let\MMLcBVAR\MMLcBVARpartialdiff - \processXMLRchild{bvar}{#3}}% - \popmacro\MMLcBVAR - \popmacro\MMLcDEGREE - \else - \processXMLRchild{apply,reln,ci,cn}{#3}% - \fi}% - \popmacro\xmlr} - -\def\doifMMLfunctionelse#1#2#3% - {\collectXMLRchild{apply}{#1}% - \doifXMLRchildelse{fn}{\the\XMLRtoks#1} - {#2} - {\doifXMLRchildelse{ci}{\the\XMLRtoks#1} - {\pushmacro\xmlr - \getXMLarguments{dummy}{type=""}% - \def\xmlr{\getmmlarguments{dummy}{}}% - \the\XMLRtoks % what if more than one ? - \popmacro\xmlr - \doif{\XMLpar{dummy}{type}{}}{fn}{#2}{#3}} - {#2}}} - -\def\subMMLcelement #1#2{_{#2}} -\def\superMMLcelement#1#2{^{#2}} - -\remapXMLsequence [lowlimit][CPA] \MMLcLOWLIMIT -\remapXMLsequence [uplimit] [CPA] \MMLcUPLIMIT -\remapXMLsequence [bvar] [CPA] \MMLcBVAR -\remapXMLsequence [degree] [CPA] \MMLcDEGREE - -\def\MMLcLOWLIMIT#1#2{#2} -\def\MMLcUPLIMIT #1#2{#2} -\def\MMLcBVAR #1#2{#2} -\def\MMLcDEGREE #1#2{#2} - -\remapXMLsingular [divergence] [CPA] \MMLcDIVERGENCE -\remapXMLsingular [grad] [CPA] \MMLcGRAD -\remapXMLsingular [curl] [CPA] \MMLcCURL -\remapXMLsingular [laplacian] [CPA] \MMLcLAPLACIAN - -\def\MMLcDIVERGENCE#1#2#3\empty{\getXMLentity{divergence}\processXMLRchildren{#3}} -\def\MMLcGRAD #1#2#3\empty{\getXMLentity{grad}\processXMLRchildren{#3}} -\def\MMLcCURL #1#2#3\empty{\getXMLentity{curl}\processXMLRchildren{#3}} -\def\MMLcLAPLACIAN #1#2#3\empty{\getXMLentity{laplacian}\processXMLRchildren{#3}} - -%%% theory of sets - -\remapXMLsequence [set] [CPA] \MMLcSET - -\def\MMLcSET#1#2% - {\doifXMLRchildelse{condition}{#2} - {\{\processXMLRchild{bvar}{#2}\,\vert\,\processXMLRchild{condition}{#2}\}} - {\encapsulateXMLR{\{}{\MMLccomma}{\}}{#2}}} - -\remapXMLsequence [list] [CPA] \MMLcLIST - -\def\MMLcLIST#1#2{\encapsulateXMLR{[}{\MMLccomma}{]}{#2}} - -\remapXMLsingular [union] [CPA] \MMLcUNION -\remapXMLsingular [intersect] [CPA] \MMLcINTERSECT -\remapXMLsingular [in] [CPA] \MMLcIN -\remapXMLsingular [notin] [CPA] \MMLcNOTIN -\remapXMLsingular [subset] [CPA] \MMLcSUBSET -\remapXMLsingular [prsubset] [CPA] \MMLcPRSUBSET -\remapXMLsingular [notsubset] [CPA] \MMLcNOTSUBSET -\remapXMLsingular [notprsubset] [CPA] \MMLcNOTPRSUBSET -\remapXMLsingular [setdiff] [CPA] \MMLcSETDIFF - -\def\MMLcset#1{\withnexttwoXMLRelements{\firstXMLRelement#1\secondXMLRelement}} - -\def\MMLcUNION #1#2{\MMLcset\cup} -\def\MMLcINTERSECT #1#2{\MMLcset\cap} -\def\MMLcIN #1#2{\MMLcset\in} -\def\MMLcNOTIN #1#2{\MMLcset{\not\in}} -\def\MMLcSUBSET #1#2{\MMLcset\subset} -\def\MMLcPRSUBSET #1#2{\MMLcset\subseteq} -\def\MMLcNOTSUBSET #1#2{\MMLcset{\not\subset}} -\def\MMLcNOTPRSUBSET #1#2{\MMLcset{\not\subseteq}} -\def\MMLcSETDIFF #1#2{\MMLcset\setminus} - -\remapXMLsingular [card] [CPA] \MMLcCARD - -\def\MMLcCARD#1#2#3\empty{\encapsulateXMLR{\vert}{}{\vert}{#3}} - -\remapXMLsingular [cartesianproduct] [CPA] \MMLcCARTESIANPRODUCT - -\def\MMLcCARTESIANPRODUCT#1#2#3\empty{\encapsulateXMLR{}{\times}{}{#3}} - -%%% sequences and series - -\remapXMLsingular [sum] [CPA] \MMLcSUM -\remapXMLsingular [product] [CPA] \MMLcPRODUCT - -\def\MMLcSUM {\MMLcSUMandPRODUCT{sum}\sum} -\def\MMLcPRODUCT{\MMLcSUMandPRODUCT{product}\prod} - -\setupMMLappearance[sum][\c!location=\v!top] -\setupMMLappearance[product][\c!location=\v!top] - -\def\stackMMLsubscripts#1% - {\vbox - {\baselineskip\zeropoint % hack, taco vragen - \halign{$\scriptstyle\hss##\hss$\cr#1\crcr}}} - -\def\MMLcSUMandPRODUCT#1#2#3#4\empty - {\pushmacro\xmlr - \doifXMLRchildelse{condition,bvar,lowlimit}{#4} - {\def\MMLcSUMlow - {_{\doifXMLRchildelse{condition}{#4} - {\collectXMLRchild{condition}{#4}% - \expanded{\collectbetweenXMLR{\crcr}{\the\XMLRtoks}}% - \stackMMLsubscripts{\the\XMLRtoks}} - {\doifXMLRchild{bvar}{#4} - {\processXMLRchild{bvar}{#4}% - \doifXMLRchild{lowlimit}{#4}{=}}% - \processXMLRchild{lowlimit}{#4}}}}} - {\let\MMLcSUMlow\empty}% - \doifXMLRchildelse{uplimit}{#4} - {\def\MMLcSUMup{^{\processXMLRchild{uplimit}{#4}}}} - {\let\MMLcSUMup\empty}% - \MMLcreset#2\doMMLlimits{#1}\MMLcSUMup\MMLcSUMlow - \MMLcreset - \processXMLRchild{apply,ci}{#4}% - \popmacro\xmlr} - -\remapXMLsingular [limit] [CPA] \MMLcLIMIT - -\setupMMLappearance[limit][\c!location=\v!top] - -\def\MMLcLIMIT#1#2#3\empty - {\pushmacro\xmlr - \MMLcreset - \lim\doMMLlimits{limit}_ - {\MMLcreset - \doifXMLRchildelse{condition}{#3} - {\processXMLRchild{condition}{#3}} - {\doifXMLRchild{bvar}{#3} - {\processXMLRchild{bvar}{#3}\rightarrow}% - \processXMLRchild{lowlimit}{#3}}}% - \processXMLRchild{apply}{#3}% - \popmacro\xmlr} - -\remapXMLsingular [tendsto] [CPA] \MMLcTENDSTO - -\def\MMLcTENDSTO#1#2% - {\getXMLarguments{tendsto}{type="default" #1}% - \withnexttwoXMLRelements - {\MMLcreset\firstXMLRelement - \processaction - [\XMLpar{tendsto}{type}{default}] - [ above=>\downarrow, - below=>\uparrow, - unknown=>\rightarrow]% - \MMLcreset\secondXMLRelement}} - -%%% elementary classical functions - -\remapXMLsingular [exp] [CPA] \MMLcEXP - -\def\MMLcEXP#1#2#3\empty - {\getXMLentity{exponentiale}^{\MMLcreset#3}} - -\remapXMLsingular [ln] [CPA] \MMLcLN - -%\def\MMLcLN#1#2#3\empty -% {\ln\left(\MMLcreset#3\right)} - -\def\MMLcLN#1#2% - {\doMMLcfunction{ln}} - -\remapXMLsingular [log] [CPA] \MMLcLOG - -\setupMMLappearance[log][\c!location=\v!right] - -\def\MMLcLOG#1#2#3\empty - {\pushmacro\MMLcLOGBASE - \let\MMLcLOGBASE\secondoftwoarguments - \doifXMLRchildelse{logbase}{#3} - {\doifelse\@@MMLloglocation\v!left - {\mathop{{}^{\processXMLRchild{logbase}{#3}}\!\getXMLentity{log}}} - {\getXMLentity{log}_{\processXMLRchild{logbase}{#3}}}} - {\getXMLentity{log}}% - \let\MMLcLOGBASE\ignoreXMLRelement - \nodoMMLcfunction#3\empty - \popmacro\MMLcLOGBASE} - -\remapXMLsequence [logbase] [CPA] \MMLcLOGBASE - -\def\MMLcLOGBASE#1#2{#2} - -\remapXMLsingular [sin] [CPA] \MMLcSIN -\remapXMLsingular [arcsin] [CPA] \MMLcARCSIN -\remapXMLsingular [sinh] [CPA] \MMLcSINH -\remapXMLsingular [arcsinh] [CPA] \MMLcARCSINH -\remapXMLsingular [cos] [CPA] \MMLcCOS -\remapXMLsingular [arccos] [CPA] \MMLcARCCOS -\remapXMLsingular [cosh] [CPA] \MMLcCOSH -\remapXMLsingular [arccosh] [CPA] \MMLcARCCOSH -\remapXMLsingular [tan] [CPA] \MMLcTAN -\remapXMLsingular [arctan] [CPA] \MMLcARCTAN -\remapXMLsingular [tanh] [CPA] \MMLcTANH -\remapXMLsingular [arctanh] [CPA] \MMLcARCTANH -\remapXMLsingular [cot] [CPA] \MMLcCOT -\remapXMLsingular [arccot] [CPA] \MMLcARCCOT -\remapXMLsingular [coth] [CPA] \MMLcCOTH -\remapXMLsingular [arccoth] [CPA] \MMLcARCCOTH -\remapXMLsingular [csc] [CPA] \MMLcCSC -\remapXMLsingular [arccsc] [CPA] \MMLcARCCSC -\remapXMLsingular [csch] [CPA] \MMLcCSCH -\remapXMLsingular [arccsch] [CPA] \MMLcARCCSCH -\remapXMLsingular [sec] [CPA] \MMLcSEC -\remapXMLsingular [arcsec] [CPA] \MMLcARCSEC -\remapXMLsingular [sech] [CPA] \MMLcSECH -\remapXMLsingular [arcsech] [CPA] \MMLcARCSECH - -\setupMMLappearance[function][\c!reduction=\v!yes] - -\def\doMMLcfunction#1% - {\doifnextcharelse\xmlr{\dodoMMLcfunction{#1}}{\getXMLentity{#1}}} - -\def\dodoMMLcfunction#1% - {\getXMLentity{#1}% - \nodoMMLcfunction} - -\def\nodoMMLcfunction#1\empty - {\ifx\MMLpowerelement\empty\else - ^{\MMLcreset\MMLpowerelement\empty}\!\let\MMLpowerelement\empty - \fi - \doifelse\@@MMLfunctionreduction\v!yes - {\doifXMLRchildelse{apply}{#1} - {\collectXMLRchild{apply}{#1}% - \@EA\doifXMLRchildelse\@EA{\MMLcfunctionlist}{\the\XMLRtoks} - {\MMLcreset#1\empty} - {\left(\MMLcreset#1\empty\right)}} - {\MMLcreset#1\empty}} - {\left(\MMLcreset#1\empty\right)}} - -\def\MMLcSIN #1#2{\doMMLcfunction{sin}} -\def\MMLcARCSIN #1#2{\doMMLcfunction{arcsin}} -\def\MMLcSINH #1#2{\doMMLcfunction{sinh}} -\def\MMLcARCSINH#1#2{\doMMLcfunction{arcsinh}} -\def\MMLcCOS #1#2{\doMMLcfunction{cos}} -\def\MMLcARCCOS #1#2{\doMMLcfunction{arccos}} -\def\MMLcCOSH #1#2{\doMMLcfunction{cosh}} -\def\MMLcARCCOSH#1#2{\doMMLcfunction{arccosh}} -\def\MMLcTAN #1#2{\doMMLcfunction{tan}} -\def\MMLcARCTAN #1#2{\doMMLcfunction{arctan}} -\def\MMLcTANH #1#2{\doMMLcfunction{tanh}} -\def\MMLcARCTANH#1#2{\doMMLcfunction{arctanh}} -\def\MMLcCOT #1#2{\doMMLcfunction{cot}} -\def\MMLcARCCOT #1#2{\doMMLcfunction{arccot}} -\def\MMLcCOTH #1#2{\doMMLcfunction{coth}} -\def\MMLcARCCOTH#1#2{\doMMLcfunction{arccoth}} -\def\MMLcCSC #1#2{\doMMLcfunction{csc}} -\def\MMLcARCCSC #1#2{\doMMLcfunction{arccsc}} -\def\MMLcCSCH #1#2{\doMMLcfunction{csch}} -\def\MMLcARCCSCH#1#2{\doMMLcfunction{arccsch}} -\def\MMLcSEC #1#2{\doMMLcfunction{sec}} -\def\MMLcARCSEC #1#2{\doMMLcfunction{arcsec}} -\def\MMLcSECH #1#2{\doMMLcfunction{sech}} -\def\MMLcARCSECH#1#2{\doMMLcfunction{arcsech}} - -%%% statistics - -\remapXMLsingular [mean] [CPA] \MMLcMEAN -\remapXMLsingular [sdev] [CPA] \MMLcSDEV -\remapXMLsingular [variance] [CPA] \MMLcVARIANCE -\remapXMLsingular [median] [CPA] \MMLcMEDIAN -\remapXMLsingular [mode] [CPA] \MMLcMODE - -\def\MMLcMEAN #1#2{\withnextXMLRelement{\overline{\nextXMLRelement}}} -\def\MMLcSDEV #1#2{\withnextXMLRelement{\sigma(\MMLcreset\nextXMLRelement)}} -\def\MMLcVARIANCE#1#2{\withnextXMLRelement{\sigma(\MMLcreset\nextXMLRelement)^2}} -\def\MMLcMEDIAN #1#2{\withnextXMLRelement{\getXMLentity{median}(\MMLcreset\nextXMLRelement)}} -\def\MMLcMODE #1#2{\withnextXMLRelement{\getXMLentity{mode}(\MMLcreset\nextXMLRelement)}} - -\remapXMLsingular [moment] [CPA] \MMLcMOMENT -\remapXMLsequence [momentabout] [CPA] \MMLcMOMENTABOUT - -\def\MMLcMOMENT#1#2#3\empty - {\left\langle\processXMLRchild{apply,reln,ci,cn}{#3}% - ^{\processXMLRchild{degree}{#3}}\right\rangle} - -\def\MMLcMOMENTABOUT#1#2{} - -%%% linear algebra - -\remapXMLsequence [vector] [CPA] \MMLcVECTOR - -\setupMMLappearance[vector][\c!direction=\v!horizontal] % \v!vertical - -\def\MMLcVECTOR#1#2% - {\countXMLRchildren{#2}% - \ifnum\nofXMLRchildren>1 - \doifelse\@@MMLvectordirection\v!horizontal - {\encapsulateXMLR{\left(}{\MMLccomma}{\right)}{#2}} - {\collectbetweenXMLR{\crcr}{#2}% - \MMLcreset\left(\matrix{\the\XMLRtoks}\right)}% - \else - \overrightarrow{#2}% - \fi} - -\remapXMLsequence [matrix] [CPA] \MMLcMATRIX -\remapXMLsequence [matrixrow] [CPA] \MMLcMATRIXROW - -\unexpanded\def\@col@amp@{&} - -\def\doMMLcMATRIX#1#2#3% - {\pushmacro\MMLcMATRIXROW - \let\MMLcMATRIXROW\normalMMLcMATRIXROW - \MMLcreset - \ifcase#1\matrix{#3}\else\left(\matrix{#3}\right)\fi - \popmacro\MMLcMATRIXROW} - -\def\MMLcMATRIX#1#2% - {\doMMLcMATRIX1{#1}{#2}} - -\def\MMLcMATRIXROW#1#2% - {\collectbetweenXMLR{\@col@amp@}{#2}\the\XMLRtoks\crcr} - -\let\normalMMLcMATRIXROW\MMLcMATRIXROW - -\def\MMLcMATRIXROW#1#2% - {\collectbetweenXMLR{\@col@amp@}{#2}% - \left(\matrix{\the\XMLRtoks\crcr}\right)} - -\remapXMLsingular [determinant] [CPA] \MMLcDETERMINANT - -% \def\MMLcDETERMINANT#1#2{\getXMLentity{determinant}} % optie - -\def\MMLcDETERMINANT#1#2\empty - {\pushmacro\MMLcMATRIX - \def\MMLcMATRIX##1##2{\doMMLcMATRIX0{##1}{##2}}% - \left|#2\empty\right|% - \popmacro\MMLcMATRIX} - -\remapXMLsingular [transpose] [CPA] \MMLcTRANSPOSE - -\def\MMLcTRANSPOSE#1#2{\withnextXMLRelement{\nextXMLRelement^{\rm T}}} - -\remapXMLsingular [selector] [CPA] \MMLcSELECTOR - -\def\MMLcSELECTOR#1#2#3\empty - {\pushmacro\xmlr - \withnextXMLRelement - {\mathinner{\nextXMLRelement}% hm, assumes a matrix or so - \doMMLcSELECTOR}% - #3\empty - \popmacro\xmlr} - -\def\doMMLcSELECTOR#1\empty - {_{\MMLcreset\encapsulateXMLR{}{\MMLccomma}{}{#1\empty}}} - -\remapXMLsingular [vectorproduct] [CPA] \MMLcVECTORPRODUCT -\remapXMLsingular [scalarproduct] [CPA] \MMLcSCALARPRODUCT -\remapXMLsingular [outerproduct] [CPA] \MMLcOUTERPRODUCT - -\def\MMLcvector#1% - {\withnexttwoXMLRelements{\firstXMLRelement#1\secondXMLRelement}} - -\def\MMLcVECTORPRODUCT#1#2{\MMLcvector{\getXMLentity{vectorproduct}}#2}% #2?% -\def\MMLcSCALARPRODUCT#1#2{\MMLcvector{\getXMLentity{scalarproduct}}#2} -\def\MMLcOUTERPRODUCT #1#2{\MMLcvector{\getXMLentity{outerproduct}}#2} - -%%% semantic mapping elements - -\remapXMLsequence [semantics] [CPA] \MMLcSEMANTICS - -\def\MMLcSEMANTICS#1#2% - {\doifXMLRchildelse{annotation}{#2} - {\processXMLRchild{annotation}{#2}} - {#2}} - -\remapXMLsequence [annotation] [CPA] \MMLcANNOTATION - -\def\MMLcANNOTATION#1#2% we need a better unmapper - {\getXMLarguments{annotation}{encoding="" #1}% - \doif{\XMLpar{annotation}{encoding}{}}{TeX}% - {\begingroup - \setnormalXMLentities % better: \simplifyXMLentities ; test first - \let\xmlrent\expandedXMLentity - \edef\mmlascii{#2}% - \setnormalcatcodes - \ifx\mmlascii\empty - \donefalse - \else - \def\do##1##2\end % hack - {\edef\!!stringa{\string##1}% - \edef\!!stringb{\letterdollar}% - \ifx\!!stringa\!!stringb - \donetrue - \else - \donefalse - \fi}% - \expandafter\do\mmlascii\end - \fi - \ifdone - \hbox{\scantokens\@EA{\mmlascii}}% - \else - \scantokens\@EA{\mmlascii}% - \fi - \endgroup}} - -\remapXMLsequence [annotation-xml] [CPA] \MMLcANNOTATIONXML - -\def\MMLcANNOTATIONXML#1#2{} - -%%% constant and symbol elements - -\remapXMLsingular [integers] [CPA] \MMLcINTEGERS -\remapXMLsingular [reals] [CPA] \MMLcREALS -\remapXMLsingular [rationals] [CPA] \MMLcRATIONALS -\remapXMLsingular [naturalnumbers] [CPA] \MMLcNATURALNUMBERS -\remapXMLsingular [complexes] [CPA] \MMLcCOMPLEXES -\remapXMLsingular [primes] [CPA] \MMLcPRIMES -\remapXMLsingular [exponentiale] [CPA] \MMLcEXPONENTIALE -\remapXMLsingular [imaginaryi] [CPA] \MMLcIMAGINARYI -\remapXMLsingular [notanumber] [CPA] \MMLcNOTANUMBER -\remapXMLsingular [true] [CPA] \MMLcTRUE -\remapXMLsingular [false] [CPA] \MMLcFALSE -\remapXMLsingular [emptyset] [CPA] \MMLcEMPTYSET -\remapXMLsingular [pi] [CPA] \MMLcPI -\remapXMLsingular [eulergamma] [CPA] \MMLcEULERGAMMA -\remapXMLsingular [infinity] [CPA] \MMLcINFINITY - -\def\MMLcINTEGERS #1#2{\getXMLentity{integers}} -\def\MMLcREALS #1#2{\getXMLentity{reals}} -\def\MMLcRATIONALS #1#2{\getXMLentity{rationals}} -\def\MMLcNATURALNUMBERS#1#2{\getXMLentity{naturalnumbers}} -\def\MMLcCOMPLEXES #1#2{\getXMLentity{complexes}} -\def\MMLcPRIMES #1#2{\getXMLentity{primes}} -\def\MMLcEXPONENTIALE #1#2{\getXMLentity{ExponentialE}} -\def\MMLcIMAGINARYI #1#2{\getXMLentity{ImaginaryI}} -\def\MMLcNOTANUMBER #1#2{\mathop{\rm NaN}} -\def\MMLcTRUE #1#2{\mathop{\rm true}} -\def\MMLcFALSE #1#2{\mathop{\rm false}} -\def\MMLcEMPTYSET #1#2{\mathop{\hbox{\O}}} -\def\MMLcPI #1#2{\pi} -\def\MMLcEULERGAMMA #1#2{\gamma} -\def\MMLcINFINITY #1#2{\infty} - -\stopXMLmapping - -\protect \endinput diff --git a/tex/context/base/xtag-mml.mkii b/tex/context/base/xtag-mml.mkii new file mode 100644 index 000000000..051d15b00 --- /dev/null +++ b/tex/context/base/xtag-mml.mkii @@ -0,0 +1,515 @@ +%D \module +%D [ file=xtag-mml, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=MathML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / MathML} + +% I will reimplement this one without mapping since we now have more +% tricks available + +\useXMLfilter[map] + +%\enablemathpunctuation + +% First some general formula element definitions. + +\defineXMLenvironment [formula] [label=,sublabel=] + {\dostartXMLformula\placeformula} + {\dostopXMLformula} + +\defineXMLenvironment [subformula] [label=,sublabel=] + {\dostartXMLformula\placesubformula} + {\dostopXMLformula} + +\def\dostartXMLformula#1% + {\doifelsenothingXMLop{label} + {\startformula} + {\expanded{#1[\XMLop{label}]{\XMLop{sublabel}}}\startformula}} + +\def\dostopXMLformula + {\stopformula} + +% Since I only had the draft of mml 2 as example of +% rendering, there are probably a lot of omissions and +% misinterpretations. At least I learned some bits and +% pieces of math rendering. +% +% The main complications were not so much the math, but to +% find the most efficient way to handle elements without +% spacing beging messed up. The first implementation was +% aimed at getting reasonable output, this second +% implementation is already better in terms of handling +% nesting, and I will definitely need a third one that has +% more efficient and less ugly code. +% +% The TeX part is not that complicated and once the +% preprocessor was okay, the rest way just a lot of keying +% and testing. It all comes down to gobbling, redefining, +% and not so much to parsing. + +\unprotect + +\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]} + +\defineXMLdirective [mathml] \setupMMLappearance + +\defineXMLargument [math] \doXMLmath +\defineXMLargument [imath] \doXMLimath +\defineXMLargument [dmath] \doXMLdmath +\defineXMLargument [m] \doXMLimath + +\unexpanded\def\doXMLmath {\ifhmode\@EA\doXMLimath\else\@EA\doXMLdmath\fi} +\unexpanded\def\doXMLimath{\XMLremapdata[mml]{$}{$}} +\unexpanded\def\doXMLdmath{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}} + +\ifx\XMLRtoks\undefined \newtoks\XMLRtoks \fi + +\def\convertasciiafter#1#2% + {\defconvertedargument\asciiafter{#2}% + \@EA#1\@EA{\asciiafter}} + +\def\checkMMLoperator#1% #2 + {\unspaceargument#1\to\ascii + \doifXMLentityelse\ascii{\getXMLentity\ascii}} % {#2} + +% this will be done in a more safe way + +\def\MMLtodo#1{\enspace\hbox{\rm#1}\enspace} + +% this goes to core-mat + +\def\normalorfiller #1#2{#1} +\def\normalordelimiter#1#2{#2} + +\def\enabledelimiter {\let\normalordelimiter\secondoftwoarguments} +\def\disabledelimiter{\let\normalordelimiter\firstoftwoarguments} + +\def\enablefiller {\let\normalorfiller\secondoftwoarguments} +\def\disablefiller {\let\normalorfiller\firstoftwoarguments} + +\def\mathopnolimits#1{\mathop{\rm#1}\nolimits} + +% Auxiliary macros + +\bgroup \obeylines + +\gdef\defineMMLentity% % needed ! + {\bgroup\obeylines\xdefineMMLentity} + +\gdef\xdefineMMLentity #1 #2 #3 #4 + {\egroup\dodefineMMLentity{#1}{#2}{#3}{#4}} + +\global\let\dodefineMMLentity\gobblefourarguments + +\gdef\defineMMLsynonym% % needed ! + {\bgroup\obeylines\xdefineMMLsynonym} + +\gdef\xdefineMMLsynonym #1 #2 + {\egroup\dodefineMMLsynonym{#1}{#2}} + +\global\let\dodefineMMLsynonym\gobbletwoarguments + +\egroup + +% some more + +\def\showMMLentity#1% + {\bgroup + \doifXMLentityelse{#1} + {\let\left\empty\let\right\empty\mathematics{\getXMLentity{#1}{}}} + {\getXMLentity{unknown}}% + \egroup} + +\newbox\unknownXMLentity +\setbox\unknownXMLentity\hbox{\inframed[\c!strut=\v!no,\c!offset=1pt]{\ttx ?}} + +\defineXMLentity [unknown] {\copy\unknownXMLentity} + +% the definitions + +\ifx\blackboard\undefined + \def\blackboard{\ifx\Bbb\undefined\else\expandafter\Bbb\fi} +\fi + +% basic entities, greek + +\defineXMLentity [alpha] {\mathematics \alpha} +\defineXMLentity [beta] {\mathematics \beta} +\defineXMLentity [gamma] {\mathematics \gamma} +\defineXMLentity [delta] {\mathematics \delta} +\defineXMLentity [epsilon] {\mathematics \epsilon} +\defineXMLentity [zeta] {\mathematics \zeta} +\defineXMLentity [eta] {\mathematics \eta} +\defineXMLentity [theta] {\mathematics \theta} +\defineXMLentity [iota] {\mathematics \iota} +\defineXMLentity [kappa] {\mathematics \kappa} +\defineXMLentity [lambda] {\mathematics \lambda} +\defineXMLentity [theta] {\mathematics \theta} +\defineXMLentity [mu] {\mathematics \mu} +\defineXMLentity [nu] {\mathematics \nu} +\defineXMLentity [xi] {\mathematics \xi} +\defineXMLentity [pi] {\mathematics \pi} +\defineXMLentity [rho] {\mathematics \rho} +\defineXMLentity [sigma] {\mathematics \sigma} +\defineXMLentity [tau] {\mathematics \tau} +\defineXMLentity [upsilon] {\mathematics \upsilon} +\defineXMLentity [phi] {\mathematics \phi} +\defineXMLentity [chi] {\mathematics \chi} +\defineXMLentity [psi] {\mathematics \psi} +\defineXMLentity [omega] {\mathematics \omega} + +\defineXMLentity [varepsilon] {\mathematics \varepsilon} +\defineXMLentity [vartheta] {\mathematics \vartheta} +\defineXMLentity [varpi] {\mathematics \varpi} +\defineXMLentity [varrho] {\mathematics \varrho} +\defineXMLentity [varsigma] {\mathematics \varsigma} +\defineXMLentity [varphi] {\mathematics \varphi} + +\defineXMLentity [epsilonv] {\mathematics \varepsilon} +\defineXMLentity [thetav] {\mathematics \vartheta} +\defineXMLentity [piv] {\mathematics \varpi} +\defineXMLentity [rhov] {\mathematics \varrho} +\defineXMLentity [sigmav] {\mathematics \varsigma} +\defineXMLentity [phiv] {\mathematics \varphi} + +\defineXMLentity [epsi] {\mathematics \epsilon} +\defineXMLentity [epsiv] {\mathematics \varepsilon} + +\defineXMLentity [Alpha] {A} +\defineXMLentity [Beta] {B} +\defineXMLentity [Gamma] {\mathematics \Gamma} +\defineXMLentity [Delta] {\mathematics \Delta} +\defineXMLentity [Epsilon] {E} +\defineXMLentity [Zeta] {Z} +\defineXMLentity [Eta] {N} +\defineXMLentity [Theta] {\mathematics \Theta} +\defineXMLentity [Iota] {I} +\defineXMLentity [Kappa] {K} +\defineXMLentity [Lambda] {\mathematics \Lambda} +\defineXMLentity [Mu] {M} +\defineXMLentity [Nu] {N} +\defineXMLentity [Xi] {\mathematics \Xi} +\defineXMLentity [Pi] {\mathematics \Pi} +\defineXMLentity [Ro] {R} +\defineXMLentity [Sigma] {\mathematics \Sigma} +\defineXMLentity [Tau] {T} +\defineXMLentity [Upsilon] {\mathematics \Upsilon} +\defineXMLentity [Phi] {\mathematics \Phi} +\defineXMLentity [Chi] {X} +\defineXMLentity [Psi] {\mathematics \Psi} +\defineXMLentity [Omega] {\mathematics \Omega} + +% basic entities, hebrew + +\defineXMLentity [aleph] {\mathematics \aleph} + +% basic entities, functions + +\defineXMLentity [abs] {\mathopnolimits{abs}} +\defineXMLentity [arg] {\mathopnolimits{arg}} +\defineXMLentity [codomain] {\mathopnolimits{codomain}} +\defineXMLentity [curl] {\mathopnolimits{curl}} +\defineXMLentity [determinant] {\mathopnolimits{det}} +\defineXMLentity [divergence] {\mathopnolimits{div}} +\defineXMLentity [domain] {\mathopnolimits{domain}} +\defineXMLentity [false] {\mathopnolimits{false}} +\defineXMLentity [gcd] {\mathopnolimits{gcd}} +\defineXMLentity [grad] {\mathopnolimits{grad}} +\defineXMLentity [identity] {\mathopnolimits{id}} +\defineXMLentity [image] {\mathopnolimits{image}} +\defineXMLentity [lcm] {\mathopnolimits{lcm}} +\defineXMLentity [max] {\mathopnolimits{max}} +\defineXMLentity [median] {\mathopnolimits{median}} +\defineXMLentity [min] {\mathopnolimits{min}} +\defineXMLentity [mode] {\mathopnolimits{mode}} +\defineXMLentity [mod] {\mathopnolimits{mod}} +\defineXMLentity [notanumber] {\mathopnolimits{NaN}} +\defineXMLentity [otherwise] {\mathopnolimits{otherwise}} +\defineXMLentity [true] {\mathopnolimits{true}} +\defineXMLentity [declare] {\mathopnolimits{declare}} +\defineXMLentity [as] {\mathopnolimits{as}} +\defineXMLentity [polar] {\mathopnolimits{Polar}} + +\defineXMLentity [mathematicald] {d} + +\defineXMLentity [imaginaryi] {{\rm i}} +\defineXMLentity [differentiald] {\partial} +\defineXMLentity [exponentiale] {{\rm e}} +\defineXMLentity [capitaldifferentiald] {D} + +\defineXMLentity [ii] {\getXMLentity{imaginaryi}} +\defineXMLentity [dd] {\getXMLentity{differentiald}} +\defineXMLentity [ee] {\getXMLentity{exponentiale}} +\defineXMLentity [DD] {\getMMLentity{capitaldifferentiald}} + +\defineXMLentity [ImaginaryI] {\getXMLentity{imaginaryi}} +\defineXMLentity [DifferentialD] {\getXMLentity{differentiald}} +\defineXMLentity [ExponentialE] {\getXMLentity{exponentiale}} +\defineXMLentity [CapitalDifferentialD] {\getXMLentity{differentiald}} + +\defineXMLentity [NaN] {\getXMLentity{notanumber}} +\defineXMLentity [NotANumber] {\getXMLentity{notanumber}} + +\defineXMLentity [and] {\wedge} +\defineXMLentity [exists] {\exists} +\defineXMLentity [forall] {\forall} +\defineXMLentity [implies] {\Rightarrow} +\defineXMLentity [not] {\neg} +\defineXMLentity [or] {\vee} +\defineXMLentity [xor] {\mathopnolimits{xor}} + +\defineXMLentity [imaginary] {\Im} +\defineXMLentity [real] {\Re} + +\defineXMLentity [lceiling] {\lceil} +\defineXMLentity [rceiling] {\rceil} + +\defineXMLentity [lfloor] {\lfloor} +\defineXMLentity [rfloor] {\rfloor} + +\defineXMLentity [ne] {\neq} +\defineXMLentity [neq] {\neq} +\defineXMLentity [gt] {>} +\defineXMLentity [lt] {<} +\defineXMLentity [ge] {\geq} +\defineXMLentity [geq] {\geq} +\defineXMLentity [le] {\leq} +\defineXMLentity [leq] {\leq} + +\defineXMLentity [equivalent] {\equiv} +\defineXMLentity [equiv] {\equiv} +\defineXMLentity [approx] {\approx} + +\defineXMLentity [factorof] {\mid} +\defineXMLentity [mapsto] {\mapsto} + +\defineXMLentity [int] {\int} +\defineXMLentity [prime] {\prime} +\defineXMLentity [laplacian] {\nabla^2} +\defineXMLentity [partial] {\partial} + +\defineXMLentity [union] {\cup} +\defineXMLentity [intersect] {\cap} +\defineXMLentity [in] {\in} +\defineXMLentity [notin] {\not\in} +\defineXMLentity [subset] {\subset} +\defineXMLentity [prsubset] {\subseteq} +\defineXMLentity [notsubset] {\not\subset} +\defineXMLentity [notprsubset] {\not\subseteq} +\defineXMLentity [setdiff] {\setminus} + +\defineXMLentity [card] {\vert} +\defineXMLentity [cartesianproduct] {\times} + +\defineXMLentity [sum] {\sum} +\defineXMLentity [prod] {\prod} +\defineXMLentity [product] {\prod} +\defineXMLentity [lim] {\lim} + +\defineXMLentity [exp] {\mathopnolimits{exp}} % {\exp} +\defineXMLentity [ln] {\mathopnolimits{ln}} % {\ln} +\defineXMLentity [log] {\mathopnolimits{log}} % {\log} + +\defineXMLentity [sin] {\mathopnolimits{sin}} +\defineXMLentity [arcsin] {\mathopnolimits{arcsin}} +\defineXMLentity [sinh] {\mathopnolimits{sinh}} +\defineXMLentity [arcsinh] {\mathopnolimits{arcsinh}} +\defineXMLentity [cos] {\mathopnolimits{cos}} +\defineXMLentity [arccos] {\mathopnolimits{arccos}} +\defineXMLentity [cosh] {\mathopnolimits{cosh}} +\defineXMLentity [arccosh] {\mathopnolimits{arccosh}} +\defineXMLentity [tan] {\mathopnolimits{tan}} +\defineXMLentity [arctan] {\mathopnolimits{arctan}} +\defineXMLentity [tanh] {\mathopnolimits{tanh}} +\defineXMLentity [arctanh] {\mathopnolimits{arctanh}} +\defineXMLentity [cot] {\mathopnolimits{cot}} +\defineXMLentity [arccot] {\mathopnolimits{arccot}} +\defineXMLentity [coth] {\mathopnolimits{coth}} +\defineXMLentity [arccoth] {\mathopnolimits{arccoth}} +\defineXMLentity [csc] {\mathopnolimits{csc}} +\defineXMLentity [arccsc] {\mathopnolimits{arccsc}} +\defineXMLentity [csch] {\mathopnolimits{csch}} +\defineXMLentity [arccsch] {\mathopnolimits{arccsch}} +\defineXMLentity [sec] {\mathopnolimits{sec}} +\defineXMLentity [arcsec] {\mathopnolimits{arcsec}} +\defineXMLentity [sech] {\mathopnolimits{sech}} +\defineXMLentity [arcsech] {\mathopnolimits{arcsech}} + +\defineXMLentity [transpose] {^{\rm T}} + +\defineXMLentity [plusminus] {\pm} +\defineXMLentity [minusplus] {\mp} + +\defineXMLentity [vectorproduct] {\times} +\defineXMLentity [scalarproduct] {\cdot} +\defineXMLentity [outerproduct] {\otimes} + +\defineXMLentity [integers] {\integers} +\defineXMLentity [reals] {\reals} +\defineXMLentity [rationals] {\rationals} +\defineXMLentity [naturalnumbers] {\naturalnumbers} +\defineXMLentity [complexes] {\complexes} +\defineXMLentity [primes] {\primes} + +\defineXMLentity [emptyset] {\emptyset} +\defineXMLentity [pi] {\pi} +\defineXMLentity [eulergamma] {\gamma} +\defineXMLentity [infinity] {\mathematics{\infty}} + +\defineXMLentity [InvisibleTimes] {} +\defineXMLentity [InvisibleComma] {} +\defineXMLentity [ApplyFunction] {} + +\defineXMLentity [it] {\getXMLentity{InvisibleTines}} +\defineXMLentity [ic] {\getXMLentity{InvisibleComma}} +\defineXMLentity [af] {\getXMLentity{ApplyFunction}} + +\defineXMLentity [PlusMinus] {\getXMLentity{plusminus}} + +\defineXMLentity [infin] {\getXMLentity{infinity}} +\defineXMLentity [infty] {\getXMLentity{infinity}} +\defineXMLentity [part] {\getXMLentity{differentiald}} + +\defineXMLentity [RightArrow] {\normalorfiller\rightarrow\rightarrowfill} +\defineXMLentity [LeftArrow] {\normalorfiller\leftarrow\leftarrowfill} +\defineXMLentity [UnderBrace] {\normalorfiller\empty\upbracefill} +\defineXMLentity [OverBrace] {\normalorfiller\empty\downbracefill} +\defineXMLentity [UnderBar] {\normalorfiller\hrule\hrulefill} +\defineXMLentity [OverBar] {\normalorfiller\hrule\hrulefill} +\defineXMLentity [Hat] {\normalorfiller\empty\empty} % todo + +\defineXMLentity [downarrow] {\mathortext\downarrow\empty} +\defineXMLentity [uparrow] {\mathortext\uparrow\empty} + +\defineXMLentity [Tab] {\hskip4em} +\defineXMLentity [NewLine] {\mathortext\empty\crlf} +\defineXMLentity [IndentingNewLine] {\mathortext\empty\crlf} + +\defineXMLentity [NoBreak] {\nobreak} +\defineXMLentity [GoodBreak] {\goodbreak} +\defineXMLentity [BadBreak] {\nobreak} + +\defineXMLentity [Space] {\getXMLentity{MediumSpace}} +\defineXMLentity [NonBreakingSpace] {\getXMLentity{MediumSpace}} +\defineXMLentity [ZeroWidthSpace] {} + +\def\somespaceentity#1#2% + {\mathortext + {\mskip#1mu} + {\ifvmode\dontleavehmode\else\unskip\fi\hskip#2em\strut\hskip\zeropoint\ignorespaces}% + \relax} + +\defineXMLentity [VeryThinSpace] {\somespaceentity {2}{.125}} +\defineXMLentity [ThinSpace] {\somespaceentity {3}{.25}} +\defineXMLentity [MediumSpace] {\somespaceentity {4}{.5}} +\defineXMLentity [ThickSpace] {\somespaceentity {5}{1}} +\defineXMLentity [NegativeVeryThinSpace] {\somespaceentity{-2}{-.125}} +\defineXMLentity [NegativeThinSpace] {\somespaceentity{-3}{-.25}} +\defineXMLentity [NegativeMediumSpace] {\somespaceentity{-4}{-.5}} +\defineXMLentity [NegativeThickSpace] {\somespaceentity{-5}{-1}} + +\defineXMLentity [NegVeryThinSpace] {\getXMLentity{NegativeVeryThinSpace}} +\defineXMLentity [NegThinSpace] {\getXMLentity{NegativeThinSpace}} +\defineXMLentity [NegMediumSpace] {\getXMLentity{NegativeMediumSpace}} +\defineXMLentity [NegThickSpace] {\getXMLentity{NegativeThickSpace}} + +\defineXMLentity [nbsp] {\getXMLentity{NonBreakingSpace}} +\defineXMLentity [thinsp] {\getXMLentity{ThinSpace}} +\defineXMLentity [medsp] {\getXMLentity{MediumSpace}} +\defineXMLentity [thicksp] {\getXMLentity{ThickSpace}} + +\defineXMLentity [larr] {\getXMLentity{LeftArrow}} +\defineXMLentity [rarr] {\getXMLentity{RightArrow}} + +\defineXMLentity [lbrace] {\normalordelimiter{\{}{\left \{}} +\defineXMLentity [rbrace] {\normalordelimiter{\}}{\right\}}} +\defineXMLentity [lbracket] {\normalordelimiter{[}{\left [}} +\defineXMLentity [rbracket] {\normalordelimiter{]}{\right]}} +\defineXMLentity [lparenthesis] {\normalordelimiter{(}{\left (}} +\defineXMLentity [rparenthesis] {\normalordelimiter{)}{\right)}} +\defineXMLentity [langle] {\normalordelimiter{\langle}{\left \langle}} +\defineXMLentity [rangle] {\normalordelimiter{\rangle}{\right\rangle}} + +\defineXMLentity [lang] {\getXMLentity{langle}} +\defineXMLentity [rang] {\getXMLentity{rangle}} +\defineXMLentity [lbrack] {\getXMLentity{lbracket}} +\defineXMLentity [rbrack] {\getXMLentity{rbracket}} +\defineXMLentity [lparent] {\getXMLentity{lparenthesis}} +\defineXMLentity [rparent] {\getXMLentity{rparenthesis}} + +\defineXMLentity [\letterleftbrace ] {\getXMLentity{lbrace}} +\defineXMLentity [\letterrightbrace] {\getXMLentity{rbrace}} + +\defineXMLentity [{[}] {\getXMLentity{lbracket}} +\defineXMLentity [{]}] {\getXMLentity{rbracket}} +\defineXMLentity [{(}] {\getXMLentity{lparenthesis}} +\defineXMLentity [{)}] {\getXMLentity{rparenthesis}} + +\defineXMLentity [times] {\times} +\defineXMLentity [minus] {-} +\defineXMLentity [plus] {+} +\defineXMLentity [plusmn] {\pm} + +\defineXMLentity [nabla] {\nabla} + +\def\myspecialnormalvert{\mathematics{\vert}} % temp hack, should stretch + +\defineXMLentity [,] {{,}} +\defineXMLentity [.] {{.}} +\defineXMLentity [+] {+} +\defineXMLentity [-] {-} +\defineXMLentity [(] {(} +\defineXMLentity [)] {)} +\defineXMLentity [<] {\mathematics{<}} +\defineXMLentity [>] {\mathematics{>}} +\defineXMLentity [|] {\myspecialnormalvert} +\defineXMLentity [/] {/} +\defineXMLentity [*] {\times} +\defineXMLentity [=] {=} + +\defineXMLentity [++] {++} +\defineXMLentity [--] {--} +\defineXMLentity [//] {//} +\defineXMLentity [**] {\times\times} +\defineXMLentity [==] {==} + +\defineXMLentity [quot] {"} + +\defineXMLentity [triangle] {\mathematics\triangle} +\defineXMLentity [otimes] {\mathematics\otimes} +\defineXMLentity [oplus] {\mathematics\oplus} +\defineXMLentity [cup] {\mathematics\cup} +\defineXMLentity [cap] {\mathematics\cap} +\defineXMLentity [sdot] {\mathematics\cdot} +\defineXMLentity [dot] {\mathematics\cdot} +\defineXMLentity [sim] {\mathematics\sim} +\defineXMLentity [circ] {\mathematics\circ} +\defineXMLentity [dagger] {\mathematics\dagger} +\defineXMLentity [cdots] {\mathematics\cdots} + +\defineXMLentity [...] {\getXMLentity{cdots}} +\defineXMLentity [continued] {\getXMLentity{cdots}} + +\defineXMLentity [sub] {\getXMLentity{subset}} +\defineXMLentity [sube] {\getXMLentity{prsubset}} +\defineXMLentity [notprsubset] {\getXMLentity{notprsubset}} + +\defineXMLentity [ndash] {\endash} +\defineXMLentity [mdash] {\emdash} + +\defineXMLentity [tex-bar] {\mathematics{\vert}} +\defineXMLentity [tex-dollar] {\dollar} +\defineXMLentity [tex-backslash] {\backslash} +\defineXMLentity [tex-leftbrace] {\mathematics{\{}} +\defineXMLentity [tex-rightbrace] {\mathematics{\}}} + +\protect \endinput diff --git a/tex/context/base/xtag-mml.tex b/tex/context/base/xtag-mml.tex deleted file mode 100644 index 051d15b00..000000000 --- a/tex/context/base/xtag-mml.tex +++ /dev/null @@ -1,515 +0,0 @@ -%D \module -%D [ file=xtag-mml, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=MathML, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / MathML} - -% I will reimplement this one without mapping since we now have more -% tricks available - -\useXMLfilter[map] - -%\enablemathpunctuation - -% First some general formula element definitions. - -\defineXMLenvironment [formula] [label=,sublabel=] - {\dostartXMLformula\placeformula} - {\dostopXMLformula} - -\defineXMLenvironment [subformula] [label=,sublabel=] - {\dostartXMLformula\placesubformula} - {\dostopXMLformula} - -\def\dostartXMLformula#1% - {\doifelsenothingXMLop{label} - {\startformula} - {\expanded{#1[\XMLop{label}]{\XMLop{sublabel}}}\startformula}} - -\def\dostopXMLformula - {\stopformula} - -% Since I only had the draft of mml 2 as example of -% rendering, there are probably a lot of omissions and -% misinterpretations. At least I learned some bits and -% pieces of math rendering. -% -% The main complications were not so much the math, but to -% find the most efficient way to handle elements without -% spacing beging messed up. The first implementation was -% aimed at getting reasonable output, this second -% implementation is already better in terms of handling -% nesting, and I will definitely need a third one that has -% more efficient and less ugly code. -% -% The TeX part is not that complicated and once the -% preprocessor was okay, the rest way just a lot of keying -% and testing. It all comes down to gobbling, redefining, -% and not so much to parsing. - -\unprotect - -\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]} - -\defineXMLdirective [mathml] \setupMMLappearance - -\defineXMLargument [math] \doXMLmath -\defineXMLargument [imath] \doXMLimath -\defineXMLargument [dmath] \doXMLdmath -\defineXMLargument [m] \doXMLimath - -\unexpanded\def\doXMLmath {\ifhmode\@EA\doXMLimath\else\@EA\doXMLdmath\fi} -\unexpanded\def\doXMLimath{\XMLremapdata[mml]{$}{$}} -\unexpanded\def\doXMLdmath{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}} - -\ifx\XMLRtoks\undefined \newtoks\XMLRtoks \fi - -\def\convertasciiafter#1#2% - {\defconvertedargument\asciiafter{#2}% - \@EA#1\@EA{\asciiafter}} - -\def\checkMMLoperator#1% #2 - {\unspaceargument#1\to\ascii - \doifXMLentityelse\ascii{\getXMLentity\ascii}} % {#2} - -% this will be done in a more safe way - -\def\MMLtodo#1{\enspace\hbox{\rm#1}\enspace} - -% this goes to core-mat - -\def\normalorfiller #1#2{#1} -\def\normalordelimiter#1#2{#2} - -\def\enabledelimiter {\let\normalordelimiter\secondoftwoarguments} -\def\disabledelimiter{\let\normalordelimiter\firstoftwoarguments} - -\def\enablefiller {\let\normalorfiller\secondoftwoarguments} -\def\disablefiller {\let\normalorfiller\firstoftwoarguments} - -\def\mathopnolimits#1{\mathop{\rm#1}\nolimits} - -% Auxiliary macros - -\bgroup \obeylines - -\gdef\defineMMLentity% % needed ! - {\bgroup\obeylines\xdefineMMLentity} - -\gdef\xdefineMMLentity #1 #2 #3 #4 - {\egroup\dodefineMMLentity{#1}{#2}{#3}{#4}} - -\global\let\dodefineMMLentity\gobblefourarguments - -\gdef\defineMMLsynonym% % needed ! - {\bgroup\obeylines\xdefineMMLsynonym} - -\gdef\xdefineMMLsynonym #1 #2 - {\egroup\dodefineMMLsynonym{#1}{#2}} - -\global\let\dodefineMMLsynonym\gobbletwoarguments - -\egroup - -% some more - -\def\showMMLentity#1% - {\bgroup - \doifXMLentityelse{#1} - {\let\left\empty\let\right\empty\mathematics{\getXMLentity{#1}{}}} - {\getXMLentity{unknown}}% - \egroup} - -\newbox\unknownXMLentity -\setbox\unknownXMLentity\hbox{\inframed[\c!strut=\v!no,\c!offset=1pt]{\ttx ?}} - -\defineXMLentity [unknown] {\copy\unknownXMLentity} - -% the definitions - -\ifx\blackboard\undefined - \def\blackboard{\ifx\Bbb\undefined\else\expandafter\Bbb\fi} -\fi - -% basic entities, greek - -\defineXMLentity [alpha] {\mathematics \alpha} -\defineXMLentity [beta] {\mathematics \beta} -\defineXMLentity [gamma] {\mathematics \gamma} -\defineXMLentity [delta] {\mathematics \delta} -\defineXMLentity [epsilon] {\mathematics \epsilon} -\defineXMLentity [zeta] {\mathematics \zeta} -\defineXMLentity [eta] {\mathematics \eta} -\defineXMLentity [theta] {\mathematics \theta} -\defineXMLentity [iota] {\mathematics \iota} -\defineXMLentity [kappa] {\mathematics \kappa} -\defineXMLentity [lambda] {\mathematics \lambda} -\defineXMLentity [theta] {\mathematics \theta} -\defineXMLentity [mu] {\mathematics \mu} -\defineXMLentity [nu] {\mathematics \nu} -\defineXMLentity [xi] {\mathematics \xi} -\defineXMLentity [pi] {\mathematics \pi} -\defineXMLentity [rho] {\mathematics \rho} -\defineXMLentity [sigma] {\mathematics \sigma} -\defineXMLentity [tau] {\mathematics \tau} -\defineXMLentity [upsilon] {\mathematics \upsilon} -\defineXMLentity [phi] {\mathematics \phi} -\defineXMLentity [chi] {\mathematics \chi} -\defineXMLentity [psi] {\mathematics \psi} -\defineXMLentity [omega] {\mathematics \omega} - -\defineXMLentity [varepsilon] {\mathematics \varepsilon} -\defineXMLentity [vartheta] {\mathematics \vartheta} -\defineXMLentity [varpi] {\mathematics \varpi} -\defineXMLentity [varrho] {\mathematics \varrho} -\defineXMLentity [varsigma] {\mathematics \varsigma} -\defineXMLentity [varphi] {\mathematics \varphi} - -\defineXMLentity [epsilonv] {\mathematics \varepsilon} -\defineXMLentity [thetav] {\mathematics \vartheta} -\defineXMLentity [piv] {\mathematics \varpi} -\defineXMLentity [rhov] {\mathematics \varrho} -\defineXMLentity [sigmav] {\mathematics \varsigma} -\defineXMLentity [phiv] {\mathematics \varphi} - -\defineXMLentity [epsi] {\mathematics \epsilon} -\defineXMLentity [epsiv] {\mathematics \varepsilon} - -\defineXMLentity [Alpha] {A} -\defineXMLentity [Beta] {B} -\defineXMLentity [Gamma] {\mathematics \Gamma} -\defineXMLentity [Delta] {\mathematics \Delta} -\defineXMLentity [Epsilon] {E} -\defineXMLentity [Zeta] {Z} -\defineXMLentity [Eta] {N} -\defineXMLentity [Theta] {\mathematics \Theta} -\defineXMLentity [Iota] {I} -\defineXMLentity [Kappa] {K} -\defineXMLentity [Lambda] {\mathematics \Lambda} -\defineXMLentity [Mu] {M} -\defineXMLentity [Nu] {N} -\defineXMLentity [Xi] {\mathematics \Xi} -\defineXMLentity [Pi] {\mathematics \Pi} -\defineXMLentity [Ro] {R} -\defineXMLentity [Sigma] {\mathematics \Sigma} -\defineXMLentity [Tau] {T} -\defineXMLentity [Upsilon] {\mathematics \Upsilon} -\defineXMLentity [Phi] {\mathematics \Phi} -\defineXMLentity [Chi] {X} -\defineXMLentity [Psi] {\mathematics \Psi} -\defineXMLentity [Omega] {\mathematics \Omega} - -% basic entities, hebrew - -\defineXMLentity [aleph] {\mathematics \aleph} - -% basic entities, functions - -\defineXMLentity [abs] {\mathopnolimits{abs}} -\defineXMLentity [arg] {\mathopnolimits{arg}} -\defineXMLentity [codomain] {\mathopnolimits{codomain}} -\defineXMLentity [curl] {\mathopnolimits{curl}} -\defineXMLentity [determinant] {\mathopnolimits{det}} -\defineXMLentity [divergence] {\mathopnolimits{div}} -\defineXMLentity [domain] {\mathopnolimits{domain}} -\defineXMLentity [false] {\mathopnolimits{false}} -\defineXMLentity [gcd] {\mathopnolimits{gcd}} -\defineXMLentity [grad] {\mathopnolimits{grad}} -\defineXMLentity [identity] {\mathopnolimits{id}} -\defineXMLentity [image] {\mathopnolimits{image}} -\defineXMLentity [lcm] {\mathopnolimits{lcm}} -\defineXMLentity [max] {\mathopnolimits{max}} -\defineXMLentity [median] {\mathopnolimits{median}} -\defineXMLentity [min] {\mathopnolimits{min}} -\defineXMLentity [mode] {\mathopnolimits{mode}} -\defineXMLentity [mod] {\mathopnolimits{mod}} -\defineXMLentity [notanumber] {\mathopnolimits{NaN}} -\defineXMLentity [otherwise] {\mathopnolimits{otherwise}} -\defineXMLentity [true] {\mathopnolimits{true}} -\defineXMLentity [declare] {\mathopnolimits{declare}} -\defineXMLentity [as] {\mathopnolimits{as}} -\defineXMLentity [polar] {\mathopnolimits{Polar}} - -\defineXMLentity [mathematicald] {d} - -\defineXMLentity [imaginaryi] {{\rm i}} -\defineXMLentity [differentiald] {\partial} -\defineXMLentity [exponentiale] {{\rm e}} -\defineXMLentity [capitaldifferentiald] {D} - -\defineXMLentity [ii] {\getXMLentity{imaginaryi}} -\defineXMLentity [dd] {\getXMLentity{differentiald}} -\defineXMLentity [ee] {\getXMLentity{exponentiale}} -\defineXMLentity [DD] {\getMMLentity{capitaldifferentiald}} - -\defineXMLentity [ImaginaryI] {\getXMLentity{imaginaryi}} -\defineXMLentity [DifferentialD] {\getXMLentity{differentiald}} -\defineXMLentity [ExponentialE] {\getXMLentity{exponentiale}} -\defineXMLentity [CapitalDifferentialD] {\getXMLentity{differentiald}} - -\defineXMLentity [NaN] {\getXMLentity{notanumber}} -\defineXMLentity [NotANumber] {\getXMLentity{notanumber}} - -\defineXMLentity [and] {\wedge} -\defineXMLentity [exists] {\exists} -\defineXMLentity [forall] {\forall} -\defineXMLentity [implies] {\Rightarrow} -\defineXMLentity [not] {\neg} -\defineXMLentity [or] {\vee} -\defineXMLentity [xor] {\mathopnolimits{xor}} - -\defineXMLentity [imaginary] {\Im} -\defineXMLentity [real] {\Re} - -\defineXMLentity [lceiling] {\lceil} -\defineXMLentity [rceiling] {\rceil} - -\defineXMLentity [lfloor] {\lfloor} -\defineXMLentity [rfloor] {\rfloor} - -\defineXMLentity [ne] {\neq} -\defineXMLentity [neq] {\neq} -\defineXMLentity [gt] {>} -\defineXMLentity [lt] {<} -\defineXMLentity [ge] {\geq} -\defineXMLentity [geq] {\geq} -\defineXMLentity [le] {\leq} -\defineXMLentity [leq] {\leq} - -\defineXMLentity [equivalent] {\equiv} -\defineXMLentity [equiv] {\equiv} -\defineXMLentity [approx] {\approx} - -\defineXMLentity [factorof] {\mid} -\defineXMLentity [mapsto] {\mapsto} - -\defineXMLentity [int] {\int} -\defineXMLentity [prime] {\prime} -\defineXMLentity [laplacian] {\nabla^2} -\defineXMLentity [partial] {\partial} - -\defineXMLentity [union] {\cup} -\defineXMLentity [intersect] {\cap} -\defineXMLentity [in] {\in} -\defineXMLentity [notin] {\not\in} -\defineXMLentity [subset] {\subset} -\defineXMLentity [prsubset] {\subseteq} -\defineXMLentity [notsubset] {\not\subset} -\defineXMLentity [notprsubset] {\not\subseteq} -\defineXMLentity [setdiff] {\setminus} - -\defineXMLentity [card] {\vert} -\defineXMLentity [cartesianproduct] {\times} - -\defineXMLentity [sum] {\sum} -\defineXMLentity [prod] {\prod} -\defineXMLentity [product] {\prod} -\defineXMLentity [lim] {\lim} - -\defineXMLentity [exp] {\mathopnolimits{exp}} % {\exp} -\defineXMLentity [ln] {\mathopnolimits{ln}} % {\ln} -\defineXMLentity [log] {\mathopnolimits{log}} % {\log} - -\defineXMLentity [sin] {\mathopnolimits{sin}} -\defineXMLentity [arcsin] {\mathopnolimits{arcsin}} -\defineXMLentity [sinh] {\mathopnolimits{sinh}} -\defineXMLentity [arcsinh] {\mathopnolimits{arcsinh}} -\defineXMLentity [cos] {\mathopnolimits{cos}} -\defineXMLentity [arccos] {\mathopnolimits{arccos}} -\defineXMLentity [cosh] {\mathopnolimits{cosh}} -\defineXMLentity [arccosh] {\mathopnolimits{arccosh}} -\defineXMLentity [tan] {\mathopnolimits{tan}} -\defineXMLentity [arctan] {\mathopnolimits{arctan}} -\defineXMLentity [tanh] {\mathopnolimits{tanh}} -\defineXMLentity [arctanh] {\mathopnolimits{arctanh}} -\defineXMLentity [cot] {\mathopnolimits{cot}} -\defineXMLentity [arccot] {\mathopnolimits{arccot}} -\defineXMLentity [coth] {\mathopnolimits{coth}} -\defineXMLentity [arccoth] {\mathopnolimits{arccoth}} -\defineXMLentity [csc] {\mathopnolimits{csc}} -\defineXMLentity [arccsc] {\mathopnolimits{arccsc}} -\defineXMLentity [csch] {\mathopnolimits{csch}} -\defineXMLentity [arccsch] {\mathopnolimits{arccsch}} -\defineXMLentity [sec] {\mathopnolimits{sec}} -\defineXMLentity [arcsec] {\mathopnolimits{arcsec}} -\defineXMLentity [sech] {\mathopnolimits{sech}} -\defineXMLentity [arcsech] {\mathopnolimits{arcsech}} - -\defineXMLentity [transpose] {^{\rm T}} - -\defineXMLentity [plusminus] {\pm} -\defineXMLentity [minusplus] {\mp} - -\defineXMLentity [vectorproduct] {\times} -\defineXMLentity [scalarproduct] {\cdot} -\defineXMLentity [outerproduct] {\otimes} - -\defineXMLentity [integers] {\integers} -\defineXMLentity [reals] {\reals} -\defineXMLentity [rationals] {\rationals} -\defineXMLentity [naturalnumbers] {\naturalnumbers} -\defineXMLentity [complexes] {\complexes} -\defineXMLentity [primes] {\primes} - -\defineXMLentity [emptyset] {\emptyset} -\defineXMLentity [pi] {\pi} -\defineXMLentity [eulergamma] {\gamma} -\defineXMLentity [infinity] {\mathematics{\infty}} - -\defineXMLentity [InvisibleTimes] {} -\defineXMLentity [InvisibleComma] {} -\defineXMLentity [ApplyFunction] {} - -\defineXMLentity [it] {\getXMLentity{InvisibleTines}} -\defineXMLentity [ic] {\getXMLentity{InvisibleComma}} -\defineXMLentity [af] {\getXMLentity{ApplyFunction}} - -\defineXMLentity [PlusMinus] {\getXMLentity{plusminus}} - -\defineXMLentity [infin] {\getXMLentity{infinity}} -\defineXMLentity [infty] {\getXMLentity{infinity}} -\defineXMLentity [part] {\getXMLentity{differentiald}} - -\defineXMLentity [RightArrow] {\normalorfiller\rightarrow\rightarrowfill} -\defineXMLentity [LeftArrow] {\normalorfiller\leftarrow\leftarrowfill} -\defineXMLentity [UnderBrace] {\normalorfiller\empty\upbracefill} -\defineXMLentity [OverBrace] {\normalorfiller\empty\downbracefill} -\defineXMLentity [UnderBar] {\normalorfiller\hrule\hrulefill} -\defineXMLentity [OverBar] {\normalorfiller\hrule\hrulefill} -\defineXMLentity [Hat] {\normalorfiller\empty\empty} % todo - -\defineXMLentity [downarrow] {\mathortext\downarrow\empty} -\defineXMLentity [uparrow] {\mathortext\uparrow\empty} - -\defineXMLentity [Tab] {\hskip4em} -\defineXMLentity [NewLine] {\mathortext\empty\crlf} -\defineXMLentity [IndentingNewLine] {\mathortext\empty\crlf} - -\defineXMLentity [NoBreak] {\nobreak} -\defineXMLentity [GoodBreak] {\goodbreak} -\defineXMLentity [BadBreak] {\nobreak} - -\defineXMLentity [Space] {\getXMLentity{MediumSpace}} -\defineXMLentity [NonBreakingSpace] {\getXMLentity{MediumSpace}} -\defineXMLentity [ZeroWidthSpace] {} - -\def\somespaceentity#1#2% - {\mathortext - {\mskip#1mu} - {\ifvmode\dontleavehmode\else\unskip\fi\hskip#2em\strut\hskip\zeropoint\ignorespaces}% - \relax} - -\defineXMLentity [VeryThinSpace] {\somespaceentity {2}{.125}} -\defineXMLentity [ThinSpace] {\somespaceentity {3}{.25}} -\defineXMLentity [MediumSpace] {\somespaceentity {4}{.5}} -\defineXMLentity [ThickSpace] {\somespaceentity {5}{1}} -\defineXMLentity [NegativeVeryThinSpace] {\somespaceentity{-2}{-.125}} -\defineXMLentity [NegativeThinSpace] {\somespaceentity{-3}{-.25}} -\defineXMLentity [NegativeMediumSpace] {\somespaceentity{-4}{-.5}} -\defineXMLentity [NegativeThickSpace] {\somespaceentity{-5}{-1}} - -\defineXMLentity [NegVeryThinSpace] {\getXMLentity{NegativeVeryThinSpace}} -\defineXMLentity [NegThinSpace] {\getXMLentity{NegativeThinSpace}} -\defineXMLentity [NegMediumSpace] {\getXMLentity{NegativeMediumSpace}} -\defineXMLentity [NegThickSpace] {\getXMLentity{NegativeThickSpace}} - -\defineXMLentity [nbsp] {\getXMLentity{NonBreakingSpace}} -\defineXMLentity [thinsp] {\getXMLentity{ThinSpace}} -\defineXMLentity [medsp] {\getXMLentity{MediumSpace}} -\defineXMLentity [thicksp] {\getXMLentity{ThickSpace}} - -\defineXMLentity [larr] {\getXMLentity{LeftArrow}} -\defineXMLentity [rarr] {\getXMLentity{RightArrow}} - -\defineXMLentity [lbrace] {\normalordelimiter{\{}{\left \{}} -\defineXMLentity [rbrace] {\normalordelimiter{\}}{\right\}}} -\defineXMLentity [lbracket] {\normalordelimiter{[}{\left [}} -\defineXMLentity [rbracket] {\normalordelimiter{]}{\right]}} -\defineXMLentity [lparenthesis] {\normalordelimiter{(}{\left (}} -\defineXMLentity [rparenthesis] {\normalordelimiter{)}{\right)}} -\defineXMLentity [langle] {\normalordelimiter{\langle}{\left \langle}} -\defineXMLentity [rangle] {\normalordelimiter{\rangle}{\right\rangle}} - -\defineXMLentity [lang] {\getXMLentity{langle}} -\defineXMLentity [rang] {\getXMLentity{rangle}} -\defineXMLentity [lbrack] {\getXMLentity{lbracket}} -\defineXMLentity [rbrack] {\getXMLentity{rbracket}} -\defineXMLentity [lparent] {\getXMLentity{lparenthesis}} -\defineXMLentity [rparent] {\getXMLentity{rparenthesis}} - -\defineXMLentity [\letterleftbrace ] {\getXMLentity{lbrace}} -\defineXMLentity [\letterrightbrace] {\getXMLentity{rbrace}} - -\defineXMLentity [{[}] {\getXMLentity{lbracket}} -\defineXMLentity [{]}] {\getXMLentity{rbracket}} -\defineXMLentity [{(}] {\getXMLentity{lparenthesis}} -\defineXMLentity [{)}] {\getXMLentity{rparenthesis}} - -\defineXMLentity [times] {\times} -\defineXMLentity [minus] {-} -\defineXMLentity [plus] {+} -\defineXMLentity [plusmn] {\pm} - -\defineXMLentity [nabla] {\nabla} - -\def\myspecialnormalvert{\mathematics{\vert}} % temp hack, should stretch - -\defineXMLentity [,] {{,}} -\defineXMLentity [.] {{.}} -\defineXMLentity [+] {+} -\defineXMLentity [-] {-} -\defineXMLentity [(] {(} -\defineXMLentity [)] {)} -\defineXMLentity [<] {\mathematics{<}} -\defineXMLentity [>] {\mathematics{>}} -\defineXMLentity [|] {\myspecialnormalvert} -\defineXMLentity [/] {/} -\defineXMLentity [*] {\times} -\defineXMLentity [=] {=} - -\defineXMLentity [++] {++} -\defineXMLentity [--] {--} -\defineXMLentity [//] {//} -\defineXMLentity [**] {\times\times} -\defineXMLentity [==] {==} - -\defineXMLentity [quot] {"} - -\defineXMLentity [triangle] {\mathematics\triangle} -\defineXMLentity [otimes] {\mathematics\otimes} -\defineXMLentity [oplus] {\mathematics\oplus} -\defineXMLentity [cup] {\mathematics\cup} -\defineXMLentity [cap] {\mathematics\cap} -\defineXMLentity [sdot] {\mathematics\cdot} -\defineXMLentity [dot] {\mathematics\cdot} -\defineXMLentity [sim] {\mathematics\sim} -\defineXMLentity [circ] {\mathematics\circ} -\defineXMLentity [dagger] {\mathematics\dagger} -\defineXMLentity [cdots] {\mathematics\cdots} - -\defineXMLentity [...] {\getXMLentity{cdots}} -\defineXMLentity [continued] {\getXMLentity{cdots}} - -\defineXMLentity [sub] {\getXMLentity{subset}} -\defineXMLentity [sube] {\getXMLentity{prsubset}} -\defineXMLentity [notprsubset] {\getXMLentity{notprsubset}} - -\defineXMLentity [ndash] {\endash} -\defineXMLentity [mdash] {\emdash} - -\defineXMLentity [tex-bar] {\mathematics{\vert}} -\defineXMLentity [tex-dollar] {\dollar} -\defineXMLentity [tex-backslash] {\backslash} -\defineXMLentity [tex-leftbrace] {\mathematics{\{}} -\defineXMLentity [tex-rightbrace] {\mathematics{\}}} - -\protect \endinput diff --git a/tex/context/base/xtag-mmp.mkii b/tex/context/base/xtag-mmp.mkii new file mode 100644 index 000000000..75167c9e9 --- /dev/null +++ b/tex/context/base/xtag-mmp.mkii @@ -0,0 +1,553 @@ +%D \module +%D [ file=xtag-mmp, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Presentation MathML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% \points should become \bodyfontsize + +% under reconstruction +% +% \starttext +% \usemodule[mathml] \useXMLfilter[utf] +% \unprotect +% +% \remapXMLsequence [mover] [CPA] \MMLpOVER +% \remapXMLsequence [munder] [CPA] \MMLpUNDER +% +% \def\MMLpUNDER#1#2% +% {\getXMLarguments{munder}{accent="false" #1}% +% \withnexttwoXMLRelements\doMMLpUNDER#2} +% +% \def\MMLpOVER#1#2% +% {\getXMLarguments{mover}{accent="false" #1}% +% \withnexttwoXMLRelements\doMMLpOVER #2} +% +% \def\doMMLpUNDER +% {\doifelse{\XMLpar{munder}{accent}{}}{true} +% {\secondXMLRelement\firstXMLRelement} +% {\mathop{\vtop{\mathsurround\zeropoint\ialign{\hss##\hss\crcr +% \disabledelimiter\doMMLfiller\firstXMLRelement +% \crcr\noalign{\kern3\points\nointerlineskip}% +% \disabledelimiter\doMMLfiller\secondXMLRelement +% \crcr\noalign{\kern3\points}}}}\limits}} +% +% \def\doMMLpOVER +% {\doifelse{\XMLpar{mover}{accent}{}}{true} +% {\secondXMLRelement\firstXMLRelement} +% {\mathop{\vbox{\mathsurround\zeropoint\ialign{\hss##\hss\crcr\noalign{\kern3\points}% +% \disabledelimiter\doMMLfiller\secondXMLRelement +% \crcr\noalign{\kern3\points\nointerlineskip}% +% \disabledelimiter\doMMLfiller\firstXMLRelement +% \crcr}}}\limits}} +% +% \protect +% +% Normal: \startXMLdataa¯\stopXMLdata \par +% Accent: \startXMLdatax¯\stopXMLdata \par +% +% \stoptext + +\writestatus{loading}{ConTeXt XML Macros / Presentational MathML} + +\unprotect + +\def\convertasciiafter#1#2% + {\defconvertedargument\asciiafter{#2}% + \@EA#1\@EA{\asciiafter}} + +\def\checkMMLoperator#1#2% temp hack + {\unspaceargument#1\to\ascii + \doifXMLentityelse\ascii{\getXMLentity\ascii}{#2}} + +\startXMLmapping [mml] + +\remapXMLsequence [mi] [CPA] \MMLpMI +\remapXMLsequence [mn] [CPA] \MMLpMN +\remapXMLsequence [mo] [CPA] \MMLpMO + +\def\MMLpmath#1#2% + {\begingroup + \getXMLarguments{mstyle}{#1}\setMMLpmathstyle{mstyle}#2% + \endgroup} + +\def\MMLpMI#1#2% + {\MMLpmath{#1}{\checkMMLoperator{#2}{#2}}} + +\def\MMLpMN#1#2% + {\begingroup\rm\MMLpmath{#1}{#2}\endgroup} + +\def\MMLpMO#1#2% yes or no + {\checkMMLoperator + {#2} + {\ConvertConstantAfter\doifinstringelse{\xmlrent}{#2} + {#2}{\hbox{\MMLpmath{#1}{\ignorespaces#2\unskip}}}}} % \hbox ? + +\remapXMLsequence [mfenced] [CPA] \MMLpFENCED + +\def\doMMLleft #1{\pushmacro\left \let\left \empty\normalleft #1\popmacro\left} +\def\doMMLright#1{\pushmacro\right\let\right\empty\normalright#1\popmacro\right} + +\let\MMLpopen \empty +\let\MMLpclose\empty + +\def\MMLpFENCED#1#2% + {\getXMLarguments{mfenced}{open="(" close=")" separators="" #1}% + \edef\MMLpopen {\XMLpar{mfenced}{open}{}}% + \edef\MMLpclose{\XMLpar{mfenced}{close}{}}% + \ifx\MMLpopen\empty\else\doMMLleft\MMLpopen\fi + \pushmacro\MMLpopen + \pushmacro\MMLpclose + \doifXMLparelse{mfenced}{separators} + {\resetMMLseparator + \encapsulateXMLR + {}% + {\pushmacro\myspecialnormalvert % hack + \def\myspecialnormalvert{\;\vrule\;}% + \grabMMLseparator{\XMLpar{mfenced}{separators}{}}% + \popmacro\myspecialnormalvert} + {}% + {#2\empty}} + {#2}% + \popmacro\MMLpclose + \popmacro\MMLpopen + \ifx\MMLpclose\empty + \ifx\MMLpopen\empty\else\right.\fi + \else\doMMLright\MMLpclose\fi} + +\def\resetMMLseparator + {\newcounter\MMLxxcounter + \let\lastMMLseparator\empty} + +\def\grabMMLseparator#1% + {\increment\MMLxxcounter + \newcounter\MMLyycounter + \expanded{\dograbMMLseparator#1\noexpand\relax}} + +\def\dograbMMLseparator + {\increment\MMLyycounter + \doifnextcharelse\relax + {\lastMMLseparator\gobbleoneargument} + {\doifnextcharelse\xmlrent\grabMMLseparatora\grabMMLseparatorb}} + +\def\grabMMLseparatora#1\xmlrent#2% + {\ifnum\MMLxxcounter=\MMLyycounter\space + \def\lastMMLseparator{\xmlrent{#2}}% + \fi + \dograbMMLseparator} + +\def\grabMMLseparatorb#1% better use \checkMMLoperator + {\ifnum\MMLxxcounter=\MMLyycounter\space +\doifXMLentityelse{#1} + {\def\lastMMLseparator{\xmlrent{#1}}} + {\def\lastMMLseparator{#1}}% + \fi + \dograbMMLseparator} + +\remapXMLsequence [menclose] [CPA] \MMLpENCLOSE + +\def\MMLpENCLOSE#1#2% + {\getXMLarguments{menclose}{notation="" #1}% + \doifelse{\XMLpar{menclose}{notation}{}}{longdiv} + {\overline{)#2}} + {#2}} + +\remapXMLsequence [mfrac] [CPA] \MMLpFRAC + +\def\MMLpFRAC#1#2% \above is suboptimal since the spacing changes + {\withnexttwoXMLRelements + {\getXMLarguments{mfrac}{linethickness="" #1}% + \doifXMLparelse{mfrac}{linethickness} + {\edef\theXMLpar{\XMLpar{mfrac}{linethickness}{1}}% + \processaction + [\theXMLpar] + [ thin=>\scratchdimen=.2pt, + medium=>\scratchdimen=.4pt, + thick=>\scratchdimen=.8pt, + unknown=>\setdimensionwithunit\scratchdimen{\theXMLpar}{}]% + {{\firstXMLRelement}\above\scratchdimen{\secondXMLRelement}}} + {\frac{\firstXMLRelement}{\secondXMLRelement}}}% + #2} + +\remapXMLsequence [ms] [CPA] \MMLpSTRING + +\def\MMLpSTRING#1#2% + {\MMLpTEXT{#1} + {\getXMLarguments{mstyle}{#1}% + \getXMLarguments{ms}{lquote="\xmlrent{quot}" rquote="\xmlrent{quot}" #1}% + \XMLpar{ms}{lquote}{}\ignorespaces#2\unskip\unskip\XMLpar{ms}{rquote}{}}} + +\remapXMLsequence [mstyle] [CPA] \MMLpSTYLE + +\getXMLarguments + {mstyle} + {fontweight="" fontstyle="" mathstyle="" mathvariant="" background="" color=""} + +\def\MMLpSTYLE#1#2% + {\getXMLarguments{mstyle}{#1}#2} + +\remapXMLsequence [mtext] [CPA] \MMLpTEXT +\remapXMLsequence [merror] [CPA] \MMLpERROR +\remapXMLsequence [mphantom] [CPA] \MMLpPHANTOM +\remapXMLsequence [mpadded] [CPA] \MMLpPADDED + +\def\MMLpTEXT#1#2% + {\hbox + {\tf % else encoding problems + \getXMLarguments{mstyle}{#1}% + \doMMPpbackground{mstyle} + {\doMMPpcolor{mstyle} + {\setMMLptextstyle{mstyle}% + \ignorespaces#2\unskip\unskip}}}} + +\def\setMMLpstyle#1% + {\doifdefined{MMLpstyle:#1}{\getvalue{MMLpstyle:#1}}} + +\def\defineMMLstyle[#1]#2% + {\setvalue{MMLpstyle:#1}{#2}} + +\defineMMLstyle[normal] {\tf} \defineMMLstyle[double-stuck] {\bf} +\defineMMLstyle[bolditalic] {\bi} \defineMMLstyle[bold-italic] {\bi} +\defineMMLstyle[boldslanted]{\bs} \defineMMLstyle[bold-slanted] {\bs} +\defineMMLstyle[boldnormal] {\bf} \defineMMLstyle[bold] {\bf} +\defineMMLstyle[slanted] {\sl} \defineMMLstyle[normalslanted]{\sl} +\defineMMLstyle[italic] {\it} \defineMMLstyle[normalitalic] {\it} +\defineMMLstyle[fraktur] {\bf} \defineMMLstyle[bold-fraktur] {\bf} +\defineMMLstyle[script] {\tf} \defineMMLstyle[bold-script] {\bf} + +% and all kind of other crappy names + +\def\setMMLptextstyle#1% + {\setMMLpstyle{\XMLpar{#1}{fontweight}{}\XMLpar{#1}{fontstyle}{}}} + +\def\setMMLpmathstyle#1% + {\setMMLpstyle{\XMLpar{#1}{mathvariant}{}}} + +\def\doMMPpcolor#1#2% + {\doifXMLparelse{#1}{color}{\color[\XMLpar{#1}{color}{}]{#2}}{#2}} + +\def\doMMPpbackground#1#2% + {\doifXMLparelse{#1}{background} + {\inframed + [\c!frame=\v!off, + \c!background=\v!color, + \c!backgroundcolor=\XMLpar{#1}{background}{}] + {#2}} + {#2}} + +\def\MMLpERROR #1#2{\hbox{$\displaystyle#2$}} +\def\MMLpPHANTOM#1#2{\phantom{\ignorespaces{}#2\unskip}} % watch spacing {} hack +\def\MMLpPADDED #1#2{#2} + +\remapXMLsequence [mrow] [CPA] \MMLpROW + +\def\MMLpROW#1#2{#2} + +\remapXMLsequence [msqrt] [CPA] \MMLpSQRT +\remapXMLsequence [mroot] [CPA] \MMLpROOT + +\def\MMLpSQRT#1#2% + {\sqrt{#2}} + +\def\MMLpROOT#1#2% + {\withnexttwoXMLRelements{\root{\secondXMLRelement}\of{\firstXMLRelement}}#2} + +\remapXMLsequence [msup] [CPA] \MMLpSUP +\remapXMLsequence [msub] [CPA] \MMLpSUB + +\setupMMLappearance[scripts][\c!alternative=\v!a] + +\def\MMLpSUBP#1#2% + {\withnexttwoXMLRelements + {\doifelse\@@MMLscriptsalternative\v!a + {{\firstXMLRelement}#1{\secondXMLRelement}} % both {} essential + {\firstXMLRelement#1{\secondXMLRelement}}}% + #2} + +\def\MMLpSUP#1{\MMLpSUBP ^} +\def\MMLpSUB#1{\MMLpSUBP _} + +\remapXMLsequence [msubsup] [CPA] \MMLpSUBSUP + +\def\MMLpSUBSUP#1#2% + {\withnextthreeXMLRelements + {\firstXMLRelement _{\secondXMLRelement}^{\thirdXMLRelement}}% + #2} + +\remapXMLsequence [mover] [CPA] \MMLpOVER +\remapXMLsequence [munder] [CPA] \MMLpUNDER +\remapXMLsequence [munderover] [CPA] \MMLpUNDEROVER + +% hack, cannot be nested + +\def\MMLpUNDER#1#2{\withnexttwoXMLRelements\doMMLpUNDER#2} +\def\MMLpOVER #1#2{\withnexttwoXMLRelements\doMMLpOVER #2} + +\def\doMMLfiller#1% + {\pushmacro\doMMLfiller + \let\doMMLfiller\gobbleoneargument + \gdef\dodoMMLfiller{\disablefiller\mathematics{#1}}% + \setbox\scratchbox=\hbox + {\def\normalorfiller##1##2% + {\gdef\dodoMMLfiller{\enablefiller#1}% + \let\normalorfiller\gobbletwoarguments}% + $#1$}% + \popmacro\doMMLfiller + \dodoMMLfiller} + +\def\doMMLpUNDER + {\mathop{\vtop{\mathsurround\zeropoint\ialign{\hss##\hss\crcr + \disabledelimiter\doMMLfiller\firstXMLRelement + \crcr\noalign{\kern3\points\nointerlineskip}% + \disabledelimiter\doMMLfiller\secondXMLRelement + \crcr\noalign{\kern3\points}}}}\limits} + +\def\doMMLpOVER + {\mathop{\vbox{\mathsurround\zeropoint\ialign{\hss##\hss\crcr\noalign{\kern3\points}% + \disabledelimiter\doMMLfiller\secondXMLRelement + \crcr\noalign{\kern3\points\nointerlineskip}% + \disabledelimiter\doMMLfiller\firstXMLRelement + \crcr}}}\limits} + +\def\MMLpUNDEROVER#1#2% + {\withnextthreeXMLRelements + {\firstXMLRelement + _{\disablefiller\disabledelimiter\secondXMLRelement}% + ^{\disablefiller\disabledelimiter\thirdXMLRelement}}#2} + +\remapXMLsequence [mtable] [CPA] \MMLpTABLE +\remapXMLsequence [mtr] [CPA] \MMLpTR +\remapXMLsequence [mtd] [CPA] \MMLpTD +\remapXMLsequence [mlabeledtr] [CPA] \MMLpLABELEDTR + +\unexpanded\def\@col@amp@{&} + +\def\MMLpTR#1#2{\collectbetweenXMLR{\@col@amp@}{#2}\the\XMLRtoks\crcr} +\def\MMLpTD#1#2{#2} + +\def\MMLpLABELEDTR{\MMLpTR} + +\def\MMLpTABLEmapper#1#2#3% + {\doifXMLparelse{mtable}{#1} + {\newcounter\MMLcounter + \def\docommand##1% + {\increment\MMLcounter + \let\MMLpREMAP\doMMLpREMAP + \def\MMLsetting{##1}#3% remap list + \expanded{\setupTABLE[column][\MMLcounter][#2=\MMLsetting]}}% + \expanded{\processseparatedlist[\XMLpar{mtable}{#1}{}][ ]\noexpand\docommand}} + {}} + +\def\MMLpTABLEmap#1#2#3% + {\doifXMLparelse{mtbl}{#1} + {\edef\MMLsetting{\XMLpar{mtbl}{#1}{}}#3% remap list + \edef\theMMLpTABLEmap{#2=\MMLsetting,\theMMLpTABLEmap}} + {}} + +\def\doMMLpREMAP#1#2% + {\doif{\MMLsetting}{#1} + {\def\MMLsetting{#2}% + \let\MMLpREMAP\gobbletwoarguments}} + +\let\MMLpREMAP\doMMLpREMAP + +\def\doMMLpTABLE#1#2% + {\begingroup + \getXMLarguments{mtable} + {columnalign="" columnspacing=".25ex" rowspacing=".25ex" + frame="" color="" background="" #1}% + \setupTABLE[\c!frame=\v!off]% + \MMLpTABLEmapper{background}{\c!backgroundcolor}{}% + \MMLpTABLEmapper{color}{\c!color}{}% + \MMLpTABLEmapper{frame}{\c!frame} + {\MMLpREMAP{none}{off}\MMLpREMAP{solid}{on}}% + \MMLpTABLEmapper{columnalign}{\c!align} + {\MMLpREMAP{left}{right}% + \MMLpREMAP{right}{left}% + \MMLpREMAP{center}{middle}}% + \setMMLpunit{\XMLpar{mtable}{rowspacing}{}}{.25ex}% + \let\MMLpTABLEoffset\MMLpunit + \let\MMLpTR\doMMLpTR + \let\MMLpTD\doMMLpTD + \bTABLE[\c!background=\v!color,\c!offset=\MMLpTABLEoffset]#2\eTABLE + \endgroup} + +\def\doMMLpTR#1#2% + {\doifXMLRchildelse{mtd}{#2} + {\bTR\ignorespaces#2\unskip\eTR} + {\bTR\doMMLpTD{#1}{#2}\eTR}} + +\def\doMMLpTD#1#2% + {\getXMLarguments{mtbl} + {columnalign="" columnspacing="" rowspacing="" + frame="" color="" background="" #1}% + \let\theMMLpTABLEmap\empty + \MMLpTABLEmap{background}{\c!backgroundcolor}{}% + \MMLpTABLEmap{color}{\c!color}{}% + \MMLpTABLEmap{frame}{\c!frame} + {\MMLpREMAP{none}{off}\MMLpREMAP{solid}{on}}% + \MMLpTABLEmap{columnalign}{\c!align} + {\MMLpREMAP{left}{right}\MMLpREMAP{right}{left}}% + \@EA\bTD\@EA[\theMMLpTABLEmap]$\ignorespaces#2\unskip$\eTD} + +\setupMMLappearance[mtable][\c!alternative=\v!a] + +\def\MMLpTABLE + {\doifelse\@@MMLmtablealternative\v!a + {\expandafter\MMLpTABLEa} + {\expandafter\MMLpTABLEb}} + +\def\MMLpTABLEa#1#2% + {\begingroup + \doifelsenothing{#1} + {\global\setfalse\mmlTABLEargs} + {\global\settrue\mmlTABLEargs}% + \ifconditional\mmlTABLEargs \else + \setbox\scratchbox=\hbox + {$\displaystyle + \def\MMLpTABLE##1##2% + {\ifconditional\mmlTABLEargs \else + \doifelsenothing{##1}{##2}{\global\settrue\mmlTABLEargs}% + \fi}% + \let\MMLpTR\MMLpTABLE + \let\MMLpTD\MMLpTABLE + #2$}% + \fi + \ifconditional\mmlTABLEargs + \let\MMLpTABLE\doMMLpTABLE + \def\next{\MMLpTABLE{#1}}% + \else + \let\next\matrix + \fi + \next{#2}% + \endgroup} + +\let\MMLpTABLEb\doMMLpTABLE + +\remapXMLsingular [mspace] [CPA] \MMLpSPACE + +\def\setMMLpunit#1#2% + {\setbox\scratchbox=\hbox + {\edef\ascii{#1}% + \@EA\aftersplitstring\ascii\at.\to\ascii + \scratchcounter=\ifx\ascii\empty#1\else\ascii\fi + \unskip\unskip}% + \ifdim\wd\scratchbox=\zeropoint + \edef\MMLpunit{#1em}% + \else + \edefconvertedargument\ascii{#1}% + \convertasciiafter\doifinstringelse{em}{\ascii}{\edef\MMLpunit{#1}}{% + \convertasciiafter\doifinstringelse{ex}{\ascii}{\edef\MMLpunit{#1}}{% + \convertasciiafter\doifinstringelse{pt}{\ascii}{\edef\MMLpunit{#1}}{% + \edef\MMLpunit{#2}}}}% + \fi} + +\def\MMLpSPACE#1#2% + {\getXMLarguments{mspace}{width=".5em" #1}% + \setMMLpunit{\XMLpar{mspace}{width}{}}{.5em}% + \hskip\MMLpunit\relax} + + +\remapXMLsingular [mglyph] [CPA] \MMLpGLYPH + +\def\MMLpGLYPH#1#2% we assume \definefont usage + {\getXMLarguments{mglyph}{fontfamily="" index="1" alt="" #1}% + \def\MMLpglyph{\XMLpar{mglyph}{fontfamily}{}}% + \doifelsenothing{\MMLpglyph} + {\hbox{\tttf[fontfamily unspecified]}} + {\doifdefinedelse{\MMLpglyph} + {\hbox{\getvalue{\MMLpglyph}\char0\XMLpar{mglyph}{index}{1}}} + {\doifelsenothing{\XMLpar{mglyph}{alt}{}} + {\hbox{\tttf[unknown fontfamily \XMLpar{mglyph}{fontfamily}{}]}} + {\hbox{\tttf\XMLpar{mglyph}{alt}{}}}}}} + +\remapXMLsingular [malignmark] [CPA] \MMLpALIGNMARK + +\def\MMLpALIGNMARK#1#2% + {} + +\remapXMLsingular [none] [CPA] \MMLpNONE +\remapXMLsingular [mprescripts] [CPA] \MMLpMPRESCRIPTS +\remapXMLsequence [mmultiscripts] [CPA] \MMLpMULTISCRIPTS + +\def\MMLpNONE #1#2{} +\def\MMLpMPRESCRIPTS#1#2{} + +\def\MMLpMULTISCRIPTS#1#2% + {\pushmacro\xmlr + \let\xmlr\pMULTISCRIPTmmlPRE + \donefalse \scratchcounter=0 #2\empty + \let\xmlr\pMULTISCRIPTmmlPOST + \donetrue \scratchcounter=0 #2\empty + \popmacro\xmlr} + +\def\pMULTISCRIPTmmlPRE#1#2#3#4% + {\ifdone + \ifodd\scratchcounter + _{\naturalxmlr{#1}{#2}{#3}{#4}}% + \else + ^{\naturalxmlr{#1}{#2}{#3}{#4}}{}% + \fi + \else + \doif{mprescripts/}{#1}{\donetrue{}}% weak, the / here + \fi + \ifdone \advance\scratchcounter \plusone \fi} + +\let\pMULTISCRIPTmmlPOST\pMULTISCRIPTmmlPRE + +\stopXMLmapping + +\protect \endinput + +% extra samples + +\startXMLdata + + + + + + + Q + + + P + + + + + R + + + + +\stopXMLdata + +\startXMLdata + + + + + + + R + + + P + + + + + R + + + + +\stopXMLdata diff --git a/tex/context/base/xtag-mmp.tex b/tex/context/base/xtag-mmp.tex deleted file mode 100644 index 75167c9e9..000000000 --- a/tex/context/base/xtag-mmp.tex +++ /dev/null @@ -1,553 +0,0 @@ -%D \module -%D [ file=xtag-mmp, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Presentation MathML, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% \points should become \bodyfontsize - -% under reconstruction -% -% \starttext -% \usemodule[mathml] \useXMLfilter[utf] -% \unprotect -% -% \remapXMLsequence [mover] [CPA] \MMLpOVER -% \remapXMLsequence [munder] [CPA] \MMLpUNDER -% -% \def\MMLpUNDER#1#2% -% {\getXMLarguments{munder}{accent="false" #1}% -% \withnexttwoXMLRelements\doMMLpUNDER#2} -% -% \def\MMLpOVER#1#2% -% {\getXMLarguments{mover}{accent="false" #1}% -% \withnexttwoXMLRelements\doMMLpOVER #2} -% -% \def\doMMLpUNDER -% {\doifelse{\XMLpar{munder}{accent}{}}{true} -% {\secondXMLRelement\firstXMLRelement} -% {\mathop{\vtop{\mathsurround\zeropoint\ialign{\hss##\hss\crcr -% \disabledelimiter\doMMLfiller\firstXMLRelement -% \crcr\noalign{\kern3\points\nointerlineskip}% -% \disabledelimiter\doMMLfiller\secondXMLRelement -% \crcr\noalign{\kern3\points}}}}\limits}} -% -% \def\doMMLpOVER -% {\doifelse{\XMLpar{mover}{accent}{}}{true} -% {\secondXMLRelement\firstXMLRelement} -% {\mathop{\vbox{\mathsurround\zeropoint\ialign{\hss##\hss\crcr\noalign{\kern3\points}% -% \disabledelimiter\doMMLfiller\secondXMLRelement -% \crcr\noalign{\kern3\points\nointerlineskip}% -% \disabledelimiter\doMMLfiller\firstXMLRelement -% \crcr}}}\limits}} -% -% \protect -% -% Normal: \startXMLdataa¯\stopXMLdata \par -% Accent: \startXMLdatax¯\stopXMLdata \par -% -% \stoptext - -\writestatus{loading}{ConTeXt XML Macros / Presentational MathML} - -\unprotect - -\def\convertasciiafter#1#2% - {\defconvertedargument\asciiafter{#2}% - \@EA#1\@EA{\asciiafter}} - -\def\checkMMLoperator#1#2% temp hack - {\unspaceargument#1\to\ascii - \doifXMLentityelse\ascii{\getXMLentity\ascii}{#2}} - -\startXMLmapping [mml] - -\remapXMLsequence [mi] [CPA] \MMLpMI -\remapXMLsequence [mn] [CPA] \MMLpMN -\remapXMLsequence [mo] [CPA] \MMLpMO - -\def\MMLpmath#1#2% - {\begingroup - \getXMLarguments{mstyle}{#1}\setMMLpmathstyle{mstyle}#2% - \endgroup} - -\def\MMLpMI#1#2% - {\MMLpmath{#1}{\checkMMLoperator{#2}{#2}}} - -\def\MMLpMN#1#2% - {\begingroup\rm\MMLpmath{#1}{#2}\endgroup} - -\def\MMLpMO#1#2% yes or no - {\checkMMLoperator - {#2} - {\ConvertConstantAfter\doifinstringelse{\xmlrent}{#2} - {#2}{\hbox{\MMLpmath{#1}{\ignorespaces#2\unskip}}}}} % \hbox ? - -\remapXMLsequence [mfenced] [CPA] \MMLpFENCED - -\def\doMMLleft #1{\pushmacro\left \let\left \empty\normalleft #1\popmacro\left} -\def\doMMLright#1{\pushmacro\right\let\right\empty\normalright#1\popmacro\right} - -\let\MMLpopen \empty -\let\MMLpclose\empty - -\def\MMLpFENCED#1#2% - {\getXMLarguments{mfenced}{open="(" close=")" separators="" #1}% - \edef\MMLpopen {\XMLpar{mfenced}{open}{}}% - \edef\MMLpclose{\XMLpar{mfenced}{close}{}}% - \ifx\MMLpopen\empty\else\doMMLleft\MMLpopen\fi - \pushmacro\MMLpopen - \pushmacro\MMLpclose - \doifXMLparelse{mfenced}{separators} - {\resetMMLseparator - \encapsulateXMLR - {}% - {\pushmacro\myspecialnormalvert % hack - \def\myspecialnormalvert{\;\vrule\;}% - \grabMMLseparator{\XMLpar{mfenced}{separators}{}}% - \popmacro\myspecialnormalvert} - {}% - {#2\empty}} - {#2}% - \popmacro\MMLpclose - \popmacro\MMLpopen - \ifx\MMLpclose\empty - \ifx\MMLpopen\empty\else\right.\fi - \else\doMMLright\MMLpclose\fi} - -\def\resetMMLseparator - {\newcounter\MMLxxcounter - \let\lastMMLseparator\empty} - -\def\grabMMLseparator#1% - {\increment\MMLxxcounter - \newcounter\MMLyycounter - \expanded{\dograbMMLseparator#1\noexpand\relax}} - -\def\dograbMMLseparator - {\increment\MMLyycounter - \doifnextcharelse\relax - {\lastMMLseparator\gobbleoneargument} - {\doifnextcharelse\xmlrent\grabMMLseparatora\grabMMLseparatorb}} - -\def\grabMMLseparatora#1\xmlrent#2% - {\ifnum\MMLxxcounter=\MMLyycounter\space - \def\lastMMLseparator{\xmlrent{#2}}% - \fi - \dograbMMLseparator} - -\def\grabMMLseparatorb#1% better use \checkMMLoperator - {\ifnum\MMLxxcounter=\MMLyycounter\space -\doifXMLentityelse{#1} - {\def\lastMMLseparator{\xmlrent{#1}}} - {\def\lastMMLseparator{#1}}% - \fi - \dograbMMLseparator} - -\remapXMLsequence [menclose] [CPA] \MMLpENCLOSE - -\def\MMLpENCLOSE#1#2% - {\getXMLarguments{menclose}{notation="" #1}% - \doifelse{\XMLpar{menclose}{notation}{}}{longdiv} - {\overline{)#2}} - {#2}} - -\remapXMLsequence [mfrac] [CPA] \MMLpFRAC - -\def\MMLpFRAC#1#2% \above is suboptimal since the spacing changes - {\withnexttwoXMLRelements - {\getXMLarguments{mfrac}{linethickness="" #1}% - \doifXMLparelse{mfrac}{linethickness} - {\edef\theXMLpar{\XMLpar{mfrac}{linethickness}{1}}% - \processaction - [\theXMLpar] - [ thin=>\scratchdimen=.2pt, - medium=>\scratchdimen=.4pt, - thick=>\scratchdimen=.8pt, - unknown=>\setdimensionwithunit\scratchdimen{\theXMLpar}{}]% - {{\firstXMLRelement}\above\scratchdimen{\secondXMLRelement}}} - {\frac{\firstXMLRelement}{\secondXMLRelement}}}% - #2} - -\remapXMLsequence [ms] [CPA] \MMLpSTRING - -\def\MMLpSTRING#1#2% - {\MMLpTEXT{#1} - {\getXMLarguments{mstyle}{#1}% - \getXMLarguments{ms}{lquote="\xmlrent{quot}" rquote="\xmlrent{quot}" #1}% - \XMLpar{ms}{lquote}{}\ignorespaces#2\unskip\unskip\XMLpar{ms}{rquote}{}}} - -\remapXMLsequence [mstyle] [CPA] \MMLpSTYLE - -\getXMLarguments - {mstyle} - {fontweight="" fontstyle="" mathstyle="" mathvariant="" background="" color=""} - -\def\MMLpSTYLE#1#2% - {\getXMLarguments{mstyle}{#1}#2} - -\remapXMLsequence [mtext] [CPA] \MMLpTEXT -\remapXMLsequence [merror] [CPA] \MMLpERROR -\remapXMLsequence [mphantom] [CPA] \MMLpPHANTOM -\remapXMLsequence [mpadded] [CPA] \MMLpPADDED - -\def\MMLpTEXT#1#2% - {\hbox - {\tf % else encoding problems - \getXMLarguments{mstyle}{#1}% - \doMMPpbackground{mstyle} - {\doMMPpcolor{mstyle} - {\setMMLptextstyle{mstyle}% - \ignorespaces#2\unskip\unskip}}}} - -\def\setMMLpstyle#1% - {\doifdefined{MMLpstyle:#1}{\getvalue{MMLpstyle:#1}}} - -\def\defineMMLstyle[#1]#2% - {\setvalue{MMLpstyle:#1}{#2}} - -\defineMMLstyle[normal] {\tf} \defineMMLstyle[double-stuck] {\bf} -\defineMMLstyle[bolditalic] {\bi} \defineMMLstyle[bold-italic] {\bi} -\defineMMLstyle[boldslanted]{\bs} \defineMMLstyle[bold-slanted] {\bs} -\defineMMLstyle[boldnormal] {\bf} \defineMMLstyle[bold] {\bf} -\defineMMLstyle[slanted] {\sl} \defineMMLstyle[normalslanted]{\sl} -\defineMMLstyle[italic] {\it} \defineMMLstyle[normalitalic] {\it} -\defineMMLstyle[fraktur] {\bf} \defineMMLstyle[bold-fraktur] {\bf} -\defineMMLstyle[script] {\tf} \defineMMLstyle[bold-script] {\bf} - -% and all kind of other crappy names - -\def\setMMLptextstyle#1% - {\setMMLpstyle{\XMLpar{#1}{fontweight}{}\XMLpar{#1}{fontstyle}{}}} - -\def\setMMLpmathstyle#1% - {\setMMLpstyle{\XMLpar{#1}{mathvariant}{}}} - -\def\doMMPpcolor#1#2% - {\doifXMLparelse{#1}{color}{\color[\XMLpar{#1}{color}{}]{#2}}{#2}} - -\def\doMMPpbackground#1#2% - {\doifXMLparelse{#1}{background} - {\inframed - [\c!frame=\v!off, - \c!background=\v!color, - \c!backgroundcolor=\XMLpar{#1}{background}{}] - {#2}} - {#2}} - -\def\MMLpERROR #1#2{\hbox{$\displaystyle#2$}} -\def\MMLpPHANTOM#1#2{\phantom{\ignorespaces{}#2\unskip}} % watch spacing {} hack -\def\MMLpPADDED #1#2{#2} - -\remapXMLsequence [mrow] [CPA] \MMLpROW - -\def\MMLpROW#1#2{#2} - -\remapXMLsequence [msqrt] [CPA] \MMLpSQRT -\remapXMLsequence [mroot] [CPA] \MMLpROOT - -\def\MMLpSQRT#1#2% - {\sqrt{#2}} - -\def\MMLpROOT#1#2% - {\withnexttwoXMLRelements{\root{\secondXMLRelement}\of{\firstXMLRelement}}#2} - -\remapXMLsequence [msup] [CPA] \MMLpSUP -\remapXMLsequence [msub] [CPA] \MMLpSUB - -\setupMMLappearance[scripts][\c!alternative=\v!a] - -\def\MMLpSUBP#1#2% - {\withnexttwoXMLRelements - {\doifelse\@@MMLscriptsalternative\v!a - {{\firstXMLRelement}#1{\secondXMLRelement}} % both {} essential - {\firstXMLRelement#1{\secondXMLRelement}}}% - #2} - -\def\MMLpSUP#1{\MMLpSUBP ^} -\def\MMLpSUB#1{\MMLpSUBP _} - -\remapXMLsequence [msubsup] [CPA] \MMLpSUBSUP - -\def\MMLpSUBSUP#1#2% - {\withnextthreeXMLRelements - {\firstXMLRelement _{\secondXMLRelement}^{\thirdXMLRelement}}% - #2} - -\remapXMLsequence [mover] [CPA] \MMLpOVER -\remapXMLsequence [munder] [CPA] \MMLpUNDER -\remapXMLsequence [munderover] [CPA] \MMLpUNDEROVER - -% hack, cannot be nested - -\def\MMLpUNDER#1#2{\withnexttwoXMLRelements\doMMLpUNDER#2} -\def\MMLpOVER #1#2{\withnexttwoXMLRelements\doMMLpOVER #2} - -\def\doMMLfiller#1% - {\pushmacro\doMMLfiller - \let\doMMLfiller\gobbleoneargument - \gdef\dodoMMLfiller{\disablefiller\mathematics{#1}}% - \setbox\scratchbox=\hbox - {\def\normalorfiller##1##2% - {\gdef\dodoMMLfiller{\enablefiller#1}% - \let\normalorfiller\gobbletwoarguments}% - $#1$}% - \popmacro\doMMLfiller - \dodoMMLfiller} - -\def\doMMLpUNDER - {\mathop{\vtop{\mathsurround\zeropoint\ialign{\hss##\hss\crcr - \disabledelimiter\doMMLfiller\firstXMLRelement - \crcr\noalign{\kern3\points\nointerlineskip}% - \disabledelimiter\doMMLfiller\secondXMLRelement - \crcr\noalign{\kern3\points}}}}\limits} - -\def\doMMLpOVER - {\mathop{\vbox{\mathsurround\zeropoint\ialign{\hss##\hss\crcr\noalign{\kern3\points}% - \disabledelimiter\doMMLfiller\secondXMLRelement - \crcr\noalign{\kern3\points\nointerlineskip}% - \disabledelimiter\doMMLfiller\firstXMLRelement - \crcr}}}\limits} - -\def\MMLpUNDEROVER#1#2% - {\withnextthreeXMLRelements - {\firstXMLRelement - _{\disablefiller\disabledelimiter\secondXMLRelement}% - ^{\disablefiller\disabledelimiter\thirdXMLRelement}}#2} - -\remapXMLsequence [mtable] [CPA] \MMLpTABLE -\remapXMLsequence [mtr] [CPA] \MMLpTR -\remapXMLsequence [mtd] [CPA] \MMLpTD -\remapXMLsequence [mlabeledtr] [CPA] \MMLpLABELEDTR - -\unexpanded\def\@col@amp@{&} - -\def\MMLpTR#1#2{\collectbetweenXMLR{\@col@amp@}{#2}\the\XMLRtoks\crcr} -\def\MMLpTD#1#2{#2} - -\def\MMLpLABELEDTR{\MMLpTR} - -\def\MMLpTABLEmapper#1#2#3% - {\doifXMLparelse{mtable}{#1} - {\newcounter\MMLcounter - \def\docommand##1% - {\increment\MMLcounter - \let\MMLpREMAP\doMMLpREMAP - \def\MMLsetting{##1}#3% remap list - \expanded{\setupTABLE[column][\MMLcounter][#2=\MMLsetting]}}% - \expanded{\processseparatedlist[\XMLpar{mtable}{#1}{}][ ]\noexpand\docommand}} - {}} - -\def\MMLpTABLEmap#1#2#3% - {\doifXMLparelse{mtbl}{#1} - {\edef\MMLsetting{\XMLpar{mtbl}{#1}{}}#3% remap list - \edef\theMMLpTABLEmap{#2=\MMLsetting,\theMMLpTABLEmap}} - {}} - -\def\doMMLpREMAP#1#2% - {\doif{\MMLsetting}{#1} - {\def\MMLsetting{#2}% - \let\MMLpREMAP\gobbletwoarguments}} - -\let\MMLpREMAP\doMMLpREMAP - -\def\doMMLpTABLE#1#2% - {\begingroup - \getXMLarguments{mtable} - {columnalign="" columnspacing=".25ex" rowspacing=".25ex" - frame="" color="" background="" #1}% - \setupTABLE[\c!frame=\v!off]% - \MMLpTABLEmapper{background}{\c!backgroundcolor}{}% - \MMLpTABLEmapper{color}{\c!color}{}% - \MMLpTABLEmapper{frame}{\c!frame} - {\MMLpREMAP{none}{off}\MMLpREMAP{solid}{on}}% - \MMLpTABLEmapper{columnalign}{\c!align} - {\MMLpREMAP{left}{right}% - \MMLpREMAP{right}{left}% - \MMLpREMAP{center}{middle}}% - \setMMLpunit{\XMLpar{mtable}{rowspacing}{}}{.25ex}% - \let\MMLpTABLEoffset\MMLpunit - \let\MMLpTR\doMMLpTR - \let\MMLpTD\doMMLpTD - \bTABLE[\c!background=\v!color,\c!offset=\MMLpTABLEoffset]#2\eTABLE - \endgroup} - -\def\doMMLpTR#1#2% - {\doifXMLRchildelse{mtd}{#2} - {\bTR\ignorespaces#2\unskip\eTR} - {\bTR\doMMLpTD{#1}{#2}\eTR}} - -\def\doMMLpTD#1#2% - {\getXMLarguments{mtbl} - {columnalign="" columnspacing="" rowspacing="" - frame="" color="" background="" #1}% - \let\theMMLpTABLEmap\empty - \MMLpTABLEmap{background}{\c!backgroundcolor}{}% - \MMLpTABLEmap{color}{\c!color}{}% - \MMLpTABLEmap{frame}{\c!frame} - {\MMLpREMAP{none}{off}\MMLpREMAP{solid}{on}}% - \MMLpTABLEmap{columnalign}{\c!align} - {\MMLpREMAP{left}{right}\MMLpREMAP{right}{left}}% - \@EA\bTD\@EA[\theMMLpTABLEmap]$\ignorespaces#2\unskip$\eTD} - -\setupMMLappearance[mtable][\c!alternative=\v!a] - -\def\MMLpTABLE - {\doifelse\@@MMLmtablealternative\v!a - {\expandafter\MMLpTABLEa} - {\expandafter\MMLpTABLEb}} - -\def\MMLpTABLEa#1#2% - {\begingroup - \doifelsenothing{#1} - {\global\setfalse\mmlTABLEargs} - {\global\settrue\mmlTABLEargs}% - \ifconditional\mmlTABLEargs \else - \setbox\scratchbox=\hbox - {$\displaystyle - \def\MMLpTABLE##1##2% - {\ifconditional\mmlTABLEargs \else - \doifelsenothing{##1}{##2}{\global\settrue\mmlTABLEargs}% - \fi}% - \let\MMLpTR\MMLpTABLE - \let\MMLpTD\MMLpTABLE - #2$}% - \fi - \ifconditional\mmlTABLEargs - \let\MMLpTABLE\doMMLpTABLE - \def\next{\MMLpTABLE{#1}}% - \else - \let\next\matrix - \fi - \next{#2}% - \endgroup} - -\let\MMLpTABLEb\doMMLpTABLE - -\remapXMLsingular [mspace] [CPA] \MMLpSPACE - -\def\setMMLpunit#1#2% - {\setbox\scratchbox=\hbox - {\edef\ascii{#1}% - \@EA\aftersplitstring\ascii\at.\to\ascii - \scratchcounter=\ifx\ascii\empty#1\else\ascii\fi - \unskip\unskip}% - \ifdim\wd\scratchbox=\zeropoint - \edef\MMLpunit{#1em}% - \else - \edefconvertedargument\ascii{#1}% - \convertasciiafter\doifinstringelse{em}{\ascii}{\edef\MMLpunit{#1}}{% - \convertasciiafter\doifinstringelse{ex}{\ascii}{\edef\MMLpunit{#1}}{% - \convertasciiafter\doifinstringelse{pt}{\ascii}{\edef\MMLpunit{#1}}{% - \edef\MMLpunit{#2}}}}% - \fi} - -\def\MMLpSPACE#1#2% - {\getXMLarguments{mspace}{width=".5em" #1}% - \setMMLpunit{\XMLpar{mspace}{width}{}}{.5em}% - \hskip\MMLpunit\relax} - - -\remapXMLsingular [mglyph] [CPA] \MMLpGLYPH - -\def\MMLpGLYPH#1#2% we assume \definefont usage - {\getXMLarguments{mglyph}{fontfamily="" index="1" alt="" #1}% - \def\MMLpglyph{\XMLpar{mglyph}{fontfamily}{}}% - \doifelsenothing{\MMLpglyph} - {\hbox{\tttf[fontfamily unspecified]}} - {\doifdefinedelse{\MMLpglyph} - {\hbox{\getvalue{\MMLpglyph}\char0\XMLpar{mglyph}{index}{1}}} - {\doifelsenothing{\XMLpar{mglyph}{alt}{}} - {\hbox{\tttf[unknown fontfamily \XMLpar{mglyph}{fontfamily}{}]}} - {\hbox{\tttf\XMLpar{mglyph}{alt}{}}}}}} - -\remapXMLsingular [malignmark] [CPA] \MMLpALIGNMARK - -\def\MMLpALIGNMARK#1#2% - {} - -\remapXMLsingular [none] [CPA] \MMLpNONE -\remapXMLsingular [mprescripts] [CPA] \MMLpMPRESCRIPTS -\remapXMLsequence [mmultiscripts] [CPA] \MMLpMULTISCRIPTS - -\def\MMLpNONE #1#2{} -\def\MMLpMPRESCRIPTS#1#2{} - -\def\MMLpMULTISCRIPTS#1#2% - {\pushmacro\xmlr - \let\xmlr\pMULTISCRIPTmmlPRE - \donefalse \scratchcounter=0 #2\empty - \let\xmlr\pMULTISCRIPTmmlPOST - \donetrue \scratchcounter=0 #2\empty - \popmacro\xmlr} - -\def\pMULTISCRIPTmmlPRE#1#2#3#4% - {\ifdone - \ifodd\scratchcounter - _{\naturalxmlr{#1}{#2}{#3}{#4}}% - \else - ^{\naturalxmlr{#1}{#2}{#3}{#4}}{}% - \fi - \else - \doif{mprescripts/}{#1}{\donetrue{}}% weak, the / here - \fi - \ifdone \advance\scratchcounter \plusone \fi} - -\let\pMULTISCRIPTmmlPOST\pMULTISCRIPTmmlPRE - -\stopXMLmapping - -\protect \endinput - -% extra samples - -\startXMLdata - - - - - - - Q - - - P - - - - - R - - - - -\stopXMLdata - -\startXMLdata - - - - - - - R - - - P - - - - - R - - - - -\stopXMLdata diff --git a/tex/context/base/xtag-mxa.mkii b/tex/context/base/xtag-mxa.mkii new file mode 100644 index 000000000..5e83367df --- /dev/null +++ b/tex/context/base/xtag-mxa.mkii @@ -0,0 +1,101 @@ +\defineMMLsynonym bkarow rbarr +\defineMMLsynonym circlearrowleft olarr +\defineMMLsynonym circlearrowright orarr +\defineMMLsynonym curvearrowleft cularr +\defineMMLsynonym curvearrowright curarr +\defineMMLsynonym dbkarow rBarr +\defineMMLsynonym DoubleDownArrow dArr +\defineMMLsynonym DoubleLeftRightArrow hArr +\defineMMLsynonym DoubleLongLeftArrow xlArr +\defineMMLsynonym DoubleLongLeftRightArrow xhArr +\defineMMLsynonym DoubleLongRightArrow xrArr +\defineMMLsynonym DoubleUpArrow uArr +\defineMMLsynonym DoubleUpDownArrow vArr +\defineMMLsynonym Downarrow dArr +\defineMMLsynonym DownArrowUpArrow duarr +\defineMMLsynonym downdownarrows ddarr +\defineMMLsynonym downharpoonleft dharl +\defineMMLsynonym downharpoonright dharr +\defineMMLsynonym DownLeftVector lhard +\defineMMLsynonym DownRightVector rhard +\defineMMLsynonym drbkarow RBarr +\defineMMLsynonym Equilibrium rlhar +\defineMMLsynonym hksearow searhk +\defineMMLsynonym hkswarow swarhk +\defineMMLsynonym hookleftarrow larrhk +\defineMMLsynonym hookrightarrow rarrhk +\defineMMLsynonym LeftArrowRightArrow lrarr +\defineMMLsynonym leftarrowtail larrtl +\defineMMLsynonym LeftDownVector dharl +\defineMMLsynonym leftharpoondown lhard +\defineMMLsynonym leftharpoonup lharu +\defineMMLsynonym leftleftarrows llarr +\defineMMLsynonym LeftRightArrow harr +\defineMMLsynonym Leftrightarrow hArr +\defineMMLsynonym leftrightarrow harr +\defineMMLsynonym leftrightarrows lrarr +\defineMMLsynonym leftrightharpoons lrhar +\defineMMLsynonym leftrightsquigarrow harrw +\defineMMLsynonym LeftUpVector uharl +\defineMMLsynonym LeftVector lharu +\defineMMLsynonym Lleftarrow lAarr +\defineMMLsynonym LongLeftArrow xlarr +\defineMMLsynonym Longleftarrow xlArr +\defineMMLsynonym longleftarrow xlarr +\defineMMLsynonym LongLeftRightArrow xharr +\defineMMLsynonym Longleftrightarrow xhArr +\defineMMLsynonym longleftrightarrow xharr +\defineMMLsynonym longmapsto xmap +\defineMMLsynonym LongRightArrow xrarr +\defineMMLsynonym Longrightarrow xrArr +\defineMMLsynonym longrightarrow xrarr +\defineMMLsynonym looparrowleft larrlp +\defineMMLsynonym looparrowright rarrlp +\defineMMLsynonym LowerLeftArrow swarr +\defineMMLsynonym LowerRightArrow searr +\defineMMLsynonym Lsh lsh +\defineMMLsynonym mapsto map +\defineMMLsynonym multimap mumap +\defineMMLsynonym nearrow nearr +\defineMMLsynonym nLeftarrow nlArr +\defineMMLsynonym nleftarrow nlarr +\defineMMLsynonym nLeftrightarrow nhArr +\defineMMLsynonym nleftrightarrow nharr +\defineMMLsynonym nRightarrow nrArr +\defineMMLsynonym nrightarrow nrarr +\defineMMLsynonym nwarrow nwarr +\defineMMLsynonym ReverseEquilibrium lrhar +\defineMMLsynonym ReverseUpEquilibrium duhar +\defineMMLsynonym RightArrowLeftArrow rlarr +\defineMMLsynonym rightarrowtail rarrtl +\defineMMLsynonym RightDownVector dharr +\defineMMLsynonym rightharpoondown rhard +\defineMMLsynonym rightharpoonup rharu +\defineMMLsynonym rightleftarrows rlarr +\defineMMLsynonym rightleftharpoons rlhar +\defineMMLsynonym rightrightarrows rrarr +\defineMMLsynonym rightsquigarrow rarrw +\defineMMLsynonym RightTeeArrow map +\defineMMLsynonym RightUpVector uharr +\defineMMLsynonym RightVector rharu +\defineMMLsynonym Rrightarrow rAarr +\defineMMLsynonym Rsh rsh +\defineMMLsynonym searrow searr +\defineMMLsynonym ShortLeftArrow slarr +\defineMMLsynonym ShortRightArrow srarr +\defineMMLsynonym swarrow swarr +\defineMMLsynonym toea nesear +\defineMMLsynonym tosa seswar +\defineMMLsynonym twoheadleftarrow Larr +\defineMMLsynonym twoheadrightarrow Rarr +\defineMMLsynonym Uparrow uArr +\defineMMLsynonym UpArrowDownArrow udarr +\defineMMLsynonym UpDownArrow varr +\defineMMLsynonym Updownarrow vArr +\defineMMLsynonym updownarrow varr +\defineMMLsynonym UpEquilibrium udhar +\defineMMLsynonym upharpoonleft uharl +\defineMMLsynonym upharpoonright uharr +\defineMMLsynonym UpperLeftArrow nwarr +\defineMMLsynonym UpperRightArrow nearr +\defineMMLsynonym upuparrows uuarr diff --git a/tex/context/base/xtag-mxa.tex b/tex/context/base/xtag-mxa.tex deleted file mode 100644 index 5e83367df..000000000 --- a/tex/context/base/xtag-mxa.tex +++ /dev/null @@ -1,101 +0,0 @@ -\defineMMLsynonym bkarow rbarr -\defineMMLsynonym circlearrowleft olarr -\defineMMLsynonym circlearrowright orarr -\defineMMLsynonym curvearrowleft cularr -\defineMMLsynonym curvearrowright curarr -\defineMMLsynonym dbkarow rBarr -\defineMMLsynonym DoubleDownArrow dArr -\defineMMLsynonym DoubleLeftRightArrow hArr -\defineMMLsynonym DoubleLongLeftArrow xlArr -\defineMMLsynonym DoubleLongLeftRightArrow xhArr -\defineMMLsynonym DoubleLongRightArrow xrArr -\defineMMLsynonym DoubleUpArrow uArr -\defineMMLsynonym DoubleUpDownArrow vArr -\defineMMLsynonym Downarrow dArr -\defineMMLsynonym DownArrowUpArrow duarr -\defineMMLsynonym downdownarrows ddarr -\defineMMLsynonym downharpoonleft dharl -\defineMMLsynonym downharpoonright dharr -\defineMMLsynonym DownLeftVector lhard -\defineMMLsynonym DownRightVector rhard -\defineMMLsynonym drbkarow RBarr -\defineMMLsynonym Equilibrium rlhar -\defineMMLsynonym hksearow searhk -\defineMMLsynonym hkswarow swarhk -\defineMMLsynonym hookleftarrow larrhk -\defineMMLsynonym hookrightarrow rarrhk -\defineMMLsynonym LeftArrowRightArrow lrarr -\defineMMLsynonym leftarrowtail larrtl -\defineMMLsynonym LeftDownVector dharl -\defineMMLsynonym leftharpoondown lhard -\defineMMLsynonym leftharpoonup lharu -\defineMMLsynonym leftleftarrows llarr -\defineMMLsynonym LeftRightArrow harr -\defineMMLsynonym Leftrightarrow hArr -\defineMMLsynonym leftrightarrow harr -\defineMMLsynonym leftrightarrows lrarr -\defineMMLsynonym leftrightharpoons lrhar -\defineMMLsynonym leftrightsquigarrow harrw -\defineMMLsynonym LeftUpVector uharl -\defineMMLsynonym LeftVector lharu -\defineMMLsynonym Lleftarrow lAarr -\defineMMLsynonym LongLeftArrow xlarr -\defineMMLsynonym Longleftarrow xlArr -\defineMMLsynonym longleftarrow xlarr -\defineMMLsynonym LongLeftRightArrow xharr -\defineMMLsynonym Longleftrightarrow xhArr -\defineMMLsynonym longleftrightarrow xharr -\defineMMLsynonym longmapsto xmap -\defineMMLsynonym LongRightArrow xrarr -\defineMMLsynonym Longrightarrow xrArr -\defineMMLsynonym longrightarrow xrarr -\defineMMLsynonym looparrowleft larrlp -\defineMMLsynonym looparrowright rarrlp -\defineMMLsynonym LowerLeftArrow swarr -\defineMMLsynonym LowerRightArrow searr -\defineMMLsynonym Lsh lsh -\defineMMLsynonym mapsto map -\defineMMLsynonym multimap mumap -\defineMMLsynonym nearrow nearr -\defineMMLsynonym nLeftarrow nlArr -\defineMMLsynonym nleftarrow nlarr -\defineMMLsynonym nLeftrightarrow nhArr -\defineMMLsynonym nleftrightarrow nharr -\defineMMLsynonym nRightarrow nrArr -\defineMMLsynonym nrightarrow nrarr -\defineMMLsynonym nwarrow nwarr -\defineMMLsynonym ReverseEquilibrium lrhar -\defineMMLsynonym ReverseUpEquilibrium duhar -\defineMMLsynonym RightArrowLeftArrow rlarr -\defineMMLsynonym rightarrowtail rarrtl -\defineMMLsynonym RightDownVector dharr -\defineMMLsynonym rightharpoondown rhard -\defineMMLsynonym rightharpoonup rharu -\defineMMLsynonym rightleftarrows rlarr -\defineMMLsynonym rightleftharpoons rlhar -\defineMMLsynonym rightrightarrows rrarr -\defineMMLsynonym rightsquigarrow rarrw -\defineMMLsynonym RightTeeArrow map -\defineMMLsynonym RightUpVector uharr -\defineMMLsynonym RightVector rharu -\defineMMLsynonym Rrightarrow rAarr -\defineMMLsynonym Rsh rsh -\defineMMLsynonym searrow searr -\defineMMLsynonym ShortLeftArrow slarr -\defineMMLsynonym ShortRightArrow srarr -\defineMMLsynonym swarrow swarr -\defineMMLsynonym toea nesear -\defineMMLsynonym tosa seswar -\defineMMLsynonym twoheadleftarrow Larr -\defineMMLsynonym twoheadrightarrow Rarr -\defineMMLsynonym Uparrow uArr -\defineMMLsynonym UpArrowDownArrow udarr -\defineMMLsynonym UpDownArrow varr -\defineMMLsynonym Updownarrow vArr -\defineMMLsynonym updownarrow varr -\defineMMLsynonym UpEquilibrium udhar -\defineMMLsynonym upharpoonleft uharl -\defineMMLsynonym upharpoonright uharr -\defineMMLsynonym UpperLeftArrow nwarr -\defineMMLsynonym UpperRightArrow nearr -\defineMMLsynonym upuparrows uuarr diff --git a/tex/context/base/xtag-mxb.mkii b/tex/context/base/xtag-mxb.mkii new file mode 100644 index 000000000..c325a9e44 --- /dev/null +++ b/tex/context/base/xtag-mxb.mkii @@ -0,0 +1,55 @@ +\defineMMLsynonym ast midast +\defineMMLsynonym Backslash setmn +\defineMMLsynonym barwedge barwed +\defineMMLsynonym bigcap xcap +\defineMMLsynonym bigcirc xcirc +\defineMMLsynonym bigcup xcup +\defineMMLsynonym bigodot xodot +\defineMMLsynonym bigoplus xoplus +\defineMMLsynonym bigotimes xotime +\defineMMLsynonym bigsqcup xsqcup +\defineMMLsynonym bigtriangledown xdtri +\defineMMLsynonym bigtriangleup xutri +\defineMMLsynonym biguplus xuplus +\defineMMLsynonym bigvee xvee +\defineMMLsynonym bigwedge xwedge +\defineMMLsynonym boxminus minusb +\defineMMLsynonym boxplus plusb +\defineMMLsynonym boxtimes timesb +\defineMMLsynonym cdot sdot +\defineMMLsynonym circledast oast +\defineMMLsynonym circledcirc ocir +\defineMMLsynonym circleddash odash +\defineMMLsynonym CircleDot odot +\defineMMLsynonym CircleMinus ominus +\defineMMLsynonym CirclePlus oplus +\defineMMLsynonym CircleTimes otimes +\defineMMLsynonym Coproduct coprod +\defineMMLsynonym curlyvee cuvee +\defineMMLsynonym curlywedge cuwed +\defineMMLsynonym ddagger Dagger +\defineMMLsynonym diamond diam +\defineMMLsynonym divideontimes divonx +\defineMMLsynonym dotminus minusd +\defineMMLsynonym dotplus plusdo +\defineMMLsynonym dotsquare sdotb +\defineMMLsynonym doublebarwedge Barwed +\defineMMLsynonym intercal intcal +\defineMMLsynonym Intersection xcap +\defineMMLsynonym intprod iprod +\defineMMLsynonym leftthreetimes lthree +\defineMMLsynonym oslash osol +\defineMMLsynonym rightthreetimes rthree +\defineMMLsynonym setminus setmn +\defineMMLsynonym smallsetminus ssetmn +\defineMMLsynonym SquareIntersection sqcap +\defineMMLsynonym SquareUnion sqcup +\defineMMLsynonym Star sstarf +\defineMMLsynonym star sstarf +\defineMMLsynonym Sum sum +\defineMMLsynonym Union xcup +\defineMMLsynonym UnionPlus uplus +\defineMMLsynonym Vee xvee +\defineMMLsynonym VerticalTilde wreath +\defineMMLsynonym Wedge xwedge +\defineMMLsynonym wr wreath diff --git a/tex/context/base/xtag-mxb.tex b/tex/context/base/xtag-mxb.tex deleted file mode 100644 index c325a9e44..000000000 --- a/tex/context/base/xtag-mxb.tex +++ /dev/null @@ -1,55 +0,0 @@ -\defineMMLsynonym ast midast -\defineMMLsynonym Backslash setmn -\defineMMLsynonym barwedge barwed -\defineMMLsynonym bigcap xcap -\defineMMLsynonym bigcirc xcirc -\defineMMLsynonym bigcup xcup -\defineMMLsynonym bigodot xodot -\defineMMLsynonym bigoplus xoplus -\defineMMLsynonym bigotimes xotime -\defineMMLsynonym bigsqcup xsqcup -\defineMMLsynonym bigtriangledown xdtri -\defineMMLsynonym bigtriangleup xutri -\defineMMLsynonym biguplus xuplus -\defineMMLsynonym bigvee xvee -\defineMMLsynonym bigwedge xwedge -\defineMMLsynonym boxminus minusb -\defineMMLsynonym boxplus plusb -\defineMMLsynonym boxtimes timesb -\defineMMLsynonym cdot sdot -\defineMMLsynonym circledast oast -\defineMMLsynonym circledcirc ocir -\defineMMLsynonym circleddash odash -\defineMMLsynonym CircleDot odot -\defineMMLsynonym CircleMinus ominus -\defineMMLsynonym CirclePlus oplus -\defineMMLsynonym CircleTimes otimes -\defineMMLsynonym Coproduct coprod -\defineMMLsynonym curlyvee cuvee -\defineMMLsynonym curlywedge cuwed -\defineMMLsynonym ddagger Dagger -\defineMMLsynonym diamond diam -\defineMMLsynonym divideontimes divonx -\defineMMLsynonym dotminus minusd -\defineMMLsynonym dotplus plusdo -\defineMMLsynonym dotsquare sdotb -\defineMMLsynonym doublebarwedge Barwed -\defineMMLsynonym intercal intcal -\defineMMLsynonym Intersection xcap -\defineMMLsynonym intprod iprod -\defineMMLsynonym leftthreetimes lthree -\defineMMLsynonym oslash osol -\defineMMLsynonym rightthreetimes rthree -\defineMMLsynonym setminus setmn -\defineMMLsynonym smallsetminus ssetmn -\defineMMLsynonym SquareIntersection sqcap -\defineMMLsynonym SquareUnion sqcup -\defineMMLsynonym Star sstarf -\defineMMLsynonym star sstarf -\defineMMLsynonym Sum sum -\defineMMLsynonym Union xcup -\defineMMLsynonym UnionPlus uplus -\defineMMLsynonym Vee xvee -\defineMMLsynonym VerticalTilde wreath -\defineMMLsynonym Wedge xwedge -\defineMMLsynonym wr wreath diff --git a/tex/context/base/xtag-mxc.mkii b/tex/context/base/xtag-mxc.mkii new file mode 100644 index 000000000..e692f2a24 --- /dev/null +++ b/tex/context/base/xtag-mxc.mkii @@ -0,0 +1,10 @@ +\defineMMLsynonym LeftCeiling lceil +\defineMMLsynonym LeftFloor lfloor +\defineMMLsynonym llcorner dlcorn +\defineMMLsynonym lmoustache lmoust +\defineMMLsynonym lrcorner drcorn +\defineMMLsynonym RightCeiling rceil +\defineMMLsynonym RightFloor rfloor +\defineMMLsynonym rmoustache rmoust +\defineMMLsynonym ulcorner ulcorn +\defineMMLsynonym urcorner urcorn diff --git a/tex/context/base/xtag-mxc.tex b/tex/context/base/xtag-mxc.tex deleted file mode 100644 index e692f2a24..000000000 --- a/tex/context/base/xtag-mxc.tex +++ /dev/null @@ -1,10 +0,0 @@ -\defineMMLsynonym LeftCeiling lceil -\defineMMLsynonym LeftFloor lfloor -\defineMMLsynonym llcorner dlcorn -\defineMMLsynonym lmoustache lmoust -\defineMMLsynonym lrcorner drcorn -\defineMMLsynonym RightCeiling rceil -\defineMMLsynonym RightFloor rfloor -\defineMMLsynonym rmoustache rmoust -\defineMMLsynonym ulcorner ulcorn -\defineMMLsynonym urcorner urcorn diff --git a/tex/context/base/xtag-mxh.mkii b/tex/context/base/xtag-mxh.mkii new file mode 100644 index 000000000..3cf0103c8 --- /dev/null +++ b/tex/context/base/xtag-mxh.mkii @@ -0,0 +1,67 @@ +\defineMMLsynonym approx ap +\defineMMLsynonym Because becaus +\defineMMLsynonym because becaus +\defineMMLsynonym blacksquare squarf +\defineMMLsynonym bot bottom +\defineMMLsynonym circ compfn +\defineMMLsynonym ClockwiseContourIntegral cwconint +\defineMMLsynonym Congruent equiv +\defineMMLsynonym ContourIntegral conint +\defineMMLsynonym CounterClockwiseContourIntegral awconint +\defineMMLsynonym Del nabla +\defineMMLsynonym DoubleContourIntegral Conint +\defineMMLsynonym DoubleLeftArrow lArr +\defineMMLsynonym DoubleRightArrow rArr +\defineMMLsynonym DoubleVerticalBar par +\defineMMLsynonym DownTee top +\defineMMLsynonym Element isinv +\defineMMLsynonym Exists exist +\defineMMLsynonym ForAll forall +\defineMMLsynonym geq ge +\defineMMLsynonym GreaterEqual ge +\defineMMLsynonym iiiint qint +\defineMMLsynonym iiint tint +\defineMMLsynonym Implies rArr +\defineMMLsynonym in isin +\defineMMLsynonym Integral int +\defineMMLsynonym langle lang +\defineMMLsynonym LeftAngleBracket lang +\defineMMLsynonym Leftarrow lArr +\defineMMLsynonym leq le +\defineMMLsynonym MinusPlus mnplus +\defineMMLsynonym mp mnplus +\defineMMLsynonym NotElement notin +\defineMMLsynonym NotEqual ne +\defineMMLsynonym NotReverseElement notniva +\defineMMLsynonym oint conint +\defineMMLsynonym parallel par +\defineMMLsynonym PartialD part +\defineMMLsynonym Proportional prop +\defineMMLsynonym propto prop +\defineMMLsynonym rangle rang +\defineMMLsynonym ReverseElement niv +\defineMMLsynonym RightAngleBracket rang +\defineMMLsynonym Rightarrow rArr +\defineMMLsynonym simeq sime +\defineMMLsynonym SmallCircle compfn +\defineMMLsynonym Sqrt radic +\defineMMLsynonym Subset sub +\defineMMLsynonym subset sub +\defineMMLsynonym subseteq sube +\defineMMLsynonym SubsetEqual sube +\defineMMLsynonym SuchThat ni +\defineMMLsynonym Superset sup +\defineMMLsynonym SupersetEqual supe +\defineMMLsynonym supset sup +\defineMMLsynonym supseteq supe +\defineMMLsynonym Therefore there4 +\defineMMLsynonym therefore there4 +\defineMMLsynonym Tilde sim +\defineMMLsynonym TildeEqual sime +\defineMMLsynonym TildeFullEqual cong +\defineMMLsynonym TildeTilde ap +\defineMMLsynonym TripleDot tdot +\defineMMLsynonym UpTee perp +\defineMMLsynonym vee or +\defineMMLsynonym Vert Verbar +\defineMMLsynonym wedge and diff --git a/tex/context/base/xtag-mxh.tex b/tex/context/base/xtag-mxh.tex deleted file mode 100644 index 3cf0103c8..000000000 --- a/tex/context/base/xtag-mxh.tex +++ /dev/null @@ -1,67 +0,0 @@ -\defineMMLsynonym approx ap -\defineMMLsynonym Because becaus -\defineMMLsynonym because becaus -\defineMMLsynonym blacksquare squarf -\defineMMLsynonym bot bottom -\defineMMLsynonym circ compfn -\defineMMLsynonym ClockwiseContourIntegral cwconint -\defineMMLsynonym Congruent equiv -\defineMMLsynonym ContourIntegral conint -\defineMMLsynonym CounterClockwiseContourIntegral awconint -\defineMMLsynonym Del nabla -\defineMMLsynonym DoubleContourIntegral Conint -\defineMMLsynonym DoubleLeftArrow lArr -\defineMMLsynonym DoubleRightArrow rArr -\defineMMLsynonym DoubleVerticalBar par -\defineMMLsynonym DownTee top -\defineMMLsynonym Element isinv -\defineMMLsynonym Exists exist -\defineMMLsynonym ForAll forall -\defineMMLsynonym geq ge -\defineMMLsynonym GreaterEqual ge -\defineMMLsynonym iiiint qint -\defineMMLsynonym iiint tint -\defineMMLsynonym Implies rArr -\defineMMLsynonym in isin -\defineMMLsynonym Integral int -\defineMMLsynonym langle lang -\defineMMLsynonym LeftAngleBracket lang -\defineMMLsynonym Leftarrow lArr -\defineMMLsynonym leq le -\defineMMLsynonym MinusPlus mnplus -\defineMMLsynonym mp mnplus -\defineMMLsynonym NotElement notin -\defineMMLsynonym NotEqual ne -\defineMMLsynonym NotReverseElement notniva -\defineMMLsynonym oint conint -\defineMMLsynonym parallel par -\defineMMLsynonym PartialD part -\defineMMLsynonym Proportional prop -\defineMMLsynonym propto prop -\defineMMLsynonym rangle rang -\defineMMLsynonym ReverseElement niv -\defineMMLsynonym RightAngleBracket rang -\defineMMLsynonym Rightarrow rArr -\defineMMLsynonym simeq sime -\defineMMLsynonym SmallCircle compfn -\defineMMLsynonym Sqrt radic -\defineMMLsynonym Subset sub -\defineMMLsynonym subset sub -\defineMMLsynonym subseteq sube -\defineMMLsynonym SubsetEqual sube -\defineMMLsynonym SuchThat ni -\defineMMLsynonym Superset sup -\defineMMLsynonym SupersetEqual supe -\defineMMLsynonym supset sup -\defineMMLsynonym supseteq supe -\defineMMLsynonym Therefore there4 -\defineMMLsynonym therefore there4 -\defineMMLsynonym Tilde sim -\defineMMLsynonym TildeEqual sime -\defineMMLsynonym TildeFullEqual cong -\defineMMLsynonym TildeTilde ap -\defineMMLsynonym TripleDot tdot -\defineMMLsynonym UpTee perp -\defineMMLsynonym vee or -\defineMMLsynonym Vert Verbar -\defineMMLsynonym wedge and diff --git a/tex/context/base/xtag-mxn.mkii b/tex/context/base/xtag-mxn.mkii new file mode 100644 index 000000000..35eeade9a --- /dev/null +++ b/tex/context/base/xtag-mxn.mkii @@ -0,0 +1,84 @@ +\defineMMLsynonym gnapprox gnap +\defineMMLsynonym gneq gne +\defineMMLsynonym gneqq gnE +\defineMMLsynonym gvertneqq gvnE +\defineMMLsynonym lnapprox lnap +\defineMMLsynonym lneq lne +\defineMMLsynonym lneqq lnE +\defineMMLsynonym lvertneqq lvnE +\defineMMLsynonym napprox nap +\defineMMLsynonym ngeq nge +\defineMMLsynonym ngeqq ngE +\defineMMLsynonym ngeqslant nges +\defineMMLsynonym ngtr ngt +\defineMMLsynonym nleq nle +\defineMMLsynonym nleqq nlE +\defineMMLsynonym nleqslant nles +\defineMMLsynonym nless nlt +\defineMMLsynonym NotCongruent nequiv +\defineMMLsynonym NotDoubleVerticalBar npar +\defineMMLsynonym NotGreater ngt +\defineMMLsynonym NotGreaterEqual nge +\defineMMLsynonym NotGreaterFullEqual ngE +\defineMMLsynonym NotGreaterGreater nGtv +\defineMMLsynonym NotGreaterLess ntvgl +\defineMMLsynonym NotGreaterSlantEqual nges +\defineMMLsynonym NotGreaterTilde ngsim +\defineMMLsynonym NotLeftTriangle nltri +\defineMMLsynonym NotLeftTriangleEqual nltrie +\defineMMLsynonym NotLess nlt +\defineMMLsynonym NotLessEqual nle +\defineMMLsynonym NotLessFullEqual nlE +\defineMMLsynonym NotLessGreater ntvlg +\defineMMLsynonym NotLessLess nLtv +\defineMMLsynonym NotLessSlantEqual nles +\defineMMLsynonym NotLessTilde nlsim +\defineMMLsynonym NotPrecedes npr +\defineMMLsynonym NotPrecedesEqual npre +\defineMMLsynonym NotPrecedesSlantEqual nprcue +\defineMMLsynonym NotRightTriangle nrtri +\defineMMLsynonym NotRightTriangleEqual nrtrie +\defineMMLsynonym NotSquareSubsetEqual nsqsube +\defineMMLsynonym NotSquareSupersetEqual nsqsupe +\defineMMLsynonym NotSubset vnsub +\defineMMLsynonym NotSucceeds nsc +\defineMMLsynonym NotSucceedsEqual nsce +\defineMMLsynonym NotSucceedsSlantEqual nsccue +\defineMMLsynonym NotSuperset vnsup +\defineMMLsynonym NotTilde nsim +\defineMMLsynonym NotTildeEqual nsime +\defineMMLsynonym NotTildeFullEqual ncong +\defineMMLsynonym NotTildeTilde nap +\defineMMLsynonym NotVerticalBar nmid +\defineMMLsynonym nparallel npar +\defineMMLsynonym nprec npr +\defineMMLsynonym npreceq npre +\defineMMLsynonym nshortmid nsmid +\defineMMLsynonym nshortparallel nspar +\defineMMLsynonym nsimeq nsime +\defineMMLsynonym nsubset vnsub +\defineMMLsynonym nsubseteq nsube +\defineMMLsynonym nsubseteqq nsubE +\defineMMLsynonym nsucc nsc +\defineMMLsynonym nsucceq nsce +\defineMMLsynonym nsupset vnsup +\defineMMLsynonym nsupseteq nsupe +\defineMMLsynonym nsupseteqq nsupE +\defineMMLsynonym ntriangleleft nltri +\defineMMLsynonym ntrianglelefteq nltrie +\defineMMLsynonym ntriangleright nrtri +\defineMMLsynonym ntrianglerighteq nrtrie +\defineMMLsynonym precnapprox prnap +\defineMMLsynonym precneqq prnE +\defineMMLsynonym precnsim prnsim +\defineMMLsynonym subsetneq subne +\defineMMLsynonym subsetneqq subnE +\defineMMLsynonym succnapprox scnap +\defineMMLsynonym succneqq scnE +\defineMMLsynonym succnsim scnsim +\defineMMLsynonym supsetneq supne +\defineMMLsynonym supsetneqq supnE +\defineMMLsynonym varsubsetneq vsubne +\defineMMLsynonym varsubsetneqq vsubnE +\defineMMLsynonym varsupsetneq vsupne +\defineMMLsynonym varsupsetneqq vsupnE diff --git a/tex/context/base/xtag-mxn.tex b/tex/context/base/xtag-mxn.tex deleted file mode 100644 index 35eeade9a..000000000 --- a/tex/context/base/xtag-mxn.tex +++ /dev/null @@ -1,84 +0,0 @@ -\defineMMLsynonym gnapprox gnap -\defineMMLsynonym gneq gne -\defineMMLsynonym gneqq gnE -\defineMMLsynonym gvertneqq gvnE -\defineMMLsynonym lnapprox lnap -\defineMMLsynonym lneq lne -\defineMMLsynonym lneqq lnE -\defineMMLsynonym lvertneqq lvnE -\defineMMLsynonym napprox nap -\defineMMLsynonym ngeq nge -\defineMMLsynonym ngeqq ngE -\defineMMLsynonym ngeqslant nges -\defineMMLsynonym ngtr ngt -\defineMMLsynonym nleq nle -\defineMMLsynonym nleqq nlE -\defineMMLsynonym nleqslant nles -\defineMMLsynonym nless nlt -\defineMMLsynonym NotCongruent nequiv -\defineMMLsynonym NotDoubleVerticalBar npar -\defineMMLsynonym NotGreater ngt -\defineMMLsynonym NotGreaterEqual nge -\defineMMLsynonym NotGreaterFullEqual ngE -\defineMMLsynonym NotGreaterGreater nGtv -\defineMMLsynonym NotGreaterLess ntvgl -\defineMMLsynonym NotGreaterSlantEqual nges -\defineMMLsynonym NotGreaterTilde ngsim -\defineMMLsynonym NotLeftTriangle nltri -\defineMMLsynonym NotLeftTriangleEqual nltrie -\defineMMLsynonym NotLess nlt -\defineMMLsynonym NotLessEqual nle -\defineMMLsynonym NotLessFullEqual nlE -\defineMMLsynonym NotLessGreater ntvlg -\defineMMLsynonym NotLessLess nLtv -\defineMMLsynonym NotLessSlantEqual nles -\defineMMLsynonym NotLessTilde nlsim -\defineMMLsynonym NotPrecedes npr -\defineMMLsynonym NotPrecedesEqual npre -\defineMMLsynonym NotPrecedesSlantEqual nprcue -\defineMMLsynonym NotRightTriangle nrtri -\defineMMLsynonym NotRightTriangleEqual nrtrie -\defineMMLsynonym NotSquareSubsetEqual nsqsube -\defineMMLsynonym NotSquareSupersetEqual nsqsupe -\defineMMLsynonym NotSubset vnsub -\defineMMLsynonym NotSucceeds nsc -\defineMMLsynonym NotSucceedsEqual nsce -\defineMMLsynonym NotSucceedsSlantEqual nsccue -\defineMMLsynonym NotSuperset vnsup -\defineMMLsynonym NotTilde nsim -\defineMMLsynonym NotTildeEqual nsime -\defineMMLsynonym NotTildeFullEqual ncong -\defineMMLsynonym NotTildeTilde nap -\defineMMLsynonym NotVerticalBar nmid -\defineMMLsynonym nparallel npar -\defineMMLsynonym nprec npr -\defineMMLsynonym npreceq npre -\defineMMLsynonym nshortmid nsmid -\defineMMLsynonym nshortparallel nspar -\defineMMLsynonym nsimeq nsime -\defineMMLsynonym nsubset vnsub -\defineMMLsynonym nsubseteq nsube -\defineMMLsynonym nsubseteqq nsubE -\defineMMLsynonym nsucc nsc -\defineMMLsynonym nsucceq nsce -\defineMMLsynonym nsupset vnsup -\defineMMLsynonym nsupseteq nsupe -\defineMMLsynonym nsupseteqq nsupE -\defineMMLsynonym ntriangleleft nltri -\defineMMLsynonym ntrianglelefteq nltrie -\defineMMLsynonym ntriangleright nrtri -\defineMMLsynonym ntrianglerighteq nrtrie -\defineMMLsynonym precnapprox prnap -\defineMMLsynonym precneqq prnE -\defineMMLsynonym precnsim prnsim -\defineMMLsynonym subsetneq subne -\defineMMLsynonym subsetneqq subnE -\defineMMLsynonym succnapprox scnap -\defineMMLsynonym succneqq scnE -\defineMMLsynonym succnsim scnsim -\defineMMLsynonym supsetneq supne -\defineMMLsynonym supsetneqq supnE -\defineMMLsynonym varsubsetneq vsubne -\defineMMLsynonym varsubsetneqq vsubnE -\defineMMLsynonym varsupsetneq vsupne -\defineMMLsynonym varsupsetneqq vsupnE diff --git a/tex/context/base/xtag-mxo.mkii b/tex/context/base/xtag-mxo.mkii new file mode 100644 index 000000000..045b4f406 --- /dev/null +++ b/tex/context/base/xtag-mxo.mkii @@ -0,0 +1,14 @@ +\defineMMLsynonym angle ang +\defineMMLsynonym backprime bprime +\defineMMLsynonym circledS oS +\defineMMLsynonym complement comp +\defineMMLsynonym emptyset empty +\defineMMLsynonym hbar plank +\defineMMLsynonym hslash plankv +\defineMMLsynonym Im image +\defineMMLsynonym measuredangle angmsd +\defineMMLsynonym nexists nexist +\defineMMLsynonym NotExists nexist +\defineMMLsynonym Re real +\defineMMLsynonym varnothing emptyv +\defineMMLsynonym wp weierp diff --git a/tex/context/base/xtag-mxo.tex b/tex/context/base/xtag-mxo.tex deleted file mode 100644 index 045b4f406..000000000 --- a/tex/context/base/xtag-mxo.tex +++ /dev/null @@ -1,14 +0,0 @@ -\defineMMLsynonym angle ang -\defineMMLsynonym backprime bprime -\defineMMLsynonym circledS oS -\defineMMLsynonym complement comp -\defineMMLsynonym emptyset empty -\defineMMLsynonym hbar plank -\defineMMLsynonym hslash plankv -\defineMMLsynonym Im image -\defineMMLsynonym measuredangle angmsd -\defineMMLsynonym nexists nexist -\defineMMLsynonym NotExists nexist -\defineMMLsynonym Re real -\defineMMLsynonym varnothing emptyv -\defineMMLsynonym wp weierp diff --git a/tex/context/base/xtag-mxr.mkii b/tex/context/base/xtag-mxr.mkii new file mode 100644 index 000000000..ed1498f81 --- /dev/null +++ b/tex/context/base/xtag-mxr.mkii @@ -0,0 +1,112 @@ +\defineMMLsynonym approxeq ape +\defineMMLsynonym backcong bcong +\defineMMLsynonym backepsilon bepsi +\defineMMLsynonym backsim bsim +\defineMMLsynonym backsimeq bsime +\defineMMLsynonym between twixt +\defineMMLsynonym Bumpeq bump +\defineMMLsynonym bumpeq bumpe +\defineMMLsynonym circeq cire +\defineMMLsynonym coloneq colone +\defineMMLsynonym Cup smile +\defineMMLsynonym CupCap asymp +\defineMMLsynonym curlyeqprec cuepr +\defineMMLsynonym curlyeqsucc cuesc +\defineMMLsynonym ddotseq eDDot +\defineMMLsynonym doteq esdot +\defineMMLsynonym doteqdot eDot +\defineMMLsynonym DotEqual esdot +\defineMMLsynonym DoubleRightTee vDash +\defineMMLsynonym eqcirc ecir +\defineMMLsynonym eqcolon ecolon +\defineMMLsynonym eqsim esim +\defineMMLsynonym eqslantgtr egs +\defineMMLsynonym eqslantless els +\defineMMLsynonym EqualTilde esim +\defineMMLsynonym fallingdotseq efDot +\defineMMLsynonym geqq gE +\defineMMLsynonym geqslant ges +\defineMMLsynonym gg Gt +\defineMMLsynonym ggg Gg +\defineMMLsynonym GreaterEqualLess gel +\defineMMLsynonym GreaterFullEqual gE +\defineMMLsynonym GreaterLess gl +\defineMMLsynonym GreaterSlantEqual ges +\defineMMLsynonym GreaterTilde gsim +\defineMMLsynonym gtrapprox gap +\defineMMLsynonym gtrdot gtdot +\defineMMLsynonym gtreqless gel +\defineMMLsynonym gtreqqless gEl +\defineMMLsynonym gtrless gl +\defineMMLsynonym gtrsim gsim +\defineMMLsynonym HumpDownHump bump +\defineMMLsynonym HumpEqual bumpe +\defineMMLsynonym LeftTee dashv +\defineMMLsynonym LeftTriangle vltri +\defineMMLsynonym LeftTriangleEqual ltrie +\defineMMLsynonym leqq lE +\defineMMLsynonym leqslant les +\defineMMLsynonym lessapprox lap +\defineMMLsynonym lessdot ltdot +\defineMMLsynonym lesseqgtr leg +\defineMMLsynonym lesseqqgtr lEg +\defineMMLsynonym LessEqualGreater leg +\defineMMLsynonym LessFullEqual lE +\defineMMLsynonym LessGreater lg +\defineMMLsynonym lessgtr lg +\defineMMLsynonym lesssim lsim +\defineMMLsynonym LessSlantEqual les +\defineMMLsynonym LessTilde lsim +\defineMMLsynonym ll Lt +\defineMMLsynonym NestedGreaterGreater Gt +\defineMMLsynonym NestedLessLess Lt +\defineMMLsynonym pitchfork fork +\defineMMLsynonym prec pr +\defineMMLsynonym precapprox prap +\defineMMLsynonym preccurlyeq prcue +\defineMMLsynonym Precedes pr +\defineMMLsynonym PrecedesEqual pre +\defineMMLsynonym PrecedesSlantEqual prcue +\defineMMLsynonym PrecedesTilde prsim +\defineMMLsynonym preceq pre +\defineMMLsynonym precsim prsim +\defineMMLsynonym Proportion Colon +\defineMMLsynonym questeq equest +\defineMMLsynonym RightTee vdash +\defineMMLsynonym RightTriangle vrtri +\defineMMLsynonym RightTriangleEqual rtrie +\defineMMLsynonym risingdotseq erDot +\defineMMLsynonym shortmid smid +\defineMMLsynonym shortparallel spar +\defineMMLsynonym smallfrown sfrown +\defineMMLsynonym smallsmile ssmile +\defineMMLsynonym sqsubset sqsub +\defineMMLsynonym sqsubseteq sqsube +\defineMMLsynonym sqsupset sqsup +\defineMMLsynonym sqsupseteq sqsupe +\defineMMLsynonym SquareSubset sqsub +\defineMMLsynonym SquareSubsetEqual sqsube +\defineMMLsynonym SquareSuperset sqsup +\defineMMLsynonym SquareSupersetEqual sqsupe +\defineMMLsynonym Subset Sub +\defineMMLsynonym subseteqq subE +\defineMMLsynonym succ sc +\defineMMLsynonym succapprox scap +\defineMMLsynonym succcurlyeq sccue +\defineMMLsynonym Succeeds sc +\defineMMLsynonym SucceedsEqual sce +\defineMMLsynonym SucceedsSlantEqual sccue +\defineMMLsynonym SucceedsTilde scsim +\defineMMLsynonym succeq sce +\defineMMLsynonym succsim scsim +\defineMMLsynonym Supset Sup +\defineMMLsynonym supseteqq supE +\defineMMLsynonym thickapprox thkap +\defineMMLsynonym thicksim thksim +\defineMMLsynonym trianglelefteq ltrie +\defineMMLsynonym triangleq trie +\defineMMLsynonym trianglerighteq rtrie +\defineMMLsynonym varpropto vprop +\defineMMLsynonym vartriangleleft vltri +\defineMMLsynonym vartriangleright vrtri +\defineMMLsynonym VerticalBar mid diff --git a/tex/context/base/xtag-mxr.tex b/tex/context/base/xtag-mxr.tex deleted file mode 100644 index ed1498f81..000000000 --- a/tex/context/base/xtag-mxr.tex +++ /dev/null @@ -1,112 +0,0 @@ -\defineMMLsynonym approxeq ape -\defineMMLsynonym backcong bcong -\defineMMLsynonym backepsilon bepsi -\defineMMLsynonym backsim bsim -\defineMMLsynonym backsimeq bsime -\defineMMLsynonym between twixt -\defineMMLsynonym Bumpeq bump -\defineMMLsynonym bumpeq bumpe -\defineMMLsynonym circeq cire -\defineMMLsynonym coloneq colone -\defineMMLsynonym Cup smile -\defineMMLsynonym CupCap asymp -\defineMMLsynonym curlyeqprec cuepr -\defineMMLsynonym curlyeqsucc cuesc -\defineMMLsynonym ddotseq eDDot -\defineMMLsynonym doteq esdot -\defineMMLsynonym doteqdot eDot -\defineMMLsynonym DotEqual esdot -\defineMMLsynonym DoubleRightTee vDash -\defineMMLsynonym eqcirc ecir -\defineMMLsynonym eqcolon ecolon -\defineMMLsynonym eqsim esim -\defineMMLsynonym eqslantgtr egs -\defineMMLsynonym eqslantless els -\defineMMLsynonym EqualTilde esim -\defineMMLsynonym fallingdotseq efDot -\defineMMLsynonym geqq gE -\defineMMLsynonym geqslant ges -\defineMMLsynonym gg Gt -\defineMMLsynonym ggg Gg -\defineMMLsynonym GreaterEqualLess gel -\defineMMLsynonym GreaterFullEqual gE -\defineMMLsynonym GreaterLess gl -\defineMMLsynonym GreaterSlantEqual ges -\defineMMLsynonym GreaterTilde gsim -\defineMMLsynonym gtrapprox gap -\defineMMLsynonym gtrdot gtdot -\defineMMLsynonym gtreqless gel -\defineMMLsynonym gtreqqless gEl -\defineMMLsynonym gtrless gl -\defineMMLsynonym gtrsim gsim -\defineMMLsynonym HumpDownHump bump -\defineMMLsynonym HumpEqual bumpe -\defineMMLsynonym LeftTee dashv -\defineMMLsynonym LeftTriangle vltri -\defineMMLsynonym LeftTriangleEqual ltrie -\defineMMLsynonym leqq lE -\defineMMLsynonym leqslant les -\defineMMLsynonym lessapprox lap -\defineMMLsynonym lessdot ltdot -\defineMMLsynonym lesseqgtr leg -\defineMMLsynonym lesseqqgtr lEg -\defineMMLsynonym LessEqualGreater leg -\defineMMLsynonym LessFullEqual lE -\defineMMLsynonym LessGreater lg -\defineMMLsynonym lessgtr lg -\defineMMLsynonym lesssim lsim -\defineMMLsynonym LessSlantEqual les -\defineMMLsynonym LessTilde lsim -\defineMMLsynonym ll Lt -\defineMMLsynonym NestedGreaterGreater Gt -\defineMMLsynonym NestedLessLess Lt -\defineMMLsynonym pitchfork fork -\defineMMLsynonym prec pr -\defineMMLsynonym precapprox prap -\defineMMLsynonym preccurlyeq prcue -\defineMMLsynonym Precedes pr -\defineMMLsynonym PrecedesEqual pre -\defineMMLsynonym PrecedesSlantEqual prcue -\defineMMLsynonym PrecedesTilde prsim -\defineMMLsynonym preceq pre -\defineMMLsynonym precsim prsim -\defineMMLsynonym Proportion Colon -\defineMMLsynonym questeq equest -\defineMMLsynonym RightTee vdash -\defineMMLsynonym RightTriangle vrtri -\defineMMLsynonym RightTriangleEqual rtrie -\defineMMLsynonym risingdotseq erDot -\defineMMLsynonym shortmid smid -\defineMMLsynonym shortparallel spar -\defineMMLsynonym smallfrown sfrown -\defineMMLsynonym smallsmile ssmile -\defineMMLsynonym sqsubset sqsub -\defineMMLsynonym sqsubseteq sqsube -\defineMMLsynonym sqsupset sqsup -\defineMMLsynonym sqsupseteq sqsupe -\defineMMLsynonym SquareSubset sqsub -\defineMMLsynonym SquareSubsetEqual sqsube -\defineMMLsynonym SquareSuperset sqsup -\defineMMLsynonym SquareSupersetEqual sqsupe -\defineMMLsynonym Subset Sub -\defineMMLsynonym subseteqq subE -\defineMMLsynonym succ sc -\defineMMLsynonym succapprox scap -\defineMMLsynonym succcurlyeq sccue -\defineMMLsynonym Succeeds sc -\defineMMLsynonym SucceedsEqual sce -\defineMMLsynonym SucceedsSlantEqual sccue -\defineMMLsynonym SucceedsTilde scsim -\defineMMLsynonym succeq sce -\defineMMLsynonym succsim scsim -\defineMMLsynonym Supset Sup -\defineMMLsynonym supseteqq supE -\defineMMLsynonym thickapprox thkap -\defineMMLsynonym thicksim thksim -\defineMMLsynonym trianglelefteq ltrie -\defineMMLsynonym triangleq trie -\defineMMLsynonym trianglerighteq rtrie -\defineMMLsynonym varpropto vprop -\defineMMLsynonym vartriangleleft vltri -\defineMMLsynonym vartriangleright vrtri -\defineMMLsynonym VerticalBar mid diff --git a/tex/context/base/xtag-pml.mkii b/tex/context/base/xtag-pml.mkii new file mode 100644 index 000000000..53d22c52a --- /dev/null +++ b/tex/context/base/xtag-pml.mkii @@ -0,0 +1,85 @@ +%D \module +%D [ file=xtag-pml, +%D version=2001.09.04, +%D title=\CONTEXT\ XML Support, +%D subtitle=Physics ML, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / PhysML} + +%D This is a reimplmentation of the old filter. This module +%D runs on top of the mathml and units modules. + +\useXMLfilter[map] +\useXMLfilter[mml,mmp,mmc] + +\defineXMLargument [phys] \doXMLphys +\defineXMLargument [iphys] \doXMLiphys +\defineXMLargument [dphys] \doXMLdphys + +\unprotect + +\unexpanded\def\doXMLphys {\ifhmode\@EA\doXMLiphys\else\@EA\doXMLdphys\fi} +\unexpanded\def\doXMLiphys{\XMLremapdata[mml]{$\ignorespaces}{\unskip$}} +\unexpanded\def\doXMLdphys{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}} + +\protect + +\doifnotmode{demo}{\endinput} + +\usemodule[units] + +\starttext + +\startXMLdata + + + 10 + + + +\stopXMLdata + +\startXMLdata + + + 10 + + + +\stopXMLdata + +\startXMLdata + + + 10 + + + +\stopXMLdata + +\startXMLdata + + + 10 + + + +\stopXMLdata + +\startXMLdata + + + 10 + + + +\stopXMLdata + +\stoptext diff --git a/tex/context/base/xtag-pml.tex b/tex/context/base/xtag-pml.tex deleted file mode 100644 index 53d22c52a..000000000 --- a/tex/context/base/xtag-pml.tex +++ /dev/null @@ -1,85 +0,0 @@ -%D \module -%D [ file=xtag-pml, -%D version=2001.09.04, -%D title=\CONTEXT\ XML Support, -%D subtitle=Physics ML, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / PhysML} - -%D This is a reimplmentation of the old filter. This module -%D runs on top of the mathml and units modules. - -\useXMLfilter[map] -\useXMLfilter[mml,mmp,mmc] - -\defineXMLargument [phys] \doXMLphys -\defineXMLargument [iphys] \doXMLiphys -\defineXMLargument [dphys] \doXMLdphys - -\unprotect - -\unexpanded\def\doXMLphys {\ifhmode\@EA\doXMLiphys\else\@EA\doXMLdphys\fi} -\unexpanded\def\doXMLiphys{\XMLremapdata[mml]{$\ignorespaces}{\unskip$}} -\unexpanded\def\doXMLdphys{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}} - -\protect - -\doifnotmode{demo}{\endinput} - -\usemodule[units] - -\starttext - -\startXMLdata - - - 10 - - - -\stopXMLdata - -\startXMLdata - - - 10 - - - -\stopXMLdata - -\startXMLdata - - - 10 - - - -\stopXMLdata - -\startXMLdata - - - 10 - - - -\stopXMLdata - -\startXMLdata - - - 10 - - - -\stopXMLdata - -\stoptext diff --git a/tex/context/base/xtag-pmu.mkii b/tex/context/base/xtag-pmu.mkii new file mode 100644 index 000000000..b913475f5 --- /dev/null +++ b/tex/context/base/xtag-pmu.mkii @@ -0,0 +1,188 @@ +%D \module +%D [ file=xtag-pmu, +%D version=2001.06.10, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Units, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Units} + +%D Quick and dirty in||line units: +%D +%D \startbuffer +%D +%D 10 +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer +%D +%D A more \MATHML||like unit application: +%D +%D \startbuffer +%D +%D 10 +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer +%D +%D A bit more compact: +%D +%D \startbuffer +%D +%D 10 +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer +%D +%D A bit more complicated: +%D +%D \startbuffer +%D +%D a 10 +%D +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer +%D +%D An alternative (equivalent) for \type {}: +%D +%D \startbuffer +%D +%D 10 +%D +%D \stopbuffer +%D +%D \typebuffer \processXMLbuffer + +\defineXMLsingular [unitmeaning] [label=] \doPMLunitmeaning + +\def\doPMLunitmeaning + {\expanded{\unitmeaning{\XMLop{label}}}} + +\startXMLmapping [mml] + +\remapXMLsequence [unit] [CPA] \doPMLuseq +\remapXMLsingular [unit] [CPA] \doPMLunit % #2\empty +\remapXMLsequence [cunseq] [CPA] \doPMLuseq % #2 +\remapXMLsequence [cu] [CPA] \doPMLuseq % #2 + +\newif\ifPMLunit \PMLunittrue + +\def\doPMLuseq#1#2{\PMLunittrue\ignorespaces#2\unskip\PMLunitfalse} +\def\doPMLunit#1#2\empty{\ignorespaces#2\unskip} + +\def\handlePMLunit#1{\ifPMLunit\ignorespaces#1\fi\ignorespaces} + +%D All unit commands are remapped in a similar way. + +\remapXMLsingular [Atto] [C] {\handlePMLunit\Atto} +\remapXMLsingular [Femto] [C] {\handlePMLunit\Femto} +\remapXMLsingular [Pico] [C] {\handlePMLunit\Pico} +\remapXMLsingular [Nano] [C] {\handlePMLunit\Nano} +\remapXMLsingular [Micro] [C] {\handlePMLunit\Micro} +\remapXMLsingular [Milli] [C] {\handlePMLunit\Milli} +\remapXMLsingular [Centi] [C] {\handlePMLunit\Centi} +\remapXMLsingular [Deci] [C] {\handlePMLunit\Deci} +\remapXMLsingular [Hecto] [C] {\handlePMLunit\Hecto} +\remapXMLsingular [Kilo] [C] {\handlePMLunit\Kilo} +\remapXMLsingular [Mega] [C] {\handlePMLunit\Mega} +\remapXMLsingular [Giga] [C] {\handlePMLunit\Giga} +\remapXMLsingular [Terra] [C] {\handlePMLunit\Terra} +\remapXMLsingular [Peta] [C] {\handlePMLunit\Peta} +\remapXMLsingular [Exa] [C] {\handlePMLunit\Exa} + +\remapXMLsingular [Times] [C] {\handlePMLunit\Times} +\remapXMLsingular [Solidus] [C] {\handlePMLunit\Solidus} +\remapXMLsingular [Per] [C] {\handlePMLunit\Per} +\remapXMLsingular [OutOf] [C] {\handlePMLunit\OutOf} + +\remapXMLsingular [Linear] [C] {\handlePMLunit\Linear} +\remapXMLsingular [Square] [C] {\handlePMLunit\Square} +\remapXMLsingular [Cubic] [C] {\handlePMLunit\Cubic} + +\remapXMLsingular [Inverse] [C] {\handlePMLunit\Inverse} + +\remapXMLsingular [Degrees] [C] {\handlePMLunit\Degrees} +\remapXMLsingular [Meter] [C] {\handlePMLunit\Meter} +\remapXMLsingular [Liter] [C] {\handlePMLunit\Liter} +\remapXMLsingular [Sec] [C] {\handlePMLunit\Sec} +\remapXMLsingular [Year] [C] {\handlePMLunit\Year} +\remapXMLsingular [Month] [C] {\handlePMLunit\Month} +\remapXMLsingular [Week] [C] {\handlePMLunit\Week} +\remapXMLsingular [Day] [C] {\handlePMLunit\Day} +\remapXMLsingular [Hour] [C] {\handlePMLunit\Hour} +\remapXMLsingular [Min] [C] {\handlePMLunit\Min} +\remapXMLsingular [Second] [C] {\handlePMLunit\Sec} +\remapXMLsingular [Rad] [C] {\handlePMLunit\Rad} +\remapXMLsingular [Deg] [C] {\handlePMLunit\Deg} +\remapXMLsingular [Hertz] [C] {\handlePMLunit\Hertz} +\remapXMLsingular [RevPerSec] [C] {\handlePMLunit\RevPerSec} +\remapXMLsingular [RevPerMin] [C] {\handlePMLunit\RevPerMin} +\remapXMLsingular [Gram] [C] {\handlePMLunit\Gram} +\remapXMLsingular [Atom] [C] {\handlePMLunit\Atom} +\remapXMLsingular [Newton] [C] {\handlePMLunit\Newton} +\remapXMLsingular [Pascal] [C] {\handlePMLunit\Pascal} +\remapXMLsingular [Joule] [C] {\handlePMLunit\Joule} +\remapXMLsingular [Watt] [C] {\handlePMLunit\Watt} +\remapXMLsingular [Celsius] [C] {\handlePMLunit\Celsius} +\remapXMLsingular [Kelvin] [C] {\handlePMLunit\Kelvin} +\remapXMLsingular [Fahrenheit] [C] {\handlePMLunit\Fahrenheit} +\remapXMLsingular [Mol] [C] {\handlePMLunit\Mol} +\remapXMLsingular [Molair] [C] {\handlePMLunit\Molair} +\remapXMLsingular [Equivalent] [C] {\handlePMLunit\Equivalent} +\remapXMLsingular [Farad] [C] {\handlePMLunit\Farad} +\remapXMLsingular [Ohm] [C] {\handlePMLunit\Ohm} +\remapXMLsingular [Siemens] [C] {\handlePMLunit\Siemens} +\remapXMLsingular [Ampere] [C] {\handlePMLunit\Ampere} +\remapXMLsingular [Coulomb] [C] {\handlePMLunit\Coulomb} +\remapXMLsingular [Volt] [C] {\handlePMLunit\Volt} +\remapXMLsingular [eVolt] [C] {\handlePMLunit\eVolt} +\remapXMLsingular [Tesla] [C] {\handlePMLunit\Tesla} +\remapXMLsingular [VoltAC] [C] {\handlePMLunit\VoltAC} +\remapXMLsingular [VoltDC] [C] {\handlePMLunit\VoltDC} +\remapXMLsingular [Baud] [C] {\handlePMLunit\Baud} +\remapXMLsingular [Bit] [C] {\handlePMLunit\Bit} +\remapXMLsingular [Byte] [C] {\handlePMLunit\Byte} +\remapXMLsingular [Bequerel] [C] {\handlePMLunit\Bequerel} +\remapXMLsingular [Sievert] [C] {\handlePMLunit\Sievert} +\remapXMLsingular [Candela] [C] {\handlePMLunit\Candela} +\remapXMLsingular [Bell] [C] {\handlePMLunit\Bell} +\remapXMLsingular [At] [C] {\handlePMLunit\At} +\remapXMLsingular [Atm] [C] {\handlePMLunit\Atm} +\remapXMLsingular [Bar] [C] {\handlePMLunit\Bar} +\remapXMLsingular [EVolt] [C] {\handlePMLunit\EVolt} +\remapXMLsingular [Foot] [C] {\handlePMLunit\Foot} +\remapXMLsingular [Inch] [C] {\handlePMLunit\Inch} +\remapXMLsingular [Cal] [C] {\handlePMLunit\Cal} +\remapXMLsingular [Force] [C] {\handlePMLunit\Force} +\remapXMLsingular [Lux] [C] {\handlePMLunit\Lux} +\remapXMLsingular [Gray] [C] {\handlePMLunit\Gray} +\remapXMLsingular [Weber] [C] {\handlePMLunit\Weber} +\remapXMLsingular [Henry] [C] {\handlePMLunit\Henry} +\remapXMLsingular [Sterant] [C] {\handlePMLunit\Sterant} +\remapXMLsingular [Angstrom] [C] {\handlePMLunit\Angstrom} +\remapXMLsingular [Gauss] [C] {\handlePMLunit\Gauss} + +\remapXMLsingular [Percent] [C] {\handlePMLunit\Percent} +\remapXMLsingular [Promille] [C] {\handlePMLunit\Promille} +\remapXMLsingular [Permille] [C] {\handlePMLunit\Permille} + +\remapXMLsingular [Unit] [C] {\handlePMLunit\Unit} +\remapXMLsingular [NoUnit] [C] {\handlePMLunit\NoUnit} + +\stopXMLmapping + +\endinput diff --git a/tex/context/base/xtag-pmu.tex b/tex/context/base/xtag-pmu.tex deleted file mode 100644 index b913475f5..000000000 --- a/tex/context/base/xtag-pmu.tex +++ /dev/null @@ -1,188 +0,0 @@ -%D \module -%D [ file=xtag-pmu, -%D version=2001.06.10, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Units, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Units} - -%D Quick and dirty in||line units: -%D -%D \startbuffer -%D -%D 10 -%D -%D -%D \stopbuffer -%D -%D \typebuffer \processXMLbuffer -%D -%D A more \MATHML||like unit application: -%D -%D \startbuffer -%D -%D 10 -%D -%D -%D \stopbuffer -%D -%D \typebuffer \processXMLbuffer -%D -%D A bit more compact: -%D -%D \startbuffer -%D -%D 10 -%D -%D -%D \stopbuffer -%D -%D \typebuffer \processXMLbuffer -%D -%D A bit more complicated: -%D -%D \startbuffer -%D -%D a 10 -%D -%D -%D \stopbuffer -%D -%D \typebuffer \processXMLbuffer -%D -%D An alternative (equivalent) for \type {}: -%D -%D \startbuffer -%D -%D 10 -%D -%D \stopbuffer -%D -%D \typebuffer \processXMLbuffer - -\defineXMLsingular [unitmeaning] [label=] \doPMLunitmeaning - -\def\doPMLunitmeaning - {\expanded{\unitmeaning{\XMLop{label}}}} - -\startXMLmapping [mml] - -\remapXMLsequence [unit] [CPA] \doPMLuseq -\remapXMLsingular [unit] [CPA] \doPMLunit % #2\empty -\remapXMLsequence [cunseq] [CPA] \doPMLuseq % #2 -\remapXMLsequence [cu] [CPA] \doPMLuseq % #2 - -\newif\ifPMLunit \PMLunittrue - -\def\doPMLuseq#1#2{\PMLunittrue\ignorespaces#2\unskip\PMLunitfalse} -\def\doPMLunit#1#2\empty{\ignorespaces#2\unskip} - -\def\handlePMLunit#1{\ifPMLunit\ignorespaces#1\fi\ignorespaces} - -%D All unit commands are remapped in a similar way. - -\remapXMLsingular [Atto] [C] {\handlePMLunit\Atto} -\remapXMLsingular [Femto] [C] {\handlePMLunit\Femto} -\remapXMLsingular [Pico] [C] {\handlePMLunit\Pico} -\remapXMLsingular [Nano] [C] {\handlePMLunit\Nano} -\remapXMLsingular [Micro] [C] {\handlePMLunit\Micro} -\remapXMLsingular [Milli] [C] {\handlePMLunit\Milli} -\remapXMLsingular [Centi] [C] {\handlePMLunit\Centi} -\remapXMLsingular [Deci] [C] {\handlePMLunit\Deci} -\remapXMLsingular [Hecto] [C] {\handlePMLunit\Hecto} -\remapXMLsingular [Kilo] [C] {\handlePMLunit\Kilo} -\remapXMLsingular [Mega] [C] {\handlePMLunit\Mega} -\remapXMLsingular [Giga] [C] {\handlePMLunit\Giga} -\remapXMLsingular [Terra] [C] {\handlePMLunit\Terra} -\remapXMLsingular [Peta] [C] {\handlePMLunit\Peta} -\remapXMLsingular [Exa] [C] {\handlePMLunit\Exa} - -\remapXMLsingular [Times] [C] {\handlePMLunit\Times} -\remapXMLsingular [Solidus] [C] {\handlePMLunit\Solidus} -\remapXMLsingular [Per] [C] {\handlePMLunit\Per} -\remapXMLsingular [OutOf] [C] {\handlePMLunit\OutOf} - -\remapXMLsingular [Linear] [C] {\handlePMLunit\Linear} -\remapXMLsingular [Square] [C] {\handlePMLunit\Square} -\remapXMLsingular [Cubic] [C] {\handlePMLunit\Cubic} - -\remapXMLsingular [Inverse] [C] {\handlePMLunit\Inverse} - -\remapXMLsingular [Degrees] [C] {\handlePMLunit\Degrees} -\remapXMLsingular [Meter] [C] {\handlePMLunit\Meter} -\remapXMLsingular [Liter] [C] {\handlePMLunit\Liter} -\remapXMLsingular [Sec] [C] {\handlePMLunit\Sec} -\remapXMLsingular [Year] [C] {\handlePMLunit\Year} -\remapXMLsingular [Month] [C] {\handlePMLunit\Month} -\remapXMLsingular [Week] [C] {\handlePMLunit\Week} -\remapXMLsingular [Day] [C] {\handlePMLunit\Day} -\remapXMLsingular [Hour] [C] {\handlePMLunit\Hour} -\remapXMLsingular [Min] [C] {\handlePMLunit\Min} -\remapXMLsingular [Second] [C] {\handlePMLunit\Sec} -\remapXMLsingular [Rad] [C] {\handlePMLunit\Rad} -\remapXMLsingular [Deg] [C] {\handlePMLunit\Deg} -\remapXMLsingular [Hertz] [C] {\handlePMLunit\Hertz} -\remapXMLsingular [RevPerSec] [C] {\handlePMLunit\RevPerSec} -\remapXMLsingular [RevPerMin] [C] {\handlePMLunit\RevPerMin} -\remapXMLsingular [Gram] [C] {\handlePMLunit\Gram} -\remapXMLsingular [Atom] [C] {\handlePMLunit\Atom} -\remapXMLsingular [Newton] [C] {\handlePMLunit\Newton} -\remapXMLsingular [Pascal] [C] {\handlePMLunit\Pascal} -\remapXMLsingular [Joule] [C] {\handlePMLunit\Joule} -\remapXMLsingular [Watt] [C] {\handlePMLunit\Watt} -\remapXMLsingular [Celsius] [C] {\handlePMLunit\Celsius} -\remapXMLsingular [Kelvin] [C] {\handlePMLunit\Kelvin} -\remapXMLsingular [Fahrenheit] [C] {\handlePMLunit\Fahrenheit} -\remapXMLsingular [Mol] [C] {\handlePMLunit\Mol} -\remapXMLsingular [Molair] [C] {\handlePMLunit\Molair} -\remapXMLsingular [Equivalent] [C] {\handlePMLunit\Equivalent} -\remapXMLsingular [Farad] [C] {\handlePMLunit\Farad} -\remapXMLsingular [Ohm] [C] {\handlePMLunit\Ohm} -\remapXMLsingular [Siemens] [C] {\handlePMLunit\Siemens} -\remapXMLsingular [Ampere] [C] {\handlePMLunit\Ampere} -\remapXMLsingular [Coulomb] [C] {\handlePMLunit\Coulomb} -\remapXMLsingular [Volt] [C] {\handlePMLunit\Volt} -\remapXMLsingular [eVolt] [C] {\handlePMLunit\eVolt} -\remapXMLsingular [Tesla] [C] {\handlePMLunit\Tesla} -\remapXMLsingular [VoltAC] [C] {\handlePMLunit\VoltAC} -\remapXMLsingular [VoltDC] [C] {\handlePMLunit\VoltDC} -\remapXMLsingular [Baud] [C] {\handlePMLunit\Baud} -\remapXMLsingular [Bit] [C] {\handlePMLunit\Bit} -\remapXMLsingular [Byte] [C] {\handlePMLunit\Byte} -\remapXMLsingular [Bequerel] [C] {\handlePMLunit\Bequerel} -\remapXMLsingular [Sievert] [C] {\handlePMLunit\Sievert} -\remapXMLsingular [Candela] [C] {\handlePMLunit\Candela} -\remapXMLsingular [Bell] [C] {\handlePMLunit\Bell} -\remapXMLsingular [At] [C] {\handlePMLunit\At} -\remapXMLsingular [Atm] [C] {\handlePMLunit\Atm} -\remapXMLsingular [Bar] [C] {\handlePMLunit\Bar} -\remapXMLsingular [EVolt] [C] {\handlePMLunit\EVolt} -\remapXMLsingular [Foot] [C] {\handlePMLunit\Foot} -\remapXMLsingular [Inch] [C] {\handlePMLunit\Inch} -\remapXMLsingular [Cal] [C] {\handlePMLunit\Cal} -\remapXMLsingular [Force] [C] {\handlePMLunit\Force} -\remapXMLsingular [Lux] [C] {\handlePMLunit\Lux} -\remapXMLsingular [Gray] [C] {\handlePMLunit\Gray} -\remapXMLsingular [Weber] [C] {\handlePMLunit\Weber} -\remapXMLsingular [Henry] [C] {\handlePMLunit\Henry} -\remapXMLsingular [Sterant] [C] {\handlePMLunit\Sterant} -\remapXMLsingular [Angstrom] [C] {\handlePMLunit\Angstrom} -\remapXMLsingular [Gauss] [C] {\handlePMLunit\Gauss} - -\remapXMLsingular [Percent] [C] {\handlePMLunit\Percent} -\remapXMLsingular [Promille] [C] {\handlePMLunit\Promille} -\remapXMLsingular [Permille] [C] {\handlePMLunit\Permille} - -\remapXMLsingular [Unit] [C] {\handlePMLunit\Unit} -\remapXMLsingular [NoUnit] [C] {\handlePMLunit\NoUnit} - -\stopXMLmapping - -\endinput diff --git a/tex/context/base/xtag-pre.mkii b/tex/context/base/xtag-pre.mkii new file mode 100644 index 000000000..94a213d94 --- /dev/null +++ b/tex/context/base/xtag-pre.mkii @@ -0,0 +1,435 @@ +%D \module +%D [ file=xtag-pre, +%D version=2000.12.20, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Predefined Things, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Predefined} + +%D Here we predefine some escapes, processing instructions, +%D entities and other handy things. + +\unprotect + +%D Let's get rid of ligatures: + +% \definefonthandling [default] [noligs] + +%D First we define the default error handler. When tracing is +%D activated, the unknown element is showed verbatim. + +\defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement +\defineXMLsingular [\s!default] \defaultXMLelement + +% \def\defaultXMLelement +% {\iftraceXMLelements[\currentXMLfullidentifier]\fi} + +\def\defaultXMLelement + {\iftraceXMLelements{\infofont<\currentXMLfullidentifier>}\fi} + +%D We can use the default handler to implement automatic +%D element hiding. Beware: this overloads the tracer. + +% \def\startXMLignore{\dododefineXMLignore \s!default} +% \def\stopXMLignore {\dododefineXMLprocess\s!default} + +\newcount\xmlignoredepth + +\def\startXMLignore{\ifcase\xmlignoredepth\dododefineXMLignore\s!default\fi\advance\xmlignoredepth\plusone} +\def\stopXMLignore {\advance\xmlignoredepth\minusone\ifcase\xmlignoredepth\dododefineXMLprocess\s!default\fi} + +%D The following entities need to be defined anyway. They +%D may be overloaded later. + +% rest also \letter + +\defineXMLentities [amp] {\letterampersand} {\&} +\defineXMLentities [gt] {\string>} {\mathematics{>}} +\defineXMLentities [lt] {\string<} {\mathematics{<}} +\defineXMLentities [quot] {\string"} {\mathematics{"}} +\defineXMLentities [apos] {\string`} {\mathematics{'}} + +%D Of course we define: + +\defineXMLentities [tex] {tex} {\TeX} +\defineXMLentities [context] {context} {\ConTeXt} +\defineXMLentities [xml] {xml} {XML} +\defineXMLentities [xsd] {xsd} {XSD} +\defineXMLentities [html] {html} {HTML} + +%D The following entities are used for internal purposes and +%D concern characters that are kind of problematic in \TEX\ +%D input. + +\defineXMLentities [tex-hash] {\letterhash} {\#} +\defineXMLentities [tex-dollar] {\letterdollar} {\$} +\defineXMLentities [tex-percent] {\letterpercent} {\%} +\defineXMLentities [tex-backslash] {\letterbackslash} {\texescape} +\defineXMLentities [tex-hat] {\letterhat} {\^{}} +\defineXMLentities [tex-underscore] {\letterunderscore} {\_} +\defineXMLentities [tex-leftbrace] {\letterleftbrace} {\leftargument} +\defineXMLentities [tex-rightbrace] {\letterrightbrace} {\rightargument} +\defineXMLentities [tex-bar] {\letterbar} {\vl} +\defineXMLentities [tex-tilde] {\lettertilde} {\~{}} + +%D Some pretty printing macros will use color, for which we +%D define a dedicated palet here. + +\definepalet + [xtag] + [0=darkgray, 1=darkred, 2=darkgreen, + 3=darkblue, 4=darkcyan, 5=darkmagenta, + 6=darkyellow, 7=black, 8=black] + +%D An example of its usage can be found in the pretty +%D printing macros in the run time module. + +\newif\ifautoXMLshow \autoXMLshowtrue +\newif\ifshowXMLarguments \showXMLargumentstrue + +\def\setupXMLfile{\dodoubleargument\getparameters[\??xf]} + +\setupXMLfile + [\c!inbetween=\blank, + \c!level=1] + +\fetchruntimecommand\showXMLfile {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLbuffer{\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLtext {\f!xtagprefix\s!run} + +\fetchruntimecommand\showXMLign {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLnop {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLtxt {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLpar {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLlin {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLwrd {\f!xtagprefix\s!run} +\fetchruntimecommand\showXMLemp {\f!xtagprefix\s!run} + +\fetchruntimecommand\showXMLbreak {\f!xtagprefix\s!run} + +%D By default, we will ignore escape commands, preceded by +%D \type {}. + +\defineXMLescape [\s!default] {\gobbleuntil{>}} + +%D The comment escape has the form: +%D +%D \starttyping +%D +%D \stoptyping + +\defineXMLescape [--] {\gobbleuntil{-->}} + +%D The \type {CDATA} escape is kind of unique in its +%D strange syntax. +%D +%D \starttyping +%D +%D \stoptyping +%D +%D Watch this rather obscure definition (we need to pass an +%D \type {[} to the macro. + +\chardef\XMLcdatamethod=1 + +\newtoks \everyXMLcdata % \appendtoks \tt \to \everyXMLcdata + +\setvalue{XMLcdatamethod1}% + {\skipfirstverbatimlinefalse + \processtaggeddisplayverbatim{]]>}} + +\setvalue{XMLcdatamethod2}% + {\begingroup + \obeylines + \obeyspaces + \the\everyXMLcdata + \processXMLcdata} + +\long\def\processXMLcdata#1]]>% + {#1\endgroup} + +\defineXMLescape [CDATA] + {\executeifdefined{XMLcdatamethod\number\XMLcdatamethod}{\begingroup\processXMLcdata}} + +%D \starttyping +%D +%D +%D \stoptyping + +\defineXMLescape [ATTLIST]{\gobbleuntil>} +\defineXMLescape [ELEMENT]{\gobbleuntil>} + +%D \starttyping +%D +%D +%D +%D \stoptyping + +\defineXMLescape [ENTITY] \handleXMLentityescape + +\def\handleXMLentityescape#1>% + {\dohandleXMLentityescape#1 @ @ @ @ @ @>} + +\def\dohandleXMLentityescape#1 #2 #3 #4> + {\doifnot{#1}\letterpercent + {\doifelse{#2}{SYSTEM} + {\dohandleXMLentitySYSTEM#1 #2 #3 #4>} + {\dohandleXMLentityDEFINE#1 #2 #3 #4>}}} + +\def\dohandleXMLentitySYSTEM#1 #2 #3 #4 #5 #6>% name SYSTEM .... + {\doifelse{#4}{@} + {\expanded{\defineXMLentity[#1]{\noexpand\readXMLsystem{\unstringed#3}}}} + {\doif{#4}{NDATA} % maybe we should also store the NDATA + {\expanded{\defineXMLentity[#1]{\noexpand\readXMLndata{\unstringed#3}}}}}} + +\def\readXMLsystem#1% + {\readfile{#1} + {\writestatus{xml-system}{reading #1}} + {\writestatus{xml-system}{unable to locate #1}}} + +\def\readXMLndata#1% + {#1} % {\externalfigure[#1]} + +\def\dohandleXMLentityDEFINE#1 %#2 #3 #4 #5 #6>% name replacement + {\def\docommand##1>{\expanded{\defineXMLentity[#1]{\the\scratchtoks}}}% + \afterassignment\docommand\grabstring} + +%D Such entities can be encapsulated in a \type {DOCTYPE} +%D element. Therefore we remove the outer level of document +%D type definitions. +%D +%D \starttyping +%D +%D +%D +%D +%D +%D +%D +%D +%D +%D \stoptyping + +\defineXMLescape [DOCTYPE] \handleXMLdoctype + +\def\handleXMLdoctype + {\let\XMLdoctype\empty + \dohandleXMLdoctype} + +\def\dohandleXMLdoctype + {\futurelet\nexttoken\dohandleXMLdoctok} + +\def\dohandleXMLdoctok + {\ifx\nexttoken>% + % [doctype: \XMLdoctype] + \@EA\gobbleuntil\@EA>% + \else\ifx\nexttoken\blankspace + % [doctype: \XMLdoctype] + \@EAEAEA\dodohandleXMLdoctype + \else + \@EAEAEA\redoXMLdoctype + \fi\fi} + +\def\redoXMLdoctype#1% + {\edef\XMLdoctype{\XMLdoctype#1}\dohandleXMLdoctype} + +\def\dodohandleXMLdoctype#1% + {\executeifdefined{XMLdoctype#1}{\gobbleuntil>}} + +\setvalue{XMLdoctype>}{} +\setvalue{XMLdoctype[}{\processuntil{]>}} % or \gobbleuntil{]>}} + +\def\XMLdoctypeS YSTEM % + {\dowithgrabbedstring\dodohandleXMLdoctype} + +\def\XMLdoctypeP UBLIC % + {\dowithgrabbedstring{\dowithgrabbedstring\dodohandleXMLdoctype}} + +% wrong +% +% \def\XMLdoctypeS YSTEM {\XMLgrabstring} +% \def\XMLdoctypeP UBLIC {\XMLgrabstring} +% +% \def\XMLgrabstring +% {\doifnextcharelse>{\gobbleuntil>}{\dowithgrabbedstring\XMLgrabstring}} + +%D Some day we may need to support entities within a +%D document type namespace. + +%D As an example of processing instructions, we implement a +%D \CONTEXT\ code handler: + +\defineXMLprocessor [context] \contextXMLcommand +\defineXMLprocessor [context-command] \contextXMLcommand + +% we need to get rid of the endlinechar inserted by \scantokens +% +% \def\saveendlinechar% +% {\ifx\restoreendlinechar\undefined +% \edef\restoreendlinechar{\endlinechar\the\endlinechar\space}% +% \fi +% \endlinechar=-1 } +% +% \def\scanXMLtokens#1% +% {\saveendlinechar\scantokens{#1}\restoreendlinechar} + +%D For security reasons, we provide a switch to turn this +%D mechanism on and off. When turned off, there is no way to +%D turn it on from within an \XML\ encoded document, simply +%D because the possibility to process \CONTEXT\ commands is +%D gone. + +\setupXMLprocessing[\c!command=\v!yes] + +%\def\contextXMLcommand#1% +% {\doif\@@xpcommando\v!ja +% {\pushmacro\disableXML +% \def\disableXML{\global\let\afterXMLprocessor\empty}% +% \global\let\afterXMLprocessor\enableXML +% \setnormalcatcodes\scantokens{#1}\afterXMLprocessor +% \popmacro\disableXML}} + +\def\contextXMLcommand#1% we don't use #1 here + {\doif\@@xpcommand\v!yes + {\disableXML\scantokens\@EA{\currentXMLprocess}\enableXML}} + +%D The indirect method (using the macro \type +%D {\currentXMLprocess} instead of \type {#}) is needed +%D because of the \type {\scantokens}. Given the previous +%D definition, and given that \ETEX\ is used, we can now +%D say: +%D +%D \starttyping +%D +%D \stoptyping +%D +%D A non||\ETEX\ solution is also possible, using buffers, +%D but for the moment we assume that \ETEX\ is used. + +%D Next we implement a general purpose directive. This one +%D can be used to set variables that can be accessed with +%D \type {\XMLvar}. + +\defineXMLprocessor [context-directive] \contextXMLdirective + +\def\contextXMLdirective#1% + {\docontextXMLdirective#1 @ @ @\end} + +\def\docontextXMLdirective#1 #2 #3 #4\end % class variable value + {\expandafter\def\csname\@@XMLvariable:#1:#2\endcsname{#3}} + +%D A simple processing instruction is the following. It just +%D writes a message to the screen. + +\defineXMLprocessor [context-message] {\writestatus{xml-message}} + +%D The following processing instruction permits you to tag +%D parts of the file in such a way that you can filter data. +%D We use this method when documenting schemas. + +\defineXMLprocessor [context-block] \handleXMLcontextblock + +\def\handleXMLcontextblock#1% + {\dohandleXMLcontextblock#1 \relax} + +\def\dohandleXMLcontextblock#1 #2 #3\relax + {\dodohandleXMLcontextblock{#1}{#2}} + +\let\dodohandleXMLcontextblock\gobbletwoarguments + +\def\hideXMLcontextblock[#1]% + {\def\dodohandleXMLcontextblock + {\dododohandleXMLcontextblock\doifinset{#1}}} + +\def\videXMLcontextblock[#1]% + {\def\dodohandleXMLcontextblock + {\dododohandleXMLcontextblock\doifnotinset{#1}}} + +\protect + +\def\dododohandleXMLcontextblock#1#2#3#4% + {\let\next\relax + \doifelse{#3}{begin} + {#1{#4}{#2} + {%\writestatus{xml-block}{skipping begin #4}% + \long\def\next##1?context-block end #4 ##2?>{}}} + {\doif{#3}{name} + {#1{#4}{#2} + {%\writestatus{xml-block}{skipping name #4}% + \long\def\next##1?context-block ##2?>{}}}}% + \next} + +\unprotect + +%D Say that a file contains blocks like the following: +%D +%D \starttyping +%D +%D +%D maybe so much +%D +%D +%D \stoptyping +%D +%D The following commands will show only this block: +%D +%D \starttyping +%D \videXMLcontextblock[whatevername] \showXMLfile{yourfile} +%D \stoptyping +%D +%D You can also mark blocks in the following way, thereby +%D saving yourself some work: +%D +%D \starttyping +%D +%D +%D What do you want? +%D +%D +%D +%D How do you want? +%D +%D +%D \stoptyping + +% yet undocumented and experimental + +% \defineXMLprocessor [context-eof] {\endinput} + +% already defined in xtag-ini + +% \defineXMLsingular [begingroup] {\begingroup} +% \defineXMLsingular [endgroup] {\endgroup} +% +% \defineXMLsingular [gobblespacetokens] {\gobblespacetokens} + +%D We automatically switch regimes (beware of nested files!): +%D +%D \starttyping +%D \startXMLdata +%D +%D ÀÁÂÃÄÅàáâãäåÆÇæç +%D ÈÉÊËèéêëÌÍÎÏÞìíîïþ +%D ÐðÑñÒÓÔÕÖòóôõöØø +%D ÙÚÛÜùúûÝýÿß +%D \stopXMLdata +%D \stoptyping + +\defineXMLprocessor [xml] {\handleXMLbanner} + +\def\handleXMLbanner#1% + {\getXMLarguments{xml}{\s!encoding='' #1}% + \doifsomething{\XMLpar{xml}\s!encoding\empty} + {\doif\currentregime\s!default % style regimes will take precedence + {\enableregime[\XMLpar{xml}\s!encoding\empty]}\donothing}} + +\protect \endinput diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex deleted file mode 100644 index 94a213d94..000000000 --- a/tex/context/base/xtag-pre.tex +++ /dev/null @@ -1,435 +0,0 @@ -%D \module -%D [ file=xtag-pre, -%D version=2000.12.20, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Predefined Things, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Predefined} - -%D Here we predefine some escapes, processing instructions, -%D entities and other handy things. - -\unprotect - -%D Let's get rid of ligatures: - -% \definefonthandling [default] [noligs] - -%D First we define the default error handler. When tracing is -%D activated, the unknown element is showed verbatim. - -\defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement -\defineXMLsingular [\s!default] \defaultXMLelement - -% \def\defaultXMLelement -% {\iftraceXMLelements[\currentXMLfullidentifier]\fi} - -\def\defaultXMLelement - {\iftraceXMLelements{\infofont<\currentXMLfullidentifier>}\fi} - -%D We can use the default handler to implement automatic -%D element hiding. Beware: this overloads the tracer. - -% \def\startXMLignore{\dododefineXMLignore \s!default} -% \def\stopXMLignore {\dododefineXMLprocess\s!default} - -\newcount\xmlignoredepth - -\def\startXMLignore{\ifcase\xmlignoredepth\dododefineXMLignore\s!default\fi\advance\xmlignoredepth\plusone} -\def\stopXMLignore {\advance\xmlignoredepth\minusone\ifcase\xmlignoredepth\dododefineXMLprocess\s!default\fi} - -%D The following entities need to be defined anyway. They -%D may be overloaded later. - -% rest also \letter - -\defineXMLentities [amp] {\letterampersand} {\&} -\defineXMLentities [gt] {\string>} {\mathematics{>}} -\defineXMLentities [lt] {\string<} {\mathematics{<}} -\defineXMLentities [quot] {\string"} {\mathematics{"}} -\defineXMLentities [apos] {\string`} {\mathematics{'}} - -%D Of course we define: - -\defineXMLentities [tex] {tex} {\TeX} -\defineXMLentities [context] {context} {\ConTeXt} -\defineXMLentities [xml] {xml} {XML} -\defineXMLentities [xsd] {xsd} {XSD} -\defineXMLentities [html] {html} {HTML} - -%D The following entities are used for internal purposes and -%D concern characters that are kind of problematic in \TEX\ -%D input. - -\defineXMLentities [tex-hash] {\letterhash} {\#} -\defineXMLentities [tex-dollar] {\letterdollar} {\$} -\defineXMLentities [tex-percent] {\letterpercent} {\%} -\defineXMLentities [tex-backslash] {\letterbackslash} {\texescape} -\defineXMLentities [tex-hat] {\letterhat} {\^{}} -\defineXMLentities [tex-underscore] {\letterunderscore} {\_} -\defineXMLentities [tex-leftbrace] {\letterleftbrace} {\leftargument} -\defineXMLentities [tex-rightbrace] {\letterrightbrace} {\rightargument} -\defineXMLentities [tex-bar] {\letterbar} {\vl} -\defineXMLentities [tex-tilde] {\lettertilde} {\~{}} - -%D Some pretty printing macros will use color, for which we -%D define a dedicated palet here. - -\definepalet - [xtag] - [0=darkgray, 1=darkred, 2=darkgreen, - 3=darkblue, 4=darkcyan, 5=darkmagenta, - 6=darkyellow, 7=black, 8=black] - -%D An example of its usage can be found in the pretty -%D printing macros in the run time module. - -\newif\ifautoXMLshow \autoXMLshowtrue -\newif\ifshowXMLarguments \showXMLargumentstrue - -\def\setupXMLfile{\dodoubleargument\getparameters[\??xf]} - -\setupXMLfile - [\c!inbetween=\blank, - \c!level=1] - -\fetchruntimecommand\showXMLfile {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLbuffer{\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLtext {\f!xtagprefix\s!run} - -\fetchruntimecommand\showXMLign {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLnop {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLtxt {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLpar {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLlin {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLwrd {\f!xtagprefix\s!run} -\fetchruntimecommand\showXMLemp {\f!xtagprefix\s!run} - -\fetchruntimecommand\showXMLbreak {\f!xtagprefix\s!run} - -%D By default, we will ignore escape commands, preceded by -%D \type {}. - -\defineXMLescape [\s!default] {\gobbleuntil{>}} - -%D The comment escape has the form: -%D -%D \starttyping -%D -%D \stoptyping - -\defineXMLescape [--] {\gobbleuntil{-->}} - -%D The \type {CDATA} escape is kind of unique in its -%D strange syntax. -%D -%D \starttyping -%D -%D \stoptyping -%D -%D Watch this rather obscure definition (we need to pass an -%D \type {[} to the macro. - -\chardef\XMLcdatamethod=1 - -\newtoks \everyXMLcdata % \appendtoks \tt \to \everyXMLcdata - -\setvalue{XMLcdatamethod1}% - {\skipfirstverbatimlinefalse - \processtaggeddisplayverbatim{]]>}} - -\setvalue{XMLcdatamethod2}% - {\begingroup - \obeylines - \obeyspaces - \the\everyXMLcdata - \processXMLcdata} - -\long\def\processXMLcdata#1]]>% - {#1\endgroup} - -\defineXMLescape [CDATA] - {\executeifdefined{XMLcdatamethod\number\XMLcdatamethod}{\begingroup\processXMLcdata}} - -%D \starttyping -%D -%D -%D \stoptyping - -\defineXMLescape [ATTLIST]{\gobbleuntil>} -\defineXMLescape [ELEMENT]{\gobbleuntil>} - -%D \starttyping -%D -%D -%D -%D \stoptyping - -\defineXMLescape [ENTITY] \handleXMLentityescape - -\def\handleXMLentityescape#1>% - {\dohandleXMLentityescape#1 @ @ @ @ @ @>} - -\def\dohandleXMLentityescape#1 #2 #3 #4> - {\doifnot{#1}\letterpercent - {\doifelse{#2}{SYSTEM} - {\dohandleXMLentitySYSTEM#1 #2 #3 #4>} - {\dohandleXMLentityDEFINE#1 #2 #3 #4>}}} - -\def\dohandleXMLentitySYSTEM#1 #2 #3 #4 #5 #6>% name SYSTEM .... - {\doifelse{#4}{@} - {\expanded{\defineXMLentity[#1]{\noexpand\readXMLsystem{\unstringed#3}}}} - {\doif{#4}{NDATA} % maybe we should also store the NDATA - {\expanded{\defineXMLentity[#1]{\noexpand\readXMLndata{\unstringed#3}}}}}} - -\def\readXMLsystem#1% - {\readfile{#1} - {\writestatus{xml-system}{reading #1}} - {\writestatus{xml-system}{unable to locate #1}}} - -\def\readXMLndata#1% - {#1} % {\externalfigure[#1]} - -\def\dohandleXMLentityDEFINE#1 %#2 #3 #4 #5 #6>% name replacement - {\def\docommand##1>{\expanded{\defineXMLentity[#1]{\the\scratchtoks}}}% - \afterassignment\docommand\grabstring} - -%D Such entities can be encapsulated in a \type {DOCTYPE} -%D element. Therefore we remove the outer level of document -%D type definitions. -%D -%D \starttyping -%D -%D -%D -%D -%D -%D -%D -%D -%D -%D \stoptyping - -\defineXMLescape [DOCTYPE] \handleXMLdoctype - -\def\handleXMLdoctype - {\let\XMLdoctype\empty - \dohandleXMLdoctype} - -\def\dohandleXMLdoctype - {\futurelet\nexttoken\dohandleXMLdoctok} - -\def\dohandleXMLdoctok - {\ifx\nexttoken>% - % [doctype: \XMLdoctype] - \@EA\gobbleuntil\@EA>% - \else\ifx\nexttoken\blankspace - % [doctype: \XMLdoctype] - \@EAEAEA\dodohandleXMLdoctype - \else - \@EAEAEA\redoXMLdoctype - \fi\fi} - -\def\redoXMLdoctype#1% - {\edef\XMLdoctype{\XMLdoctype#1}\dohandleXMLdoctype} - -\def\dodohandleXMLdoctype#1% - {\executeifdefined{XMLdoctype#1}{\gobbleuntil>}} - -\setvalue{XMLdoctype>}{} -\setvalue{XMLdoctype[}{\processuntil{]>}} % or \gobbleuntil{]>}} - -\def\XMLdoctypeS YSTEM % - {\dowithgrabbedstring\dodohandleXMLdoctype} - -\def\XMLdoctypeP UBLIC % - {\dowithgrabbedstring{\dowithgrabbedstring\dodohandleXMLdoctype}} - -% wrong -% -% \def\XMLdoctypeS YSTEM {\XMLgrabstring} -% \def\XMLdoctypeP UBLIC {\XMLgrabstring} -% -% \def\XMLgrabstring -% {\doifnextcharelse>{\gobbleuntil>}{\dowithgrabbedstring\XMLgrabstring}} - -%D Some day we may need to support entities within a -%D document type namespace. - -%D As an example of processing instructions, we implement a -%D \CONTEXT\ code handler: - -\defineXMLprocessor [context] \contextXMLcommand -\defineXMLprocessor [context-command] \contextXMLcommand - -% we need to get rid of the endlinechar inserted by \scantokens -% -% \def\saveendlinechar% -% {\ifx\restoreendlinechar\undefined -% \edef\restoreendlinechar{\endlinechar\the\endlinechar\space}% -% \fi -% \endlinechar=-1 } -% -% \def\scanXMLtokens#1% -% {\saveendlinechar\scantokens{#1}\restoreendlinechar} - -%D For security reasons, we provide a switch to turn this -%D mechanism on and off. When turned off, there is no way to -%D turn it on from within an \XML\ encoded document, simply -%D because the possibility to process \CONTEXT\ commands is -%D gone. - -\setupXMLprocessing[\c!command=\v!yes] - -%\def\contextXMLcommand#1% -% {\doif\@@xpcommando\v!ja -% {\pushmacro\disableXML -% \def\disableXML{\global\let\afterXMLprocessor\empty}% -% \global\let\afterXMLprocessor\enableXML -% \setnormalcatcodes\scantokens{#1}\afterXMLprocessor -% \popmacro\disableXML}} - -\def\contextXMLcommand#1% we don't use #1 here - {\doif\@@xpcommand\v!yes - {\disableXML\scantokens\@EA{\currentXMLprocess}\enableXML}} - -%D The indirect method (using the macro \type -%D {\currentXMLprocess} instead of \type {#}) is needed -%D because of the \type {\scantokens}. Given the previous -%D definition, and given that \ETEX\ is used, we can now -%D say: -%D -%D \starttyping -%D -%D \stoptyping -%D -%D A non||\ETEX\ solution is also possible, using buffers, -%D but for the moment we assume that \ETEX\ is used. - -%D Next we implement a general purpose directive. This one -%D can be used to set variables that can be accessed with -%D \type {\XMLvar}. - -\defineXMLprocessor [context-directive] \contextXMLdirective - -\def\contextXMLdirective#1% - {\docontextXMLdirective#1 @ @ @\end} - -\def\docontextXMLdirective#1 #2 #3 #4\end % class variable value - {\expandafter\def\csname\@@XMLvariable:#1:#2\endcsname{#3}} - -%D A simple processing instruction is the following. It just -%D writes a message to the screen. - -\defineXMLprocessor [context-message] {\writestatus{xml-message}} - -%D The following processing instruction permits you to tag -%D parts of the file in such a way that you can filter data. -%D We use this method when documenting schemas. - -\defineXMLprocessor [context-block] \handleXMLcontextblock - -\def\handleXMLcontextblock#1% - {\dohandleXMLcontextblock#1 \relax} - -\def\dohandleXMLcontextblock#1 #2 #3\relax - {\dodohandleXMLcontextblock{#1}{#2}} - -\let\dodohandleXMLcontextblock\gobbletwoarguments - -\def\hideXMLcontextblock[#1]% - {\def\dodohandleXMLcontextblock - {\dododohandleXMLcontextblock\doifinset{#1}}} - -\def\videXMLcontextblock[#1]% - {\def\dodohandleXMLcontextblock - {\dododohandleXMLcontextblock\doifnotinset{#1}}} - -\protect - -\def\dododohandleXMLcontextblock#1#2#3#4% - {\let\next\relax - \doifelse{#3}{begin} - {#1{#4}{#2} - {%\writestatus{xml-block}{skipping begin #4}% - \long\def\next##1?context-block end #4 ##2?>{}}} - {\doif{#3}{name} - {#1{#4}{#2} - {%\writestatus{xml-block}{skipping name #4}% - \long\def\next##1?context-block ##2?>{}}}}% - \next} - -\unprotect - -%D Say that a file contains blocks like the following: -%D -%D \starttyping -%D -%D -%D maybe so much -%D -%D -%D \stoptyping -%D -%D The following commands will show only this block: -%D -%D \starttyping -%D \videXMLcontextblock[whatevername] \showXMLfile{yourfile} -%D \stoptyping -%D -%D You can also mark blocks in the following way, thereby -%D saving yourself some work: -%D -%D \starttyping -%D -%D -%D What do you want? -%D -%D -%D -%D How do you want? -%D -%D -%D \stoptyping - -% yet undocumented and experimental - -% \defineXMLprocessor [context-eof] {\endinput} - -% already defined in xtag-ini - -% \defineXMLsingular [begingroup] {\begingroup} -% \defineXMLsingular [endgroup] {\endgroup} -% -% \defineXMLsingular [gobblespacetokens] {\gobblespacetokens} - -%D We automatically switch regimes (beware of nested files!): -%D -%D \starttyping -%D \startXMLdata -%D -%D ÀÁÂÃÄÅàáâãäåÆÇæç -%D ÈÉÊËèéêëÌÍÎÏÞìíîïþ -%D ÐðÑñÒÓÔÕÖòóôõöØø -%D ÙÚÛÜùúûÝýÿß -%D \stopXMLdata -%D \stoptyping - -\defineXMLprocessor [xml] {\handleXMLbanner} - -\def\handleXMLbanner#1% - {\getXMLarguments{xml}{\s!encoding='' #1}% - \doifsomething{\XMLpar{xml}\s!encoding\empty} - {\doif\currentregime\s!default % style regimes will take precedence - {\enableregime[\XMLpar{xml}\s!encoding\empty]}\donothing}} - -\protect \endinput diff --git a/tex/context/base/xtag-prs.mkii b/tex/context/base/xtag-prs.mkii new file mode 100644 index 000000000..02bdcf21c --- /dev/null +++ b/tex/context/base/xtag-prs.mkii @@ -0,0 +1,42 @@ +%D \module +%D [ file=xtag-prs, +%D version=2004.08.18, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Parsing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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\analyzefunction#1% + {\expanded{\doanalyzefunction#1\relax\relax(#1)}\empty\relax\end} + +\def\doanalyzefunction#1#2(#3)#4\relax#5\end + {\ifx#4\empty + \let\functionname\empty + \else + \def\functionname{#1#2}% + \fi + \getfunctionargs#3,\empty,\empty,\empty,\empty,\empty,\empty,\empty,\empty\relax} + +\def\getfunctionargs#1,#2,#3,#4,#5,#6,#7,#8,#9\relax + {\edef\functionA{#1}\edef\functionB{#2}% + \edef\functionC{#3}\edef\functionD{#4}% + \edef\functionE{#5}\edef\functionF{#6}% + \edef\functionG{#7}\edef\functionH{#8}} + +% \analyzefunction{x} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf +% \analyzefunction{sin(x)} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf +% \analyzefunction{1pt,2pt,3pt,4pt} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf +% \analyzefunction{rect(1pt,2pt,3pt,4pt)} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf +% \analyzefunction{1pt,2pt,3pt,4pt,5pt,6pt,7pt,8pt} [\functionname][e:\functionE/f:\functionF/g:\functionG/h:\functionH] \endgraf +% \analyzefunction{rect(1pt,2pt,3pt,4pt,5pt,6pt,7pt,8pt)} [\functionname][e:\functionE/f:\functionF/g:\functionG/h:\functionH] \endgraf + +% todo [#1][settings][maxwidth,maxheight,method=] with method=x y xy [1] + +\protect \endinput diff --git a/tex/context/base/xtag-prs.tex b/tex/context/base/xtag-prs.tex deleted file mode 100644 index 02bdcf21c..000000000 --- a/tex/context/base/xtag-prs.tex +++ /dev/null @@ -1,42 +0,0 @@ -%D \module -%D [ file=xtag-prs, -%D version=2004.08.18, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Parsing, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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\analyzefunction#1% - {\expanded{\doanalyzefunction#1\relax\relax(#1)}\empty\relax\end} - -\def\doanalyzefunction#1#2(#3)#4\relax#5\end - {\ifx#4\empty - \let\functionname\empty - \else - \def\functionname{#1#2}% - \fi - \getfunctionargs#3,\empty,\empty,\empty,\empty,\empty,\empty,\empty,\empty\relax} - -\def\getfunctionargs#1,#2,#3,#4,#5,#6,#7,#8,#9\relax - {\edef\functionA{#1}\edef\functionB{#2}% - \edef\functionC{#3}\edef\functionD{#4}% - \edef\functionE{#5}\edef\functionF{#6}% - \edef\functionG{#7}\edef\functionH{#8}} - -% \analyzefunction{x} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf -% \analyzefunction{sin(x)} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf -% \analyzefunction{1pt,2pt,3pt,4pt} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf -% \analyzefunction{rect(1pt,2pt,3pt,4pt)} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf -% \analyzefunction{1pt,2pt,3pt,4pt,5pt,6pt,7pt,8pt} [\functionname][e:\functionE/f:\functionF/g:\functionG/h:\functionH] \endgraf -% \analyzefunction{rect(1pt,2pt,3pt,4pt,5pt,6pt,7pt,8pt)} [\functionname][e:\functionE/f:\functionF/g:\functionG/h:\functionH] \endgraf - -% todo [#1][settings][maxwidth,maxheight,method=] with method=x y xy [1] - -\protect \endinput diff --git a/tex/context/base/xtag-raw.mkii b/tex/context/base/xtag-raw.mkii new file mode 100644 index 000000000..e6dfdea41 --- /dev/null +++ b/tex/context/base/xtag-raw.mkii @@ -0,0 +1,37 @@ +%D \module +%D [ file=xtag-raw, +%D version=2002.03.21, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Raw Specials, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Raw Specials} + +%D Some day this module will be obsolete. + +\defineXMLentity [tex-hash] {\letterhash} +\defineXMLentity [tex-dollar] {\letterdollar} +\defineXMLentity [tex-percent] {\letterpercent} +\defineXMLentity [tex-backslash] {\letterbackslash} +\defineXMLentity [tex-hat] {\letterhat} +\defineXMLentity [tex-underscore] {\letterunderscore} +\defineXMLentity [tex-leftbrace] {\letterbgroup} +\defineXMLentity [tex-rightbrace] {\letteregroup} +\defineXMLentity [tex-bar] {\letterbar} +\defineXMLentity [tex-tilde] {\lettertilde} + +\endinput + +\defineXMLsingular[test][oeps=,whow=,hm=] +% {\tttf \input \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]} + {\tttf \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]} + +\startXMLdata + +\stopXMLdata diff --git a/tex/context/base/xtag-raw.tex b/tex/context/base/xtag-raw.tex deleted file mode 100644 index e6dfdea41..000000000 --- a/tex/context/base/xtag-raw.tex +++ /dev/null @@ -1,37 +0,0 @@ -%D \module -%D [ file=xtag-raw, -%D version=2002.03.21, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Raw Specials, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Raw Specials} - -%D Some day this module will be obsolete. - -\defineXMLentity [tex-hash] {\letterhash} -\defineXMLentity [tex-dollar] {\letterdollar} -\defineXMLentity [tex-percent] {\letterpercent} -\defineXMLentity [tex-backslash] {\letterbackslash} -\defineXMLentity [tex-hat] {\letterhat} -\defineXMLentity [tex-underscore] {\letterunderscore} -\defineXMLentity [tex-leftbrace] {\letterbgroup} -\defineXMLentity [tex-rightbrace] {\letteregroup} -\defineXMLentity [tex-bar] {\letterbar} -\defineXMLentity [tex-tilde] {\lettertilde} - -\endinput - -\defineXMLsingular[test][oeps=,whow=,hm=] -% {\tttf \input \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]} - {\tttf \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]} - -\startXMLdata - -\stopXMLdata diff --git a/tex/context/base/xtag-rng.mkii b/tex/context/base/xtag-rng.mkii new file mode 100644 index 000000000..254282424 --- /dev/null +++ b/tex/context/base/xtag-rng.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=xtag-rng, +%D version=2002.10.29, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Relax NG, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 The following commands picks up a named block from the +%D given file and pretty prints it. +%D +%D \starttyping +%D \showRNGcomponent [eximple.rng] [request] +%D \stoptyping +%D +%D If needed, you adapt the colors used by redefining the +%D \type {xtag} color palet. + +\fetchruntimecommand\showRNGcomponent {\f!xtagprefix\s!run} + +\protect \endinput diff --git a/tex/context/base/xtag-rng.tex b/tex/context/base/xtag-rng.tex deleted file mode 100644 index 254282424..000000000 --- a/tex/context/base/xtag-rng.tex +++ /dev/null @@ -1,28 +0,0 @@ -%D \module -%D [ file=xtag-rng, -%D version=2002.10.29, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Relax NG, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 The following commands picks up a named block from the -%D given file and pretty prints it. -%D -%D \starttyping -%D \showRNGcomponent [eximple.rng] [request] -%D \stoptyping -%D -%D If needed, you adapt the colors used by redefining the -%D \type {xtag} color palet. - -\fetchruntimecommand\showRNGcomponent {\f!xtagprefix\s!run} - -\protect \endinput diff --git a/tex/context/base/xtag-run.mkii b/tex/context/base/xtag-run.mkii new file mode 100644 index 000000000..035268104 --- /dev/null +++ b/tex/context/base/xtag-run.mkii @@ -0,0 +1,319 @@ +%D \module +%D [ file=xtag-run, +%D version=2001.01.10, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Visualization, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% TODO: make this mkiv compliant, catcode tables etc + +\writestatus{loading}{ConTeXt XML Macros / Visualization} + +\unprotect + +\bgroup + +\catcode`\.=\@@escape +.catcode`.B=.@@begingroup +.catcode`.E=.@@endgroup +.catcode`.#=.@@active +.catcode`.$=.@@active +.catcode`.%=.@@active +.catcode`.\=.@@active +.catcode`.^=.@@active +.catcode`._=.@@active +.catcode`.{=.@@active +.catcode`.}=.@@active +.catcode`.|=.@@active +.catcode`.~=.@@active + +.gdef.verbatimXML + B.catcode`.#=.@@active .let#.letterhash + .catcode`.$=.@@active .let$.dollar + .catcode`.%=.@@active .let%.percent + .catcode`.\=.@@active .let\.letterbackslash + .catcode`.^=.@@active .let^.letterhat + .catcode`._=.@@active .let_.letterunderscore + .catcode`.{=.@@active .let{.leftargument + .catcode`.}=.@@active .let}.rightargument + .catcode`.|=.@@active .let|.letterbar + .catcode`.~=.@@active .let~.lettertilde + E + +.egroup + +\gdef\@@XMLshow{\@@XML shw} + +\gdef\@XMLindent#1% + {\ifnum\XMLlevel>\plusone\advance\leftskip#11em\relax\fi} + +\gdef\@XMLlevel#1% + {\advance\XMLlevel#11\relax} + +\unexpanded\gdef\@XMLentity#1% + {\noindent\hbox{\localcolortrue\color[xtag:0]{\string}}} + +\bgroup + +\@EA\catcode\string`=\@@active +\@EA\catcode\string`"\@@active +\@EA\catcode\string``\@@active +\@EA\catcode\string`&\@@active + +\gdef\doshowXMLargument#1#2#3#4% + {\hskip\zeropoint % or maybe \allowbreak + \string#1\color[xtag:#3]{#4}\string#2}% + +\gdef\showXMLarguments + {\hskip\zeropoint % or maybe \allowbreak + \ifshowXMLarguments + \bgroup + \@EA\catcode\string`=\@@active + \@EA\catcode\string`"\@@active + \@EA\catcode\string``\@@active + \@EA\catcode\string`&\@@active + \def={\color[xtag:7]{\string=}}% + \def"##1"{\doshowXMLargument""8{##1}}% + \def`##1`{\doshowXMLargument``8{##1}}% + \def&##1;{\doshowXMLargument&;7{##1}}% + \scantokens\@EA{\currentXMLarguments}% + \egroup + \else + \currentXMLarguments + \fi} + +\egroup + +\ifx\XMLprettycycle\undefined \gdef\XMLprettycycle{3} \fi + +\doglobal\newcounter\@XMLnofelements +\doglobal\newif\ifXMLunspacepretty + +\gdef\@XMLelement#1% + {\ifnum\XMLlevel<\@@xflevel\relax + \ifnum\kindofXMLelement=2\else + \doglobal\increment\@XMLnofelements\relax + \ifcase\@XMLnofelements\else\@@xfinbetween\fi + \fi + \fi + % no, too fragile: +% \ifnum\XMLlevel>1\hangindent2em\fi + \ifcase\kindofXMLelement\or\or + \getvalue{\@@XMLshow::\currentXMLelement}\relax + \fi + \dontleavehmode % \indent + \bgroup + % \localcolortrue + \advance\XMLlevel \minusone + \DoMod\XMLlevel by\XMLprettycycle to\scratchcounter + \advance\scratchcounter \plusone + \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]% + \ifXMLunspacepretty\unskip\fi + \string<% + \ifnum\kindofXMLelement=2\string/\fi + \currentXMLelement + \stopcolor + \ifcase#1\or + \cleanupXMLarguments % get rid of spurious end space and end / + \ifx\currentXMLarguments\empty\else + \setbox\scratchbox\hbox{\space}\hskip\wd\scratchbox % hm, slow + \startcolor[xtag:0]\showXMLarguments\unskip\stopcolor\unskip + \fi + \fi + \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]% + \ifnum\kindofXMLelement=3\string/\fi + \string>% + \stopcolor + \egroup + \ifcase\kindofXMLelement\or + \getvalue{\@@XMLshow::\currentXMLelement}\relax + \fi + \ifnum\XMLlevel<\@@xflevel\relax + \ifnum\kindofXMLelement=1\else + \doglobal\increment\@XMLnofelements\relax + \ifcase\@XMLnofelements\else\@@xfinbetween\fi + \fi + \fi + \ifXMLunspacepretty\ignorespaces\fi} + +\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par} +\gdef\prevXMLtext{\par\@XMLelement0\par\@XMLlevel-\blank} +\gdef\nextXMLpara{\nextXMLline\par} +\gdef\prevXMLpara{\par\prevXMLline} +\gdef\nextXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1} +\gdef\prevXMLline{\@XMLelement0\par\@XMLindent-\@XMLlevel-} +\gdef\nextXMLword{\@XMLlevel+\@XMLelement1} +\gdef\prevXMLword{\@XMLelement0\@XMLlevel-} + +\gdef\someXMLtext{\blank\@XMLlevel+\@XMLelement1\@XMLlevel-\blank} +\gdef\someXMLpara{\someXMLline} +\gdef\someXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1\par\@XMLindent-\@XMLlevel-} +\gdef\someXMLword{\@XMLlevel+\@XMLelement1\@XMLlevel-} + +\gdef\@XMLindent#1% + {\ifnum\XMLlevel>\zerocount + \advance\leftskip#11em\relax + \fi} + +\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par\@XMLindent+} +\gdef\prevXMLtext{\par\@XMLindent-\@XMLelement0\par\@XMLlevel-\blank} +\gdef\nextXMLpara{\nextXMLline\par\@XMLindent+} +\gdef\prevXMLpara{\par\@XMLindent-\prevXMLline} +\gdef\nextXMLline{\par\@XMLlevel+\@XMLelement1} +\gdef\prevXMLline{\@XMLelement0\par\@XMLlevel-} + +\gdef\someXMLline{\par\@XMLlevel+\@XMLelement1\par\@XMLlevel-} + +\gdef\setXMLshow#1#2#3[#4]% + {\def\docommand##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}% + \processcommalist[#4]\docommand} + +\gdef\showXMLign[#1]% + {\setXMLshow\defineXMLignore \relax\relax[#1]% + \setXMLshow\defineXMLsingular \relax\relax[#1]} + +\gdef\showXMLnop[#1]% + {\setXMLshow\defineXMLenvironment\relax\relax[#1]% + \setXMLshow\defineXMLsingular \relax\relax[#1]} + +\gdef\showXMLtxt[#1]% + {\setXMLshow\defineXMLenvironment\nextXMLtext\prevXMLtext[#1]% + \setXMLshow\defineXMLsingular \someXMLtext\relax [#1]} + +\gdef\showXMLpar[#1]% + {\setXMLshow\defineXMLenvironment\nextXMLpara\prevXMLpara[#1]% + \setXMLshow\defineXMLsingular \someXMLline\relax [#1]} + +\gdef\showXMLlin[#1]% + {\setXMLshow\defineXMLenvironment\nextXMLline\prevXMLline[#1]% + \setXMLshow\defineXMLsingular \someXMLword\relax [#1]} + +\gdef\showXMLwrd[#1]% + {\setXMLshow\defineXMLenvironment\nextXMLword\prevXMLword[#1]% + \setXMLshow\defineXMLsingular \someXMLword\relax [#1]} + +\gdef\showXMLemp[#1]% + {\setXMLshow\defineXMLsingular\someXMLword\relax[#1]} + +\gdef\showXMLbreak[#1]% + {\def\docommand##1{\setvalue{\@@XMLshow::##1}{\hskip\zeropoint}}% + \processcommalist[#1]\docommand} + +\gdef\doautoshowXMLelement + {\ifcase\kindofXMLelement + \or \nextXMLpara \or \prevXMLpara \or \someXMLline + \fi} + +\gdef\autoshowXMLelement + {\ifcsname\@@XMLshow:\currentXMLelement\endcsname + \expandafter\normalexecuteXMLelement + \else + \expandafter\doautoshowXMLelement + \fi} + +\global\let\normalexecuteXMLelement\executeXMLelement + +\gdef\showXMLfile#1% + {\bgroup + % temp hack, will be the normal definition + \long\def\docleanupXMLarguments##1/ ##2\relax{\def\currentXMLarguments{##1}}% + % so far for hack + \nohyphens + \dontcomplain + \XMLlevel\zerocount + \increment\@@xflevel % hack + \tttf + \startpacked[\v!blank] + \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi + \let\executeXMLentity\@XMLentity + \enableXML\verbatimXML + \enableregime[utf]% + \utfunicodetracer\pluseight + \veryraggedright + \readfile{\truefilename{#1}}\donothing\donothing\endgraf + \removelastskip % really needed + \stoppacked + \egroup} + +\gdef\showXMLtext#1% + {\bgroup + % temp hack, will be the normal definition + \long\def\docleanupXMLarguments##1/ ##2\relax{\def\currentXMLarguments{##1}}% + % so far for hack + \dontcomplain + \XMLlevel\maxcard + \increment\@@xflevel % hack + \tttf + \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi + \let\executeXMLentity\@XMLentity + \let\par\allowbreak\let\endgraf\par + \setbox\scratchbox\hbox + {\enableXML\verbatimXML\scantokens{#1}\removelastskip}% + \unhbox\scratchbox + \egroup} + +\gdef\showXMLbuffer + {\dosingleempty\doshowXMLbuffer} + +\gdef\doshowXMLbuffer[#1]% + {\doifelsenothing{#1} + {\doshowXMLbuffer[\jobname]} + {\bgroup + \def\dodoprocessXMLbuffer##1{\showXMLfile{\TEXbufferfile{##1}}}% + \processcommalist[#1]\dodoprocessXMLbuffer + \egroup}} + +%D + +\gdef\showXSDcomponent + {\dodoubleargument\doshowXSDcomponent} + +\gdef\doshowXSDcomponent[#1][#2]% + {\bgroup + \showXMLnop[xsd:schema] + \showXMLign[xsd:appInfo] + \showXMLign[xsd:annotation] + \videXMLcontextblock[#2] + \showXMLfile{#1} + \egroup} + +\gdef\showRNGcomponent + {\dodoubleargument\doshowRNGcomponent} + +\gdef\doshowRNGcomponent[#1][#2]% + {\bgroup + \videXMLcontextblock[#2] + \showXMLfile{#1} + \egroup} + +%D + +\gdef\tracebackXMLattribute#1% + {\bgroup + \doloop + {\ifcsname\@@XMLdepth:\recurselevel\endcsname + \edef\!!stringa{\csname\@@XMLdepth:\recurselevel\endcsname}% + \writestatus + {XML TRACE} + {[#1] [\recurselevel] [\!!stringa] [\XMLinh{#1}]}% + \else + \exitloop + \fi}% + \egroup} + +\gdef\showXMLinh[#1]% + {\doifsomething{#1} + {\bgroup\infofont[% + \dorecurse\XMLdepth +% {\csname\@@XMLvariable:\csname\@@XMLdepth:\recurselevel\endcsname:#1\endcsname + {\csname\@@XMLvariable:\recurselevel:#1\endcsname + \ifnum\recurselevel<\XMLdepth->\fi}% + ]\egroup}} + +\protect \endinput diff --git a/tex/context/base/xtag-run.tex b/tex/context/base/xtag-run.tex deleted file mode 100644 index 035268104..000000000 --- a/tex/context/base/xtag-run.tex +++ /dev/null @@ -1,319 +0,0 @@ -%D \module -%D [ file=xtag-run, -%D version=2001.01.10, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Visualization, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -% TODO: make this mkiv compliant, catcode tables etc - -\writestatus{loading}{ConTeXt XML Macros / Visualization} - -\unprotect - -\bgroup - -\catcode`\.=\@@escape -.catcode`.B=.@@begingroup -.catcode`.E=.@@endgroup -.catcode`.#=.@@active -.catcode`.$=.@@active -.catcode`.%=.@@active -.catcode`.\=.@@active -.catcode`.^=.@@active -.catcode`._=.@@active -.catcode`.{=.@@active -.catcode`.}=.@@active -.catcode`.|=.@@active -.catcode`.~=.@@active - -.gdef.verbatimXML - B.catcode`.#=.@@active .let#.letterhash - .catcode`.$=.@@active .let$.dollar - .catcode`.%=.@@active .let%.percent - .catcode`.\=.@@active .let\.letterbackslash - .catcode`.^=.@@active .let^.letterhat - .catcode`._=.@@active .let_.letterunderscore - .catcode`.{=.@@active .let{.leftargument - .catcode`.}=.@@active .let}.rightargument - .catcode`.|=.@@active .let|.letterbar - .catcode`.~=.@@active .let~.lettertilde - E - -.egroup - -\gdef\@@XMLshow{\@@XML shw} - -\gdef\@XMLindent#1% - {\ifnum\XMLlevel>\plusone\advance\leftskip#11em\relax\fi} - -\gdef\@XMLlevel#1% - {\advance\XMLlevel#11\relax} - -\unexpanded\gdef\@XMLentity#1% - {\noindent\hbox{\localcolortrue\color[xtag:0]{\string}}} - -\bgroup - -\@EA\catcode\string`=\@@active -\@EA\catcode\string`"\@@active -\@EA\catcode\string``\@@active -\@EA\catcode\string`&\@@active - -\gdef\doshowXMLargument#1#2#3#4% - {\hskip\zeropoint % or maybe \allowbreak - \string#1\color[xtag:#3]{#4}\string#2}% - -\gdef\showXMLarguments - {\hskip\zeropoint % or maybe \allowbreak - \ifshowXMLarguments - \bgroup - \@EA\catcode\string`=\@@active - \@EA\catcode\string`"\@@active - \@EA\catcode\string``\@@active - \@EA\catcode\string`&\@@active - \def={\color[xtag:7]{\string=}}% - \def"##1"{\doshowXMLargument""8{##1}}% - \def`##1`{\doshowXMLargument``8{##1}}% - \def&##1;{\doshowXMLargument&;7{##1}}% - \scantokens\@EA{\currentXMLarguments}% - \egroup - \else - \currentXMLarguments - \fi} - -\egroup - -\ifx\XMLprettycycle\undefined \gdef\XMLprettycycle{3} \fi - -\doglobal\newcounter\@XMLnofelements -\doglobal\newif\ifXMLunspacepretty - -\gdef\@XMLelement#1% - {\ifnum\XMLlevel<\@@xflevel\relax - \ifnum\kindofXMLelement=2\else - \doglobal\increment\@XMLnofelements\relax - \ifcase\@XMLnofelements\else\@@xfinbetween\fi - \fi - \fi - % no, too fragile: -% \ifnum\XMLlevel>1\hangindent2em\fi - \ifcase\kindofXMLelement\or\or - \getvalue{\@@XMLshow::\currentXMLelement}\relax - \fi - \dontleavehmode % \indent - \bgroup - % \localcolortrue - \advance\XMLlevel \minusone - \DoMod\XMLlevel by\XMLprettycycle to\scratchcounter - \advance\scratchcounter \plusone - \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]% - \ifXMLunspacepretty\unskip\fi - \string<% - \ifnum\kindofXMLelement=2\string/\fi - \currentXMLelement - \stopcolor - \ifcase#1\or - \cleanupXMLarguments % get rid of spurious end space and end / - \ifx\currentXMLarguments\empty\else - \setbox\scratchbox\hbox{\space}\hskip\wd\scratchbox % hm, slow - \startcolor[xtag:0]\showXMLarguments\unskip\stopcolor\unskip - \fi - \fi - \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]% - \ifnum\kindofXMLelement=3\string/\fi - \string>% - \stopcolor - \egroup - \ifcase\kindofXMLelement\or - \getvalue{\@@XMLshow::\currentXMLelement}\relax - \fi - \ifnum\XMLlevel<\@@xflevel\relax - \ifnum\kindofXMLelement=1\else - \doglobal\increment\@XMLnofelements\relax - \ifcase\@XMLnofelements\else\@@xfinbetween\fi - \fi - \fi - \ifXMLunspacepretty\ignorespaces\fi} - -\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par} -\gdef\prevXMLtext{\par\@XMLelement0\par\@XMLlevel-\blank} -\gdef\nextXMLpara{\nextXMLline\par} -\gdef\prevXMLpara{\par\prevXMLline} -\gdef\nextXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1} -\gdef\prevXMLline{\@XMLelement0\par\@XMLindent-\@XMLlevel-} -\gdef\nextXMLword{\@XMLlevel+\@XMLelement1} -\gdef\prevXMLword{\@XMLelement0\@XMLlevel-} - -\gdef\someXMLtext{\blank\@XMLlevel+\@XMLelement1\@XMLlevel-\blank} -\gdef\someXMLpara{\someXMLline} -\gdef\someXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1\par\@XMLindent-\@XMLlevel-} -\gdef\someXMLword{\@XMLlevel+\@XMLelement1\@XMLlevel-} - -\gdef\@XMLindent#1% - {\ifnum\XMLlevel>\zerocount - \advance\leftskip#11em\relax - \fi} - -\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par\@XMLindent+} -\gdef\prevXMLtext{\par\@XMLindent-\@XMLelement0\par\@XMLlevel-\blank} -\gdef\nextXMLpara{\nextXMLline\par\@XMLindent+} -\gdef\prevXMLpara{\par\@XMLindent-\prevXMLline} -\gdef\nextXMLline{\par\@XMLlevel+\@XMLelement1} -\gdef\prevXMLline{\@XMLelement0\par\@XMLlevel-} - -\gdef\someXMLline{\par\@XMLlevel+\@XMLelement1\par\@XMLlevel-} - -\gdef\setXMLshow#1#2#3[#4]% - {\def\docommand##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}% - \processcommalist[#4]\docommand} - -\gdef\showXMLign[#1]% - {\setXMLshow\defineXMLignore \relax\relax[#1]% - \setXMLshow\defineXMLsingular \relax\relax[#1]} - -\gdef\showXMLnop[#1]% - {\setXMLshow\defineXMLenvironment\relax\relax[#1]% - \setXMLshow\defineXMLsingular \relax\relax[#1]} - -\gdef\showXMLtxt[#1]% - {\setXMLshow\defineXMLenvironment\nextXMLtext\prevXMLtext[#1]% - \setXMLshow\defineXMLsingular \someXMLtext\relax [#1]} - -\gdef\showXMLpar[#1]% - {\setXMLshow\defineXMLenvironment\nextXMLpara\prevXMLpara[#1]% - \setXMLshow\defineXMLsingular \someXMLline\relax [#1]} - -\gdef\showXMLlin[#1]% - {\setXMLshow\defineXMLenvironment\nextXMLline\prevXMLline[#1]% - \setXMLshow\defineXMLsingular \someXMLword\relax [#1]} - -\gdef\showXMLwrd[#1]% - {\setXMLshow\defineXMLenvironment\nextXMLword\prevXMLword[#1]% - \setXMLshow\defineXMLsingular \someXMLword\relax [#1]} - -\gdef\showXMLemp[#1]% - {\setXMLshow\defineXMLsingular\someXMLword\relax[#1]} - -\gdef\showXMLbreak[#1]% - {\def\docommand##1{\setvalue{\@@XMLshow::##1}{\hskip\zeropoint}}% - \processcommalist[#1]\docommand} - -\gdef\doautoshowXMLelement - {\ifcase\kindofXMLelement - \or \nextXMLpara \or \prevXMLpara \or \someXMLline - \fi} - -\gdef\autoshowXMLelement - {\ifcsname\@@XMLshow:\currentXMLelement\endcsname - \expandafter\normalexecuteXMLelement - \else - \expandafter\doautoshowXMLelement - \fi} - -\global\let\normalexecuteXMLelement\executeXMLelement - -\gdef\showXMLfile#1% - {\bgroup - % temp hack, will be the normal definition - \long\def\docleanupXMLarguments##1/ ##2\relax{\def\currentXMLarguments{##1}}% - % so far for hack - \nohyphens - \dontcomplain - \XMLlevel\zerocount - \increment\@@xflevel % hack - \tttf - \startpacked[\v!blank] - \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi - \let\executeXMLentity\@XMLentity - \enableXML\verbatimXML - \enableregime[utf]% - \utfunicodetracer\pluseight - \veryraggedright - \readfile{\truefilename{#1}}\donothing\donothing\endgraf - \removelastskip % really needed - \stoppacked - \egroup} - -\gdef\showXMLtext#1% - {\bgroup - % temp hack, will be the normal definition - \long\def\docleanupXMLarguments##1/ ##2\relax{\def\currentXMLarguments{##1}}% - % so far for hack - \dontcomplain - \XMLlevel\maxcard - \increment\@@xflevel % hack - \tttf - \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi - \let\executeXMLentity\@XMLentity - \let\par\allowbreak\let\endgraf\par - \setbox\scratchbox\hbox - {\enableXML\verbatimXML\scantokens{#1}\removelastskip}% - \unhbox\scratchbox - \egroup} - -\gdef\showXMLbuffer - {\dosingleempty\doshowXMLbuffer} - -\gdef\doshowXMLbuffer[#1]% - {\doifelsenothing{#1} - {\doshowXMLbuffer[\jobname]} - {\bgroup - \def\dodoprocessXMLbuffer##1{\showXMLfile{\TEXbufferfile{##1}}}% - \processcommalist[#1]\dodoprocessXMLbuffer - \egroup}} - -%D - -\gdef\showXSDcomponent - {\dodoubleargument\doshowXSDcomponent} - -\gdef\doshowXSDcomponent[#1][#2]% - {\bgroup - \showXMLnop[xsd:schema] - \showXMLign[xsd:appInfo] - \showXMLign[xsd:annotation] - \videXMLcontextblock[#2] - \showXMLfile{#1} - \egroup} - -\gdef\showRNGcomponent - {\dodoubleargument\doshowRNGcomponent} - -\gdef\doshowRNGcomponent[#1][#2]% - {\bgroup - \videXMLcontextblock[#2] - \showXMLfile{#1} - \egroup} - -%D - -\gdef\tracebackXMLattribute#1% - {\bgroup - \doloop - {\ifcsname\@@XMLdepth:\recurselevel\endcsname - \edef\!!stringa{\csname\@@XMLdepth:\recurselevel\endcsname}% - \writestatus - {XML TRACE} - {[#1] [\recurselevel] [\!!stringa] [\XMLinh{#1}]}% - \else - \exitloop - \fi}% - \egroup} - -\gdef\showXMLinh[#1]% - {\doifsomething{#1} - {\bgroup\infofont[% - \dorecurse\XMLdepth -% {\csname\@@XMLvariable:\csname\@@XMLdepth:\recurselevel\endcsname:#1\endcsname - {\csname\@@XMLvariable:\recurselevel:#1\endcsname - \ifnum\recurselevel<\XMLdepth->\fi}% - ]\egroup}} - -\protect \endinput diff --git a/tex/context/base/xtag-stk.mkii b/tex/context/base/xtag-stk.mkii new file mode 100644 index 000000000..e126ae5c7 --- /dev/null +++ b/tex/context/base/xtag-stk.mkii @@ -0,0 +1,230 @@ +%D \module +%D [ file=xtag-exp, +%D version=2006.01.19, +%D title=\CONTEXT\ XML Macros, +%D subtitle=Stacking Data, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / Stacks} + +%D This module is experimental. Don't use it (yet). It needs a +%D clean-up. The stack handler is used in the third MathML renderer. + +\unprotect + +\ifx\XMLRtoks \undefined \newtoks \XMLRtoks \fi +\ifx\XMLstacklevel\undefined \newcount\XMLstacklevel \fi + +\def\@@xmlstack{xmlstack} + +\let\XMLstackid\empty + +\def\resetXMLelements + {\XMLstacklevel\zerocount} + +\def\startsavingXMLelements % maybe something with \ignorespaces \\removeunwantedspaces + {\XMLstacklevel\zerocount + \let\normalexecuteXMLelement\executeXMLelement + \def\executeXMLelement{\csname\@@XMLelement:\@@xmlstack\ifcase\kindofXMLelement\or\or\or/\fi\endcsname}} + +\def\stopsavingXMLelements + {\let\executeXMLelement\normalexecuteXMLelement} + +\defineXMLnestedenvironmentsave + [\@@xmlstack] + {} + {\pushXMLdataonstack} + +\startXMLmapping[xmlstack:test] + + \defineXMLnestedenvironmentsave + [\@@xmlstack] + {} + {\pushXMLnameonstack} + + % in mathml handler: + % + % \defineXMLnested + % [apply] + % {\startsavingXMLelements} + % {\stopsavingXMLelements} + +\stopXMLmapping + +\def\pushXMLdataonstack + {\advance\XMLstacklevel\plusone + \letvalue {\@@xmlstack:n:\XMLstackid:\number\XMLstacklevel}\currentXMLelement + \saveXMLdata {\@@xmlstack:t:\XMLstackid:\number\XMLstacklevel} \@@xmlstack + \saveXMLdatainelement{\@@xmlstack:d:\XMLstackid:\number\XMLstacklevel}\currentXMLelement\@@xmlstack} + +\def\pushXMLnameonstack + {\advance\XMLstacklevel\plusone + \letvalue {\@@xmlstack:n:\XMLstackid:\number\XMLstacklevel}\currentXMLelement} + +\def\eraseXMLdataonstack#1% + {\letvalue{\@@xmlstack:n:\XMLstackid:\number#1}\empty + \XMLerase{\@@xmlstack:t:\XMLstackid:\number#1}% + \XMLerase{\@@xmlstack:d:\XMLstackid:\number#1}} + +\def\getXMLstackdata{\getXMLstackiddata\XMLstackid} +\def\getXMLstackname{\getXMLstackidname\XMLstackid} +\def\getXMLstacktext{\getXMLstackidtext\XMLstackid} + +\def\getXMLstackiddata#1#2{\flushXMLelement{\@@xmlstack:d:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}} +\def\getXMLstackidname#1#2{\getvalue {\@@xmlstack:n:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}} +\def\getXMLstackidtext#1#2{\flushXMLelement{\@@xmlstack:t:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}} + +\def\rawXMLstackdata{\rawXMLstackiddata\XMLstackid} +\def\rawXMLstackname{\rawXMLstackidname\XMLstackid} +\def\rawXMLstacktext{\rawXMLstackidtext\XMLstackid} + +\def\rawXMLstackiddata#1#2{\flushXMLelement{\@@xmlstack:d:#1:\number#2}} +\def\rawXMLstackidname#1#2{\getvalue {\@@xmlstack:n:#1:\number#2}} +\def\rawXMLstackidtext#1#2{\flushXMLelement{\@@xmlstack:t:#1:\number#2}} + +\def\defXMLstackiddata#1#2#3% + {\defXMLelement#1{\@@xmlstack:d:#2:\ifnum#3>\XMLstacklevel\else\number#3\fi}} + +\def\defXMLstackdata#1% #2 + {\defXMLstackiddata#1\XMLstackid} + +\def\showXMLstacknames + {\hbox{[\space\dorecurse\XMLstacklevel{\recurselevel:\getXMLstackname\recurselevel\space}]}} + +\def\flushXMLstackfrom#1% + {\dostepwiserecurse{#1}\XMLstacklevel\plusone + {\getXMLstackdata\recurselevel}} + +\def\flushXMLstackwith#1#2% + {\dostepwiserecurse{#1}\XMLstacklevel\plusone + {\relax\ifnum\recurselevel>#1\relax#2\fi + \getXMLstackdata\recurselevel}} + +\def\flushXMLnamedstackwith#1#2#3% + {\dostepwiserecurse{#1}\XMLstacklevel\plusone + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} + {\ifnum\recurselevel>#1\relax#3\fi + \getXMLstackdata\recurselevel}}} + +\def\countXMLnamedstack#1% todo: \nofXMLchildren ! ! ! ! ! + {\scratchcounter\zerocount + \dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\advance\scratchcounter\plusone}}} + +\def\collectXMLstack#1% + {\XMLRtoks\emptytoks + \dorecurse\XMLstacklevel + {\ifnum\recurselevel>\plusone\appendtoks#1\to\XMLRtoks\fi + \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}} + +\def\collectXMLstackrows#1#2% + {\XMLRtoks\emptytoks + \dostepwiserecurse{#1}\XMLstacklevel\plusone + {\ifnum\recurselevel>#1\appendtoks#2\to\XMLRtoks\fi + \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}} + +\def\collectXMLnamedstack#1#2% + {\XMLRtoks\emptytoks + \dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\ifnum\recurselevel>\plusone\appendtoks#2\to\XMLRtoks\fi + \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}}} + +\def\collectXMLnamedstacknamed#1#2#3% names, inbetween, nestednames (maddness, this macro) + {\XMLRtoks\emptytoks + \!!doneafalse + \let\globalascii\empty + \dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\begingroup + \startsavingXMLelements + \rawXMLstacktext\recurselevel % still on stack, raw does not test + \stopsavingXMLelements + \let\globalascii\empty + \dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} + {\xdef\globalascii{\getXMLstackdata\recurselevel}}}% + \endgroup + \ifx\globalascii\empty\else + \if!!donea\appendtoks#3\to\XMLRtoks\fi + \expandafter\appendtoks\globalascii\to\XMLRtoks + \!!doneatrue + \fi}}} + +\def\XMLcopydata#1#2% to from + {\@EA\let\csname\@@XMLdata:#1\@EA\endcsname\csname\@@XMLdata:#2\endcsname} +\def\XMLcopysave#1#2% to from + {\@EA\let\csname\@@XMLsave:#1\@EA\endcsname\csname\@@XMLsave:#2\endcsname} + +\def\removeXMLdatafromstack#1% + {\dorecurse\XMLstacklevel + {\doif{\getXMLstackname\recurselevel}{#1} + {\dostepwiserecurse\recurselevel{\numexpr\XMLstacklevel+\minusone}\plusone + {\scratchcounter\numexpr\recurselevel+\plusone\relax + \@EA\let\csname\@@xmlstack:n:\XMLstackid:\recurselevel\@EA\endcsname\csname\@@xmlstack:n:\XMLstackid:\number\scratchcounter\endcsname + \XMLcopysave{\@@xmlstack:t:\XMLstackid:\recurselevel}{\@@xmlstack:t:\XMLstackid:\number\scratchcounter}% + \XMLcopysave{\@@xmlstack:d:\XMLstackid:\recurselevel}{\@@xmlstack:d:\XMLstackid:\number\scratchcounter}}% + \advance\XMLstacklevel\minusone + \exitloop}}} + +%D BEWARE: these names may change (get stack in the name) + +\def\XMLallnamed#1% + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\getXMLstackdata\recurselevel}}} + +\def\defXMLfirstnamed#1#2% \cs list + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} + {\defXMLstackdata#1\recurselevel\exitloop}}} + +\def\defXMLfirstnamedtext#1#2% \cs list + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} + {\edef#1{\getXMLstacktext\recurselevel}\exitloop}}} + +\def\XMLfirstnamed#1% + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\getXMLstackdata\recurselevel\exitloop}}} + +\def\XMLnotnamed#1% + {\dorecurse\XMLstacklevel + {\expanded{\doifnotinset{\getXMLstackname\recurselevel}{#1}} + {\getXMLstackdata\recurselevel\exitloop}}} + +\let\XMLstackposition\!!zerocount + +\def\XMLdoifonstackelse#1% was \XMLdoifelsefound + {\!!doneafalse + \let\XMLstackposition\!!zerocount + \dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\let\XMLstackposition\recurselevel\!!doneatrue\exitloop}}% + \if!!donea + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +%D Handy: + +\def\pushXMLmeaning#1% or [#1] + {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname + \@EA\pushmacro\csname\@@XMLelement:#1\endcsname + \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname} + +\def\popXMLmeaning#1% or [#1] + {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname + \@EA\popmacro\csname\@@XMLelement:#1\endcsname + \@EA\popmacro\csname\@@XMLelement:/#1\endcsname} + +\protect \endinput diff --git a/tex/context/base/xtag-stk.tex b/tex/context/base/xtag-stk.tex deleted file mode 100644 index e126ae5c7..000000000 --- a/tex/context/base/xtag-stk.tex +++ /dev/null @@ -1,230 +0,0 @@ -%D \module -%D [ file=xtag-exp, -%D version=2006.01.19, -%D title=\CONTEXT\ XML Macros, -%D subtitle=Stacking Data, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / Stacks} - -%D This module is experimental. Don't use it (yet). It needs a -%D clean-up. The stack handler is used in the third MathML renderer. - -\unprotect - -\ifx\XMLRtoks \undefined \newtoks \XMLRtoks \fi -\ifx\XMLstacklevel\undefined \newcount\XMLstacklevel \fi - -\def\@@xmlstack{xmlstack} - -\let\XMLstackid\empty - -\def\resetXMLelements - {\XMLstacklevel\zerocount} - -\def\startsavingXMLelements % maybe something with \ignorespaces \\removeunwantedspaces - {\XMLstacklevel\zerocount - \let\normalexecuteXMLelement\executeXMLelement - \def\executeXMLelement{\csname\@@XMLelement:\@@xmlstack\ifcase\kindofXMLelement\or\or\or/\fi\endcsname}} - -\def\stopsavingXMLelements - {\let\executeXMLelement\normalexecuteXMLelement} - -\defineXMLnestedenvironmentsave - [\@@xmlstack] - {} - {\pushXMLdataonstack} - -\startXMLmapping[xmlstack:test] - - \defineXMLnestedenvironmentsave - [\@@xmlstack] - {} - {\pushXMLnameonstack} - - % in mathml handler: - % - % \defineXMLnested - % [apply] - % {\startsavingXMLelements} - % {\stopsavingXMLelements} - -\stopXMLmapping - -\def\pushXMLdataonstack - {\advance\XMLstacklevel\plusone - \letvalue {\@@xmlstack:n:\XMLstackid:\number\XMLstacklevel}\currentXMLelement - \saveXMLdata {\@@xmlstack:t:\XMLstackid:\number\XMLstacklevel} \@@xmlstack - \saveXMLdatainelement{\@@xmlstack:d:\XMLstackid:\number\XMLstacklevel}\currentXMLelement\@@xmlstack} - -\def\pushXMLnameonstack - {\advance\XMLstacklevel\plusone - \letvalue {\@@xmlstack:n:\XMLstackid:\number\XMLstacklevel}\currentXMLelement} - -\def\eraseXMLdataonstack#1% - {\letvalue{\@@xmlstack:n:\XMLstackid:\number#1}\empty - \XMLerase{\@@xmlstack:t:\XMLstackid:\number#1}% - \XMLerase{\@@xmlstack:d:\XMLstackid:\number#1}} - -\def\getXMLstackdata{\getXMLstackiddata\XMLstackid} -\def\getXMLstackname{\getXMLstackidname\XMLstackid} -\def\getXMLstacktext{\getXMLstackidtext\XMLstackid} - -\def\getXMLstackiddata#1#2{\flushXMLelement{\@@xmlstack:d:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}} -\def\getXMLstackidname#1#2{\getvalue {\@@xmlstack:n:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}} -\def\getXMLstackidtext#1#2{\flushXMLelement{\@@xmlstack:t:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}} - -\def\rawXMLstackdata{\rawXMLstackiddata\XMLstackid} -\def\rawXMLstackname{\rawXMLstackidname\XMLstackid} -\def\rawXMLstacktext{\rawXMLstackidtext\XMLstackid} - -\def\rawXMLstackiddata#1#2{\flushXMLelement{\@@xmlstack:d:#1:\number#2}} -\def\rawXMLstackidname#1#2{\getvalue {\@@xmlstack:n:#1:\number#2}} -\def\rawXMLstackidtext#1#2{\flushXMLelement{\@@xmlstack:t:#1:\number#2}} - -\def\defXMLstackiddata#1#2#3% - {\defXMLelement#1{\@@xmlstack:d:#2:\ifnum#3>\XMLstacklevel\else\number#3\fi}} - -\def\defXMLstackdata#1% #2 - {\defXMLstackiddata#1\XMLstackid} - -\def\showXMLstacknames - {\hbox{[\space\dorecurse\XMLstacklevel{\recurselevel:\getXMLstackname\recurselevel\space}]}} - -\def\flushXMLstackfrom#1% - {\dostepwiserecurse{#1}\XMLstacklevel\plusone - {\getXMLstackdata\recurselevel}} - -\def\flushXMLstackwith#1#2% - {\dostepwiserecurse{#1}\XMLstacklevel\plusone - {\relax\ifnum\recurselevel>#1\relax#2\fi - \getXMLstackdata\recurselevel}} - -\def\flushXMLnamedstackwith#1#2#3% - {\dostepwiserecurse{#1}\XMLstacklevel\plusone - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} - {\ifnum\recurselevel>#1\relax#3\fi - \getXMLstackdata\recurselevel}}} - -\def\countXMLnamedstack#1% todo: \nofXMLchildren ! ! ! ! ! - {\scratchcounter\zerocount - \dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} - {\advance\scratchcounter\plusone}}} - -\def\collectXMLstack#1% - {\XMLRtoks\emptytoks - \dorecurse\XMLstacklevel - {\ifnum\recurselevel>\plusone\appendtoks#1\to\XMLRtoks\fi - \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}} - -\def\collectXMLstackrows#1#2% - {\XMLRtoks\emptytoks - \dostepwiserecurse{#1}\XMLstacklevel\plusone - {\ifnum\recurselevel>#1\appendtoks#2\to\XMLRtoks\fi - \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}} - -\def\collectXMLnamedstack#1#2% - {\XMLRtoks\emptytoks - \dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} - {\ifnum\recurselevel>\plusone\appendtoks#2\to\XMLRtoks\fi - \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}}} - -\def\collectXMLnamedstacknamed#1#2#3% names, inbetween, nestednames (maddness, this macro) - {\XMLRtoks\emptytoks - \!!doneafalse - \let\globalascii\empty - \dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} - {\begingroup - \startsavingXMLelements - \rawXMLstacktext\recurselevel % still on stack, raw does not test - \stopsavingXMLelements - \let\globalascii\empty - \dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} - {\xdef\globalascii{\getXMLstackdata\recurselevel}}}% - \endgroup - \ifx\globalascii\empty\else - \if!!donea\appendtoks#3\to\XMLRtoks\fi - \expandafter\appendtoks\globalascii\to\XMLRtoks - \!!doneatrue - \fi}}} - -\def\XMLcopydata#1#2% to from - {\@EA\let\csname\@@XMLdata:#1\@EA\endcsname\csname\@@XMLdata:#2\endcsname} -\def\XMLcopysave#1#2% to from - {\@EA\let\csname\@@XMLsave:#1\@EA\endcsname\csname\@@XMLsave:#2\endcsname} - -\def\removeXMLdatafromstack#1% - {\dorecurse\XMLstacklevel - {\doif{\getXMLstackname\recurselevel}{#1} - {\dostepwiserecurse\recurselevel{\numexpr\XMLstacklevel+\minusone}\plusone - {\scratchcounter\numexpr\recurselevel+\plusone\relax - \@EA\let\csname\@@xmlstack:n:\XMLstackid:\recurselevel\@EA\endcsname\csname\@@xmlstack:n:\XMLstackid:\number\scratchcounter\endcsname - \XMLcopysave{\@@xmlstack:t:\XMLstackid:\recurselevel}{\@@xmlstack:t:\XMLstackid:\number\scratchcounter}% - \XMLcopysave{\@@xmlstack:d:\XMLstackid:\recurselevel}{\@@xmlstack:d:\XMLstackid:\number\scratchcounter}}% - \advance\XMLstacklevel\minusone - \exitloop}}} - -%D BEWARE: these names may change (get stack in the name) - -\def\XMLallnamed#1% - {\dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} - {\getXMLstackdata\recurselevel}}} - -\def\defXMLfirstnamed#1#2% \cs list - {\dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} - {\defXMLstackdata#1\recurselevel\exitloop}}} - -\def\defXMLfirstnamedtext#1#2% \cs list - {\dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} - {\edef#1{\getXMLstacktext\recurselevel}\exitloop}}} - -\def\XMLfirstnamed#1% - {\dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} - {\getXMLstackdata\recurselevel\exitloop}}} - -\def\XMLnotnamed#1% - {\dorecurse\XMLstacklevel - {\expanded{\doifnotinset{\getXMLstackname\recurselevel}{#1}} - {\getXMLstackdata\recurselevel\exitloop}}} - -\let\XMLstackposition\!!zerocount - -\def\XMLdoifonstackelse#1% was \XMLdoifelsefound - {\!!doneafalse - \let\XMLstackposition\!!zerocount - \dorecurse\XMLstacklevel - {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} - {\let\XMLstackposition\recurselevel\!!doneatrue\exitloop}}% - \if!!donea - \expandafter\firstoftwoarguments - \else - \expandafter\secondoftwoarguments - \fi} - -%D Handy: - -\def\pushXMLmeaning#1% or [#1] - {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname - \@EA\pushmacro\csname\@@XMLelement:#1\endcsname - \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname} - -\def\popXMLmeaning#1% or [#1] - {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname - \@EA\popmacro\csname\@@XMLelement:#1\endcsname - \@EA\popmacro\csname\@@XMLelement:/#1\endcsname} - -\protect \endinput diff --git a/tex/context/base/xtag-utf.mkii b/tex/context/base/xtag-utf.mkii new file mode 100644 index 000000000..fec84d279 --- /dev/null +++ b/tex/context/base/xtag-utf.mkii @@ -0,0 +1,21 @@ +%D \module +%D [ file=xtag-utf, +%D version=2002.06.24, +%D title=\CONTEXT\ XML Macros, +%D subtitle=UTF, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +\writestatus{loading}{ConTeXt XML Macros / UTF} + +%D This filter is kind of obsolete, since \UTF\ is not +%D limited to \XML. So, here we only enable \UTF\ support. + +\chardef\XMLtokensreduction\plustwo \enableregime[utf] + +\endinput diff --git a/tex/context/base/xtag-utf.tex b/tex/context/base/xtag-utf.tex deleted file mode 100644 index fec84d279..000000000 --- a/tex/context/base/xtag-utf.tex +++ /dev/null @@ -1,21 +0,0 @@ -%D \module -%D [ file=xtag-utf, -%D version=2002.06.24, -%D title=\CONTEXT\ XML Macros, -%D subtitle=UTF, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\writestatus{loading}{ConTeXt XML Macros / UTF} - -%D This filter is kind of obsolete, since \UTF\ is not -%D limited to \XML. So, here we only enable \UTF\ support. - -\chardef\XMLtokensreduction\plustwo \enableregime[utf] - -\endinput diff --git a/tex/context/base/xtag-xsd.mkii b/tex/context/base/xtag-xsd.mkii new file mode 100644 index 000000000..96169afa2 --- /dev/null +++ b/tex/context/base/xtag-xsd.mkii @@ -0,0 +1,28 @@ +%D \module +%D [ file=xtag-xsd, +%D version=2001.10.04, +%D title=\CONTEXT\ XML Support, +%D subtitle=Schemas, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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 The following commands picks up a named block from the +%D given file and pretty prints it. +%D +%D \starttyping +%D \showXSDcomponent [x-exa-tx.xsd] [sequence] +%D \stoptyping +%D +%D If needed, you adapt the colors used by redefining the +%D \type {xtag} color palet. + +\fetchruntimecommand\showXSDcomponent {\f!xtagprefix\s!run} + +\protect \endinput diff --git a/tex/context/base/xtag-xsd.tex b/tex/context/base/xtag-xsd.tex deleted file mode 100644 index 96169afa2..000000000 --- a/tex/context/base/xtag-xsd.tex +++ /dev/null @@ -1,28 +0,0 @@ -%D \module -%D [ file=xtag-xsd, -%D version=2001.10.04, -%D title=\CONTEXT\ XML Support, -%D subtitle=Schemas, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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 The following commands picks up a named block from the -%D given file and pretty prints it. -%D -%D \starttyping -%D \showXSDcomponent [x-exa-tx.xsd] [sequence] -%D \stoptyping -%D -%D If needed, you adapt the colors used by redefining the -%D \type {xtag} color palet. - -\fetchruntimecommand\showXSDcomponent {\f!xtagprefix\s!run} - -\protect \endinput diff --git a/tex/context/base/xtag-xsl.mkii b/tex/context/base/xtag-xsl.mkii new file mode 100644 index 000000000..3ad096c28 --- /dev/null +++ b/tex/context/base/xtag-xsl.mkii @@ -0,0 +1,224 @@ +%D \module +%D [ file=xtag-xsl, +%D version=2002.03.07, +%D title=\CONTEXT\ XML Support, +%D subtitle=XSLT processing, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA / 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. + +% FOR THIS TO WORK YOU NEED A PROPER cp8bit VECTOR +% +% 8 bit support has been messed up in a couple of distributions +% +% 0x00 0x00 +% 0x01 0x01 +% 0x02 0x02 +% etc + +%D This module is rather experimental so users may expect +%D changes in the interface. + +\unprotect + +\definesystemvariable {xl} + +\newif\iftraceXSLTprocessing % \traceXSLTprocessingtrue + +\def\XSLTscriptfile{\bufferprefix xlscript} + +% to be sped up: + +\def\presetXSLTcharacters + {\let\par\empty + \def\{{\rawcharacter{`\{}}% \string^^.. + \def\}{\rawcharacter{`\}}}% \string^^.. + \def\\{\rawcharacter{`\\}}}% \string^^.. + +\def\obeyXSLTcharacters + {\setnaturalcatcodes + \catcode`\\=\@@escape} + +\long\def\startXSLTscript #1 #2 % + {\bgroup + \obeyXSLTcharacters + \doifelse{#2}{capsule}\dostartXSLTscript\nostartXSLTscript#1 #2 } + +\long\def\dostartXSLTscript#1 #2 #3 % + {\obeylines + \dodostartXSLTscript#1 #2 #3 } + +\long\def\dodostartXSLTscript#1 #2 #3 #4\stopXSLTscript + {\egroup + \long\setvalue{\??xl#1}{\doXSLTscript{#3}{#4}}} + +\long\def\nostartXSLTscript + {\obeylines + \nonostartXSLTscript} + +\long\def\nonostartXSLTscript#1 #2\stopXSLTscript + {\egroup + \long\setvalue{\??xl#1}{\doXSLTscript\empty{#2}}} + +\long\def\donormalXSLTscript#1#2% + {\includeXSLTscript{b-capsule-#1}% + #2% + \includeXSLTscript{e-capsule-#1}} + +\def\includeXSLTscript#1% + {\csname\ifcsname\??xl#1\endcsname\??xl#1\else\s!empty\fi\endcsname} + +\startXSLTscript b-capsule-1.0 + + +\stopXSLTscript + +\startXSLTscript e-capsule-1.0 + +\stopXSLTscript + +\def\applyXSLTscript + {\dotripleempty\doapplyXSLTscript} + +\long\def\doapplyXSLTscript[#1][#2][#3]% + {\ifthirdargument + \bgroup + \let\doXSLTscript\donormalXSLTscript + \presetXSLTcharacters + \donefalse + \def\docommand##1{\dodoapplyXSLTscript{##1}{\ifdone#3\else#2\fi}{#3}\donetrue}% + \processcommalist[#1]\docommand + \egroup + \else + \applyXSLTscript[#1][#2][#2]% + \fi} + +% Since a \XML\ file is loaded into memory as a tree, we +% can safely use the same input and output filename, thereby +% avoiding temporary files. + +\def\dodoapplyXSLTscript#1#2#3% + {\bgroup + \doifundefined{\??xl#1}% + {\writestatus{XSLT}{unknown script #1}} + {\writestatus{XSLT}{convert #2 into #3 using #1}% + \edef\par{\outputnewlinechar}% + \edef\!!stringc{\getvalue{\??xl#1}}% + \immediate\openout\scratchwrite=\XSLTscriptfile.xsl + \immediate\write\scratchwrite{\!!stringc}% + \immediate\closeout\scratchwrite + \iftraceXSLTprocessing\wait\fi + \executeXSLT{\XSLTscriptfile.xsl}{#2}{#3}% + \iftraceXSLTprocessing\wait\fi}% + \egroup} + +\def\executeXSLT#1#2#3% script input output + {\executesystemcommand{xsltproc -o #3 #1 #2}} + +\long\def\applyXSLTtobuffer + {\dodoubleempty\doapplyXSLTtobuffer} + +\long\def\doapplyXSLTtobuffer[#1][#2]% + {\expanded{\applyXSLTscript[#1][\TEXbufferfile{\ifsecondargument#2\else\jobname\fi}]}} + +\def\resetXSLTscripting#1% + {\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{}}} + +\resetXSLTscripting{1.0} + +\def\startXSLTscripting + {\bgroup + \obeyXSLTcharacters + \obeylines + \dostartXSLTscripting} + +\long\def\dostartXSLTscripting#1\stopXSLTscripting + {\egroup + \let\doXSLTscript\doextendXSLTscript + \getvalue{\??xl\s!dummy}{#1}} + +\long\def\doextendXSLTscript#1#2#3% + {\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{#2#3}}} + +\def\applyXSLTscripting + {\applyXSLTscript[\s!dummy]} + +\protect + +\doifnotmode{demo}{\endinput} + +% \def\Whow{Whow It Works} +% +% \startXSLTscript test capsule 1.0 +% +% +% +% \Whow \\ # +% +% +% +% +% +% \stopXSLTscript +% +% \applyXSLTscript [test] [figtest.xml] [crap.tmp] \typefile{crap.tmp} +% +% \startbuffer +% world +% \stopbuffer +% +% \applyXSLTtobuffer[test] \typebuffer +% +% \startXSLTscripting +% +% \stopXSLTscripting +% +% \startXSLTscripting +% +% +% +% \stopXSLTscripting +% +% \startXSLTscripting +% +% +% +% \stopXSLTscripting +% +% \applyXSLTscripting [figtest.xml] [crap.tmp] \typefile{crap.tmp} + +\starttext + +\startXSLTscript another + + + + + + + + + + + + + + + + name: \\par + + + +\stopXSLTscript + +\applyXSLTscript [another] [cont-en.xml] [whatever.tmp] + +\readfile{whatever.tmp}{}{} + +\stoptext diff --git a/tex/context/base/xtag-xsl.tex b/tex/context/base/xtag-xsl.tex deleted file mode 100644 index 3ad096c28..000000000 --- a/tex/context/base/xtag-xsl.tex +++ /dev/null @@ -1,224 +0,0 @@ -%D \module -%D [ file=xtag-xsl, -%D version=2002.03.07, -%D title=\CONTEXT\ XML Support, -%D subtitle=XSLT processing, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA / 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. - -% FOR THIS TO WORK YOU NEED A PROPER cp8bit VECTOR -% -% 8 bit support has been messed up in a couple of distributions -% -% 0x00 0x00 -% 0x01 0x01 -% 0x02 0x02 -% etc - -%D This module is rather experimental so users may expect -%D changes in the interface. - -\unprotect - -\definesystemvariable {xl} - -\newif\iftraceXSLTprocessing % \traceXSLTprocessingtrue - -\def\XSLTscriptfile{\bufferprefix xlscript} - -% to be sped up: - -\def\presetXSLTcharacters - {\let\par\empty - \def\{{\rawcharacter{`\{}}% \string^^.. - \def\}{\rawcharacter{`\}}}% \string^^.. - \def\\{\rawcharacter{`\\}}}% \string^^.. - -\def\obeyXSLTcharacters - {\setnaturalcatcodes - \catcode`\\=\@@escape} - -\long\def\startXSLTscript #1 #2 % - {\bgroup - \obeyXSLTcharacters - \doifelse{#2}{capsule}\dostartXSLTscript\nostartXSLTscript#1 #2 } - -\long\def\dostartXSLTscript#1 #2 #3 % - {\obeylines - \dodostartXSLTscript#1 #2 #3 } - -\long\def\dodostartXSLTscript#1 #2 #3 #4\stopXSLTscript - {\egroup - \long\setvalue{\??xl#1}{\doXSLTscript{#3}{#4}}} - -\long\def\nostartXSLTscript - {\obeylines - \nonostartXSLTscript} - -\long\def\nonostartXSLTscript#1 #2\stopXSLTscript - {\egroup - \long\setvalue{\??xl#1}{\doXSLTscript\empty{#2}}} - -\long\def\donormalXSLTscript#1#2% - {\includeXSLTscript{b-capsule-#1}% - #2% - \includeXSLTscript{e-capsule-#1}} - -\def\includeXSLTscript#1% - {\csname\ifcsname\??xl#1\endcsname\??xl#1\else\s!empty\fi\endcsname} - -\startXSLTscript b-capsule-1.0 - - -\stopXSLTscript - -\startXSLTscript e-capsule-1.0 - -\stopXSLTscript - -\def\applyXSLTscript - {\dotripleempty\doapplyXSLTscript} - -\long\def\doapplyXSLTscript[#1][#2][#3]% - {\ifthirdargument - \bgroup - \let\doXSLTscript\donormalXSLTscript - \presetXSLTcharacters - \donefalse - \def\docommand##1{\dodoapplyXSLTscript{##1}{\ifdone#3\else#2\fi}{#3}\donetrue}% - \processcommalist[#1]\docommand - \egroup - \else - \applyXSLTscript[#1][#2][#2]% - \fi} - -% Since a \XML\ file is loaded into memory as a tree, we -% can safely use the same input and output filename, thereby -% avoiding temporary files. - -\def\dodoapplyXSLTscript#1#2#3% - {\bgroup - \doifundefined{\??xl#1}% - {\writestatus{XSLT}{unknown script #1}} - {\writestatus{XSLT}{convert #2 into #3 using #1}% - \edef\par{\outputnewlinechar}% - \edef\!!stringc{\getvalue{\??xl#1}}% - \immediate\openout\scratchwrite=\XSLTscriptfile.xsl - \immediate\write\scratchwrite{\!!stringc}% - \immediate\closeout\scratchwrite - \iftraceXSLTprocessing\wait\fi - \executeXSLT{\XSLTscriptfile.xsl}{#2}{#3}% - \iftraceXSLTprocessing\wait\fi}% - \egroup} - -\def\executeXSLT#1#2#3% script input output - {\executesystemcommand{xsltproc -o #3 #1 #2}} - -\long\def\applyXSLTtobuffer - {\dodoubleempty\doapplyXSLTtobuffer} - -\long\def\doapplyXSLTtobuffer[#1][#2]% - {\expanded{\applyXSLTscript[#1][\TEXbufferfile{\ifsecondargument#2\else\jobname\fi}]}} - -\def\resetXSLTscripting#1% - {\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{}}} - -\resetXSLTscripting{1.0} - -\def\startXSLTscripting - {\bgroup - \obeyXSLTcharacters - \obeylines - \dostartXSLTscripting} - -\long\def\dostartXSLTscripting#1\stopXSLTscripting - {\egroup - \let\doXSLTscript\doextendXSLTscript - \getvalue{\??xl\s!dummy}{#1}} - -\long\def\doextendXSLTscript#1#2#3% - {\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{#2#3}}} - -\def\applyXSLTscripting - {\applyXSLTscript[\s!dummy]} - -\protect - -\doifnotmode{demo}{\endinput} - -% \def\Whow{Whow It Works} -% -% \startXSLTscript test capsule 1.0 -% -% -% -% \Whow \\ # -% -% -% -% -% -% \stopXSLTscript -% -% \applyXSLTscript [test] [figtest.xml] [crap.tmp] \typefile{crap.tmp} -% -% \startbuffer -% world -% \stopbuffer -% -% \applyXSLTtobuffer[test] \typebuffer -% -% \startXSLTscripting -% -% \stopXSLTscripting -% -% \startXSLTscripting -% -% -% -% \stopXSLTscripting -% -% \startXSLTscripting -% -% -% -% \stopXSLTscripting -% -% \applyXSLTscripting [figtest.xml] [crap.tmp] \typefile{crap.tmp} - -\starttext - -\startXSLTscript another - - - - - - - - - - - - - - - - name: \\par - - - -\stopXSLTscript - -\applyXSLTscript [another] [cont-en.xml] [whatever.tmp] - -\readfile{whatever.tmp}{}{} - -\stoptext diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 69a2b3e8c..cb61067af 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 01/24/11 10:00:19 +-- merge date : 01/24/11 23:51:55 do -- begin closure to overcome local limits and interference -- cgit v1.2.3